We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We assert Swapped events in way too many places, leading to many failing tests once some implementation changes.
Such tests are still useful but we should heavily minimize them, or at least not asserting for specific values.
In most, relevant integration tests, we could just check the Operation stack instead of the whole Swapped event.
Some helper macros:
#[macro_export] macro_rules! assert_operation_stack { ($event:expr, [$($expected:expr),*]) => { if let pallet_broadcast::Event::Swapped { operation_stack, .. } = $event { assert_eq!(&operation_stack[..], &[$($expected),*]); } else { panic!("Expected Swapped event"); } } } ///Used for cases when some params of operation stack types are not known in advance #[macro_export] macro_rules! assert_operation_stack_pattern { ($event:expr, [$($pattern:pat),*]) => { if let pallet_broadcast::Event::Swapped { operation_stack, .. } = $event { assert!(matches!(&operation_stack[..], [ $($pattern),* ] )); } else { panic!("Expected Swapped event"); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We assert Swapped events in way too many places, leading to many failing tests once some implementation changes.
Such tests are still useful but we should heavily minimize them, or at least not asserting for specific values.
In most, relevant integration tests, we could just check the Operation stack instead of the whole Swapped event.
Some helper macros:
The text was updated successfully, but these errors were encountered: