@@ -29,10 +29,7 @@ function buildTransactionControllerMock(
2929 partialMock ?: Partial < TransactionController > ,
3030) : TransactionController {
3131 const defaultMocks = {
32- addTransaction : jest . fn ( ) . mockResolvedValue ( 'txId' ) ,
33- estimateGasFee : jest . fn ( ) . mockResolvedValue ( { gasLimit : '0x5208' } ) ,
3432 addTransactionBatch : jest . fn ( ) . mockResolvedValue ( [ 'txId1' , 'txId2' ] ) ,
35- updateTransaction : jest . fn ( ) . mockResolvedValue ( undefined ) ,
3633 } ;
3734
3835 // @ts -expect-error Incomplete mock, just includes properties used by code-under-test
@@ -197,62 +194,6 @@ describe('BridgeStatusController Init', () => {
197194 } ) ;
198195 } ) ;
199196
200- it ( 'correctly sets up addTransactionFn' , ( ) => {
201- // Arrange
202- const mockTransactionController = buildTransactionControllerMock ( {
203- addTransaction : jest . fn ( ) . mockResolvedValue ( 'newTxId' ) ,
204- } ) ;
205- const requestMock = buildInitRequestMock ( {
206- getController : jest . fn ( ) . mockReturnValue ( mockTransactionController ) ,
207- } ) ;
208-
209- // Act
210- bridgeStatusControllerInit ( requestMock ) ;
211-
212- // Assert
213- const constructorOptions =
214- bridgeStatusControllerClassMock . mock . calls [ 0 ] [ 0 ] ;
215- const addTransactionFn = constructorOptions . addTransactionFn ;
216- const mockTxParams = { from : '0xabc' , to : '0x123' , value : '0x0' } ;
217- const mockOrigin = 'test-origin' ;
218-
219- addTransactionFn ( mockTxParams , {
220- origin : mockOrigin ,
221- networkClientId : 'mainnet' ,
222- } ) ;
223- expect ( mockTransactionController . addTransaction ) . toHaveBeenCalledWith (
224- mockTxParams ,
225- { origin : mockOrigin , networkClientId : 'mainnet' } ,
226- ) ;
227- } ) ;
228-
229- it ( 'correctly sets up estimateGasFeeFn' , ( ) => {
230- // Arrange
231- const mockTransactionController = buildTransactionControllerMock ( {
232- estimateGasFee : jest . fn ( ) . mockResolvedValue ( { gasLimit : '0x7530' } ) ,
233- } ) ;
234- const requestMock = buildInitRequestMock ( {
235- getController : jest . fn ( ) . mockReturnValue ( mockTransactionController ) ,
236- } ) ;
237-
238- // Act
239- bridgeStatusControllerInit ( requestMock ) ;
240-
241- // Assert
242- const constructorOptions =
243- bridgeStatusControllerClassMock . mock . calls [ 0 ] [ 0 ] ;
244- const estimateGasFeeFn = constructorOptions . estimateGasFeeFn ;
245- const mockTxParams = {
246- transactionParams : { from : '0xabc' , to : '0x123' , value : '0x0' } ,
247- chainId : '0x1' as const ,
248- } ;
249-
250- estimateGasFeeFn ( mockTxParams ) ;
251- expect ( mockTransactionController . estimateGasFee ) . toHaveBeenCalledWith (
252- mockTxParams ,
253- ) ;
254- } ) ;
255-
256197 it ( 'correctly sets up addTransactionBatchFn' , ( ) => {
257198 // Arrange
258199 const mockTransactionController = buildTransactionControllerMock ( {
@@ -284,40 +225,6 @@ describe('BridgeStatusController Init', () => {
284225 ) . toHaveBeenCalledWith ( mockTxBatch ) ;
285226 } ) ;
286227
287- it ( 'correctly sets up updateTransactionFn' , ( ) => {
288- // Arrange
289- const mockTransactionController = buildTransactionControllerMock ( {
290- updateTransaction : jest . fn ( ) . mockResolvedValue ( undefined ) ,
291- } ) ;
292- const requestMock = buildInitRequestMock ( {
293- getController : jest . fn ( ) . mockReturnValue ( mockTransactionController ) ,
294- } ) ;
295-
296- // Act
297- bridgeStatusControllerInit ( requestMock ) ;
298-
299- // Assert
300- const constructorOptions =
301- bridgeStatusControllerClassMock . mock . calls [ 0 ] [ 0 ] ;
302- const updateTransactionFn = constructorOptions . updateTransactionFn ;
303- const mockTxUpdate = {
304- id : 'txId' ,
305- chainId : '0x1' as const ,
306- networkClientId : 'mainnet' ,
307- time : Date . now ( ) ,
308- txParams : { from : '0xabc' , to : '0x123' , value : '0x0' } ,
309- // eslint-disable-next-line @typescript-eslint/no-explicit-any
310- status : 'confirmed' as any ,
311- } ;
312- const mockNote = 'test note' ;
313-
314- updateTransactionFn ( mockTxUpdate , mockNote ) ;
315- expect ( mockTransactionController . updateTransaction ) . toHaveBeenCalledWith (
316- mockTxUpdate ,
317- mockNote ,
318- ) ;
319- } ) ;
320-
321228 it ( 'handles undefined persistedState' , ( ) => {
322229 // Arrange
323230 const requestMock = buildInitRequestMock ( {
0 commit comments