From ec6707c6abf5b7d777c8cc3de2b28ddbbfbd20f2 Mon Sep 17 00:00:00 2001 From: i-norden Date: Sat, 1 Apr 2023 12:52:20 -0500 Subject: [PATCH] return effectiveGasPrice in GetTransactionReceipt --- pkg/eth/api.go | 1 + pkg/eth/api_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/pkg/eth/api.go b/pkg/eth/api.go index 120ede1d..9b10e7fc 100644 --- a/pkg/eth/api.go +++ b/pkg/eth/api.go @@ -623,6 +623,7 @@ func (pea *PublicEthAPI) localGetTransactionReceipt(ctx context.Context, hash co "contractAddress": nil, "logs": receipt.Logs, "logsBloom": receipt.Bloom, + "effectiveGasPrice": (*hexutil.Big)(receipt.EffectiveGasPrice), } // Assign receipt status or post state. diff --git a/pkg/eth/api_test.go b/pkg/eth/api_test.go index c543ab72..186acaf1 100644 --- a/pkg/eth/api_test.go +++ b/pkg/eth/api_test.go @@ -150,6 +150,7 @@ var ( "logs": test_helpers.MockReceipts[0].Logs, "logsBloom": test_helpers.MockReceipts[0].Bloom, "status": hexutil.Uint(test_helpers.MockReceipts[0].Status), + "effectiveGasPrice": (*hexutil.Big)(big.NewInt(100)), } expectedReceipt2 = map[string]interface{}{ "blockHash": blockHash, @@ -164,6 +165,7 @@ var ( "logs": test_helpers.MockReceipts[1].Logs, "logsBloom": test_helpers.MockReceipts[1].Bloom, "root": hexutil.Bytes(test_helpers.MockReceipts[1].PostState), + "effectiveGasPrice": (*hexutil.Big)(big.NewInt(200)), } expectedReceipt3 = map[string]interface{}{ "blockHash": blockHash, @@ -178,6 +180,7 @@ var ( "logs": test_helpers.MockReceipts[2].Logs, "logsBloom": test_helpers.MockReceipts[2].Bloom, "root": hexutil.Bytes(test_helpers.MockReceipts[2].PostState), + "effectiveGasPrice": (*hexutil.Big)(big.NewInt(150)), } )