@@ -2232,36 +2232,22 @@ describe('Eth calls using MirrorNode', async function () {
22322232 expect ( hasError ) . to . be . true ;
22332233 } ) ;
22342234
2235- it ( 'eth_getStorageAt should throw a predefined RESOURCE_NOT_FOUND when state_changes is null' , async function ( ) {
2235+ it ( 'eth_getStorageAt should return EthImpl.zeroHex32Byte when state_changes is null' , async function ( ) {
22362236 defaultDetailedContractResultsNullStateChange
22372237 mock . onGet ( `blocks/${ blockNumber } ` ) . reply ( 200 , defaultBlock ) ;
22382238 mock . onGet ( `contracts/${ contractAddress1 } /results?timestamp=lte:${ defaultBlock . timestamp . to } &limit=1&order=desc` ) . reply ( 200 , defaultContractResults ) ;
22392239 mock . onGet ( `contracts/${ contractAddress1 } /results/${ contractTimestamp1 } ` ) . reply ( 200 , defaultDetailedContractResultsNullStateChange ) ;
2240- let hasError = false ;
2241- try {
2242- await ethImpl . getStorageAt ( contractAddress1 , defaultDetailedContractResults . state_changes [ 0 ] . slot , EthImpl . numberTo0x ( blockNumber ) ) ;
2243- } catch ( e : any ) {
2244- hasError = true ;
2245- expect ( e . code ) . to . equal ( predefined . RESOURCE_NOT_FOUND ( ) . code ) ;
2246- expect ( e . name ) . to . equal ( predefined . RESOURCE_NOT_FOUND ( ) . name ) ;
2247- }
2248- expect ( hasError ) . to . be . true ;
2240+ const result = await ethImpl . getStorageAt ( contractAddress1 , defaultDetailedContractResults . state_changes [ 0 ] . slot , EthImpl . numberTo0x ( blockNumber ) ) ;
2241+ expect ( result ) . to . equal ( EthImpl . zeroHex32Byte ) ;
22492242 } ) ;
22502243
2251- it ( 'eth_getStorageAt should throw a predefined RESOURCE_NOT_FOUND when state_changes is an empty array' , async function ( ) {
2244+ it ( 'eth_getStorageAt should return EthImpl.zeroHex32Byte when state_changes is an empty array' , async function ( ) {
22522245 defaultDetailedContractResultsNullStateChange
22532246 mock . onGet ( `blocks/${ blockNumber } ` ) . reply ( 200 , defaultBlock ) ;
22542247 mock . onGet ( `contracts/${ contractAddress1 } /results?timestamp=lte:${ defaultBlock . timestamp . to } &limit=1&order=desc` ) . reply ( 200 , defaultContractResults ) ;
22552248 mock . onGet ( `contracts/${ contractAddress1 } /results/${ contractTimestamp1 } ` ) . reply ( 200 , defaultDetailedContractResultsEmptyArrayStateChange ) ;
2256- let hasError = false ;
2257- try {
2258- await ethImpl . getStorageAt ( contractAddress1 , defaultDetailedContractResults . state_changes [ 0 ] . slot , EthImpl . numberTo0x ( blockNumber ) ) ;
2259- } catch ( e : any ) {
2260- hasError = true ;
2261- expect ( e . code ) . to . equal ( predefined . RESOURCE_NOT_FOUND ( ) . code ) ;
2262- expect ( e . name ) . to . equal ( predefined . RESOURCE_NOT_FOUND ( ) . name ) ;
2263- }
2264- expect ( hasError ) . to . be . true ;
2249+ const result = await ethImpl . getStorageAt ( contractAddress1 , defaultDetailedContractResults . state_changes [ 0 ] . slot , EthImpl . numberTo0x ( blockNumber ) ) ;
2250+ expect ( result ) . to . equal ( EthImpl . zeroHex32Byte ) ;
22652251 } ) ;
22662252
22672253 it ( 'eth_getStorageAt should throw error when contract not found' , async function ( ) {
0 commit comments