Skip to content

Commit

Permalink
fix int-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Feb 1, 2024
1 parent 06df7cc commit 18cbcce
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 520 deletions.
4 changes: 2 additions & 2 deletions contracts/vesting-lp-pcl/examples/vesting-lp_schema.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cosmwasm_schema::write_api;
use vesting_base::msg::{ExecuteMsg, MigrateMsg, QueryMsg};
use vesting_lp::msg::InstantiateMsg;
use vesting_base_pcl::msg::{ExecuteMsg, MigrateMsg, QueryMsg};
use vesting_lp_pcl::msg::InstantiateMsg;

fn main() {
write_api! {
Expand Down
2 changes: 1 addition & 1 deletion contracts/vesting-lp-pcl/src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmwasm_schema::cw_serde;
use astroport::asset::AssetInfo;
use cosmwasm_schema::cw_serde;

/// This structure describes the parameters used for creating a contract.
#[cw_serde]
Expand Down
26 changes: 7 additions & 19 deletions contracts/vesting-lp-pcl/src/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use cosmwasm_std::{coin, coins, to_binary, Addr, StdResult, Timestamp, Uint128};
use cw20::{BalanceResponse, Cw20ExecuteMsg, Cw20QueryMsg, MinterResponse};
use cw_multi_test::{App, ContractWrapper, Executor};
use cw_utils::PaymentError;
use vesting_base::error::ContractError;
use vesting_base::msg::{
use vesting_base_pcl::error::ContractError;
use vesting_base_pcl::msg::{
Cw20HookMsg, ExecuteMsg, ExecuteMsgWithManagers, QueryMsg, QueryMsgHistorical,
QueryMsgWithManagers,
};
use vesting_base::types::{
use vesting_base_pcl::types::{
Config, VestingAccount, VestingAccountResponse, VestingSchedule, VestingSchedulePoint,
};

Expand Down Expand Up @@ -1195,7 +1195,9 @@ fn instantiate_vesting(app: &mut App, cw20_token_instance: &Addr) -> Addr {
let init_msg = InstantiateMsg {
owner: OWNER1.to_string(),
token_info_manager: TOKEN_MANAGER.to_string(),
xyk_vesting_lp_contract: "test".to_string(),
vesting_managers: vec![],
vesting_token: token_asset_info(cw20_token_instance.clone()),
};

let vesting_instance = app
Expand All @@ -1208,17 +1210,6 @@ fn instantiate_vesting(app: &mut App, cw20_token_instance: &Addr) -> Addr {
None,
)
.unwrap();
let set_vesting_token_msg = ExecuteMsg::SetVestingToken {
vesting_token: token_asset_info(cw20_token_instance.clone()),
};
app.execute_contract(
token_manager,
vesting_instance.clone(),
&set_vesting_token_msg,
&[],
)
.unwrap();

let res: Config = app
.wrap()
.query_wasm_smart(vesting_instance.clone(), &QueryMsg::Config {})
Expand Down Expand Up @@ -1249,16 +1240,13 @@ fn instantiate_vesting_remote_chain(app: &mut App) -> Addr {
owner: OWNER1.to_string(),
token_info_manager: TOKEN_MANAGER.to_string(),
vesting_managers: vec![],
vesting_token: native_asset_info(VESTING_TOKEN.to_string()),
xyk_vesting_lp_contract: "test".to_string(),
};

let res = app
.instantiate_contract(vesting_code_id, owner, &init_msg, &[], "Vesting", None)
.unwrap();
let msg = ExecuteMsg::SetVestingToken {
vesting_token: native_asset_info(VESTING_TOKEN.to_string()),
};
app.execute_contract(token_manager, res.clone(), &msg, &[])
.unwrap();
res
}

Expand Down
11 changes: 4 additions & 7 deletions packages/vesting-base-lp/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ use crate::ext_historical::{handle_execute_historical_msg, handle_query_historic
use crate::ext_managed::{handle_execute_managed_msg, handle_query_managed_msg};
use crate::ext_with_managers::{handle_execute_with_managers_msg, handle_query_managers_msg};
use crate::msg::{CallbackMsg, Cw20HookMsg, ExecuteMsg, MigrateMsg, QueryMsg};
use crate::state::{
read_vesting_infos, vesting_info, vesting_state, XYK_TO_CL_MIGRATION_CONFIG,
};
use crate::state::{read_vesting_infos, vesting_info, vesting_state, XYK_TO_CL_MIGRATION_CONFIG};
use crate::state::{CONFIG, OWNERSHIP_PROPOSAL, VESTING_MANAGERS};
use crate::types::{
Config, OrderBy, VestingAccount, VestingAccountResponse,
VestingAccountsResponse, VestingInfo, VestingSchedule, VestingState, XykToClMigrationConfig,
Config, OrderBy, VestingAccount, VestingAccountResponse, VestingAccountsResponse, VestingInfo,
VestingSchedule, VestingState, XykToClMigrationConfig,
};
use astroport::asset::{
addr_opt_validate, native_asset, token_asset_info, AssetInfo, AssetInfoExt, PairInfo,
Expand Down Expand Up @@ -290,7 +288,7 @@ fn execute_migrate_liquidity(
info: MessageInfo,
env: Env,
slippage_tolerance: Option<Decimal>,
user: Option<String>
user: Option<String>,
) -> Result<Response, ContractError> {
let config = CONFIG.load(deps.storage)?;
let migration_config: XykToClMigrationConfig = XYK_TO_CL_MIGRATION_CONFIG.load(deps.storage)?;
Expand Down Expand Up @@ -598,7 +596,6 @@ fn post_migration_vesting_reschedule_callback(

/// Exposes all the queries available in the contract.
pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> StdResult<Binary> {

match msg {
QueryMsg::Config {} => Ok(to_binary(&query_config(deps)?)?),
QueryMsg::VestingAccount { address } => {
Expand Down
4 changes: 1 addition & 3 deletions packages/vesting-base-lp/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::types::{
Config, OrderBy, VestingInfo, VestingState, XykToClMigrationConfig,
};
use crate::types::{Config, OrderBy, VestingInfo, VestingState, XykToClMigrationConfig};
use astroport::common::OwnershipProposal;
use cosmwasm_std::{Addr, Deps, StdResult};
use cw_storage_plus::{Bound, Item, Map, SnapshotItem, SnapshotMap, Strategy};
Expand Down
2 changes: 1 addition & 1 deletion packages/vesting-base-pcl/src/builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::state::{CONFIG, VESTING_MANAGERS};
use crate::types::{Config, Extensions};
use cosmwasm_std::{DepsMut, StdResult};
use astroport::asset::AssetInfo;
use cosmwasm_std::{DepsMut, StdResult};

/// A builder for vesting contracts with different extensions.
#[derive(Default)]
Expand Down
3 changes: 0 additions & 3 deletions packages/vesting-base-pcl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ pub mod types;
pub(crate) mod ext_historical;
pub(crate) mod ext_managed;
pub(crate) mod ext_with_managers;

#[cfg(test)]
mod testing;
Loading

0 comments on commit 18cbcce

Please sign in to comment.