Change setNonce, getNonce to use AccountNonce, which is uint64 from UInt256
This commit is contained in:
parent
0229d16fed
commit
1427d59f27
|
@ -105,13 +105,13 @@ proc getStorage*(db: AccountStateDB, address: EthAddress, slot: UInt256): (UInt2
|
||||||
else:
|
else:
|
||||||
result = (0.u256, false)
|
result = (0.u256, false)
|
||||||
|
|
||||||
proc setNonce*(db: var AccountStateDB, address: EthAddress, newNonce: UInt256) =
|
proc setNonce*(db: var AccountStateDB, address: EthAddress, newNonce: AccountNonce) =
|
||||||
var account = db.getAccount(address)
|
var account = db.getAccount(address)
|
||||||
if newNonce != account.nonce:
|
if newNonce != account.nonce:
|
||||||
account.nonce = newNonce
|
account.nonce = newNonce
|
||||||
db.setAccount(address, account)
|
db.setAccount(address, account)
|
||||||
|
|
||||||
proc getNonce*(db: AccountStateDB, address: EthAddress): UInt256 =
|
proc getNonce*(db: AccountStateDB, address: EthAddress): AccountNonce =
|
||||||
let account = db.getAccount(address)
|
let account = db.getAccount(address)
|
||||||
account.nonce
|
account.nonce
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue