File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -1101,7 +1101,7 @@ export class EthImpl implements Eth {
11011101 to : contractResult . to ?. substring ( 0 , 42 ) ,
11021102 transactionIndex : EthImpl . numberTo0x ( contractResult . transaction_index ) ,
11031103 type : EthImpl . nullableNumberTo0x ( contractResult . type ) ,
1104- v : EthImpl . nullableNumberTo0x ( contractResult . v ) ,
1104+ v : EthImpl . nanOrNumberTo0x ( contractResult . v ) ,
11051105 value : EthImpl . nanOrNumberTo0x ( contractResult . amount ) ,
11061106 } ) ;
11071107 }
@@ -1382,7 +1382,7 @@ export class EthImpl implements Eth {
13821382 to : contractResultDetails . to . substring ( 0 , 42 ) ,
13831383 transactionIndex : EthImpl . numberTo0x ( contractResultDetails . transaction_index ) ,
13841384 type : EthImpl . nullableNumberTo0x ( contractResultDetails . type ) ,
1385- v : EthImpl . nullableNumberTo0x ( contractResultDetails . v ) ,
1385+ v : EthImpl . nanOrNumberTo0x ( contractResultDetails . v ) ,
13861386 value : EthImpl . nanOrNumberTo0x ( contractResultDetails . amount ) ,
13871387 } ) ;
13881388 }
Original file line number Diff line number Diff line change @@ -3320,6 +3320,24 @@ describe('Eth', async function () {
33203320 expect ( result . value ) . to . eq ( '0x0' ) ;
33213321 } ) ;
33223322
3323+ it ( 'handles transactions with v as null' , async function ( ) {
3324+ // mirror node request mocks
3325+ const detailedResultsWithNullNullableValues = {
3326+ ...defaultDetailedContractResultByHash ,
3327+ v : null
3328+ } ;
3329+
3330+ restMock . onGet ( `contracts/results/${ defaultTxHash } ` ) . reply ( 200 , detailedResultsWithNullNullableValues ) ;
3331+ restMock . onGet ( `accounts/${ defaultFromLongZeroAddress } ` ) . reply ( 200 , {
3332+ evm_address : `${ defaultTransaction . from } `
3333+ } ) ;
3334+ const result = await ethImpl . getTransactionByHash ( defaultTxHash ) ;
3335+ if ( result == null ) return ;
3336+
3337+ expect ( result ) . to . exist ;
3338+ expect ( result . v ) . to . eq ( '0x0' ) ;
3339+ } ) ;
3340+
33233341 it ( 'returns reverted transactions' , async function ( ) {
33243342 restMock . onGet ( `contracts/results/${ defaultTxHash } ` ) . reply ( 200 , defaultDetailedContractResultByHashReverted ) ;
33253343 restMock . onGet ( `accounts/${ defaultFromLongZeroAddress } ` ) . reply ( 200 , {
You can’t perform that action at this time.
0 commit comments