Skip to content

Refactor verification logic into dedicated module and modify verify_issue_bundle function#135

Closed
dmidem wants to merge 4 commits intozsa1from
verif-for-zebra
Closed

Refactor verification logic into dedicated module and modify verify_issue_bundle function#135
dmidem wants to merge 4 commits intozsa1from
verif-for-zebra

Conversation

@dmidem
Copy link

@dmidem dmidem commented Jan 20, 2025

This PR extracts and reorganizes the verification logic for asset burn and issuance into a new verification module (and submodules) and modifies the verify_issue_bundle function. These new verification modules could be potentially moved to the Zebra repository for further integration.

  1. New Verification Module & Folder

    • Created a verification.rs module and a verification/ folder to house all verification-related logic.
  2. Relocation of burn.rs

    • Moved the entire burn.rs file (containing the validate_bundle_burn function) to verification/burn.rs.
  3. Refactoring verify_issue_bundle

    • The verify_issue_bundle function was moved from issuance.rs to verification/issuance.rs.
    • Its signature was updated to use a get_asset_state method (closure/trait) instead of relying on a finalization set.
  4. Removed supply_info.rs Module

    • The SupplyInfo struct and related tests have been removed entirely, as the verification function (verify_issue_bundle) now returns a HashMap instead of SupplyInfo.
    • The AssetSupply struct definition, previously in supply_info.rs, has been moved to issuance.rs for consistency.
  5. Test Updates & Extensions

    • All existing tests for the moved code were also relocated under the new verification folder.
    • Adjusted the tests to align with the revised verify_issue_bundle signature (using get_asset_state).
  6. Retention of verify_supply in issuance.rs

    • The verify_supply method remains in issuance.rs, as it is still needed when the IssueBundle is signed in that module.
  7. Visibility Fixes in issuance.rs

    • Since verify_issue_bundle tests have been moved to a separate module, certain fields in IssueBundle, IssueAction, and Signed structs were made pub(crate) so they can be accessed from verification/issuance.rs.
    • FIXME comments were added to indicate these visibility changes may need revisiting in the future.

TODO: Extend the test set in verification/issuance.rs to verify the correct handling of issued asset states in a global store context.

@dmidem dmidem requested a review from PaulLaux January 20, 2025 08:56
@QED-it QED-it deleted a comment from what-the-diff bot Jan 20, 2025
@dmidem
Copy link
Author

dmidem commented Jan 29, 2025

Closed in favour #138

@dmidem dmidem closed this Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant