File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -657,9 +657,12 @@ export class EthImpl implements Eth {
657657 try {
658658 const gasPrice = await this . getFeeWeibars ( EthImpl . ethSendRawTransaction ) ;
659659 await this . precheck . sendRawTransactionCheck ( transaction , gasPrice ) ;
660- }
661- catch ( e : any ) {
662- return e ;
660+ } catch ( e : any ) {
661+ if ( e instanceof JsonRpcError ) {
662+ return e ;
663+ }
664+
665+ throw predefined . INTERNAL_ERROR ;
663666 }
664667
665668 const transactionBuffer = Buffer . from ( EthImpl . prune0x ( transaction ) , 'hex' ) ;
Original file line number Diff line number Diff line change @@ -1437,6 +1437,24 @@ describe('Eth calls using MirrorNode', async function () {
14371437 expect ( result ) . to . equal ( "0x00" )
14381438 } ) ;
14391439 } ) ;
1440+
1441+ describe ( 'eth_sendRawTransaction' , async function ( ) {
1442+ it ( 'should return a predefined INTERNAL_ERROR instead of NUMERIC_FAULT as precheck exception' , async function ( ) {
1443+ // tx with 'gasLimit: BigNumber { value: "30678687678687676876786786876876876000" }'
1444+ const txHash = '0x02f881820128048459682f0086014fa0186f00901714801554cbe52dd95512bedddf68e09405fba803be258049a27b820088bab1cad205887185174876e80080c080a0cab3f53602000c9989be5787d0db637512acdd2ad187ce15ba83d10d9eae2571a07802515717a5a1c7d6fa7616183eb78307b4657d7462dbb9e9deca820dd28f62' ;
1445+
1446+ let hasError = false ;
1447+ mock . onGet ( 'network/fees' ) . reply ( 200 , defaultNetworkFees ) ;
1448+ try {
1449+ await ethImpl . sendRawTransaction ( txHash ) ;
1450+ } catch ( e ) {
1451+ hasError = true ;
1452+ expect ( e . code ) . to . equal ( - 32603 ) ;
1453+ expect ( e . name ) . to . equal ( 'Internal error' ) ;
1454+ }
1455+ expect ( hasError ) . to . be . true ;
1456+ } ) ;
1457+ } ) ;
14401458} ) ;
14411459
14421460describe ( 'Eth' , async function ( ) {
You can’t perform that action at this time.
0 commit comments