From 494d646539447958de5df5e10978b3b3a0752043 Mon Sep 17 00:00:00 2001 From: crypto-facs <84574577+crypto-facs@users.noreply.github.com> Date: Tue, 21 Jun 2022 13:13:13 +0200 Subject: [PATCH] fix(rpc): Fix `GasPrice` calculation with relation to `MinGasPrice` (#1138) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix gasPrice minGasPrice comparison * update changelog Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- CHANGELOG.md | 1 + rpc/namespaces/ethereum/eth/api.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcf38ac2..ac6ada40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (evm) [tharsis#1118](https://github.com/evmos/ethermint/pull/1118) Fix `Type()` `Account` method `EmptyCodeHash` comparison +* (rpc) [tharsis#1138](https://github.com/evmos/ethermint/pull/1138) Fix GasPrice calculation with relation to `MinGasPrice` ## [v0.16.0] - 2022-06-06 diff --git a/rpc/namespaces/ethereum/eth/api.go b/rpc/namespaces/ethereum/eth/api.go index ed11f08e..99181b21 100644 --- a/rpc/namespaces/ethereum/eth/api.go +++ b/rpc/namespaces/ethereum/eth/api.go @@ -216,7 +216,7 @@ func (e *PublicAPI) GasPrice() (*hexutil.Big, error) { if err != nil { return nil, err } - minGasPriceInt := minGasPrice.BigInt() + minGasPriceInt := minGasPrice.TruncateInt().BigInt() if result.Cmp(minGasPriceInt) < 0 { result = minGasPriceInt }