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

Tests issued asset state tracking and contextual validation #27

Draft
wants to merge 14 commits into
base: zsa-integration-block-test
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions zebra-chain/src/orchard/orchard_flavor_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use proptest_derive::Arbitrary;

use orchard::{note_encryption::OrchardDomainCommon, orchard_flavor};

use crate::serialization::{ZcashDeserialize, ZcashSerialize};
use crate::{
orchard_zsa,
serialization::{ZcashDeserialize, ZcashSerialize},
};

#[cfg(feature = "tx-v6")]
use crate::orchard_zsa::{Burn, NoBurn};
Expand Down Expand Up @@ -50,7 +53,13 @@ pub trait OrchardFlavorExt: Clone + Debug {

/// A type representing a burn field for this protocol version.
#[cfg(feature = "tx-v6")]
type BurnType: Clone + Debug + Default + ZcashDeserialize + ZcashSerialize + TestArbitrary;
type BurnType: Clone
+ Debug
+ Default
+ ZcashDeserialize
+ ZcashSerialize
+ TestArbitrary
+ AsRef<[orchard_zsa::BurnItem]>;
}

/// A structure representing a tag for Orchard protocol variant used for the transaction version `V5`.
Expand Down
9 changes: 6 additions & 3 deletions zebra-chain/src/orchard_zsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
#[cfg(any(test, feature = "proptest-impl"))]
pub(crate) mod arbitrary;

#[cfg(test)]
mod tests;
#[cfg(any(test, feature = "proptest-impl"))]
pub mod tests;

mod asset_state;
mod burn;
mod issuance;

pub(crate) use burn::{Burn, NoBurn};
pub(crate) use burn::{Burn, BurnItem, NoBurn};
pub(crate) use issuance::IssueData;

pub use asset_state::{AssetBase, AssetState, AssetStateChange, IssuedAssets, IssuedAssetsChange};
Loading
Loading