File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -1814,7 +1814,7 @@ export class EthImpl implements Eth {
18141814 effectiveGasPrice : nanOrNumberTo0x ( Number . parseInt ( effectiveGas ) * 10_000_000_000 ) ,
18151815 root : receiptResponse . root ,
18161816 status : receiptResponse . status ,
1817- type : numberTo0x ( receiptResponse . type ) ,
1817+ type : nullableNumberTo0x ( receiptResponse . type ) ,
18181818 } ;
18191819
18201820 if ( receiptResponse . error_message ) {
Original file line number Diff line number Diff line change @@ -5610,6 +5610,24 @@ describe('Eth', async function () {
56105610 expect ( receipt . effectiveGasPrice ) . to . eq ( '0x0' ) ;
56115611 } ) ;
56125612
5613+ it ( 'Handles null type' , async function ( ) {
5614+ const contractResult = {
5615+ ...defaultDetailedContractResultByHash ,
5616+ type : null ,
5617+ } ;
5618+
5619+ const uniqueTxHash = '0x07cdd7b820375d10d73af57a6a3e84353645fdb1305ea58ff52daa53ec640533' ;
5620+
5621+ restMock . onGet ( `contracts/results/${ uniqueTxHash } ` ) . reply ( 200 , contractResult ) ;
5622+ restMock . onGet ( `contracts/${ defaultDetailedContractResultByHash . created_contract_ids [ 0 ] } ` ) . reply ( 404 ) ;
5623+ const receipt = await ethImpl . getTransactionReceipt ( uniqueTxHash ) ;
5624+
5625+ expect ( receipt ) . to . exist ;
5626+ if ( receipt == null ) return ;
5627+
5628+ expect ( receipt . type ) . to . be . null ;
5629+ } ) ;
5630+
56135631 it ( 'handles empty bloom' , async function ( ) {
56145632 const receiptWith0xBloom = {
56155633 ...defaultDetailedContractResultByHash ,
You can’t perform that action at this time.
0 commit comments