-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Use expectEvent to test logs #1232
Comments
Hey, apart of main work for this task I faced the case where logged event argument is uint256. At truffle test level this argument is represented by BigNumber, so I tried to verify if argument was logged. For instance: Even the values are equal the check fails due the arguments are both struct. Please correct me if I'm missing something but I have feeling that expectEvent.inLogs method should verify equality like: I have tested it for my case with BigNumber and it works fine. |
Hey there @jbogacz! You're absolutely right, |
Yes Sir! I will do it shortly :) |
* Add BigNumber support to expectEvent/inLogs (#1026) * switched direct logs array check to expectEvent method in AllowanceCrowdsale.test.js * Refactor expectEvent.inLogs function to use simple value number check * Introduced should.be.bignumber method to compare BigNumber values * Use expectEvent to test logs (#1232) * Removed trailing space
Closed via #1343 |
* Add BigNumber support to expectEvent/inLogs (#1026) * switched direct logs array check to expectEvent method in AllowanceCrowdsale.test.js * Refactor expectEvent.inLogs function to use simple value number check * Introduced should.be.bignumber method to compare BigNumber values * Use expectEvent to test logs (#1232) * Removed trailing space (cherry picked from commit 536262f)
Most log tests directly access the log array: we should instead use the
expectEvent
helper to do that.Example from the
Escrow
tests:Part of #1091.
Requires #1026.
The text was updated successfully, but these errors were encountered: