Skip to content
Open
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
5 changes: 4 additions & 1 deletion amm/src/sync.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use amm_core::{read_vault_fungible_balances, PoolDefinition, MINIMUM_LIQUIDITY};
use amm_core::{
assert_supported_fee_tier, read_vault_fungible_balances, PoolDefinition, MINIMUM_LIQUIDITY,
};
use nssa_core::{
account::{AccountWithMetadata, Data},
program::{AccountPostState, ChainedCall},
Expand All @@ -11,6 +13,7 @@ pub fn sync_reserves(
) -> (Vec<AccountPostState>, Vec<ChainedCall>) {
let pool_def_data = PoolDefinition::try_from(&pool.account.data)
.expect("Sync reserves: AMM Program expects a valid Pool Definition Account");
assert_supported_fee_tier(pool_def_data.fees);
Comment on lines 14 to +16
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The change is correct, but I recommend to add a small unit test for sync_reserves that sets PoolDefinition.fees = 2 and expects the shared unsupported-fee panic message, cuz the current sync tests do not have this new guard directly.


assert!(
pool_def_data.liquidity_pool_supply >= MINIMUM_LIQUIDITY,
Expand Down
Loading