chore: move nssa dependency of amm to dev-dependencies

This commit is contained in:
Daniil Polyakov 2026-03-19 01:11:07 +03:00
parent 05c2c3a56d
commit 7b50c68550
2 changed files with 6 additions and 23 deletions

View File

@ -8,12 +8,9 @@ license = { workspace = true }
workspace = true workspace = true
[dependencies] [dependencies]
nssa = { workspace = true, optional = true, features = [
"test-utils",
], default-features = true }
nssa_core.workspace = true nssa_core.workspace = true
token_core.workspace = true token_core.workspace = true
amm_core.workspace = true amm_core.workspace = true
[features] [dev-dependencies]
nssa = ["dep:nssa"] nssa = { workspace = true, features = ["test-utils"] }

View File

@ -4,7 +4,6 @@ use amm_core::{
PoolDefinition, compute_liquidity_token_pda, compute_liquidity_token_pda_seed, PoolDefinition, compute_liquidity_token_pda, compute_liquidity_token_pda_seed,
compute_pool_pda, compute_vault_pda, compute_vault_pda_seed, compute_pool_pda, compute_vault_pda, compute_vault_pda_seed,
}; };
#[cfg(feature = "nssa")]
use nssa::{ use nssa::{
PrivateKey, PublicKey, PublicTransaction, V02State, program::Program, public_transaction, PrivateKey, PublicKey, PublicTransaction, V02State, program::Program, public_transaction,
}; };
@ -25,16 +24,15 @@ struct BalanceForTests;
struct ChainedCallForTests; struct ChainedCallForTests;
struct IdForTests; struct IdForTests;
struct AccountWithMetadataForTests; struct AccountWithMetadataForTests;
#[cfg(feature = "nssa")]
struct PrivateKeysForTests; struct PrivateKeysForTests;
#[cfg(feature = "nssa")]
struct IdForExeTests; struct IdForExeTests;
#[cfg(feature = "nssa")]
struct BalanceForExeTests; struct BalanceForExeTests;
#[cfg(feature = "nssa")]
struct AccountsForExeTests; struct AccountsForExeTests;
#[cfg(feature = "nssa")]
impl PrivateKeysForTests { impl PrivateKeysForTests {
fn user_token_a_key() -> PrivateKey { fn user_token_a_key() -> PrivateKey {
PrivateKey::try_new([31; 32]).expect("Keys constructor expects valid private key") PrivateKey::try_new([31; 32]).expect("Keys constructor expects valid private key")
@ -1008,7 +1006,6 @@ impl AccountWithMetadataForTests {
} }
} }
#[cfg(feature = "nssa")]
impl BalanceForExeTests { impl BalanceForExeTests {
fn user_token_a_holding_init() -> u128 { fn user_token_a_holding_init() -> u128 {
10_000 10_000
@ -1172,7 +1169,6 @@ impl BalanceForExeTests {
} }
} }
#[cfg(feature = "nssa")]
impl IdForExeTests { impl IdForExeTests {
fn pool_definition_id() -> AccountId { fn pool_definition_id() -> AccountId {
amm_core::compute_pool_pda( amm_core::compute_pool_pda(
@ -1229,7 +1225,6 @@ impl IdForExeTests {
} }
} }
#[cfg(feature = "nssa")]
impl AccountsForExeTests { impl AccountsForExeTests {
fn user_token_a_holding() -> Account { fn user_token_a_holding() -> Account {
Account { Account {
@ -2641,7 +2636,6 @@ fn new_definition_lp_symmetric_amounts() {
assert_eq!(chained_call_lp, expected_lp_call); assert_eq!(chained_call_lp, expected_lp_call);
} }
#[cfg(feature = "nssa")]
fn state_for_amm_tests() -> V02State { fn state_for_amm_tests() -> V02State {
let initial_data = []; let initial_data = [];
let mut state = V02State::new_with_genesis_accounts(&initial_data, &[]); let mut state = V02State::new_with_genesis_accounts(&initial_data, &[]);
@ -2685,7 +2679,6 @@ fn state_for_amm_tests() -> V02State {
state state
} }
#[cfg(feature = "nssa")]
fn state_for_amm_tests_with_new_def() -> V02State { fn state_for_amm_tests_with_new_def() -> V02State {
let initial_data = []; let initial_data = [];
let mut state = V02State::new_with_genesis_accounts(&initial_data, &[]); let mut state = V02State::new_with_genesis_accounts(&initial_data, &[]);
@ -2708,7 +2701,6 @@ fn state_for_amm_tests_with_new_def() -> V02State {
state state
} }
#[cfg(feature = "nssa")]
#[test] #[test]
fn simple_amm_remove() { fn simple_amm_remove() {
let mut state = state_for_amm_tests(); let mut state = state_for_amm_tests();
@ -2768,7 +2760,6 @@ fn simple_amm_remove() {
assert_eq!(user_token_lp_post, expected_user_token_lp); assert_eq!(user_token_lp_post, expected_user_token_lp);
} }
#[cfg(feature = "nssa")]
#[test] #[test]
fn simple_amm_new_definition_inactive_initialized_pool_and_uninit_user_lp() { fn simple_amm_new_definition_inactive_initialized_pool_and_uninit_user_lp() {
let mut state = state_for_amm_tests_with_new_def(); let mut state = state_for_amm_tests_with_new_def();
@ -2849,7 +2840,6 @@ fn simple_amm_new_definition_inactive_initialized_pool_and_uninit_user_lp() {
assert_eq!(user_token_lp_post, expected_user_token_lp); assert_eq!(user_token_lp_post, expected_user_token_lp);
} }
#[cfg(feature = "nssa")]
#[test] #[test]
fn simple_amm_new_definition_inactive_initialized_pool_init_user_lp() { fn simple_amm_new_definition_inactive_initialized_pool_init_user_lp() {
let mut state = state_for_amm_tests_with_new_def(); let mut state = state_for_amm_tests_with_new_def();
@ -2934,7 +2924,6 @@ fn simple_amm_new_definition_inactive_initialized_pool_init_user_lp() {
assert_eq!(user_token_lp_post, expected_user_token_lp); assert_eq!(user_token_lp_post, expected_user_token_lp);
} }
#[cfg(feature = "nssa")]
#[test] #[test]
fn simple_amm_new_definition_uninitialized_pool() { fn simple_amm_new_definition_uninitialized_pool() {
let mut state = state_for_amm_tests_with_new_def(); let mut state = state_for_amm_tests_with_new_def();
@ -3007,7 +2996,6 @@ fn simple_amm_new_definition_uninitialized_pool() {
assert_eq!(user_token_lp_post, expected_user_token_lp); assert_eq!(user_token_lp_post, expected_user_token_lp);
} }
#[cfg(feature = "nssa")]
#[test] #[test]
fn simple_amm_add() { fn simple_amm_add() {
let mut state = state_for_amm_tests(); let mut state = state_for_amm_tests();
@ -3070,7 +3058,6 @@ fn simple_amm_add() {
assert_eq!(user_token_lp_post, expected_user_token_lp); assert_eq!(user_token_lp_post, expected_user_token_lp);
} }
#[cfg(feature = "nssa")]
#[test] #[test]
fn simple_amm_swap_1() { fn simple_amm_swap_1() {
let mut state = state_for_amm_tests(); let mut state = state_for_amm_tests();
@ -3122,7 +3109,6 @@ fn simple_amm_swap_1() {
assert_eq!(user_token_b_post, expected_user_token_b); assert_eq!(user_token_b_post, expected_user_token_b);
} }
#[cfg(feature = "nssa")]
#[test] #[test]
fn simple_amm_swap_2() { fn simple_amm_swap_2() {
let mut state = state_for_amm_tests(); let mut state = state_for_amm_tests();