Skip to content

Commit d2e69e9

Browse files
deffrianNikita Mescheryakov
authored andcommitted
Blob gas info in receipts (#5767)
* Blob gas info in receipts * Fix gas price * Fix spaces * Add tests * Supports blobs * Ignore on null * Fix suggestions * Fix build --------- Co-authored-by: Nikita Mescheryakov <[email protected]>
1 parent 8049f94 commit d2e69e9

File tree

13 files changed

+116
-40
lines changed

13 files changed

+116
-40
lines changed

src/Nethermind/Nethermind.Evm/IntrinsicGasCalculator.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,14 @@ private static long AccessListCost(Transaction transaction, IReleaseSpec release
9696

9797
public static ulong CalculateDataGas(int blobCount) => (ulong)blobCount * Eip4844Constants.DataGasPerBlob;
9898

99+
public static ulong CalculateDataGas(Transaction transaction) =>
100+
CalculateDataGas(transaction.BlobVersionedHashes?.Length ?? 0);
101+
99102
public static UInt256 CalculateDataGasPrice(BlockHeader header, Transaction transaction) =>
100-
CalculateDataGas(transaction.BlobVersionedHashes?.Length ?? 0) * CalculateDataGasPricePerUnit(header);
103+
CalculateDataGas(transaction) * CalculateDataGasPricePerUnit(header);
101104

102105
public static UInt256 CalculateDataGasPrice(BlockHeader header) =>
103-
header.DataGasUsed.Value * CalculateDataGasPricePerUnit(header);
106+
header.DataGasUsed!.Value * CalculateDataGasPricePerUnit(header);
104107

105108
public static UInt256 CalculateDataGasPricePerUnit(BlockHeader header)
106109
{

src/Nethermind/Nethermind.Evm/TransactionExtensions.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,40 @@ tx.To is not null
1414
: tx.IsSystem()
1515
? tx.SenderAddress
1616
: ContractAddress.From(tx.SenderAddress, nonce > 0 ? nonce - 1 : nonce);
17+
18+
public static TxGasInfo GetGasInfo(this Transaction tx, bool is1559Enabled, BlockHeader header)
19+
{
20+
UInt256 effectiveGasPrice = tx.CalculateEffectiveGasPrice(is1559Enabled, header.BaseFeePerGas);
21+
ulong? dataGas = null;
22+
UInt256? dataGasPrice = null;
23+
if (tx.SupportsBlobs)
24+
{
25+
dataGas = IntrinsicGasCalculator.CalculateDataGas(tx);
26+
dataGasPrice = IntrinsicGasCalculator.CalculateDataGasPrice(header, tx);
27+
}
28+
29+
return new(effectiveGasPrice, dataGasPrice, dataGas);
30+
}
31+
}
32+
33+
public struct TxGasInfo
34+
{
35+
public TxGasInfo() { }
36+
37+
public TxGasInfo(UInt256? effectiveGasPrice, UInt256? dataGasPrice, ulong? dataGasUsed)
38+
{
39+
EffectiveGasPrice = effectiveGasPrice;
40+
DataGasPrice = dataGasPrice;
41+
DataGasUsed = dataGasUsed;
42+
}
43+
44+
public TxGasInfo(UInt256? effectiveGasPrice)
45+
{
46+
EffectiveGasPrice = effectiveGasPrice;
47+
}
48+
49+
public UInt256? EffectiveGasPrice { get; private set; }
50+
public UInt256? DataGasPrice { get; private set; }
51+
public ulong? DataGasUsed { get; private set; }
1752
}
1853
}

src/Nethermind/Nethermind.Facade.Test/BlockchainBridgeTests.cs

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
using NSubstitute;
2929
using NUnit.Framework;
3030
using Nethermind.Config;
31+
using Nethermind.Evm;
3132

3233
namespace Nethermind.Facade.Test
3334
{
@@ -231,20 +232,34 @@ public void Bridge_head_is_correct(long headNumber)
231232
_blockchainBridge.HeadBlock.Should().Be(head);
232233
}
233234

234-
[TestCase(true)]
235-
[TestCase(false)]
236-
public void GetReceiptAndEffectiveGasPrice_returns_correct_results(bool isCanonical)
235+
[TestCase(true, true)]
236+
[TestCase(false, true)]
237+
[TestCase(true, false)]
238+
[TestCase(false, false)]
239+
public void GetReceiptAndGasInfo_returns_correct_results(bool isCanonical, bool postEip4844)
237240
{
238241
Keccak txHash = TestItem.KeccakA;
239242
Keccak blockHash = TestItem.KeccakB;
240243
UInt256 effectiveGasPrice = 123;
241244

242-
Transaction tx = Build.A.Transaction
243-
.WithGasPrice(effectiveGasPrice)
244-
.TestObject;
245-
Block block = Build.A.Block
246-
.WithTransactions(tx)
247-
.TestObject;
245+
Transaction tx = postEip4844
246+
? Build.A.Transaction
247+
.WithGasPrice(effectiveGasPrice)
248+
.WithType(TxType.Blob)
249+
.WithMaxFeePerDataGas(2)
250+
.WithBlobVersionedHashes(2)
251+
.TestObject
252+
: Build.A.Transaction
253+
.WithGasPrice(effectiveGasPrice)
254+
.TestObject;
255+
Block block = postEip4844
256+
? Build.A.Block
257+
.WithTransactions(tx)
258+
.WithExcessDataGas(2)
259+
.TestObject
260+
: Build.A.Block
261+
.WithTransactions(tx)
262+
.TestObject;
248263
TxReceipt receipt = Build.A.Receipt
249264
.WithBlockHash(blockHash)
250265
.WithTransactionHash(txHash)
@@ -255,8 +270,16 @@ public void GetReceiptAndEffectiveGasPrice_returns_correct_results(bool isCanoni
255270
_receiptStorage.FindBlockHash(txHash).Returns(blockHash);
256271
_receiptStorage.Get(block).Returns(new[] { receipt });
257272

258-
(TxReceipt Receipt, UInt256? EffectiveGasPrice, int LogIndexStart) result = isCanonical ? (receipt, effectiveGasPrice, 0) : (null, null, 0);
259-
_blockchainBridge.GetReceiptAndEffectiveGasPrice(txHash).Should().BeEquivalentTo(result);
273+
(TxReceipt? Receipt, TxGasInfo? GasInfo, int LogIndexStart) result = postEip4844
274+
? (receipt, new(effectiveGasPrice, 262144, 262144), 0)
275+
: (receipt, new(effectiveGasPrice), 0);
276+
277+
if (!isCanonical)
278+
{
279+
result = (null, null, 0);
280+
}
281+
282+
_blockchainBridge.GetReceiptAndGasInfo(txHash).Should().BeEquivalentTo(result);
260283
}
261284
}
262285
}

src/Nethermind/Nethermind.Facade.Test/Nethermind.Facade.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net7.0</TargetFramework>
55
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
6+
<Nullable>annotations</Nullable>
67
</PropertyGroup>
78

89
<ItemGroup>

src/Nethermind/Nethermind.Facade/BlockchainBridge.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public Block? HeadBlock
8383

8484
public bool IsMining { get; }
8585

86-
public (TxReceipt Receipt, UInt256? EffectiveGasPrice, int LogIndexStart) GetReceiptAndEffectiveGasPrice(Keccak txHash)
86+
public (TxReceipt? Receipt, TxGasInfo? GasInfo, int LogIndexStart) GetReceiptAndGasInfo(Keccak txHash)
8787
{
8888
Keccak blockHash = _receiptFinder.FindBlockHash(txHash);
8989
if (blockHash is not null)
@@ -96,15 +96,14 @@ public Block? HeadBlock
9696
int logIndexStart = txReceipts.GetBlockLogFirstIndex(txReceipt.Index);
9797
Transaction tx = block.Transactions[txReceipt.Index];
9898
bool is1559Enabled = _specProvider.GetSpecFor1559(block.Number).IsEip1559Enabled;
99-
UInt256 effectiveGasPrice = tx.CalculateEffectiveGasPrice(is1559Enabled, block.Header.BaseFeePerGas);
100-
return (txReceipt, effectiveGasPrice, logIndexStart);
99+
return (txReceipt, tx.GetGasInfo(is1559Enabled, block.Header), logIndexStart);
101100
}
102101
}
103102

104103
return (null, null, 0);
105104
}
106105

107-
public (TxReceipt Receipt, Transaction Transaction, UInt256? baseFee) GetTransaction(Keccak txHash)
106+
public (TxReceipt? Receipt, Transaction Transaction, UInt256? baseFee) GetTransaction(Keccak txHash)
108107
{
109108
Keccak blockHash = _receiptFinder.FindBlockHash(txHash);
110109
if (blockHash is not null)
@@ -271,7 +270,7 @@ private void CallAndRestore(
271270

272271
if (releaseSpec.IsEip4844Enabled)
273272
{
274-
callHeader.DataGasUsed = IntrinsicGasCalculator.CalculateDataGas(transaction.BlobVersionedHashes?.Length ?? 0);
273+
callHeader.DataGasUsed = IntrinsicGasCalculator.CalculateDataGas(transaction);
275274
callHeader.ExcessDataGas = treatBlockHeaderAsParentBlock
276275
? IntrinsicGasCalculator.CalculateExcessDataGas(blockHeader, releaseSpec)
277276
: blockHeader.ExcessDataGas;

src/Nethermind/Nethermind.Facade/IBlockchainBridge.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Nethermind.Blockchain.Find;
88
using Nethermind.Core;
99
using Nethermind.Core.Crypto;
10+
using Nethermind.Evm;
1011
using Nethermind.Facade.Filters;
1112
using Nethermind.Int256;
1213
using Nethermind.Trie;
@@ -21,8 +22,8 @@ public interface IBlockchainBridge : ILogFinder
2122
void RecoverTxSenders(Block block);
2223
Address? RecoverTxSender(Transaction tx);
2324
TxReceipt GetReceipt(Keccak txHash);
24-
(TxReceipt Receipt, UInt256? EffectiveGasPrice, int LogIndexStart) GetReceiptAndEffectiveGasPrice(Keccak txHash);
25-
(TxReceipt Receipt, Transaction Transaction, UInt256? baseFee) GetTransaction(Keccak txHash);
25+
(TxReceipt? Receipt, TxGasInfo? GasInfo, int LogIndexStart) GetReceiptAndGasInfo(Keccak txHash);
26+
(TxReceipt? Receipt, Transaction Transaction, UInt256? baseFee) GetTransaction(Keccak txHash);
2627
BlockchainBridge.CallOutput Call(BlockHeader header, Transaction tx, CancellationToken cancellationToken);
2728
BlockchainBridge.CallOutput EstimateGas(BlockHeader header, Transaction tx, CancellationToken cancellationToken);
2829
BlockchainBridge.CallOutput CreateAccessList(BlockHeader header, Transaction tx, CancellationToken cancellationToken, bool optimize);

src/Nethermind/Nethermind.JsonRpc.Test/Data/ReceiptsForRpcTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void Are_log_indexes_unique()
3838
};
3939

4040
UInt256 effectiveGasPrice = new(5526);
41-
ReceiptForRpc receiptForRpc = new(txHash, receipt1, effectiveGasPrice);
41+
ReceiptForRpc receiptForRpc = new(txHash, receipt1, new(effectiveGasPrice));
4242
long?[] indexes = receiptForRpc.Logs.Select(log => log.LogIndex).ToArray();
4343
long?[] expected = { 0, 1, 2 };
4444

src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)