diff --git a/contracts/tgrade-valset/Cargo.toml b/contracts/tgrade-valset/Cargo.toml index 917e798b..e2215022 100644 --- a/contracts/tgrade-valset/Cargo.toml +++ b/contracts/tgrade-valset/Cargo.toml @@ -42,7 +42,7 @@ protobuf = { version = "2", features = ["with-bytes"] } [dev-dependencies] cosmwasm-schema = { version = "1.0.0-beta" } -cw-multi-test = { version = "0.10.0" } +cw-multi-test = "0.10.0" tg4-engagement = { path = "../tg4-engagement", version = "0.5.0-alpha" } tg4-stake = { path = "../tg4-stake", version = "0.5.0-alpha" } # we enable multitest feature only for tests @@ -50,3 +50,4 @@ tg-bindings-test = { path = "../../packages/bindings-test", version = "0.5.0-alp derivative = "2" anyhow = "1" assert_matches = "1.5" + diff --git a/contracts/tgrade-valset/src/contract.rs b/contracts/tgrade-valset/src/contract.rs index 53332266..492eec4e 100644 --- a/contracts/tgrade-valset/src/contract.rs +++ b/contracts/tgrade-valset/src/contract.rs @@ -21,7 +21,7 @@ use tg_utils::Duration; use crate::error::ContractError; use crate::msg::{ - ConfigResponse, EpochResponse, ExecuteMsg, InstantiateMsg, JailingPeriod, + ConfigResponse, EpochResponse, ExecuteMsg, InstantiateMsg, InstantiateResponse, JailingPeriod, ListActiveValidatorsResponse, ListValidatorResponse, OperatorResponse, QueryMsg, RewardsDistribution, RewardsInstantiateMsg, ValidatorMetadata, ValidatorResponse, }; @@ -603,14 +603,18 @@ fn calculate_diff( } #[cfg_attr(not(feature = "library"), entry_point)] -pub fn reply(deps: DepsMut, _env: Env, msg: Reply) -> Result { +pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result { match msg.id { - REWARDS_INIT_REPLY_ID => rewards_instantiate_reply(deps, msg), + REWARDS_INIT_REPLY_ID => rewards_instantiate_reply(deps, env, msg), _ => Err(ContractError::UnrecognisedReply(msg.id)), } } -pub fn rewards_instantiate_reply(deps: DepsMut, msg: Reply) -> Result { +pub fn rewards_instantiate_reply( + deps: DepsMut, + env: Env, + msg: Reply, +) -> Result { let id = msg.id; let res: MsgInstantiateContractResponse = Message::parse_from_bytes( msg.result @@ -634,9 +638,18 @@ pub fn rewards_instantiate_reply(deps: DepsMut, msg: Reply) -> Result