From abda8493b09b48b72efc4f94366b26a5589cc3e3 Mon Sep 17 00:00:00 2001 From: Jackie Date: Tue, 12 Jul 2022 20:22:31 +0200 Subject: [PATCH] Change Transaction type to support EIP1559 --- ethers/signer.nim | 2 +- ethers/transaction.nim | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ethers/signer.nim b/ethers/signer.nim index bf6ea7b..3405056 100644 --- a/ethers/signer.nim +++ b/ethers/signer.nim @@ -58,7 +58,7 @@ method populateTransaction*(signer: Signer, populated.nonce = some(await signer.getTransactionCount(BlockTag.pending)) if transaction.chainId.isNone: populated.chainId = some(await signer.getChainId()) - if transaction.gasPrice.isNone: + if transaction.gasPrice.isNone and (transaction.maxFee.isNone or transaction.maxPriorityFee.isNone): populated.gasPrice = some(await signer.getGasPrice()) if transaction.gasLimit.isNone: populated.gasLimit = some(await signer.estimateGas(populated)) diff --git a/ethers/transaction.nim b/ethers/transaction.nim index c80a54b..910d9aa 100644 --- a/ethers/transaction.nim +++ b/ethers/transaction.nim @@ -8,6 +8,8 @@ type Transaction* = object nonce*: ?UInt256 chainId*: ?UInt256 gasPrice*: ?UInt256 + maxFee*: ?UInt256 + maxPriorityFee*: ?UInt256 gasLimit*: ?UInt256 func `$`*(transaction: Transaction): string =