From 92224d8ef96b69f054e54e33cd9d6acd10398806 Mon Sep 17 00:00:00 2001 From: ApolloGie Date: Sat, 22 Jun 2024 10:29:52 -0500 Subject: [PATCH] fix: cleanup, remove astroport generator --- Cargo.lock | 64 ++---------------------------------------- Cargo.toml | 6 ++-- deny.toml | 4 +-- src/astroport/robot.rs | 9 +++--- src/astroport/utils.rs | 39 ++++++++++--------------- 5 files changed, 26 insertions(+), 96 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b452482..aef83a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -210,25 +210,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "astroport-generator" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb2172cfb6654079f976397be1665731c6af3739ffecbdbb4b4f0d731ac0fe9d" -dependencies = [ - "astroport 3.11.1", - "astroport-governance", - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus 0.15.1", - "cw-utils 1.0.3", - "cw1-whitelist 0.15.1", - "cw2 0.15.1", - "cw20 0.15.1", - "protobuf 2.28.0", - "thiserror", -] - [[package]] name = "astroport-governance" version = "1.2.0" @@ -431,7 +412,7 @@ checksum = "ecc56be98fb0fad68549e2af01b03322476b5b163f2ebbb579d19a96eec73e6f" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw1-whitelist 1.1.2", + "cw1-whitelist", "cw2 1.1.2", "neutron-sdk", "thiserror", @@ -969,7 +950,6 @@ dependencies = [ "astroport 2.9.5", "astroport 5.1.0", "astroport-factory", - "astroport-generator", "astroport-incentives", "astroport-maker", "astroport-native-coin-registry", @@ -1054,18 +1034,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cw1" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe0783ec4210ba4e0cdfed9874802f469c6db0880f742ad427cb950e940b21c" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "schemars", - "serde", -] - [[package]] name = "cw1" version = "1.1.2" @@ -1078,23 +1046,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cw1-whitelist" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233dd13f61495f1336da57c8bdca0536fa9f8dd59c12d2bbfc59928ea580e478" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus 0.15.1", - "cw-utils 0.15.1", - "cw1 0.15.1", - "cw2 0.15.1", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "cw1-whitelist" version = "1.1.2" @@ -1105,7 +1056,7 @@ dependencies = [ "cosmwasm-std", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw1 1.1.2", + "cw1", "cw2 1.1.2", "schemars", "serde", @@ -1971,7 +1922,7 @@ dependencies = [ "cosmwasm-std", "prost 0.12.3", "prost-types 0.12.3", - "protobuf 3.4.0", + "protobuf", "schemars", "serde", "serde-json-wasm 1.0.1", @@ -2439,15 +2390,6 @@ dependencies = [ "prost 0.12.3", ] -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" -dependencies = [ - "bytes", -] - [[package]] name = "protobuf" version = "3.4.0" diff --git a/Cargo.toml b/Cargo.toml index 0aea09e..e9b15bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,6 @@ astroport-multi-test = [ "astroport-token", "astroport-native-coin-registry", "astroport-factory", - "astroport-generator", "astroport-maker", "astroport-pair-stable", "astroport-pair", @@ -69,11 +68,11 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [package.metadata.cargo-machete] -ignored = ["astroport-token", "astroport-native-coin-registry", "astroport-factory", "astroport-generator", "astroport-maker", "astroport-pair-stable", "astroport-pair", "astroport-router", "astroport-staking", "astroport-vesting", "astroport-whitelist"] +ignored = ["astroport-token", "astroport-native-coin-registry", "astroport-factory", "astroport-maker", "astroport-pair-stable", "astroport-pair", "astroport-router", "astroport-staking", "astroport-vesting", "astroport-whitelist"] [dependencies] bip32 = { version = "0.5", features = ["bip39"], optional = true } -cosmwasm-std = { version = "1.5.4", features = ["stargate"] } +cosmwasm-std = { version = "1.5.5", features = ["stargate"] } serde = { version = "1.0.152", default-features = false, features = ["derive"] } thiserror = { version = "1.0.31" } cosmwasm-schema = "1.2.1" @@ -97,7 +96,6 @@ cw20 = { version = "0.15", optional = true } astroport-token = { version = "=1.1.1", optional = true, features = ["library"] } astroport-native-coin-registry = { version = "=1.0.1", optional = true, features = ["library"] } astroport-factory = { version = "=1.8.0", optional = true, features = ["library"] } -astroport-generator = { version = "=2.3.2", optional = true } astroport-maker = { version = "=1.5.0", optional = true } astroport-pair-stable = { version = "=4.0.0", optional = true, features = ["library"] } astroport-pair = { version = "=2.0.1", optional = true } diff --git a/deny.toml b/deny.toml index 9b7bf4e..56a4093 100644 --- a/deny.toml +++ b/deny.toml @@ -37,14 +37,14 @@ exceptions = [ { allow = ["OpenSSL"], name = "ring" }, { allow = ["GPL-3.0"], name = "astroport-incentives" }, { allow = ["GPL-3.0"], name = "astroport-factory" }, - { allow = ["GPL-3.0"], name = "astroport-generator" }, { allow = ["GPL-3.0"], name = "astroport-maker" }, { allow = ["GPL-3.0"], name = "astroport-pair" }, { allow = ["GPL-3.0"], name = "astroport-pair-concentrated" }, { allow = ["GPL-3.0"], name = "astroport-pair-stable" }, { allow = ["GPL-3.0"], name = "astroport-pcl-common" }, { allow = ["GPL-3.0"], name = "astroport-router" }, - { allow = ["GPL-3.0"], name = "astroport-vesting" } + { allow = ["GPL-3.0"], name = "astroport-vesting" }, + { allow = ["GPL-3.0"], name = "astroport-staking" } ] [[licenses.clarify]] diff --git a/src/astroport/robot.rs b/src/astroport/robot.rs index 76979a8..5088d1b 100644 --- a/src/astroport/robot.rs +++ b/src/astroport/robot.rs @@ -438,9 +438,8 @@ mod tests { use super::AstroportTestRobot; use crate::traits::CwItRunner; use crate::{ - astroport::utils::{cw20_info, native_info, AstroportContracts}, - robot::TestRobot, - ContractMap, OwnedTestRunner, TestRunner, + astroport::utils::AstroportContracts, robot::TestRobot, ContractMap, OwnedTestRunner, + TestRunner, }; use cosmwasm_std::Addr; @@ -583,7 +582,7 @@ mod tests { let asset_infos = get_asset_infos(asset_info_choice, &contracts.astro_token.address); - let (pair_addr, lp_token_addr, lp_token_denom) = robot.create_astroport_pair( + let (pair_addr, _lp_token_addr, lp_token_denom) = robot.create_astroport_pair( pair_type.clone(), &asset_infos, init_params, @@ -635,7 +634,7 @@ mod tests { let asset_infos = get_asset_infos(asset_info_choice, &contracts.astro_token.address); let initial_liquidity = Some(&[420420u128, 696969u128]); - let (pair_addr, _lp_token_addr, lp_token_denom) = robot.create_astroport_pair( + let (pair_addr, _lp_token_addr, _lp_token_denom) = robot.create_astroport_pair( pair_type, &asset_infos, init_params, diff --git a/src/astroport/utils.rs b/src/astroport/utils.rs index 45c7fff..91822ed 100644 --- a/src/astroport/utils.rs +++ b/src/astroport/utils.rs @@ -5,31 +5,28 @@ use crate::{ContractMap, ContractType, TestRunner}; use astroport::asset::{Asset, AssetInfo}; use astroport::maker::InstantiateMsg as MakerInstantiateMsg; use astroport::native_coin_registry::InstantiateMsg as CoinRegistryInstantiateMsg; +use astroport::router::InstantiateMsg as RouterInstantiateMsg; +use astroport::token::InstantiateMsg as AstroTokenInstantiateMsg; +use astroport::vesting::{ + Cw20HookMsg as VestingHookMsg, InstantiateMsg as VestingInstantiateMsg, VestingAccount, + VestingSchedule, VestingSchedulePoint, +}; use astroport_v5::asset::AssetInfo as AssetInfoV5; use astroport_v5::factory::{ ExecuteMsg as AstroportFactoryExecuteMsg, InstantiateMsg as AstroportFactoryInstantiateMsg, PairConfig, PairType, }; use astroport_v5::incentives::InstantiateMsg as IncentivesInstantiateMsg; +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{to_json_binary, Addr, Binary, Coin, Event, Uint128, Uint64}; +use cw20::{BalanceResponse, Cw20Coin, Cw20ExecuteMsg, Cw20QueryMsg, MinterResponse}; +use osmosis_std::types::cosmos::bank::v1beta1::QueryBalanceRequest; use osmosis_std::types::cosmos::base::v1beta1::Coin as OsmosisCoin; use osmosis_std::types::osmosis::tokenfactory::v1beta1::{ MsgCreateDenom, MsgCreateDenomResponse, MsgMint, MsgMintResponse, }; -use test_tube::ExecuteResponse; -// use astroport_v5::tokenfactory_tracker::InstantiateMsg as TrackerInstantiateMsg; -use osmosis_std::types::cosmos::bank::v1beta1::QueryBalanceRequest; use std::collections::HashMap; - -// use astroport::liquidity_manager::InstantiateMsg as LiquidityManagerInstantiateMsg; -use astroport::router::InstantiateMsg as RouterInstantiateMsg; -use astroport::token::InstantiateMsg as AstroTokenInstantiateMsg; -use astroport::vesting::{ - Cw20HookMsg as VestingHookMsg, InstantiateMsg as VestingInstantiateMsg, VestingAccount, - VestingSchedule, VestingSchedulePoint, -}; -use cosmwasm_schema::cw_serde; -use cosmwasm_std::{to_json_binary, Addr, Binary, Coin, Event, Uint128, Uint64}; -use cw20::{BalanceResponse, Cw20Coin, Cw20ExecuteMsg, Cw20QueryMsg, MinterResponse}; +use test_tube::ExecuteResponse; use test_tube::{Account, Bank, Module, Runner, SigningAccount, Wasm}; pub fn astroport_asset_info_to_astroport_v5_asset_info( @@ -47,15 +44,11 @@ pub const ASTROPORT_CONTRACT_NAMES: [&str; 11] = [ "astroport_token", "astroport_native_coin_registry", "astroport_factory", - // "astroport_generator", "astroport_maker", "astroport_pair_stable", "astroport_pair", "astroport_router", - // "astroport_staking", "astroport_vesting", - // "astroport_whitelist", - // "astroport_liquidity_manager", "astroport_pair_concentrated", "astroport_incentives", "astroport_tokenfactory_tracker", @@ -671,8 +664,6 @@ pub fn get_astroport_multitest_contracts() -> HashMap { ); contract_wrappers.extend(create_contract_wrappers_with_reply!( - // "astroport_generator", - // "astroport_staking", "astroport_factory", "astroport_pair_stable", "astroport_pair" @@ -715,7 +706,7 @@ pub fn get_astroport_multitest_contracts() -> HashMap { mod tests { use astroport::asset::{Asset, AssetInfo}; use cosmwasm_std::{Addr, Coin, Decimal, Uint128}; - use cw20::{AllowanceResponse, BalanceResponse, Cw20ExecuteMsg, Cw20QueryMsg}; + use cw20::{AllowanceResponse, Cw20ExecuteMsg, Cw20QueryMsg}; use osmosis_std::types::cosmos::bank::v1beta1::QueryAllBalancesRequest; use osmosis_std::types::cosmos::bank::v1beta1::QueryBalanceRequest; use test_tube::{Account, Bank, Module, Wasm}; @@ -742,8 +733,8 @@ mod tests { #[cfg(feature = "chain-download")] use { - super::get_wasm_path, crate::artifact::Artifact, crate::artifact::ChainArtifact, - crate::ContractType, std::collections::HashMap, + super::get_wasm_path, crate::artifact::ChainArtifact, crate::ContractType, + std::collections::HashMap, }; #[cfg(feature = "rpc-runner")] @@ -822,7 +813,7 @@ mod tests { #[cfg(feature = "chain-download")] /// Get artifacts from Neutron testnet fn get_neutron_testnet_artifacts() -> HashMap { - let mut artifacts = NEUTRON_CONTRACT_ADDRESSES + let artifacts = NEUTRON_CONTRACT_ADDRESSES .iter() .map(|(name, chain_artifact)| { (