Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit f0a1bd1

Browse files
vubvub
authored andcommitted
Added changes to rlp decoder:
1 parent 4b2f106 commit f0a1bd1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ethereum/rlp_decoder_contract.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ def any():
5454
~invalid()
5555
if dataPos > 1024 or positionIndex > 32:
5656
~invalid()
57+
positions[positionIndex] = dataPos
5758
output = string(2048)
5859
i = 0
59-
while i < positionIndex:
60-
output[i] = positions[i] + positionIndex * 32
60+
while i <= positionIndex:
61+
output[i] = positions[i] + positionIndex * 32 + 32
6162
i += 1
62-
mcopy(output + positionIndex * 32, data, dataPos)
63-
~return(output, positionIndex * 32 + dataPos)
63+
mcopy(output + positionIndex * 32 + 32, data, dataPos)
64+
~return(output, positionIndex * 32 + dataPos + 32)

ethereum/state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def to_dict(self):
337337
acct_trie = SecureTrie(Trie(self.db))
338338
acct_trie.root_hash = acct.storage
339339
for key, v in acct_trie.to_dict().items():
340-
storage_dump['0x'+encode_hex(key.lstrip('\x00') or '\x00')] = '0x'+encode_hex(rlp.decode(v))
340+
storage_dump['0x'+encode_hex(key.lstrip(b'\x00') or b'\x00')] = '0x'+encode_hex(rlp.decode(v))
341341
acct_dump = {"storage": storage_dump}
342342
for c in ACCOUNT_OUTPUTTABLE_PARAMS:
343343
acct_dump[c] = snapshot_form(getattr(acct, c))

0 commit comments

Comments
 (0)