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

Commit 3603a57

Browse files
committed
pyrlp update
1 parent dd9986c commit 3603a57

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ethereum/blocks.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,11 @@ def __init__(self, header, transaction_list=[], uncles=[], env=None,
426426
'difficulty': header.difficulty,
427427
'uncles_hash': header.uncles_hash,
428428
'bloom': header.bloom,
429+
'header_mutable': self.header.mutable_,
429430
}
431+
assert self.mutable_
432+
self.rlp_ = None
433+
self.header.mutable_ = True
430434

431435
self.transactions = Trie(self.db, trie.BLANK_ROOT)
432436
self.receipts = Trie(self.db, trie.BLANK_ROOT)
@@ -492,6 +496,7 @@ def must_le(what, a, b):
492496

493497
# from now on, trie roots refer to block instead of header
494498
header.block = self
499+
self.header.mutable_ = original_values['header_mutable']
495500

496501
# Basic consistency verifications
497502
if not self.check_fields():
@@ -687,6 +692,8 @@ def _get_acct(self, address):
687692
rlpdata = self.state.get(address)
688693
if rlpdata != trie.BLANK_NODE:
689694
acct = rlp.decode(rlpdata, Account, db=self.db)
695+
acct.mutable_ = True
696+
acct.rlp_ = None
690697
else:
691698
acct = Account.blank_account(self.db)
692699
return acct

ethereum/tester.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ def snapshot(self):
270270

271271
def revert(self, data):
272272
self.block = rlp.decode(data, b.Block, env=self.env)
273+
self.block.mutable_ = True
274+
self.block.header.mutable_ = True
275+
self.block.rlp_ = None
276+
self.block.header.rlp_ = None
273277

274278
# logging
275279

0 commit comments

Comments
 (0)