This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.
GetTransactionReceipt(hash common.Hash): the "cumulativeGasUsed" should not be nil in this function #648
Closed
Description
System info: [Include Ethermint commit, operating system name, and other relevant details]
before 6e1c166
Steps to reproduce:
If someone try to get a transaction receipt based on an txhash
when using go-ethereum
- [First Step]
import thegithub.com/ethereum/go-ethereum v1.9.24
to get a transaction receipt
client, err := ethclient.Dial(host)
if err != nil {
log.Fatalf("failed to initialize client: %+v", err)
}
receipt, err := client.TransactionReceipt(context.Background(), "0x6283f56fd27cb547e54c9e16ac402ea31c5bc3f21279a4e93234da29da3f8810")
if err != nil {
log.Fatal(err)
}
fmt.Println("contract address:", receipt.ContractAddress.String())
Expected behavior: [What you expected to happen]
the output should show up an legal eth adress
Actual behavior: [What actually happened]
an error comes out: missing required field 'cumulativeGasUsed' for Receipt
Additional info: [Include gist of relevant config, logs, etc.]
ethermint/rpc/namespaces/eth/api.go
Line 702 in 6e1c166
- the root cause is coming from here. You guys make it as
nil
- but when I use
client.TransactionReceipt
, it will trigger the judgement in (r *Receipt) UnmarshalJSON(input []byte) function - so it cause a tiny error
- what I suggest is making
nil
intohexutil.Uint64(0)