await expect(xxx) vs expect(await yyy) #3227
Replies: 2 comments
-
Hello @SiegfriedBz The A. In this example:
The method provider.getBalance() from the B. In this example:
I'm guessing a Chai Matcher with an Emitting event was used. That's why the entire expression is wrapped with the I recommend you to read about Promises, await/Async functions and |
Beta Was this translation helpful? Give feedback.
-
It is really straight-forward actually.
Here, it does not wait for
Here, it waits for Now, you will be in a dilemma as to which is better. (Hint: This is a good read to further clear your doubts: https://stackoverflow.com/a/66069510 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can someone please explain the differences between
await expect(xxx)
e.g. : expect(await ethers.provider.getBalance(contract.address)).to...
expect(await yyy)
e.g. : await expect(contract.contractMethod()).to...
?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions