-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add classes to handle W3_RPC #27
Conversation
Fraxtal is missing from dRPC. Challenging them to see how such a thing is dealt with. |
…ing. Update version in setup.py
# Conflicts: # setup.py
tagged: https://github.com/BalancerMaxis/bal_tools/releases/tag/v0.1.2alpha1 |
Next step is to approve/release bal_tools. Then deal with questions about where the canonical list pools to check permissions lives on in the bal_addresses pr and merge/release that. Then release new releases, update the protocol_feel_allocator. |
bal_tools/drpc.py
Outdated
|
||
def __getitem__(self, chain): | ||
if chain not in self.w3_by_chain: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i modified Web3RpcByChain
to only init a chains respective w3 instance when referenced for the first time instead of initializing all chains at the start. still maintains the same interface/usage
nice, simple to use class for web3 instances across all chains. added some very basic tests. lgtm |
def __getitem__(self, chain): | ||
return self._get_or_create_w3(chain) | ||
|
||
def __getattr__(self, chain): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also added support for dot syntax, so a chain's web3 instance can be referenced like:
Web3RpcByChain().mainnet
# or
Web3RpcByChain()["mainnet"]
since this class can basically be used across the board, i think making it more flexible is worth it
new test is not being run:
|
fixed in 0f40f08 |
@jalbrekt85 @gosuto-inzasheru thanks for the help. Will merge this and release a new version. |
Use dRPC right now as it's super easy, but this creates an interface that is easy to change in 1 place.
See:
BalancerMaxis/bal_addresses#383
For a test of these classes, I don't think bal_addresses can actually use them due to the dependancy conflict, so maybe this belongs there?