-
Notifications
You must be signed in to change notification settings - Fork 667
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
assert_expected_events!
gives false positives on inner enum values
#2460
Open
2 tasks done
Tracked by
#50
Labels
I2-bug
The node fails to follow expected behavior.
I10-unconfirmed
Issue might be valid, but it's not yet known.
Comments
0xmovses
added
I2-bug
The node fails to follow expected behavior.
I10-unconfirmed
Issue might be valid, but it's not yet known.
labels
Nov 22, 2023
0xmovses
changed the title
Nov 22, 2023
assert_expected_events!
gives false positive on inner valuesassert_expected_events!
gives false positive on Event enum inner values
0xmovses
changed the title
Nov 22, 2023
assert_expected_events!
gives false positive on Event enum inner valuesassert_expected_events!
gives false positives on inner enum values
Can you add a reproducible example on its own that's not dependent on a branch? E.g. #[test]
fn inner_event_assertions_should_work() {
RococoRelay::execute_with(|| {
type RuntimeEvent = <RococoRelay as Chain>::RuntimeEvent;
assert_ok!(/* balance transfer */);
assert_expected_events!(
RococoRelay,
vec![
RuntimeEvent::Balances(pallet_balances::Event::Transfer { from, to, amount }) => {
/* assert things */
},
]
);
});
} |
could this be related to this: #1127 ? |
@joepetrowski I've updated the issue with an example that can be ran on main. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
I2-bug
The node fails to follow expected behavior.
I10-unconfirmed
Issue might be valid, but it's not yet known.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
In XCM emulator tests, when asserting on inner Event enum values, the macro will always pass even if the assertion should fail. For example:
No matter what number you assert
free_balance
, it will always pass (if the event is emitted).These will all pass. We don't want false positives on XCM emulator tests for obvious reasons.
Steps to reproduce
On master, navigate to
cumulus/parachains/integration-tests/emulated/tests/assets/asset-hub-rococo/src/tests/send.rs
On line 90 you'll see an assertion :
ASSET_ID
to some other number, re-run the test. The test still passesThe text was updated successfully, but these errors were encountered: