-
Notifications
You must be signed in to change notification settings - Fork 1
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 #232 from BalancerMaxis/support_all_web3_versions
Support all web3 versions
- Loading branch information
Showing
5 changed files
with
23 additions
and
11 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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
pathlib>=1.0 | ||
requests | ||
pandas | ||
web3==5.31.3 | ||
web3 | ||
dotmap | ||
munch==4.0.0 | ||
gql[requests] |
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,14 @@ | ||
from web3 import Web3 | ||
|
||
|
||
### These functions are to deal with differing web3 versions and the need to use 5.x for legacy brownie code | ||
def to_checksum_address(address: str): | ||
if hasattr(Web3, 'toChecksumAddress'): | ||
return Web3.toChecksumAddress(address) | ||
if hasattr(Web3, "to_checksum_address"): | ||
return Web3.to_checksum_address(address) | ||
def is_address(address: str): | ||
if hasattr(Web3, "isAddress"): | ||
return Web3.isAddress(address) | ||
if hasattr(Web3, "is_address"): | ||
return Web3.isAddress(address) |
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