Skip to content

Commit

Permalink
Merge pull request #6 from cosmorama/jakub/release-v1-2-1
Browse files Browse the repository at this point in the history
Release v1.2.1
  • Loading branch information
ueco-jb authored Feb 27, 2023
2 parents bf9a885 + c2ee4b4 commit 20ffca3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = ["packages/*", "contracts/*", "tests"]

[workspace.package]
version = "1.2.0"
version = "1.2.1"
edition = "2021"
license = "GPL 3.0"
repository = "https://github.com/cosmorama/wynddex"
Expand Down
28 changes: 16 additions & 12 deletions contracts/factory/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@ use cosmwasm_std::{
attr, entry_point, to_binary, Addr, Binary, CosmosMsg, Decimal, Deps, DepsMut, Env,
MessageInfo, Order, Reply, ReplyOn, Response, StdError, StdResult, SubMsg, WasmMsg,
};
use cw2::set_contract_version;
use cw_utils::ensure_from_older_version;

use wyndex::asset::{addr_opt_validate, AssetInfo};
use wyndex::common::{
claim_ownership, drop_ownership_proposal, propose_new_owner, validate_addresses,
};
use wyndex::factory::{
ConfigResponse, DistributionFlow, ExecuteMsg, FeeInfoResponse, InstantiateMsg, MigrateMsg,
PairConfig, PairType, PairsResponse, PartialDefaultStakeConfig, PartialStakeConfig, QueryMsg,
ROUTE,
};
use wyndex::fee_config::FeeConfig;
use wyndex::stake::UnbondingPeriod;
use wyndex_stake::msg::ExecuteMsg as StakeExecuteMsg;

use crate::error::ContractError;
use crate::querier::query_pair_info;

use crate::state::{
check_asset_infos, pair_key, read_pairs, Config, TmpPairInfo, CONFIG, OWNERSHIP_PROPOSAL,
PAIRS, PAIRS_TO_MIGRATE, PAIR_CONFIGS, STAKING_ADDRESSES, TMP_PAIR_INFO,
};

use cw2::set_contract_version;
use itertools::Itertools;
use std::collections::HashSet;
use wyndex::asset::{addr_opt_validate, AssetInfo};
use wyndex::common::{
claim_ownership, drop_ownership_proposal, propose_new_owner, validate_addresses,
};
use wyndex::factory::{
ConfigResponse, DistributionFlow, ExecuteMsg, FeeInfoResponse, InstantiateMsg, MigrateMsg,
PairConfig, PairType, PairsResponse, PartialDefaultStakeConfig, PartialStakeConfig, QueryMsg,
ROUTE,
};
use wyndex_stake::msg::ExecuteMsg as StakeExecuteMsg;

use cw_placeholder::contract::CONTRACT_NAME as PLACEHOLDER_CONTRACT_NAME;
use wyndex::pair::{ExecuteMsg as PairExecuteMsg, InstantiateMsg as PairInstantiateMsg, PairInfo};
Expand Down Expand Up @@ -783,6 +784,9 @@ pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> Result<Response, Con
)
.unwrap();
}
MigrateMsg::Update() => {
ensure_from_older_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?;
}
};

Ok(Response::new())
Expand Down
11 changes: 6 additions & 5 deletions packages/wyndex/src/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,16 @@ pub enum UpdateAddr {
pub enum MigrateMsg {
/// Used to instantiate from cw-placeholder
Init(InstantiateMsg),
Update(),
}

/// Map which contains a list of all pairs which are able to convert X <> Y assets.
/// Example: given 3 pools (X, Y), (X,Y,Z) and (X,Y,Z,W), the map will contain the following entries
/// (pair addresses):
/// `ROUTE[X][Y] = [(X,Y), (X,Y,Z), (X,Y,Z,W)]`
/// `ROUTE[X][Z] = [(X,Y,Z), (X,Y,Z,W)]`
/// `ROUTE[X][W] = [(X,Y,Z,W)]`
/// ...
/// (pair addresses):
/// `ROUTE[X][Y] = [(X,Y), (X,Y,Z), (X,Y,Z,W)]`
/// `ROUTE[X][Z] = [(X,Y,Z), (X,Y,Z,W)]`
/// `ROUTE[X][W] = [(X,Y,Z,W)]`
/// ...
///
/// Notice that `ROUTE[X][Y] = ROUTE[Y][X]`
pub const ROUTE: Map<(String, String), Vec<Addr>> = Map::new("routes");

0 comments on commit 20ffca3

Please sign in to comment.