This commit is contained in:
mratsim 2018-04-11 12:51:46 +02:00 committed by zah
parent b7d949eec2
commit a5b2652f85
2 changed files with 2 additions and 3 deletions

View File

@ -10,7 +10,6 @@ skipDirs = @["tests"]
requires "nim >= 0.18.1",
"https://github.com/cheatfate/nimcrypto#master",
"https://github.com/status-im/nim-rlp",
"https://github.com/status-im/nim-ranges",
"https://github.com/status-im/nim-ttmath#master"
proc test(name: string, lang = "cpp") =

View File

@ -8,7 +8,7 @@
import
strformat, tables,
../constants, ../errors, ../validation, ../account, ../logging, ../utils_numeric, .. / utils / [padding, bytes, keccak],
ttmath, rlp, ranges
ttmath, rlp
type
AccountStateDB* = ref object
@ -68,7 +68,7 @@ proc setStorage*(db: var AccountStateDB, address: string, slot: UInt256, value:
var storage = db.db
# TODO fix
if value > 0:
let encodedValue = rlp.encode(value)
let encodedValue = rlp.encode value.table # TODO This is a hack, RLP encoding ttmath table has issues
storage[slotAsKey] = encodedValue.decode(Bytes)
else:
storage.del(slotAsKey)