Add "value" to Transaction object
This commit is contained in:
parent
e086b71b42
commit
5127991117
|
@ -5,6 +5,7 @@ type Transaction* = object
|
|||
sender*: ?Address
|
||||
to*: Address
|
||||
data*: seq[byte]
|
||||
value*: UInt256
|
||||
nonce*: ?UInt256
|
||||
chainId*: ?UInt256
|
||||
gasPrice*: ?UInt256
|
||||
|
@ -17,6 +18,7 @@ func `$`*(transaction: Transaction): string =
|
|||
if sender =? transaction.sender:
|
||||
result &= "from: " & $sender & ", "
|
||||
result &= "to: " & $transaction.to & ", "
|
||||
result &= "value: " & $transaction.value & ", "
|
||||
result &= "data: 0x" & $transaction.data.toHex
|
||||
if nonce =? transaction.nonce:
|
||||
result &= ", nonce: 0x" & $nonce.toHex
|
||||
|
|
|
@ -97,6 +97,7 @@ proc signTransaction*(wallet: Wallet, tx: tx.Transaction): Future[seq[byte]] {.a
|
|||
|
||||
s.chainId = ChainId(chainId.truncate(uint64))
|
||||
s.gasLimit = GasInt(gasLimit.truncate(uint64))
|
||||
s.value = tx.value
|
||||
s.nonce = nonce.truncate(uint64)
|
||||
s.to = some EthAddress(tx.to)
|
||||
s.payload = tx.data
|
||||
|
|
Loading…
Reference in New Issue