-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #944 from medvedev1088/contract-call-optimization
Contract call optimization - remove round trip
- Loading branch information
Showing
3 changed files
with
26 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from web3.contract import ( | ||
parse_block_identifier_int, | ||
) | ||
|
||
|
||
# This tests negative block number identifiers, which behave like python | ||
# list slices, with -1 being the latest block and -2 being the block before that. | ||
# This test is necessary because transaction calls allow negative block indexes, although | ||
# getBlock() does not allow negative block identifiers. Support for negative block identifier | ||
# will likely be removed in v5. | ||
def test_parse_block_identifier_int(web3): | ||
last_num = web3.eth.getBlock('latest').number | ||
assert 0 == parse_block_identifier_int(web3, -1 - last_num) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters