diff --git a/nssa/src/state.rs b/nssa/src/state.rs index ec9dfe91..9548c24f 100644 --- a/nssa/src/state.rs +++ b/nssa/src/state.rs @@ -306,7 +306,7 @@ impl V02State { } } - #[cfg(test)] +#[cfg(any(test, feature = "test-utils"))] impl V02State { pub fn force_insert_account(&mut self, account_id: AccountId, account: Account) { self.public_state.insert(account_id, account); @@ -317,9 +317,6 @@ impl V02State { pub mod tests { use std::collections::HashMap; - - use token_core::{TokenDefinition, TokenHolding}; - use nssa_core::{ Commitment, Nullifier, NullifierPublicKey, NullifierSecretKey, SharedSecretKey, account::{Account, AccountId, AccountWithMetadata, Nonce, data::Data}, diff --git a/programs/amm/Cargo.toml b/programs/amm/Cargo.toml index 9d64a289..cee580af 100644 --- a/programs/amm/Cargo.toml +++ b/programs/amm/Cargo.toml @@ -5,7 +5,11 @@ edition = "2024" license = { workspace = true } [dependencies] +nssa = { workspace = true, optional = true, features = ["test-utils"], default-features = true } nssa_core.workspace = true token_core.workspace = true amm_core.workspace = true -nssa.workspace = true \ No newline at end of file + +[features] +with-nssa = ["nssa"] +test-utils = [] \ No newline at end of file diff --git a/programs/amm/src/full_tests.rs b/programs/amm/src/full_tests.rs index f3fed381..8326d2aa 100644 --- a/programs/amm/src/full_tests.rs +++ b/programs/amm/src/full_tests.rs @@ -1,4 +1,4 @@ -#![cfg(all(test, feature = "test-utils"))] +#![cfg(all(test, feature = "with-nssa"))] use amm_core::PoolDefinition; use nssa::{Account, AccountId, Data, PrivateKey, PublicKey, PublicTransaction, V02State, program::Program, public_transaction};