fix warnings
This commit is contained in:
@@ -19,6 +19,7 @@ pub struct CreateListing<'info> {
|
||||
pub system_program: Program<'info, System>,
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn handler(
|
||||
ctx: Context<CreateListing>,
|
||||
listing_id: u64,
|
||||
|
||||
@@ -16,6 +16,7 @@ pub struct UpdateListing<'info> {
|
||||
pub listing_account: Account<'info, ListingAccount>,
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn handler(
|
||||
ctx: Context<UpdateListing>,
|
||||
canonical_currency: Currency,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![allow(clippy::diverging_sub_expression)]
|
||||
|
||||
pub mod constants;
|
||||
pub mod error;
|
||||
pub mod instructions;
|
||||
@@ -19,6 +21,7 @@ pub mod solisting {
|
||||
initialize::handler(ctx)
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn create_listing(
|
||||
ctx: Context<CreateListing>,
|
||||
listing_id: u64,
|
||||
@@ -36,6 +39,7 @@ pub mod solisting {
|
||||
)
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn update_listing(
|
||||
ctx: Context<UpdateListing>,
|
||||
canonical_currency: state::Currency,
|
||||
|
||||
@@ -78,10 +78,7 @@ pub fn convert_with_slippage(
|
||||
};
|
||||
|
||||
if max_slippage_bps > 0 && expected_amount > 0 {
|
||||
let tolerance = (expected_amount as u128)
|
||||
.checked_mul(max_slippage_bps as u128)
|
||||
.unwrap_or(u128::MAX)
|
||||
/ 10_000;
|
||||
let tolerance = (expected_amount as u128).saturating_mul(max_slippage_bps as u128) / 10_000;
|
||||
let diff = computed.abs_diff(expected_amount) as u128;
|
||||
require!(diff <= tolerance, SolistingError::SlippageExceeded);
|
||||
}
|
||||
|
||||
@@ -77,6 +77,7 @@ pub fn send(svm: &mut LiteSVM, ixs: &[Instruction], signers: &[&Keypair]) {
|
||||
svm.send_transaction(tx).expect("transaction failed");
|
||||
}
|
||||
|
||||
#[allow(clippy::result_large_err)]
|
||||
pub fn try_send(
|
||||
svm: &mut LiteSVM,
|
||||
ixs: &[Instruction],
|
||||
@@ -90,6 +91,7 @@ pub fn try_send(
|
||||
|
||||
// --- Listing instruction builders ---
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn ix_create_listing(
|
||||
seller: &Pubkey,
|
||||
listing_id: u64,
|
||||
@@ -124,6 +126,7 @@ pub fn ix_create_listing(
|
||||
)
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn ix_update_listing(
|
||||
seller: &Pubkey,
|
||||
listing_id: u64,
|
||||
@@ -173,6 +176,7 @@ pub fn ix_close_listing(seller: &Pubkey, listing_id: u64) -> Instruction {
|
||||
|
||||
/// Build a create_order instruction paying in the canonical currency (no oracle accounts needed).
|
||||
/// For alt-currency orders, use ix_create_order_with_resolver with explicit oracle keys.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn ix_create_order(
|
||||
buyer: &Pubkey,
|
||||
seller: &Pubkey,
|
||||
@@ -197,6 +201,7 @@ pub fn ix_create_order(
|
||||
)
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn ix_create_order_with_resolver(
|
||||
buyer: &Pubkey,
|
||||
seller: &Pubkey,
|
||||
|
||||
Reference in New Issue
Block a user