mirror of
https://github.com/logos-storage/nim-ethers.git
synced 2026-01-09 09:03:08 +00:00
cleanup -- combine ensureNonceSequence into populateTransaction
This commit is contained in:
parent
28125532e1
commit
9edb3d2fa7
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user