@@ -84,8 +84,8 @@ jest.mock('@metamask/eth-query', () =>
8484 } ,
8585 getTransactionByHash : ( _hash : string , callback : any ) => {
8686 const txs : any = [
87- { hash : '1337 ' , blockNumber : '0x1 ' } ,
88- { hash : '1338' , blockNumber : null } ,
87+ { blockNumber : '0x1 ' , hash : '1337 ' } ,
88+ { blockNumber : null , hash : '1338' } ,
8989 ] ;
9090 const tx : any = txs . find ( ( element : any ) => element . hash === _hash ) ;
9191 callback ( undefined , tx ) ;
@@ -99,15 +99,15 @@ jest.mock('@metamask/eth-query', () =>
9999 getTransactionReceipt : ( _hash : any , callback : any ) => {
100100 const txs : any = [
101101 {
102- hash : '1337' ,
102+ blockHash : '1337' ,
103103 gasUsed : '0x5208' ,
104+ hash : '1337' ,
104105 status : '0x1' ,
105106 transactionIndex : 1337 ,
106- blockHash : '1337' ,
107107 } ,
108108 {
109- hash : '1111' ,
110109 gasUsed : '0x1108' ,
110+ hash : '1111' ,
111111 status : '0x0' ,
112112 transactionIndex : 1111 ,
113113 } ,
@@ -118,9 +118,9 @@ jest.mock('@metamask/eth-query', () =>
118118 getBlockByHash : ( _blockHash : any , callback : any ) => {
119119 const blocks : any = [
120120 {
121+ baseFeePerGas : '0x14' ,
121122 hash : '1337' ,
122123 number : '0x1' ,
123- baseFeePerGas : '0x14' ,
124124 timestamp : '628dc0c8' ,
125125 } ,
126126 { hash : '1338' , number : '0x2' } ,
@@ -395,21 +395,21 @@ const NONCE_MOCK = 12;
395395const ACTION_ID_MOCK = '123456' ;
396396
397397const TRANSACTION_META_MOCK = {
398+ hash : '0x1' ,
398399 status : TransactionStatus . confirmed ,
400+ time : 123456789 ,
399401 transaction : {
400402 from : ACCOUNT_MOCK ,
401403 } ,
402- hash : '0x1' ,
403- time : 123456789 ,
404404} as TransactionMeta ;
405405
406406const TRANSACTION_META_2_MOCK = {
407+ hash : '0x2' ,
407408 status : TransactionStatus . confirmed ,
409+ time : 987654321 ,
408410 transaction : {
409411 from : '0x3' ,
410412 } ,
411- hash : '0x2' ,
412- time : 987654321 ,
413413} as TransactionMeta ;
414414
415415describe ( 'TransactionController' , ( ) => {
@@ -1378,10 +1378,10 @@ describe('TransactionController', () => {
13781378
13791379 controller . state . transactions . push ( {
13801380 from : MOCK_PREFERENCES . state . selectedAddress ,
1381+ hash : '1337' ,
13811382 id : 'foo' ,
13821383 networkID : '5' ,
13831384 status : TransactionStatus . submitted ,
1384- hash : '1337' ,
13851385 } as any ) ;
13861386
13871387 controller . wipeTransactions ( ) ;
@@ -1457,12 +1457,12 @@ describe('TransactionController', () => {
14571457 const controller = newController ( ) ;
14581458
14591459 controller . state . transactions . push ( {
1460+ chainId : toHex ( 5 ) ,
14601461 from : MOCK_PREFERENCES . state . selectedAddress ,
1462+ hash : '1337' ,
14611463 id : 'foo' ,
14621464 networkID : '5' ,
1463- chainId : toHex ( 5 ) ,
14641465 status : TransactionStatus . submitted ,
1465- hash : '1337' ,
14661466 } as any ) ;
14671467
14681468 controller . state . transactions . push ( { } as any ) ;
@@ -1484,10 +1484,10 @@ describe('TransactionController', () => {
14841484
14851485 controller . state . transactions . push ( {
14861486 from : MOCK_PREFERENCES . state . selectedAddress ,
1487+ hash : '1337' ,
14871488 id : 'foo' ,
14881489 networkID : '5' ,
14891490 status : TransactionStatus . submitted ,
1490- hash : '1337' ,
14911491 } as any ) ;
14921492
14931493 controller . state . transactions . push ( { } as any ) ;
@@ -1523,16 +1523,16 @@ describe('TransactionController', () => {
15231523 const controller = newController ( ) ;
15241524
15251525 controller . state . transactions . push ( {
1526+ chainId : toHex ( 5 ) ,
15261527 from : MOCK_PREFERENCES . state . selectedAddress ,
1528+ hash : '1337' ,
15271529 id : 'foo' ,
15281530 networkID : '5' ,
1529- chainId : toHex ( 5 ) ,
15301531 status : TransactionStatus . confirmed ,
1531- hash : '1337' ,
1532- verifiedOnBlockchain : false ,
15331532 transaction : {
15341533 gasUsed : undefined ,
15351534 } ,
1535+ verifiedOnBlockchain : false ,
15361536 } as any ) ;
15371537
15381538 await controller . queryTransactionStatuses ( ) ;
@@ -1779,10 +1779,10 @@ describe('TransactionController', () => {
17791779 it ( 'creates approvals for all unapproved transaction' , async ( ) => {
17801780 const transaction = {
17811781 from : ACCOUNT_MOCK ,
1782+ hash : '1337' ,
17821783 id : 'mocked' ,
17831784 networkID : '5' ,
17841785 status : TransactionStatus . unapproved ,
1785- hash : '1337' ,
17861786 } ;
17871787 const controller = newController ( ) ;
17881788 controller . state . transactions . push ( transaction as any ) ;
0 commit comments