diff --git a/artifacts/program_methods/amm.bin b/artifacts/program_methods/amm.bin index 0afa906e..788ea2bb 100644 Binary files a/artifacts/program_methods/amm.bin and b/artifacts/program_methods/amm.bin differ diff --git a/nssa/src/state.rs b/nssa/src/state.rs index 0d5e6364..4ab71da3 100644 --- a/nssa/src/state.rs +++ b/nssa/src/state.rs @@ -16,7 +16,7 @@ use crate::{ pub const MAX_NUMBER_CHAINED_CALLS: usize = 10; -#[derive(BorshSerialize, BorshDeserialize)] +#[derive(Clone, BorshSerialize, BorshDeserialize)] #[cfg_attr(test, derive(Debug, PartialEq, Eq))] pub(crate) struct CommitmentSet { merkle_tree: MerkleTree, @@ -64,6 +64,7 @@ impl CommitmentSet { } #[cfg_attr(test, derive(Debug, PartialEq, Eq))] +#[derive(Clone)] struct NullifierSet(BTreeSet); impl NullifierSet { @@ -104,7 +105,7 @@ impl BorshDeserialize for NullifierSet { } } -#[derive(BorshSerialize, BorshDeserialize)] +#[derive(Clone, BorshSerialize, BorshDeserialize)] #[cfg_attr(test, derive(Debug, PartialEq, Eq))] pub struct V02State { public_state: HashMap, diff --git a/programs/amm/src/full_tests.rs b/programs/amm/src/full_tests.rs index 51fbea8a..5c918eae 100644 --- a/programs/amm/src/full_tests.rs +++ b/programs/amm/src/full_tests.rs @@ -1,5 +1,3 @@ -#![cfg(all(test, feature = "with-nssa"))] - use amm_core::PoolDefinition; use nssa::{ Account, AccountId, Data, PrivateKey, PublicKey, PublicTransaction, V02State, program::Program, diff --git a/programs/amm/src/lib.rs b/programs/amm/src/lib.rs index 476e4776..1219592c 100644 --- a/programs/amm/src/lib.rs +++ b/programs/amm/src/lib.rs @@ -7,5 +7,7 @@ pub mod new_definition; pub mod remove; pub mod swap; +#[cfg(all(test, feature = "with-nssa"))] mod full_tests; +#[cfg(test)] mod tests; diff --git a/programs/amm/src/tests.rs b/programs/amm/src/tests.rs index 203e3284..9d2213a2 100644 --- a/programs/amm/src/tests.rs +++ b/programs/amm/src/tests.rs @@ -1,4 +1,4 @@ -#![cfg(test)] + use std::num::NonZero;