@@ -73,12 +73,11 @@ def calc_difficulty(parent, timestamp):
73
73
o = int (max (parent .difficulty + offset * sign , min (parent .difficulty , config ['MIN_DIFF' ])))
74
74
period_count = (parent .number + 1 ) // config ['EXPDIFF_PERIOD' ]
75
75
if period_count >= config ['EXPDIFF_FREE_PERIODS' ]:
76
- o = max (o + 2 ** (period_count - config ['EXPDIFF_FREE_PERIODS' ]), config ['MIN_DIFF' ])
76
+ o = max (o + 2 ** (period_count - config ['EXPDIFF_FREE_PERIODS' ]), config ['MIN_DIFF' ])
77
77
# print('Calculating difficulty of block %d, timestamp difference %d, parent diff %d, child diff %d' % (parent.number + 1, timestamp - parent.timestamp, parent.difficulty, o))
78
78
return o
79
79
80
80
81
-
82
81
class Account (rlp .Serializable ):
83
82
84
83
"""An Ethereum account.
@@ -396,7 +395,7 @@ def __init__(self, header, transaction_list=[], uncles=[], env=None,
396
395
parent = None , making = False ):
397
396
assert isinstance (env , Env ), "No Env object given"
398
397
assert isinstance (env .db , BaseDB ), "No database object given"
399
- self .env = env # don't re-set after init
398
+ self .env = env # don't re-set after init
400
399
self .db = env .db
401
400
self .config = env .config
402
401
@@ -442,7 +441,7 @@ def __init__(self, header, transaction_list=[], uncles=[], env=None,
442
441
raise ValueError ("Gas used exceeds gas limit" )
443
442
if self .timestamp <= parent .header .timestamp :
444
443
raise ValueError ("Timestamp equal to or before parent" )
445
- if self .timestamp >= 2 ** 256 :
444
+ if self .timestamp >= 2 ** 256 :
446
445
raise ValueError ("Timestamp waaaaaaaaaaayy too large" )
447
446
448
447
for uncle in uncles :
@@ -531,7 +530,7 @@ def must_le(what, a, b):
531
530
if not self .check_fields ():
532
531
raise ValueError ("Block is invalid" )
533
532
if len (to_string (self .header .extra_data )) > self .config ['MAX_EXTRADATA_LENGTH' ]:
534
- raise ValueError ("Extra data cannot exceed %d bytes" \
533
+ raise ValueError ("Extra data cannot exceed %d bytes"
535
534
% default_config ['MAX_EXTRADATA_LENGTH' ])
536
535
if self .header .coinbase == '' :
537
536
raise ValueError ("Coinbase cannot be empty address" )
@@ -695,7 +694,7 @@ def get_ancestor_list(self, n):
695
694
if n == 0 or self .header .number == 0 :
696
695
return []
697
696
p = self .get_parent ()
698
- return [p ] + p .get_ancestor_list (n - 1 )
697
+ return [p ] + p .get_ancestor_list (n - 1 )
699
698
700
699
def get_ancestor_hash (self , n ):
701
700
assert n > 0
@@ -706,7 +705,7 @@ def get_ancestor_hash(self, n):
706
705
self .ancestor_hashes .append (
707
706
get_block (self .env ,
708
707
self .ancestor_hashes [- 1 ]).get_parent ().hash )
709
- return self .ancestor_hashes [n - 1 ]
708
+ return self .ancestor_hashes [n - 1 ]
710
709
711
710
# def get_ancestor(self, n):
712
711
# return self.get_block(self.get_ancestor_hash(n))
@@ -785,7 +784,7 @@ def _delta_item(self, address, param, value):
785
784
new_value = self ._get_acct_item (address , param ) + value
786
785
if new_value < 0 :
787
786
return False
788
- self ._set_acct_item (address , param , new_value % 2 ** 256 )
787
+ self ._set_acct_item (address , param , new_value % 2 ** 256 )
789
788
return True
790
789
791
790
def mk_transaction_receipt (self , tx ):
0 commit comments