cleanup -- combine ensureNonceSequence into populateTransaction

This commit is contained in:
Eric 2023-10-25 10:36:05 +11:00
parent 28125532e1
commit 9edb3d2fa7
No known key found for this signature in database
4 changed files with 2 additions and 17 deletions

View File

@ -3,13 +3,11 @@ import std/macros
import std/sequtils
import pkg/chronos
import pkg/contractabi
import pkg/stew/byteutils
import ./basics
import ./provider
import ./signer
import ./events
import ./fields
import ./exceptions
export basics
export provider

View File

@ -1,7 +0,0 @@
import ./basics
func msgStack*(error: ref EthersError): string =
var msg = error.msg
if not error.parent.isNil:
msg &= " -- Parent exception: " & error.parent.msg
return msg

View File

@ -3,7 +3,6 @@ import std/tables
import std/uri
import pkg/json_rpc/rpcclient
import pkg/json_rpc/errors
import pkg/stew/byteutils
import ../basics
import ../provider
import ../signer

View File

@ -1,12 +1,7 @@
import ./basics
import ./provider
import pkg/chronicles
export basics
export chronicles
logScope:
topics = "ethers signer"
type
Signer* = ref object of RootObj
@ -107,9 +102,9 @@ method populateTransaction*(signer: Signer,
var populated = transaction
if populated.sender.isNone:
if transaction.sender.isNone:
populated.sender = some(await signer.getAddress())
if populated.chainId.isNone:
if transaction.chainId.isNone:
populated.chainId = some(await signer.getChainId())
if transaction.gasPrice.isNone and (transaction.maxFee.isNone or transaction.maxPriorityFee.isNone):
populated.gasPrice = some(await signer.getGasPrice())