From bbd477a3b5a21883d844d4c474f0efd68e929f78 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Fri, 26 Jul 2024 18:38:44 +0800 Subject: [PATCH] fix RPC for blob tx receipt --- pkg/eth/api.go | 6 ++++++ test/compose-server.yml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/pkg/eth/api.go b/pkg/eth/api.go index 6adcc901..57e5e745 100644 --- a/pkg/eth/api.go +++ b/pkg/eth/api.go @@ -660,6 +660,12 @@ func (pea *PublicEthAPI) localGetTransactionReceipt(ctx context.Context, hash co if receipt.Logs == nil { fields["logs"] = []*types.Log{} } + + if tx.Type() == types.BlobTxType { + fields["blobGasUsed"] = hexutil.Uint64(receipt.BlobGasUsed) + fields["blobGasPrice"] = (*hexutil.Big)(receipt.BlobGasPrice) + } + // If the ContractAddress is 20 0x0 bytes, assume it is not a contract creation if receipt.ContractAddress != (common.Address{}) { fields["contractAddress"] = receipt.ContractAddress diff --git a/test/compose-server.yml b/test/compose-server.yml index 2aa8bdb5..b7d5409b 100644 --- a/test/compose-server.yml +++ b/test/compose-server.yml @@ -4,6 +4,8 @@ services: ipld-eth-server: restart: unless-stopped image: cerc/ipld-eth-server:local + build: + context: .. networks: - test_default environment: