diff --git a/ethers/signer.nim b/ethers/signer.nim index ac9cafe..5b8f5d3 100644 --- a/ethers/signer.nim +++ b/ethers/signer.nim @@ -139,12 +139,11 @@ method populateTransaction*( # Multiply by 2 because during times of congestion, baseFeePerGas can increase by 12.5% per block. # https://github.com/ethers-io/ethers.js/discussions/3601#discussioncomment-4461273 - let maxFeePerGas = baseFeePerGas * 2 + maxPriorityFeePerGas - populated.maxFeePerGas = some(maxFeePerGas) + populated.maxFeePerGas = some(transaction.maxFeePerGas |? baseFeePerGas * 2 + maxPriorityFeePerGas) populated.gasPrice = none(UInt256) - trace "EIP-1559 is supported", maxPriorityFeePerGas = maxPriorityFeePerGas, maxFeePerGas = maxFeePerGas + trace "EIP-1559 is supported", maxPriorityFeePerGas = maxPriorityFeePerGas, maxFeePerGas = populated.maxFeePerGas else: populated.gasPrice = some(transaction.gasPrice |? (await signer.getGasPrice())) trace "EIP-1559 is not supported", gasPrice = populated.gasPrice