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

Commit 25a026f

Browse files
committed
fix errors
1 parent 679c564 commit 25a026f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

ethereum/blocks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ def account_to_dict(self, address, with_storage_root=False,
11121112
v2 = subcache.get(utils.big_endian_to_int(k), None)
11131113
hexkey = b'0x' + encode_hex(utils.zunpad(k))
11141114
if v2 is not None:
1115-
if v2 != '':
1115+
if v2 != b'':
11161116
med_dict['storage'][hexkey] = \
11171117
b'0x' + encode_hex(v2)
11181118
elif v is not None:

ethereum/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from rlp.utils import decode_hex
2+
13
from ethereum import utils
24
from ethereum.db import BaseDB
35

@@ -52,7 +54,7 @@
5254
METROPOLIS_STATEROOT_STORE=0x10,
5355
METROPOLIS_BLOCKHASH_STORE=0x20,
5456
METROPOLIS_WRAPAROUND=65536,
55-
METROPOLIS_GETTER_CODE='6000355460205260206020f3'.decode('hex'),
57+
METROPOLIS_GETTER_CODE=decode_hex('6000355460205260206020f3'),
5658
METROPOLIS_DIFF_ADJUSTMENT_CUTOFF=9,
5759
# Metropolis fork
5860
)

ethereum/processblock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def rp(what, actual, target):
146146
return '%r: %r actual:%r target:%r' % (tx, what, actual, target)
147147

148148
intrinsic_gas = tx.intrinsic_gas_used
149-
print 'b1', block.get_balance(tx.sender)
149+
print('b1', block.get_balance(tx.sender))
150150
if block.number >= block.config['HOMESTEAD_FORK_BLKNUM']:
151151
assert tx.s * 2 < transactions.secpk1n
152152
if not tx.to or tx.to == CREATE_CONTRACT_ADDRESS:
@@ -165,7 +165,7 @@ def rp(what, actual, target):
165165
message_data = vm.CallData([safe_ord(x) for x in tx.data], 0, len(tx.data))
166166
message = vm.Message(tx.sender, tx.to, tx.value, message_gas, message_data, code_address=tx.to)
167167

168-
print 'b2', block.get_balance(tx.sender)
168+
print('b2', block.get_balance(tx.sender))
169169
# MESSAGE
170170
ext = VMExt(block, tx)
171171
if tx.to and tx.to != CREATE_CONTRACT_ADDRESS:
@@ -215,7 +215,7 @@ def rp(what, actual, target):
215215
block.del_account(s)
216216
block.add_transaction_to_list(tx)
217217
block.logs = []
218-
print 'b3', block.get_balance(tx.sender), success
218+
print('b3', block.get_balance(tx.sender), success)
219219
return success, output
220220

221221

ethereum/testutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ def blkhash(n):
403403
_shouldbe = params1.get(k, None)
404404
_reallyis = params2.get(k, None)
405405
if _shouldbe != _reallyis:
406-
print 's', shouldbe
407-
print 'r', reallyis
406+
print('s', shouldbe)
407+
print('r', reallyis)
408408
raise Exception("Mismatch: " + k + ':\n shouldbe %r\n reallyis %r' %
409409
(_shouldbe, _reallyis))
410410

0 commit comments

Comments
 (0)