test(stm): add negative single-signature tests#2985
Conversation
There was a problem hiding this comment.
Pull request overview
Adds negative unit tests for SingleSignature::verify in mithril-stm to ensure invalid inputs are rejected, addressing #2946.
Changes:
- Introduce a shared test setup helper to build a signer / AVK context.
- Add negative verification tests for: wrong verification key, out-of-bounds lottery index, and wrong message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
curiecrypt
left a comment
There was a problem hiding this comment.
Looks good overall. Here are my suggestions:
- Use a structure for the test context, I give the details below.
- Modify
build_single_signature_contextfunction to take arguments such as number of signers, orrng. After that, it should return the struct created for test. - Another test case would be trying to verify a valid signature for another registration. This would be done with a different avk (in the current version). In the case we have the structure and context builder function, we can use different calls to this function.
9423053 to
a6a6856
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jpraynaud
left a comment
There was a problem hiding this comment.
Thanks for the updates @leepl37 !
Once all comments from @curiecrypt are addressed and the CI is all green, we'll be able to merge 👍
|
Hi @curiecrypt and @jpraynaud! I have addressed all the feedback and implemented the new test context structure. |
|
@leepl37 could you bump the version and update the CHANGELOG file in I'll merge the PR once this is done 🚀 |
dbb9202 to
9b64cc9
Compare
|
Hi @jpraynaud! |
Content
This PR adds negative tests for
SingleSignature::verifyinmithril-stmto ensure invalid inputs are rejected:This aligns with the reviewer suggestion from @hjeljeli32 and addresses #2946.
Note: dependency on #2943 is acknowledged; I will rebase/update after it merges if needed.
Pre-submit checklist
Comments
This is a Draft PR as discussed with @jpraynaud. I am opening it now to allow for early review of the test logic.
Issue(s)
Relates to #2946
Blocked by #2943 (will rebase if needed)