@@ -39,11 +39,6 @@ import type { SmartTransaction, UnsignedTransaction, Hex } from './types';
39
39
import { SmartTransactionStatuses , ClientId } from './types' ;
40
40
import * as utils from './utils' ;
41
41
42
- jest . mock ( '@ethersproject/bytes' , ( ) => ( {
43
- ...jest . requireActual ( '@ethersproject/bytes' ) ,
44
- hexlify : ( str : string ) => `0x${ str } ` ,
45
- } ) ) ;
46
-
47
42
jest . mock ( '@metamask/eth-query' , ( ) => {
48
43
const EthQuery = jest . requireActual ( '@metamask/eth-query' ) ;
49
44
return class FakeEthQuery extends EthQuery {
@@ -730,7 +725,7 @@ describe('SmartTransactionsController', () => {
730
725
it ( 'should acquire nonce for Swap transactions only' , async ( ) => {
731
726
// Create a mock for getNonceLock
732
727
const mockGetNonceLock = jest . fn ( ) . mockResolvedValue ( {
733
- nextNonce : 'nextNonce' ,
728
+ nextNonce : 42 ,
734
729
nonceDetails : { test : 'details' } ,
735
730
releaseLock : jest . fn ( ) ,
736
731
} ) ;
@@ -840,7 +835,7 @@ describe('SmartTransactionsController', () => {
840
835
] [ 0 ] ;
841
836
842
837
// Verify nonce was set correctly on the txParams in the created transaction
843
- expect ( createdSmartTransaction . txParams . nonce ) . toBe ( '0x42 ' ) ; // 42 as a hex string
838
+ expect ( createdSmartTransaction . txParams . nonce ) . toBe ( '0x2a ' ) ; // 42 in hex
844
839
845
840
// Verify transaction type is set to 'swap' by default
846
841
expect ( createdSmartTransaction . type ) . toBe ( 'swap' ) ;
@@ -2652,7 +2647,7 @@ async function withController<ReturnValue>(
2652
2647
messenger,
2653
2648
clientId : ClientId . Mobile ,
2654
2649
getNonceLock : jest . fn ( ) . mockResolvedValue ( {
2655
- nextNonce : 'nextNonce' ,
2650
+ nextNonce : 42 ,
2656
2651
releaseLock : jest . fn ( ) ,
2657
2652
} ) ,
2658
2653
confirmExternalTransaction : jest . fn ( ) ,
0 commit comments