Merge pull request #1235 from josepfo/fix/eth-fee-unit-convertion

fix: eth fee unit convertion
This commit is contained in:
Rafael Taranto 2022-05-23 09:41:13 +01:00 committed by GitHub
commit 835e8244aa

View file

@ -139,14 +139,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,