Fixed TTInt rlp encoding. Fixes #9. (#12)

This commit is contained in:
Yuriy Glukhov 2018-04-12 13:34:20 +03:00 committed by Mamy Ratsimbazafy
parent a41ff1f3a5
commit 4da71f76b9
3 changed files with 3 additions and 17 deletions

View File

@ -1,9 +1,6 @@
matrix:
allow_failures:
# disabled for the moment: https://github.com/status-im/nimbus/issues/9
# Installing GCC-7 on travis is not straightforward due to hombrew conflict:
# https://travis-ci.org/status-im/nimbus/jobs/365157366#L2322
- os: osx
# allow_failures:
# - os: osx
include:
- os: linux

11
nim.cfg
View File

@ -1,11 +0,0 @@
# TODO - https://github.com/status-im/nimbus/issues/9
# Workaround for Rlp + TT-math:
# use GCC on MacOS
@if macosx:
cc:"gcc"
gcc.exe:"/usr/local/bin/gcc-7"
gcc.linkerexe:"/usr/local/bin/gcc-7"
gcc.cpp.exe:"/usr/local/bin/g++-7"
gcc.cpp.linkerexe:"/usr/local/bin/g++-7"
@end

View File

@ -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.table # TODO This is a hack, RLP encoding ttmath table has issues
let encodedValue = rlp.encode value.toByteArrayBE
storage[slotAsKey] = encodedValue.decode(Bytes)
else:
storage.del(slotAsKey)