@@ -183,14 +183,14 @@ describe('@ethSendRawTransaction eth_sendRawTransaction spec', async function ()
183183
184184 it ( 'should return a predefined GAS_LIMIT_TOO_HIGH instead of NUMERIC_FAULT as precheck exception' , async function ( ) {
185185 // tx with 'gasLimit: BigNumber { value: "30678687678687676876786786876876876000" }'
186- const txHash =
186+ const tx =
187187 '0x02f881820128048459682f0086014fa0186f00901714801554cbe52dd95512bedddf68e09405fba803be258049a27b820088bab1cad205887185174876e80080c080a0cab3f53602000c9989be5787d0db637512acdd2ad187ce15ba83d10d9eae2571a07802515717a5a1c7d6fa7616183eb78307b4657d7462dbb9e9deca820dd28f62' ;
188188 await RelayAssertions . assertRejection (
189189 predefined . GAS_LIMIT_TOO_HIGH ( null , null ) ,
190190 ethImpl . sendRawTransaction ,
191191 false ,
192192 ethImpl ,
193- [ txHash , requestDetails ] ,
193+ [ tx , requestDetails ] ,
194194 ) ;
195195 } ) ;
196196
@@ -456,15 +456,29 @@ describe('@ethSendRawTransaction eth_sendRawTransaction spec', async function ()
456456 } ) ;
457457
458458 withOverriddenEnvsInMochaTest ( { READ_ONLY : true } , ( ) => {
459- it ( 'should throw `UNSUPPORTED_OPERATION` when Relay is in Read-Only mode' , async function ( ) {
460- const signed = await signTransaction ( { ...transaction , value : '0x1234567890' } ) ;
461- await RelayAssertions . assertRejection (
462- predefined . UNSUPPORTED_OPERATION ( 'Relay is in read-only mode' ) ,
463- ethImpl . sendRawTransaction ,
464- false ,
465- ethImpl ,
466- [ signed , requestDetails ] ,
467- ) ;
459+ [ false , true ] . forEach ( ( useAsyncTxProcessing ) => {
460+ withOverriddenEnvsInMochaTest ( { USE_ASYNC_TX_PROCESSING : useAsyncTxProcessing } , ( ) => {
461+ [
462+ { title : 'ill-formatted' , transaction : constants . INVALID_TRANSACTION } ,
463+ {
464+ title : 'failed precheck' ,
465+ transaction :
466+ '0x02f881820128048459682f0086014fa0186f00901714801554cbe52dd95512bedddf68e09405fba803be258049a27b820088bab1cad205887185174876e80080c080a0cab3f53602000c9989be5787d0db637512acdd2ad187ce15ba83d10d9eae2571a07802515717a5a1c7d6fa7616183eb78307b4657d7462dbb9e9deca820dd28f62' ,
467+ } ,
468+ { title : 'valid' , transaction } ,
469+ ] . forEach ( ( { title, transaction } ) => {
470+ it ( `should throw \`UNSUPPORTED_OPERATION\` when Relay is in Read-Only mode for a '${ title } ' transaction` , async function ( ) {
471+ const signed = typeof transaction === 'string' ? transaction : await signTransaction ( transaction ) ;
472+ await RelayAssertions . assertRejection (
473+ predefined . UNSUPPORTED_OPERATION ( 'Relay is in read-only mode' ) ,
474+ ethImpl . sendRawTransaction ,
475+ false ,
476+ ethImpl ,
477+ [ signed , requestDetails ] ,
478+ ) ;
479+ } ) ;
480+ } ) ;
481+ } ) ;
468482 } ) ;
469483 } ) ;
470484 } ) ;
0 commit comments