-
Notifications
You must be signed in to change notification settings - Fork 857
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
Fix assert_expected_events macro #7913
base: master
Are you sure you want to change the base?
Fix assert_expected_events macro #7913
Conversation
@claravanstaden can you also please check this #2460 - if it is related or the same problem? And if so, please close with this PR? |
Closing as a duplicate of #2460. |
#2460 is just an issue, not a PR, this PR is not a duplicate |
I think I fixed the macro, but need to fix all the failing tests now. 😅 |
🙈 that is some noble task ❤️ |
if any of them are complicated to fix, feel free to tag the |
|
…' into fix-assert-expected-events-macro
assert_expected_events!( | ||
AssetHubRococo, | ||
vec![ | ||
RuntimeEvent::Balances( | ||
pallet_balances::Event::Burned { amount, .. } | ||
) => { | ||
amount: *amount == test.args.amount, | ||
amount: *amount > test.args.amount * 90/100, |
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.
@franciscoaguirre for multi_hop_pay_fees_works
, the expected amount for the burn event is 1000000000000
, but the actual amount in the event is 966873920000
. Probably a part of it was used to pay for fees? I want to update the tests but just make sure with you if it is OK. I want to remove the amount or change it to something like: amount: *amount >= test.args.amount *.9
(i.e. the amount burned should at least be higher than 90% of the test amount).
Description
The
assert_expected_events
does not correctly check event fields. Even though the provided field values do not match, the macro did not raise an error.Review Notes
The
meet_conditions
variable kept being reset to true, which means that conditions not met would be overwritten with a positive value.Closes: #2460