Change Transaction type to support EIP1559
This commit is contained in:
parent
e01ef1daf8
commit
abda8493b0
|
@ -58,7 +58,7 @@ method populateTransaction*(signer: Signer,
|
||||||
populated.nonce = some(await signer.getTransactionCount(BlockTag.pending))
|
populated.nonce = some(await signer.getTransactionCount(BlockTag.pending))
|
||||||
if transaction.chainId.isNone:
|
if transaction.chainId.isNone:
|
||||||
populated.chainId = some(await signer.getChainId())
|
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())
|
populated.gasPrice = some(await signer.getGasPrice())
|
||||||
if transaction.gasLimit.isNone:
|
if transaction.gasLimit.isNone:
|
||||||
populated.gasLimit = some(await signer.estimateGas(populated))
|
populated.gasLimit = some(await signer.estimateGas(populated))
|
||||||
|
|
|
@ -8,6 +8,8 @@ type Transaction* = object
|
||||||
nonce*: ?UInt256
|
nonce*: ?UInt256
|
||||||
chainId*: ?UInt256
|
chainId*: ?UInt256
|
||||||
gasPrice*: ?UInt256
|
gasPrice*: ?UInt256
|
||||||
|
maxFee*: ?UInt256
|
||||||
|
maxPriorityFee*: ?UInt256
|
||||||
gasLimit*: ?UInt256
|
gasLimit*: ?UInt256
|
||||||
|
|
||||||
func `$`*(transaction: Transaction): string =
|
func `$`*(transaction: Transaction): string =
|
||||||
|
|
Loading…
Reference in New Issue