-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat: add set_balance test provider API #823
Conversation
We can better out-of-the-box support if this feat request is honored: Also, I will adjust + add more tests to |
if isinstance(account, BaseAddress): | ||
account = account.address # type: ignore |
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.
Doesn't self.conversion_manager.convert(account, AddressType)
work here?
# Support hex strings | ||
amount = int(amount, 16) |
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.
Isn't there a hex converter toint
?
|
||
|
||
def test_set_balance(chain, test_accounts): | ||
with pytest.raises(APINotImplementedError): |
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.
Wait, does eth-tester
not support this method?
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.
It didnt seem like it but i created an issue for them
@raises_not_implemented | ||
def set_balance(self, address: AddressType, amount: int): |
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.
Thank you for discussing this choice and future alternatives to making these test methods, like setting the balance or timestamp, only available on local/test chains.
…s/ape into feat/jules/set-bal
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.
LGTM
What I did
Adds
set_balance()
API toTestProviderAPI
class that raises not implemented by default.Hardhat and Foundry both use this!
How I did it
How to verify it
Checklist