From a7ec4fae5349fdf8fe95b3f4a96bfff4bc5e8be8 Mon Sep 17 00:00:00 2001 From: 0xripleys <0xripleys@solend.fi> Date: Fri, 5 Jul 2024 00:29:46 -0400 Subject: [PATCH] clip --- token-lending/program/tests/helpers/mock_pyth.rs | 2 +- token-lending/program/tests/helpers/mock_pyth_pull.rs | 2 -- token-lending/program/tests/helpers/mock_switchboard.rs | 2 +- token-lending/program/tests/helpers/mock_switchboard_pull.rs | 3 +-- token-lending/program/tests/helpers/solend_program_test.rs | 5 +---- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/token-lending/program/tests/helpers/mock_pyth.rs b/token-lending/program/tests/helpers/mock_pyth.rs index 55f177d05d8..72e15f3c990 100644 --- a/token-lending/program/tests/helpers/mock_pyth.rs +++ b/token-lending/program/tests/helpers/mock_pyth.rs @@ -113,7 +113,7 @@ impl Processor { msg!("Mock Pyth: Set price"); let price_account_info = next_account_info(account_info_iter)?; let data = &mut price_account_info.try_borrow_mut_data()?; - let mut price_account: &mut PriceAccount = load_mut(data).unwrap(); + let price_account: &mut PriceAccount = load_mut(data).unwrap(); price_account.agg.price = price; price_account.agg.conf = conf; diff --git a/token-lending/program/tests/helpers/mock_pyth_pull.rs b/token-lending/program/tests/helpers/mock_pyth_pull.rs index 26f8bfab0f0..7552074c3f0 100644 --- a/token-lending/program/tests/helpers/mock_pyth_pull.rs +++ b/token-lending/program/tests/helpers/mock_pyth_pull.rs @@ -15,8 +15,6 @@ use borsh::{BorshDeserialize, BorshSerialize}; use spl_token::solana_program::{account_info::next_account_info, program_error::ProgramError}; use thiserror::Error; -use super::{load_mut, QUOTE_CURRENCY}; - #[derive(BorshSerialize, BorshDeserialize)] pub enum MockPythPullInstruction { /// Accounts: diff --git a/token-lending/program/tests/helpers/mock_switchboard.rs b/token-lending/program/tests/helpers/mock_switchboard.rs index f4bfabbda4a..53936da06a8 100644 --- a/token-lending/program/tests/helpers/mock_switchboard.rs +++ b/token-lending/program/tests/helpers/mock_switchboard.rs @@ -9,7 +9,7 @@ use solana_program::{ sysvar::Sysvar, }; use std::cell::RefMut; -use switchboard_on_demand::OracleSubmission; + use switchboard_v2::{AggregatorAccountData, SwitchboardDecimal}; use borsh::{BorshDeserialize, BorshSerialize}; diff --git a/token-lending/program/tests/helpers/mock_switchboard_pull.rs b/token-lending/program/tests/helpers/mock_switchboard_pull.rs index 5180fa9ed43..9371bb23424 100644 --- a/token-lending/program/tests/helpers/mock_switchboard_pull.rs +++ b/token-lending/program/tests/helpers/mock_switchboard_pull.rs @@ -8,9 +8,8 @@ use solana_program::{ pubkey::Pubkey, sysvar::Sysvar, }; -use std::cell::RefMut; + use switchboard_on_demand::PullFeedAccountData; -use switchboard_v2::{AggregatorAccountData, SwitchboardDecimal}; use borsh::{BorshDeserialize, BorshSerialize}; use spl_token::solana_program::{account_info::next_account_info, program_error::ProgramError}; diff --git a/token-lending/program/tests/helpers/solend_program_test.rs b/token-lending/program/tests/helpers/solend_program_test.rs index 4dd63b5f2c7..85cfdf722be 100644 --- a/token-lending/program/tests/helpers/solend_program_test.rs +++ b/token-lending/program/tests/helpers/solend_program_test.rs @@ -1870,10 +1870,7 @@ pub async fn custom_scenario( .or_insert(arg.liquidity_amount); } - let mints_and_liquidity_amounts = mints_and_liquidity_amounts - .into_iter() - .map(|(mint, liquidity_amount)| (mint, liquidity_amount)) - .collect::>(); + let mints_and_liquidity_amounts = mints_and_liquidity_amounts.into_iter().collect::>(); let lending_market_owner = User::new_with_balances(&mut test, &mints_and_liquidity_amounts).await;