Improve logs

This commit is contained in:
Arnaud 2025-04-02 09:18:26 +02:00
parent fe7a5bc917
commit eb1cb8b7ee
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F

View File

@ -134,8 +134,6 @@ method populateTransaction*(
let blk = await signer.provider.getBlock(BlockTag.latest)
if baseFeePerGas =? blk.?baseFeePerGas:
trace "EIP-1559 is supported"
let maxPriorityFeePerGas = transaction.maxPriorityFeePerGas |? (await signer.provider.getMaxPriorityFeePerGas())
populated.maxPriorityFeePerGas = some(maxPriorityFeePerGas)
@ -143,9 +141,11 @@ method populateTransaction*(
# https://github.com/ethers-io/ethers.js/discussions/3601#discussioncomment-4461273
let maxFeePerGas = baseFeePerGas * 2 + maxPriorityFeePerGas
populated.maxFeePerGas = some(maxFeePerGas)
trace "EIP-1559 is supported", maxPriorityFeePerGas = maxPriorityFeePerGas, maxFeePerGas = maxFeePerGas
else:
trace "EIP-1559 is not supported"
populated.gasPrice = some(transaction.gasPrice |? (await signer.getGasPrice()))
trace "EIP-1559 is not supported", gasPrice = populated.gasPrice
if transaction.nonce.isNone and transaction.gasLimit.isNone:
# when both nonce and gasLimit are not populated, we must ensure getNonce is