Open rockfridrich opened 5 years ago
In your example initialization can be simplified to:
try EthNumber(
hex: DecodedABINumber(
abiMessage: message,
index: index
)
)
as hex and DecodedABINumber
are both BytesScalar
For ABIMessage
it is right but if we get it remotely then the call will be executed only when we check EthNumber.value()
. Also I don't want to parse ABIMessage each time I need EthNumber value.
@biboran so what is the best way to precompute the value of DecodeABINumber
to pass into EthNumber
in your opinion? There are also cases when we don't want lazy computations or overuse of CachedBytes
It is often needed to construct primitives like
EthNumber
with pure bytes.