Start using the new rlpFields macro

This commit is contained in:
Alexander Ivanov 2018-01-30 12:51:13 +02:00
parent 0fa5c5fd94
commit e6e3f09ebd
3 changed files with 8 additions and 2 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
nimcache/ nimcache/
runner

View File

@ -7,5 +7,8 @@ description = "An Ethereum 2.0 Sharding Client for Resource-Restricted Devices
license = "Apache License 2.0" license = "Apache License 2.0"
skipDirs = @["tests"] skipDirs = @["tests"]
requires "nim >= 0.17.0", "https://github.com/status-im/nim-keccak-tiny.git >= 0.1.0" requires "nim >= 0.17.0",
"https://github.com/status-im/nim-keccak-tiny.git >= 0.1.0",
"https://github.com/status-im/nim-rlp.git >= 1.0.0"

View File

@ -1,5 +1,5 @@
import import
constants, errors, bigints constants, errors, bigints, rlp
type type
Account* = ref object Account* = ref object
@ -8,5 +8,7 @@ type
#storageRoot*: #storageRoot*:
#codeHash*: #codeHash*:
rlpFields Account, nonce, balance
proc newAccount*(nonce: Int256 = 0.i256, balance: Int256 = 0.i256): Account = proc newAccount*(nonce: Int256 = 0.i256, balance: Int256 = 0.i256): Account =
Account(nonce: nonce, balance: balance) Account(nonce: nonce, balance: balance)