@@ -116,11 +116,14 @@ class Receipt(rlp.Serializable):
116
116
]
117
117
118
118
def __init__ (self , state_root , gas_used , logs , bloom = None ):
119
+ # does not call super.__init__ as bloom should not be an attribute but a property
119
120
self .state_root = state_root
120
121
self .gas_used = gas_used
121
122
self .logs = logs
122
123
if bloom is not None and bloom != self .bloom :
123
124
raise ValueError ("Invalid bloom filter" )
125
+ self ._cached_rlp = None
126
+ self ._mutable = True
124
127
125
128
@property
126
129
def bloom (self ):
@@ -426,11 +429,11 @@ def __init__(self, header, transaction_list=[], uncles=[], env=None,
426
429
'difficulty' : header .difficulty ,
427
430
'uncles_hash' : header .uncles_hash ,
428
431
'bloom' : header .bloom ,
429
- 'header_mutable' : self .header .mutable_ ,
432
+ 'header_mutable' : self .header ._mutable ,
430
433
}
431
- assert self .mutable_
432
- self .rlp_ = None
433
- self .header .mutable_ = True
434
+ assert self ._mutable
435
+ self ._cached_rlp = None
436
+ self .header ._mutable = True
434
437
435
438
self .transactions = Trie (self .db , trie .BLANK_ROOT )
436
439
self .receipts = Trie (self .db , trie .BLANK_ROOT )
@@ -496,7 +499,7 @@ def must_le(what, a, b):
496
499
497
500
# from now on, trie roots refer to block instead of header
498
501
header .block = self
499
- self .header .mutable_ = original_values ['header_mutable' ]
502
+ self .header ._mutable = original_values ['header_mutable' ]
500
503
501
504
# Basic consistency verifications
502
505
if not self .check_fields ():
@@ -692,8 +695,8 @@ def _get_acct(self, address):
692
695
rlpdata = self .state .get (address )
693
696
if rlpdata != trie .BLANK_NODE :
694
697
acct = rlp .decode (rlpdata , Account , db = self .db )
695
- acct .mutable_ = True
696
- acct .rlp_ = None
698
+ acct ._mutable = True
699
+ acct ._cached_rlp = None
697
700
else :
698
701
acct = Account .blank_account (self .db )
699
702
return acct
0 commit comments