Make tests green (AccountNonce)

This commit is contained in:
coffeepots 2018-09-02 03:26:22 +01:00
parent 4d0adfd514
commit bda219f8fe
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ type
code*: seq[byte]
storage*: Table[UInt256, UInt256]
balance*: UInt256
nonce*: UInt256
nonce*: AccountNonce
func toAddress(n: UInt256): EthAddress =
let a = n.toByteArrayBE()

View File

@ -85,7 +85,7 @@ proc setupStateDB*(wantedState: JsonNode, stateDB: var AccountStateDB) =
for slot, value in accountData{"storage"}:
stateDB.setStorage(account, slot.parseHexInt.u256, value.getStr.parseHexInt.u256)
let nonce = accountData{"nonce"}.getInt.u256
let nonce = accountData{"nonce"}.getInt.AccountNonce
let code = hexToSeqByte(accountData{"code"}.getStr).toRange
let balance = UInt256.fromHex accountData{"balance"}.getStr
@ -110,7 +110,7 @@ proc verifyStateDB*(wantedState: JsonNode, stateDB: AccountStateDB) =
let
wantedCode = hexToSeqByte(accountData{"code"}.getStr).toRange
wantedBalance = UInt256.fromHex accountData{"balance"}.getStr
wantedNonce = accountData{"nonce"}.getInt.u256
wantedNonce = accountData{"nonce"}.getInt.AccountNonce
actualCode = stateDB.getCode(account)
actualBalance = stateDB.getBalance(account)