@@ -818,8 +818,9 @@ public async Task Eth_get_block_by_number_with_recovering_sender_from_receipts()
818818 Assert . That ( serialized , Is . EqualTo ( "{\" jsonrpc\" :\" 2.0\" ,\" result\" :{\" author\" :\" 0x0000000000000000000000000000000000000000\" ,\" difficulty\" :\" 0xf4240\" ,\" extraData\" :\" 0x010203\" ,\" gasLimit\" :\" 0x3d0900\" ,\" gasUsed\" :\" 0x0\" ,\" hash\" :\" 0xe3026a6708b90d5cb25557ac38ddc3f5ef550af10f31e1cf771524da8553fa1c\" ,\" logsBloom\" :\" 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\" ,\" miner\" :\" 0x0000000000000000000000000000000000000000\" ,\" mixHash\" :\" 0x2ba5557a4c62a513c7e56d1bf13373e0da6bec016755483e91589fe1c6d212e2\" ,\" nonce\" :\" 0x00000000000003e8\" ,\" number\" :\" 0x1\" ,\" parentHash\" :\" 0xff483e972a04a9a62bb4b7d04ae403c615604e4090521ecc5bb7af67f71be09c\" ,\" receiptsRoot\" :\" 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\" ,\" sha3Uncles\" :\" 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\" ,\" size\" :\" 0x221\" ,\" stateRoot\" :\" 0x1ef7300d8961797263939a3d29bbba4ccf1702fabf02d8ad7a20b454edb6fd2f\" ,\" totalDifficulty\" :\" 0x0\" ,\" timestamp\" :\" 0xf4240\" ,\" transactions\" :[{\" nonce\" :\" 0x0\" ,\" blockHash\" :\" 0xe3026a6708b90d5cb25557ac38ddc3f5ef550af10f31e1cf771524da8553fa1c\" ,\" blockNumber\" :\" 0x1\" ,\" transactionIndex\" :\" 0x0\" ,\" from\" :\" 0x2d36e6c27c34ea22620e7b7c45de774599406cf3\" ,\" to\" :\" 0x0000000000000000000000000000000000000000\" ,\" value\" :\" 0x1\" ,\" gasPrice\" :\" 0x1\" ,\" gas\" :\" 0x5208\" ,\" data\" :\" 0x\" ,\" input\" :\" 0x\" ,\" type\" :\" 0x0\" }],\" transactionsRoot\" :\" 0x29cc403075ed3d1d6af940d577125cc378ee5a26f7746cbaf87f1cf4a38258b5\" ,\" uncles\" :[]},\" id\" :67}" ) ) ;
819819 }
820820
821- [ Test ]
822- public async Task Eth_get_transaction_receipt ( )
821+ [ TestCase ( false ) ]
822+ [ TestCase ( true ) ]
823+ public async Task Eth_get_transaction_receipt ( bool postEip4844 )
823824 {
824825 using Context ctx = await Context . Create ( ) ;
825826 IBlockchainBridge blockchainBridge = Substitute . For < IBlockchainBridge > ( ) ;
@@ -840,15 +841,20 @@ public async Task Eth_get_transaction_receipt()
840841 . WithLogs ( entries ) . TestObject ;
841842 TxReceipt [ ] receiptsTab = { receipt } ;
842843
843- blockchainBridge . GetReceiptAndEffectiveGasPrice ( Arg . Any < Keccak > ( ) ) . Returns ( ( receipt , UInt256 . One , 0 ) ) ;
844+
845+ blockchainBridge . GetReceiptAndGasInfo ( Arg . Any < Keccak > ( ) )
846+ . Returns ( ( receipt , postEip4844 ? new ( UInt256 . One , 2 , 3 ) : new ( UInt256 . One ) , 0 ) ) ;
844847 blockFinder . FindBlock ( Arg . Any < BlockParameter > ( ) ) . Returns ( block ) ;
845848 receiptFinder . Get ( Arg . Any < Block > ( ) ) . Returns ( receiptsTab ) ;
846849 receiptFinder . Get ( Arg . Any < Keccak > ( ) ) . Returns ( receiptsTab ) ;
847850
848851 ctx . Test = await TestRpcBlockchain . ForTest ( SealEngineType . NethDev ) . WithBlockFinder ( blockFinder ) . WithReceiptFinder ( receiptFinder ) . WithBlockchainBridge ( blockchainBridge ) . Build ( ) ;
849852 string serialized = ctx . Test . TestEthRpc ( "eth_getTransactionReceipt" , TestItem . KeccakA . ToString ( ) ) ;
850853
851- Assert . That ( serialized , Is . EqualTo ( "{\" jsonrpc\" :\" 2.0\" ,\" result\" :{\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" transactionIndex\" :\" 0x2\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" cumulativeGasUsed\" :\" 0x3e8\" ,\" gasUsed\" :\" 0x64\" ,\" effectiveGasPrice\" :\" 0x1\" ,\" from\" :\" 0xb7705ae4c6f81b66cdb323c65f4e8133690fc099\" ,\" to\" :\" 0x942921b14f1b1c385cd7e0cc2ef7abe5598c8358\" ,\" contractAddress\" :\" 0x76e68a8696537e4141926f3e528733af9e237d69\" ,\" logs\" :[{\" removed\" :false,\" logIndex\" :\" 0x0\" ,\" transactionIndex\" :\" 0x2\" ,\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" address\" :\" 0x0000000000000000000000000000000000000000\" ,\" data\" :\" 0x\" ,\" topics\" :[\" 0x0000000000000000000000000000000000000000000000000000000000000000\" ]},{\" removed\" :false,\" logIndex\" :\" 0x1\" ,\" transactionIndex\" :\" 0x2\" ,\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" address\" :\" 0x0000000000000000000000000000000000000000\" ,\" data\" :\" 0x\" ,\" topics\" :[\" 0x0000000000000000000000000000000000000000000000000000000000000000\" ]}],\" logsBloom\" :\" 0x00000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000\" ,\" root\" :\" 0x1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a69111\" ,\" status\" :\" 0x1\" ,\" error\" :\" error\" ,\" type\" :\" 0x0\" },\" id\" :67}" ) ) ;
854+ if ( postEip4844 )
855+ Assert . That ( serialized , Is . EqualTo ( "{\" jsonrpc\" :\" 2.0\" ,\" result\" :{\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" transactionIndex\" :\" 0x2\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" cumulativeGasUsed\" :\" 0x3e8\" ,\" gasUsed\" :\" 0x64\" ,\" dataGasUsed\" :\" 0x3\" ,\" dataGasPrice\" :\" 0x2\" ,\" effectiveGasPrice\" :\" 0x1\" ,\" from\" :\" 0xb7705ae4c6f81b66cdb323c65f4e8133690fc099\" ,\" to\" :\" 0x942921b14f1b1c385cd7e0cc2ef7abe5598c8358\" ,\" contractAddress\" :\" 0x76e68a8696537e4141926f3e528733af9e237d69\" ,\" logs\" :[{\" removed\" :false,\" logIndex\" :\" 0x0\" ,\" transactionIndex\" :\" 0x2\" ,\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" address\" :\" 0x0000000000000000000000000000000000000000\" ,\" data\" :\" 0x\" ,\" topics\" :[\" 0x0000000000000000000000000000000000000000000000000000000000000000\" ]},{\" removed\" :false,\" logIndex\" :\" 0x1\" ,\" transactionIndex\" :\" 0x2\" ,\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" address\" :\" 0x0000000000000000000000000000000000000000\" ,\" data\" :\" 0x\" ,\" topics\" :[\" 0x0000000000000000000000000000000000000000000000000000000000000000\" ]}],\" logsBloom\" :\" 0x00000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000\" ,\" root\" :\" 0x1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a69111\" ,\" status\" :\" 0x1\" ,\" error\" :\" error\" ,\" type\" :\" 0x0\" },\" id\" :67}" ) ) ;
856+ else
857+ Assert . That ( serialized , Is . EqualTo ( "{\" jsonrpc\" :\" 2.0\" ,\" result\" :{\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" transactionIndex\" :\" 0x2\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" cumulativeGasUsed\" :\" 0x3e8\" ,\" gasUsed\" :\" 0x64\" ,\" effectiveGasPrice\" :\" 0x1\" ,\" from\" :\" 0xb7705ae4c6f81b66cdb323c65f4e8133690fc099\" ,\" to\" :\" 0x942921b14f1b1c385cd7e0cc2ef7abe5598c8358\" ,\" contractAddress\" :\" 0x76e68a8696537e4141926f3e528733af9e237d69\" ,\" logs\" :[{\" removed\" :false,\" logIndex\" :\" 0x0\" ,\" transactionIndex\" :\" 0x2\" ,\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" address\" :\" 0x0000000000000000000000000000000000000000\" ,\" data\" :\" 0x\" ,\" topics\" :[\" 0x0000000000000000000000000000000000000000000000000000000000000000\" ]},{\" removed\" :false,\" logIndex\" :\" 0x1\" ,\" transactionIndex\" :\" 0x2\" ,\" transactionHash\" :\" 0x03783fac2efed8fbc9ad443e592ee30e61d65f471140c10ca155e937b435b760\" ,\" blockHash\" :\" 0x017e667f4b8c174291d1543c466717566e206df1bfd6f30271055ddafdb18f72\" ,\" blockNumber\" :\" 0x2\" ,\" address\" :\" 0x0000000000000000000000000000000000000000\" ,\" data\" :\" 0x\" ,\" topics\" :[\" 0x0000000000000000000000000000000000000000000000000000000000000000\" ]}],\" logsBloom\" :\" 0x00000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000\" ,\" root\" :\" 0x1f675bff07515f5df96737194ea945c36c41e7b4fcef307b7cd4d0e602a69111\" ,\" status\" :\" 0x1\" ,\" error\" :\" error\" ,\" type\" :\" 0x0\" },\" id\" :67}" ) ) ;
852858 }
853859
854860
@@ -903,7 +909,7 @@ public async Task Eth_get_transaction_receipt_when_block_has_few_receipts()
903909 Logs = logEntries
904910 } ;
905911
906- blockchainBridge . GetReceiptAndEffectiveGasPrice ( Arg . Any < Keccak > ( ) ) . Returns ( ( receipt2 , UInt256 . One , 2 ) ) ;
912+ blockchainBridge . GetReceiptAndGasInfo ( Arg . Any < Keccak > ( ) ) . Returns ( ( receipt2 , new ( UInt256 . One ) , 2 ) ) ;
907913
908914 TxReceipt [ ] receipts = { receipt1 , receipt2 } ;
909915
@@ -959,7 +965,7 @@ public async Task Eth_getTransactionReceipt_return_info_about_mined_tx()
959965 blockFinder . FindBlock ( Arg . Any < BlockParameter > ( ) ) . Returns ( block ) ;
960966 receiptFinder . Get ( Arg . Any < Block > ( ) ) . Returns ( receiptsTab ) ;
961967 receiptFinder . Get ( Arg . Any < Keccak > ( ) ) . Returns ( receiptsTab ) ;
962- blockchainBridge . GetReceiptAndEffectiveGasPrice ( Arg . Any < Keccak > ( ) ) . Returns ( ( receipt , UInt256 . One , 0 ) ) ;
968+ blockchainBridge . GetReceiptAndGasInfo ( Arg . Any < Keccak > ( ) ) . Returns ( ( receipt , new ( UInt256 . One ) , 0 ) ) ;
963969
964970 ctx . Test = await TestRpcBlockchain . ForTest ( SealEngineType . NethDev ) . WithBlockFinder ( blockFinder ) . WithReceiptFinder ( receiptFinder ) . WithBlockchainBridge ( blockchainBridge ) . Build ( ) ;
965971 string serialized = ctx . Test . TestEthRpc ( "eth_getTransactionReceipt" , tx . Hash ! . ToString ( ) ) ;
0 commit comments