-
Notifications
You must be signed in to change notification settings - Fork 165
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
New matcher: expect to change balance #9
Comments
Partially implemented in #24 |
The matcher works nice for wallets, could you also support passing a bare address to the function? Would be useful e.g. to track balance changes on a contract address. Currently, if I try to do that, I get a runtime error: Side note: could you also make the typings concrete here? Currently the arguments are |
Hi @quezak The problem with passing bare address is that matcher don't have access to the provider. So it is either wallet or (we could implement) bare address + provider Typing definitely can be improved. Would you create a separate issue for that? |
Thanks for the reply! Another idea: it looks much easier (and satisfies my use case) to accept I'll add the typings issue some time later. |
@quezak I second that:
@marekkirejczyk @sz-piotr Any ETAs for new features like this ? Thanks for the amazing tool btw! |
Proposed variation of syntax for different ways to provide provider:expect(() => wallet.transfer('0xab..cd.', 200)).to.changeBalance('0xab...cd', 200, provider)
expect(() => wallet.transfer('0xab..cd.', 200)).to.changeBalance(wallet, 200)
expect(() => wallet.transfer('0xab..cd.', 200)).to.changeBalance(contract, 200) Can we skip promise and have sth like below?expect(await wallet.transfer('0xab..cd.', 200).to.changeBalance('0xab...cd', 200, provider) Idea 1:Take the block number from receipt and check the balance in previous block
Cons:
Idea 2:
|
✅ Expectation for token balance |
Example usage:
chained:
token:
The text was updated successfully, but these errors were encountered: