Skip to content
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

ZSA integration (step 5): Modify Orchard proptest implementations to support ZSA #18

Open
wants to merge 8 commits into
base: zsa-integration-generics
Choose a base branch
from

Conversation

dmidem
Copy link

@dmidem dmidem commented Oct 17, 2024

Updates the existing Orchard property-based test implementations to include transaction V6 ZSA fields (burn in ShieldedData and orchard_zsa_issue_data).

Changes:

  • Added the TestArbitrary trait to orchard_flavor_ext to conditionally modify the list of constraints for EncryptedNote and BurnType associated types.
  • Implemented Arbitrary for orchard::ShieldedData as a generic type.
  • Introduced a new type, Burn, which wraps Vec<BurnItem>. Implemented serialization/deserialization for it and placed it in orchard_zsa/burn.rs. Also moved NoBurn there from orchard_flavor_ext.rs for better code structuring.
  • Renamed serialize.rs to common.rs in the orchard_zsa folder.
  • Generalized the v5_strategy and v6_strategy functions in transaction/arbitrary.rs to work with V5 and V6 transactions, and to handle burn and issuance for V6.

Note: This is draft code that needs to be cleaned up, possibly refactored/improved, and the FIXMEs resolved.

1. Introduced new type `Burn` that wraps `Vec<BurnItem>`, implemented serialization/deserialization for it - put it
   into `orchard_zsa/burn.rs`, also moved `NoBurn` there from `orchard_flavor_ext.rs` for better code structuring.
2. Renamed the `EncryptedNoteTest` trait to `TestArbitrary` in `orchard_flavor_ext.rs` and used it to constrain
   `BurnType` as well.
3. Renamed `serialize.rs` to `common.rs` in the `orchard_zsa` folder.
4. Refactored transaction generation strategies for V5 and V6 in `transaction/arbitrary.rs` and
  `orchard_zsa/arbitrary.rs` to incorporate the new burn handling and proper issuance handling.
@dmidem dmidem requested a review from PaulLaux October 17, 2024 09:11
@dmidem dmidem changed the title Step 5: Modify Orchard proptest implementations to support ZSA ZSA integration, step 5: Modify Orchard proptest implementations to support ZSA Oct 18, 2024
@dmidem dmidem changed the title ZSA integration, step 5: Modify Orchard proptest implementations to support ZSA ZSA integration (step 5): Modify Orchard proptest implementations to support ZSA Oct 18, 2024
@PaulLaux PaulLaux requested a review from arya2 October 31, 2024 15:08
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