From 3195ce71d7f110769f12ceac24af9dfac09a64b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Fri, 20 May 2022 18:38:43 +0100 Subject: [PATCH] fix: eth fee unit convertion --- lib/plugins/wallet/geth/base.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/plugins/wallet/geth/base.js b/lib/plugins/wallet/geth/base.js index 8720808d..6b9921d3 100644 --- a/lib/plugins/wallet/geth/base.js +++ b/lib/plugins/wallet/geth/base.js @@ -137,14 +137,14 @@ function generateTx (_toAddress, wallet, amount, includesFee, cryptoCode) { ? amount.minus(gasPrice.times(gas)) : amount - const maxPriorityFeePerGas = new BN(2.5) // web3 default value + const maxPriorityFeePerGas = new BN(web3.utils.toWei('2.5', 'gwei')) // web3 default value const maxFeePerGas = new BN(2).times(baseFeePerGas).plus(maxPriorityFeePerGas) const rawTx = { chainId: 1, nonce: txCount, - maxPriorityFeePerGas: web3.utils.toHex(web3.utils.toWei(maxPriorityFeePerGas.toString(), 'gwei')), - maxFeePerGas: web3.utils.toHex(web3.utils.toWei(maxFeePerGas.toString(), 'gwei')), + maxPriorityFeePerGas: web3.utils.toHex(maxPriorityFeePerGas), + maxFeePerGas: web3.utils.toHex(maxFeePerGas), gasLimit: hex(gas), to: toAddress, from: fromAddress,