diff --git a/CHANGELOG.md b/CHANGELOG.md index 9861b45ba6..f6f318408e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (rpc) [tharsis#1059](https://github.com/tharsis/ethermint/pull/1059) Remove unnecessary event filtering logic on the `eth_baseFee` JSON-RPC endpoint. +* (rpc) [tharsis#1082](https://github.com/tharsis/ethermint/pull/1082) fix gas price returned in getTransaction api. ### API Breaking diff --git a/rpc/ethereum/backend/backend.go b/rpc/ethereum/backend/backend.go index 567f4e56ca..706147f36d 100644 --- a/rpc/ethereum/backend/backend.go +++ b/rpc/ethereum/backend/backend.go @@ -666,7 +666,7 @@ func (e *EVMBackend) GetTransactionByHash(txHash common.Hash) (*types.RPCTransac common.Hash{}, uint64(0), uint64(0), - e.chainID, + nil, ) if err != nil { return nil, err @@ -734,7 +734,7 @@ func (e *EVMBackend) GetTransactionByHash(txHash common.Hash) (*types.RPCTransac common.BytesToHash(block.BlockID.Hash.Bytes()), uint64(res.Height), txIndex, - e.chainID, + nil, ) } diff --git a/rpc/ethereum/namespaces/eth/api.go b/rpc/ethereum/namespaces/eth/api.go index 1667d7913e..768c58eda1 100644 --- a/rpc/ethereum/namespaces/eth/api.go +++ b/rpc/ethereum/namespaces/eth/api.go @@ -733,12 +733,17 @@ func (e *PublicAPI) getTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, msg = ethMsgs[i] } + baseFee, err := e.backend.BaseFee(block.Block.Height) + if err != nil { + return nil, err + } + return rpctypes.NewTransactionFromMsg( msg, common.BytesToHash(block.Block.Hash()), uint64(block.Block.Height), uint64(idx), - e.chainIDEpoch, + baseFee, ) } @@ -952,7 +957,7 @@ func (e *PublicAPI) GetPendingTransactions() ([]*rpctypes.RPCTransaction, error) common.Hash{}, uint64(0), uint64(0), - e.chainIDEpoch, + nil, ) if err != nil { return nil, err