mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-03-21 11:23:10 +00:00
chore: move nssa dependency of amm to dev-dependencies
This commit is contained in:
parent
05c2c3a56d
commit
7b50c68550
@ -8,12 +8,9 @@ license = { workspace = true }
|
||||
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
|
||||
|
||||
[features]
|
||||
nssa = ["dep:nssa"]
|
||||
[dev-dependencies]
|
||||
nssa = { workspace = true, features = ["test-utils"] }
|
||||
|
||||
@ -4,7 +4,6 @@ use amm_core::{
|
||||
PoolDefinition, compute_liquidity_token_pda, compute_liquidity_token_pda_seed,
|
||||
compute_pool_pda, compute_vault_pda, compute_vault_pda_seed,
|
||||
};
|
||||
#[cfg(feature = "nssa")]
|
||||
use nssa::{
|
||||
PrivateKey, PublicKey, PublicTransaction, V02State, program::Program, public_transaction,
|
||||
};
|
||||
@ -25,16 +24,15 @@ struct BalanceForTests;
|
||||
struct ChainedCallForTests;
|
||||
struct IdForTests;
|
||||
struct AccountWithMetadataForTests;
|
||||
#[cfg(feature = "nssa")]
|
||||
|
||||
struct PrivateKeysForTests;
|
||||
#[cfg(feature = "nssa")]
|
||||
|
||||
struct IdForExeTests;
|
||||
#[cfg(feature = "nssa")]
|
||||
|
||||
struct BalanceForExeTests;
|
||||
#[cfg(feature = "nssa")]
|
||||
|
||||
struct AccountsForExeTests;
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
impl PrivateKeysForTests {
|
||||
fn user_token_a_key() -> PrivateKey {
|
||||
PrivateKey::try_new([31; 32]).expect("Keys constructor expects valid private key")
|
||||
@ -1008,7 +1006,6 @@ impl AccountWithMetadataForTests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
impl BalanceForExeTests {
|
||||
fn user_token_a_holding_init() -> u128 {
|
||||
10_000
|
||||
@ -1172,7 +1169,6 @@ impl BalanceForExeTests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
impl IdForExeTests {
|
||||
fn pool_definition_id() -> AccountId {
|
||||
amm_core::compute_pool_pda(
|
||||
@ -1229,7 +1225,6 @@ impl IdForExeTests {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
impl AccountsForExeTests {
|
||||
fn user_token_a_holding() -> Account {
|
||||
Account {
|
||||
@ -2641,7 +2636,6 @@ fn new_definition_lp_symmetric_amounts() {
|
||||
assert_eq!(chained_call_lp, expected_lp_call);
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
fn state_for_amm_tests() -> V02State {
|
||||
let initial_data = [];
|
||||
let mut state = V02State::new_with_genesis_accounts(&initial_data, &[]);
|
||||
@ -2685,7 +2679,6 @@ fn state_for_amm_tests() -> V02State {
|
||||
state
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
fn state_for_amm_tests_with_new_def() -> V02State {
|
||||
let 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
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
#[test]
|
||||
fn simple_amm_remove() {
|
||||
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);
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
#[test]
|
||||
fn simple_amm_new_definition_inactive_initialized_pool_and_uninit_user_lp() {
|
||||
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);
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
#[test]
|
||||
fn simple_amm_new_definition_inactive_initialized_pool_init_user_lp() {
|
||||
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);
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
#[test]
|
||||
fn simple_amm_new_definition_uninitialized_pool() {
|
||||
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);
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
#[test]
|
||||
fn simple_amm_add() {
|
||||
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);
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
#[test]
|
||||
fn simple_amm_swap_1() {
|
||||
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);
|
||||
}
|
||||
|
||||
#[cfg(feature = "nssa")]
|
||||
#[test]
|
||||
fn simple_amm_swap_2() {
|
||||
let mut state = state_for_amm_tests();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user