From 30012071f6e4fa2da85ec369cfd4dade2105f939 Mon Sep 17 00:00:00 2001 From: 0xFable <0xfable@protonmail.com> Date: Mon, 5 Feb 2024 18:04:14 +0000 Subject: [PATCH] fix: fmt and fix one leftover import --- .../epoch-manager/tests/common.rs | 4 +++- .../epoch-manager/tests/epoch.rs | 2 +- .../epoch-manager/tests/instantiate.rs | 2 +- .../pool-manager/src/contract.rs | 4 +++- .../pool-manager/src/manager/commands.rs | 2 +- .../frontend_helper/src/reply/deposit_pair.rs | 12 +++++++---- .../terraswap_pair/src/helpers.rs | 2 +- .../vault-manager/src/manager/commands.rs | 3 +-- .../vault_router/src/execute/next_loan.rs | 3 ++- .../src/epoch_manager/epoch_manager.rs | 2 +- packages/white-whale-std/src/lib.rs | 2 +- packages/white-whale-std/src/pool_manager.rs | 20 +++++++------------ .../white-whale-std/src/pool_network/asset.rs | 2 -- .../src/pool_network/mock_querier.rs | 14 ++++++++----- .../white-whale-std/src/pool_network/mod.rs | 2 +- .../src/pool_network/temp_mock_api.rs | 2 +- 16 files changed, 41 insertions(+), 37 deletions(-) diff --git a/contracts/liquidity_hub/epoch-manager/tests/common.rs b/contracts/liquidity_hub/epoch-manager/tests/common.rs index 88f785b0a..ae48d517c 100644 --- a/contracts/liquidity_hub/epoch-manager/tests/common.rs +++ b/contracts/liquidity_hub/epoch-manager/tests/common.rs @@ -3,7 +3,9 @@ use cosmwasm_std::{DepsMut, MessageInfo, Response, Uint64}; use epoch_manager::contract::{execute, instantiate}; use epoch_manager::ContractError; -use white_whale_std::epoch_manager::epoch_manager::{EpochV2, EpochConfig, ExecuteMsg, InstantiateMsg}; +use white_whale_std::epoch_manager::epoch_manager::{ + EpochConfig, EpochV2, ExecuteMsg, InstantiateMsg, +}; /// Mocks contract instantiation. pub(crate) fn mock_instantiation( diff --git a/contracts/liquidity_hub/epoch-manager/tests/epoch.rs b/contracts/liquidity_hub/epoch-manager/tests/epoch.rs index 288384ef6..efc153c2d 100644 --- a/contracts/liquidity_hub/epoch-manager/tests/epoch.rs +++ b/contracts/liquidity_hub/epoch-manager/tests/epoch.rs @@ -3,7 +3,7 @@ use cosmwasm_std::testing::{mock_env, mock_info}; use epoch_manager::contract::{execute, query}; use epoch_manager::ContractError; -use white_whale_std::epoch_manager::epoch_manager::{EpochV2, EpochResponse, ExecuteMsg, QueryMsg}; +use white_whale_std::epoch_manager::epoch_manager::{EpochResponse, EpochV2, ExecuteMsg, QueryMsg}; use white_whale_std::epoch_manager::hooks::EpochChangedHookMsg; use white_whale_std::pool_network::mock_querier::mock_dependencies; diff --git a/contracts/liquidity_hub/epoch-manager/tests/instantiate.rs b/contracts/liquidity_hub/epoch-manager/tests/instantiate.rs index 178c78374..0dcca6fb2 100644 --- a/contracts/liquidity_hub/epoch-manager/tests/instantiate.rs +++ b/contracts/liquidity_hub/epoch-manager/tests/instantiate.rs @@ -4,7 +4,7 @@ use cosmwasm_std::{from_json, Addr, Uint64}; use epoch_manager::contract::{instantiate, query}; use epoch_manager::ContractError; use white_whale_std::epoch_manager::epoch_manager::{ - ConfigResponse, EpochV2, EpochConfig, InstantiateMsg, QueryMsg, + ConfigResponse, EpochConfig, EpochV2, InstantiateMsg, QueryMsg, }; use white_whale_std::pool_network::mock_querier::mock_dependencies; diff --git a/contracts/liquidity_hub/pool-manager/src/contract.rs b/contracts/liquidity_hub/pool-manager/src/contract.rs index 7642dd926..8c641caed 100644 --- a/contracts/liquidity_hub/pool-manager/src/contract.rs +++ b/contracts/liquidity_hub/pool-manager/src/contract.rs @@ -10,7 +10,9 @@ use cosmwasm_std::{ use cw2::set_contract_version; use cw20::Cw20ReceiveMsg; use semver::Version; -use white_whale_std::pool_manager::{Cw20HookMsg, ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg}; +use white_whale_std::pool_manager::{ + Cw20HookMsg, ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg, +}; use white_whale_std::pool_network::asset::{Asset, AssetInfo}; use white_whale_std::pool_network::pair::FeatureToggle; diff --git a/contracts/liquidity_hub/pool-manager/src/manager/commands.rs b/contracts/liquidity_hub/pool-manager/src/manager/commands.rs index 8fb8fe23b..0d514ae1c 100644 --- a/contracts/liquidity_hub/pool-manager/src/manager/commands.rs +++ b/contracts/liquidity_hub/pool-manager/src/manager/commands.rs @@ -209,7 +209,7 @@ pub fn create_pair( feature = "osmosis_token_factory", feature = "injective" ))] - Ok(tokenfactory::create_denom::create_denom( + Ok(white_whale_std::tokenfactory::create_denom::create_denom( env.contract.address, lp_symbol, )) diff --git a/contracts/liquidity_hub/pool-network/frontend_helper/src/reply/deposit_pair.rs b/contracts/liquidity_hub/pool-network/frontend_helper/src/reply/deposit_pair.rs index 29f449733..ddf96cd22 100644 --- a/contracts/liquidity_hub/pool-network/frontend_helper/src/reply/deposit_pair.rs +++ b/contracts/liquidity_hub/pool-network/frontend_helper/src/reply/deposit_pair.rs @@ -96,11 +96,15 @@ pub fn deposit_pair(deps: DepsMut, env: Env, msg: Reply) -> Result, - }, + }, // CW20 Methods Receive(Cw20ReceiveMsg), } @@ -247,7 +242,6 @@ pub enum QueryMsg { // ask_amount: Uint128, // operations: Vec, // }, - #[returns(NPairInfo)] Pair { pair_identifier: String }, } diff --git a/packages/white-whale-std/src/pool_network/asset.rs b/packages/white-whale-std/src/pool_network/asset.rs index ae71b6197..68fae153a 100644 --- a/packages/white-whale-std/src/pool_network/asset.rs +++ b/packages/white-whale-std/src/pool_network/asset.rs @@ -184,8 +184,6 @@ impl AssetInfo { } } - - pub fn equal(&self, asset: &AssetInfo) -> bool { match self { AssetInfo::Token { contract_addr, .. } => { diff --git a/packages/white-whale-std/src/pool_network/mock_querier.rs b/packages/white-whale-std/src/pool_network/mock_querier.rs index 751b53f04..cd71a4e34 100644 --- a/packages/white-whale-std/src/pool_network/mock_querier.rs +++ b/packages/white-whale-std/src/pool_network/mock_querier.rs @@ -3,10 +3,11 @@ use std::iter::FromIterator; use std::marker::PhantomData; use std::panic; -use cosmwasm_std::testing::{MockQuerier, MockApi, MockStorage, MOCK_CONTRACT_ADDR}; +use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR}; use cosmwasm_std::{ - from_json, to_json_binary, Coin, ContractInfoResponse, ContractResult, Empty, OwnedDeps, - Querier, QuerierResult, QueryRequest, SystemError, SystemResult, Uint128, WasmQuery, CodeInfoResponse, Addr, HexBinary, to_binary, + from_json, to_binary, to_json_binary, Addr, CodeInfoResponse, Coin, ContractInfoResponse, + ContractResult, Empty, HexBinary, OwnedDeps, Querier, QuerierResult, QueryRequest, SystemError, + SystemResult, Uint128, WasmQuery, }; use cw20::{BalanceResponse as Cw20BalanceResponse, Cw20QueryMsg, TokenInfoResponse}; @@ -348,7 +349,7 @@ impl WasmMockQuerier { SystemResult::Ok(ContractResult::Ok( to_json_binary(&contract_info_response).unwrap(), )) - }, + } QueryRequest::Wasm(WasmQuery::CodeInfo { code_id }) => { let mut default = CodeInfoResponse::default(); @@ -356,7 +357,10 @@ impl WasmMockQuerier { 11 => { default.code_id = 67; default.creator = Addr::unchecked("creator").to_string(); - default.checksum =HexBinary::from_hex(&sha256::digest(format!("code_checksum_{}", code_id))) + default.checksum = HexBinary::from_hex(&sha256::digest(format!( + "code_checksum_{}", + code_id + ))) .unwrap(); SystemResult::Ok(to_binary(&default).into()) } diff --git a/packages/white-whale-std/src/pool_network/mod.rs b/packages/white-whale-std/src/pool_network/mod.rs index 012f00a12..486f51a3f 100644 --- a/packages/white-whale-std/src/pool_network/mod.rs +++ b/packages/white-whale-std/src/pool_network/mod.rs @@ -13,9 +13,9 @@ pub mod pair; pub mod querier; pub mod router; pub mod swap; +pub mod temp_mock_api; pub mod token; pub mod trio; -pub mod temp_mock_api; #[cfg(test)] mod testing; diff --git a/packages/white-whale-std/src/pool_network/temp_mock_api.rs b/packages/white-whale-std/src/pool_network/temp_mock_api.rs index f22c82cc6..d7f69dbab 100644 --- a/packages/white-whale-std/src/pool_network/temp_mock_api.rs +++ b/packages/white-whale-std/src/pool_network/temp_mock_api.rs @@ -80,4 +80,4 @@ impl Api for MockSimpleApi { fn debug(&self, message: &str) { println!("{}", message); } -} \ No newline at end of file +}