mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-25 08:13:12 +00:00
style(amm): cargo fmt
This commit is contained in:
parent
cf92e5d111
commit
f1fc061664
@ -73,7 +73,10 @@ pub unsafe extern "C" fn amm_client_swap_words(
|
||||
min_out: *const [u8; 16],
|
||||
deadline: u64,
|
||||
) -> AmmWords {
|
||||
let (a, m) = (u128::from_le_bytes(*amount_in), u128::from_le_bytes(*min_out));
|
||||
let (a, m) = (
|
||||
u128::from_le_bytes(*amount_in),
|
||||
u128::from_le_bytes(*min_out),
|
||||
);
|
||||
match swap::swap_exact_input_words(a, m, deadline) {
|
||||
Ok(w) => {
|
||||
let boxed = w.into_boxed_slice();
|
||||
|
||||
@ -33,8 +33,7 @@ pub fn current_tick_pda(twap: ProgramId, pool: AccountId) -> AccountId {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use amm_core::compute_pool_pda;
|
||||
use nssa_core::account::AccountId;
|
||||
use nssa_core::program::ProgramId;
|
||||
use nssa_core::{account::AccountId, program::ProgramId};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
||||
@ -27,8 +27,7 @@ pub fn decode_pool(bytes: &[u8]) -> Result<PoolView, String> {
|
||||
reserve_a: p.reserve_a,
|
||||
reserve_b: p.reserve_b,
|
||||
liquidity_supply: p.liquidity_pool_supply,
|
||||
fees: u32::try_from(p.fees)
|
||||
.map_err(|_| format!("pool fee {} exceeds u32::MAX", p.fees))?,
|
||||
fees: u32::try_from(p.fees).map_err(|_| format!("pool fee {} exceeds u32::MAX", p.fees))?,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user