fix build warn
This commit is contained in:
+12
-24
@@ -68,9 +68,7 @@ impl InstructionBuilder for PumpSwapInstructionBuilder {
|
|||||||
creator = params_coin_creator_vault_authority;
|
creator = params_coin_creator_vault_authority;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut token_amount = 0;
|
let (token_amount, sol_amount) = if quote_mint_is_wsol {
|
||||||
let mut sol_amount = 0;
|
|
||||||
if quote_mint_is_wsol {
|
|
||||||
let result = buy_quote_input_internal(
|
let result = buy_quote_input_internal(
|
||||||
params.sol_amount,
|
params.sol_amount,
|
||||||
params.slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE),
|
params.slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE),
|
||||||
@@ -79,10 +77,8 @@ impl InstructionBuilder for PumpSwapInstructionBuilder {
|
|||||||
&creator,
|
&creator,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// base_amount_out
|
// base_amount_out, max_quote_amount_in
|
||||||
token_amount = result.base;
|
(result.base, result.max_quote)
|
||||||
// max_quote_amount_in
|
|
||||||
sol_amount = result.max_quote;
|
|
||||||
} else {
|
} else {
|
||||||
let result = sell_base_input_internal(
|
let result = sell_base_input_internal(
|
||||||
params.sol_amount,
|
params.sol_amount,
|
||||||
@@ -92,11 +88,9 @@ impl InstructionBuilder for PumpSwapInstructionBuilder {
|
|||||||
&creator,
|
&creator,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// min_quote_amount_out
|
// min_quote_amount_out, base_amount_in
|
||||||
token_amount = result.min_quote;
|
(result.min_quote, params.sol_amount)
|
||||||
// base_amount_in
|
};
|
||||||
sol_amount = params.sol_amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
let user_base_token_account =
|
let user_base_token_account =
|
||||||
crate::common::fast_fn::get_associated_token_address_with_program_id_fast_use_seed(
|
crate::common::fast_fn::get_associated_token_address_with_program_id_fast_use_seed(
|
||||||
@@ -239,9 +233,7 @@ impl InstructionBuilder for PumpSwapInstructionBuilder {
|
|||||||
creator = params_coin_creator_vault_authority;
|
creator = params_coin_creator_vault_authority;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut token_amount = 0;
|
let (token_amount, sol_amount) = if quote_mint_is_wsol {
|
||||||
let mut sol_amount = 0;
|
|
||||||
if quote_mint_is_wsol {
|
|
||||||
let result = sell_base_input_internal(
|
let result = sell_base_input_internal(
|
||||||
params.token_amount.unwrap(),
|
params.token_amount.unwrap(),
|
||||||
params.slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE),
|
params.slippage_basis_points.unwrap_or(DEFAULT_SLIPPAGE),
|
||||||
@@ -250,10 +242,8 @@ impl InstructionBuilder for PumpSwapInstructionBuilder {
|
|||||||
&creator,
|
&creator,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// base_amount_in
|
// base_amount_in, min_quote_amount_out
|
||||||
token_amount = params.token_amount.unwrap();
|
(params.token_amount.unwrap(), result.min_quote)
|
||||||
// min_quote_amount_out
|
|
||||||
sol_amount = result.min_quote;
|
|
||||||
} else {
|
} else {
|
||||||
let result = buy_quote_input_internal(
|
let result = buy_quote_input_internal(
|
||||||
params.token_amount.unwrap(),
|
params.token_amount.unwrap(),
|
||||||
@@ -263,11 +253,9 @@ impl InstructionBuilder for PumpSwapInstructionBuilder {
|
|||||||
&creator,
|
&creator,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
// max_quote_amount_in
|
// max_quote_amount_in, base_amount_out
|
||||||
token_amount = result.max_quote;
|
(result.max_quote, result.base)
|
||||||
// base_amount_out
|
};
|
||||||
sol_amount = result.base;
|
|
||||||
}
|
|
||||||
|
|
||||||
let fee_recipient_ata = fee_recipient_ata(accounts::FEE_RECIPIENT, quote_mint);
|
let fee_recipient_ata = fee_recipient_ata(accounts::FEE_RECIPIENT, quote_mint);
|
||||||
let user_base_token_account =
|
let user_base_token_account =
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use solana_hash::Hash;
|
use solana_hash::Hash;
|
||||||
use solana_sdk::{instruction::Instruction, pubkey::Pubkey, signature::Keypair, signer::Signer};
|
use solana_sdk::{instruction::Instruction, signature::Keypair, signer::Signer};
|
||||||
use solana_system_interface::instruction::advance_nonce_account;
|
use solana_system_interface::instruction::advance_nonce_account;
|
||||||
|
|
||||||
use crate::common::nonce_cache::DurableNonceInfo;
|
use crate::common::nonce_cache::DurableNonceInfo;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
use anyhow::{anyhow, Result};
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::instruction::{
|
use crate::instruction::{
|
||||||
|
|||||||
Reference in New Issue
Block a user