Skip to content

Comments

Partial signature message semantic validation#183

Merged
jking-aus merged 3 commits intosigp:unstablefrom
diegomrsantos:partial-sig-validation
Mar 25, 2025
Merged

Partial signature message semantic validation#183
jking-aus merged 3 commits intosigp:unstablefrom
diegomrsantos:partial-sig-validation

Conversation

@diegomrsantos
Copy link
Member

@diegomrsantos diegomrsantos commented Mar 11, 2025

Issue Addressed

#161

Proposed Changes

Add in a new module the partial signature message semantic validation logic and tests with additional helper functions to enhance test coverage and clarity.

@diegomrsantos diegomrsantos force-pushed the partial-sig-validation branch 3 times, most recently from 9a60db1 to dd9a49c Compare March 11, 2025 20:04
@diegomrsantos diegomrsantos self-assigned this Mar 11, 2025
@diegomrsantos diegomrsantos changed the title Partial signature validation Partial Signature Message Semantic validation Mar 12, 2025
@diegomrsantos diegomrsantos force-pushed the partial-sig-validation branch from dd9a49c to c499a5a Compare March 12, 2025 15:59
@diegomrsantos diegomrsantos changed the title Partial Signature Message Semantic validation Partial signature sessage semantic validation Mar 12, 2025
@diegomrsantos diegomrsantos force-pushed the partial-sig-validation branch 5 times, most recently from b700db1 to 2524bd0 Compare March 18, 2025 12:17
@diegomrsantos diegomrsantos requested a review from Copilot March 18, 2025 12:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the partial signature message validation logic by moving its implementation into a new module and updates the tests with additional helper functions to enhance test coverage and clarity.

  • Moved the partial signature message validation function into a new module.
  • Removed the inlined implementation of validate_partial_signature_message.
  • Added test helpers for creating message IDs and asserting validation errors.
Comments suppressed due to low confidence (3)

anchor/message_validator/src/lib.rs:7

  • Ensure that the new validate_partial_signature_message implementation in the partial_signature module is adequately covered by tests, particularly for edge-case partial signature validations.
use crate::partial_signature::validate_partial_signature_message;

anchor/message_validator/src/lib.rs:272

  • [nitpick] Ensure that create_message_id_for_test is actively used in tests for partial signature validation, so its behavior and output are verified in various scenarios.
pub fn create_message_id_for_test(role: Role) -> MessageId {

anchor/message_validator/src/lib.rs:282

  • [nitpick] Consider renaming the parameter 'expected_error' to 'error_predicate' in the assert_validation_error helper to better reflect that it represents a predicate function for evaluating errors.
pub fn assert_validation_error<T, F>(...

@diegomrsantos diegomrsantos marked this pull request as ready for review March 18, 2025 12:26
@diegomrsantos diegomrsantos requested a review from jking-aus March 18, 2025 12:27
@diegomrsantos diegomrsantos added the ready-for-review This PR is ready to be reviewed label Mar 18, 2025
@diegomrsantos diegomrsantos changed the title Partial signature sessage semantic validation Partial signature message semantic validation Mar 18, 2025
@diegomrsantos diegomrsantos force-pushed the partial-sig-validation branch from a18451f to 1ccc241 Compare March 21, 2025 00:01
@diegomrsantos diegomrsantos force-pushed the partial-sig-validation branch from 1ccc241 to b796586 Compare March 21, 2025 00:05
@diegomrsantos diegomrsantos requested review from jking-aus and removed request for jking-aus March 21, 2025 00:05
Copy link
Member

@jking-aus jking-aus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apologies on the delay -- lgtm great work diego

@jking-aus jking-aus merged commit 040cfe8 into sigp:unstable Mar 25, 2025
10 checks passed
@diegomrsantos diegomrsantos deleted the partial-sig-validation branch March 25, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review This PR is ready to be reviewed validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants