mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-10 12:26:02 +00:00
c58d83efd5
* Reviving more of the code for stateless mode. * Made asyncProcessTransaction. * More work on stateless mode.
19 lines
415 B
Nim
19 lines
415 B
Nim
# This code was duplicated enough times around the codebase
|
|
# that it seemed worth factoring it out.
|
|
|
|
import
|
|
stint,
|
|
eth/[common, rlp]
|
|
|
|
proc accountFromBytes*(accountBytes: seq[byte]): Account =
|
|
if accountBytes.len > 0:
|
|
rlp.decode(accountBytes, Account)
|
|
else:
|
|
newAccount()
|
|
|
|
proc slotValueFromBytes*(rec: seq[byte]): UInt256 =
|
|
if rec.len > 0:
|
|
rlp.decode(rec, UInt256)
|
|
else:
|
|
UInt256.zero()
|