Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jkbpvsc committed Jul 17, 2024
1 parent 6304d43 commit 4b35cd0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
5 changes: 1 addition & 4 deletions src/liquidator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ use crate::{
};
use anchor_client::Program;
use anchor_lang::Discriminator;
use crossbeam::{
channel::{Receiver, Sender},
epoch::Atomic,
};
use crossbeam::channel::{Receiver, Sender};
use fixed::types::I80F48;
use fixed_macro::types::I80F48;
use log::{debug, error, info};
Expand Down
15 changes: 5 additions & 10 deletions src/transaction_manager.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::config::GeneralConfig;
use core::panic;
use crossbeam::channel::Receiver;
use jito_protos::searcher::{
searcher_service_client::SearcherServiceClient, GetTipAccountsRequest,
NextScheduledLeaderRequest, SubscribeBundleResultsRequest,
};
use jito_searcher_client::{get_searcher_client_no_auth, send_bundle_with_confirmation};
use log::{error, info};
use rayon::iter::IntoParallelRefIterator;
use log::error;
use solana_address_lookup_table_program::state::AddressLookupTable;
use solana_client::{
nonblocking::rpc_client::RpcClient, rpc_client::RpcClient as NonBlockRpc,
Expand All @@ -24,12 +22,9 @@ use solana_sdk::{
system_instruction::transfer,
transaction::VersionedTransaction,
};
use std::{
collections::{HashMap, HashSet},
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use std::{error::Error, str::FromStr};
use tonic::transport::Channel;
Expand Down Expand Up @@ -136,7 +131,7 @@ impl TransactionManager {
tokio::time::sleep(SLEEP_DURATION).await;
}
for tx in transactions {
let mut transaction = Self::send_transaction(
let transaction = Self::send_transaction(
tx.clone(),
self.searcher_client.clone(),
self.rpc.clone(),
Expand Down
8 changes: 4 additions & 4 deletions src/wrappers/liquidator_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl LiquidatorAccount {
bank_liquidaity_vault_authority,
bank_liquidaity_vault,
bank_insurante_vault,
self.token_program_per_mint.get(&liab_mint).unwrap().clone(),
*self.token_program_per_mint.get(&liab_mint).unwrap(),
liquidator_observation_accounts,
liquidatee_observation_accounts,
asset_bank.bank.config.oracle_keys[0],
Expand Down Expand Up @@ -148,7 +148,7 @@ impl LiquidatorAccount {
.get_observation_accounts(&[], &banks_to_exclude, banks);

let mint = bank.bank.mint;
let token_program = self.token_program_per_mint.get(&mint).unwrap().clone();
let token_program = *self.token_program_per_mint.get(&mint).unwrap();

let withdraw_ix = make_withdraw_ix(
self.program_id,
Expand Down Expand Up @@ -189,7 +189,7 @@ impl LiquidatorAccount {
let signer_pk = self.signer_keypair.pubkey();

let mint = bank.bank.mint;
let token_program = self.token_program_per_mint.get(&mint).unwrap().clone();
let token_program = *self.token_program_per_mint.get(&mint).unwrap();

let repay_ix = make_repay_ix(
self.program_id,
Expand Down Expand Up @@ -222,7 +222,7 @@ impl LiquidatorAccount {
let signer_pk = self.signer_keypair.pubkey();

let mint = bank.bank.mint;
let token_program = self.token_program_per_mint.get(&mint).unwrap().clone();
let token_program = *self.token_program_per_mint.get(&mint).unwrap();

let deposit_ix = make_deposit_ix(
self.program_id,
Expand Down

0 comments on commit 4b35cd0

Please sign in to comment.