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

Step 4: Refactor Orchard structures to generics and add Orchard ZSA support for Transaction V6 #11

Closed

Conversation

dmidem
Copy link

@dmidem dmidem commented Sep 16, 2024

This PR refactors the Orchard-related structures to be generics and adds support for both Orchard Vanilla and Orchard ZSA in Zebra's Transaction V6. This change allows the codebase to handle both versions of the Orchard protocol and implements necessary serialization/deserialization logic.

Key changes

  • Generic Orchard Structures:
    • Refactored ShieldedData and Action structures to be generic, parameterized by Orchard flavor (OrchardVanilla or OrchardZSA), enabling support for both protocols in Tx V6.
  • burn Field in ShieldedData:
    • Added a burn field to ShieldedData to support ZSA: a unit type for Tx V5 and a vector of burn items for Tx V6.
  • Updates to Transaction Enum Methods:
    • Modified methods in the Transaction enum to handle the new generic structures properly and support both Orchard flavors.
  • Serialization and Deserialization for Tx V6:
    • Implemented serialization and deserialization for Transaction V6, ensuring the new structures are correctly processed while avoiding code redundancy with Tx V5.

…(without unit tests fixing for now).

- Refactored `ShieldedData` and `Action` structures to be generics parameterized by Orchard flavor
  (`OrchardVanilla` or `OrchardZSA`), enabling support for both Orchard protocols in Tx V6.
- Introduced a `burn` field in `ShieldedData` to support ZSA, with unit type for Tx V5 and a vector of burn items for Tx V6.
- Modified `Transaction` enum methods (orchard_...) to handle generics properly, ensuring compatibility with both Orchard flavors.
- Implemented serialization and deserialization for Tx V6 while avoiding code redundancy with Tx V5 wherever possible.
@dmidem dmidem changed the title Refactor Orchard structures to generics and add Orchard ZSA support for Transaction V6 Step 4: Refactor Orchard structures to generics and add Orchard ZSA support for Transaction V6 Oct 17, 2024
@dmidem dmidem deleted the branch switch-to-zsa-crates-nu6-txv6 October 17, 2024 07:55
@dmidem dmidem closed this Oct 17, 2024
@dmidem dmidem deleted the switch-to-zsa-crates-nu6-txv6-gen branch October 17, 2024 07:55
@dmidem
Copy link
Author

dmidem commented Oct 17, 2024

Closed in favour of #17 due to the branch renaming.

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