-
Notifications
You must be signed in to change notification settings - Fork 305
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
app: 🤠 address warning #3900
app: 🤠 address warning #3900
Conversation
addresses this compiler warning: ``` warning: argument must be of the form: `expected = "error message"` --> crates/core/app/tests/spend.rs:97:1 | 97 | #[cfg_attr( | ^ | = note: errors in this attribute were erroneously allowed and will become a hard error in a future release ```
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.
// 3. Simulate execution of the Spend action
spend
.check_stateless(transaction_context)
.await
.unwrap_err()
.to_string()
.contains("spend proof did not verify");
This should be wrapped in an assert!
right?
i'm not sure. i didn't write this test, it was added in #3871. i just wanted to address the warning i'm seeing when building |
@@ -96,7 +96,7 @@ async fn spend_happy_path() -> anyhow::Result<()> { | |||
#[tokio::test] | |||
#[cfg_attr( | |||
debug_assertions, | |||
should_panic("assertion failed: cs.is_satisfied().unwrap()") | |||
should_panic = "assertion failed: cs.is_satisfied().unwrap()" |
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.
Not a huge deal, but reading the last state of the proof test, I am not sure I understand why we expect this to panic? the attribute makes me think it might be a debug assert nested deep in arkworks? If so we should probably add a comment
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.
This is cursed, if you try to verify an invalid proof in debug mode, arkworks will panic with this error. So we expect this to panic in debug mode, in release mode it should error with an invalid spend proof. The way the test is written currently with contains() is a bug
Ah yeah, np I'll ask @avahowell |
addresses this compiler warning: