Skip to content

Commit

Permalink
fixed faulty dict access syntax which causes an attribute error
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Baer authored and pipermerriam committed Sep 3, 2018
1 parent 0605962 commit 38b0303
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web3/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ def parse_block_identifier(web3, block_identifier):
elif block_identifier in ['latest', 'earliest', 'pending']:
return block_identifier
elif isinstance(block_identifier, bytes) or is_hex_encoded_block_hash(block_identifier):
return web3.eth.getBlock(block_identifier).number
return web3.eth.getBlock(block_identifier)['number']
else:
raise BlockNumberOutofRange

Expand All @@ -1425,7 +1425,7 @@ def parse_block_identifier_int(web3, block_identifier_int):
if block_identifier_int >= 0:
block_num = block_identifier_int
else:
last_block = web3.eth.getBlock('latest').number
last_block = web3.eth.getBlock('latest')['number']
block_num = last_block + block_identifier_int + 1
if block_num < 0:
raise BlockNumberOutofRange
Expand Down

0 comments on commit 38b0303

Please sign in to comment.