1- import {
2- JsonRpcEngine ,
3- JsonRpcMiddleware ,
4- } from '@metamask/json-rpc-engine' ;
5- import type { Json , JsonRpcFailure , JsonRpcParams , JsonRpcRequest , JsonRpcResponse , JsonRpcSuccess , } from '@metamask/utils' ;
6- import type { Transaction } from '@metamask/transaction-controller' ;
1+ import { JsonRpcEngine , JsonRpcMiddleware } from '@metamask/json-rpc-engine' ;
2+ import type {
3+ Json ,
4+ JsonRpcFailure ,
5+ JsonRpcParams ,
6+ JsonRpcRequest ,
7+ JsonRpcResponse ,
8+ JsonRpcSuccess ,
9+ } from '@metamask/utils' ;
710import type { ProviderConfig } from '@metamask/network-controller' ;
811import { providerErrors , rpcErrors } from '@metamask/rpc-errors' ;
912import Engine from '../Engine' ;
@@ -827,7 +830,7 @@ describe('getRpcMethodMiddleware', () => {
827830 it ( 'returns a JSON-RPC error if an error is thrown when adding this transaction' , async ( ) => {
828831 // Omit `from` and `chainId` here to skip validation for simplicity
829832 // Downcast needed here because `from` is required by this type
830- const mockTransactionParameters = { } as JsonRpcParams
833+ const mockTransactionParameters = { } as JsonRpcParams ;
831834 // Transaction fails before returning a result
832835 mockAddTransaction . mockImplementation ( async ( ) => {
833836 throw new Error ( 'Failed to add transaction' ) ;
@@ -840,7 +843,7 @@ describe('getRpcMethodMiddleware', () => {
840843 jsonrpc,
841844 id : 1 ,
842845 method : 'eth_sendTransaction' ,
843- params : [ mockTransactionParameters ]
846+ params : [ mockTransactionParameters ] ,
844847 } ;
845848 const expectedError = rpcErrors . internal ( 'Failed to add transaction' ) ;
846849
@@ -857,7 +860,7 @@ describe('getRpcMethodMiddleware', () => {
857860 it ( 'returns a JSON-RPC error if an error is thrown after approval' , async ( ) => {
858861 // Omit `from` and `chainId` here to skip validation for simplicity
859862 // Downcast needed here because `from` is required by this type
860- const mockTransactionParameters = { } as JsonRpcParams
863+ const mockTransactionParameters = { } as JsonRpcParams ;
861864 setupGlobalState ( {
862865 addTransactionResult : Promise . reject (
863866 new Error ( 'Failed to process transaction' ) ,
0 commit comments