fix: gas price value in eth_getTransaction JSON-RPC response (#1082)

Solution:
- pass the correct baseFee parameter

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
yihuang
2022-05-19 06:48:37 +00:00
committed by GitHub
co-authored by Federico Kunze Küllmer
parent a313008afc
commit d359cbd9c9
3 changed files with 18 additions and 4 deletions
+7 -2
View File
@@ -586,7 +586,7 @@ func (b *Backend) GetTransactionByHash(txHash common.Hash) (*types.RPCTransactio
common.Hash{},
uint64(0),
uint64(0),
b.chainID,
nil,
)
if err != nil {
return nil, err
@@ -649,12 +649,17 @@ func (b *Backend) GetTransactionByHash(txHash common.Hash) (*types.RPCTransactio
return nil, errors.New("can't find index of ethereum tx")
}
baseFee, err := b.BaseFee(block.Block.Height)
if err != nil {
return nil, err
}
return types.NewTransactionFromMsg(
msg,
common.BytesToHash(block.BlockID.Hash.Bytes()),
uint64(res.Height),
txIndex,
b.chainID,
baseFee,
)
}
+7 -2
View File
@@ -764,12 +764,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,
)
}
@@ -983,7 +988,7 @@ func (e *PublicAPI) GetPendingTransactions() ([]*rpctypes.RPCTransaction, error)
common.Hash{},
uint64(0),
uint64(0),
e.chainIDEpoch,
nil,
)
if err != nil {
return nil, err