2022-01-20 11:56:18 +00:00
|
|
|
import pkg/stew/byteutils
|
|
|
|
import ./basics
|
|
|
|
|
|
|
|
type Transaction* = object
|
2022-01-24 13:40:47 +00:00
|
|
|
sender*: ?Address
|
2022-01-20 11:56:18 +00:00
|
|
|
to*: Address
|
|
|
|
data*: seq[byte]
|
|
|
|
|
|
|
|
func `$`*(transaction: Transaction): string =
|
2022-01-24 13:40:47 +00:00
|
|
|
result = "("
|
|
|
|
if sender =? transaction.sender:
|
|
|
|
result &= "from: " & $sender & ", "
|
|
|
|
result &= "to: " & $transaction.to & ", "
|
|
|
|
result &= "data: 0x" & $transaction.data.toHex
|
|
|
|
result &= ")"
|