Skip to content

Commit

Permalink
Merge pull request #177 from confio/165-deprecate-ensure-from-older-v…
Browse files Browse the repository at this point in the history
…ersion

Deprecate `ensure_from_older_version`
  • Loading branch information
ueco-jb committed Sep 2, 2022
2 parents fa6305d + 20cca45 commit 001d45f
Show file tree
Hide file tree
Showing 25 changed files with 82 additions and 181 deletions.
33 changes: 18 additions & 15 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions contracts/tg4-engagement/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ library = []

[dependencies]
cosmwasm-std = "1.0.0"
cw-controllers = "0.13.4"
cw-storage-plus = "0.13.4"
cw-utils = "0.13.4"
cw2 = "0.13.4"
cw-controllers = "0.14.0"
cw-storage-plus = "0.14.0"
cw-utils = "0.14.0"
cw2 = "0.14.0"
tg-utils = { version = "0.13.0", path = "../../packages/utils" }
tg-bindings = { version = "0.13.0", path = "../../packages/bindings" }
tg4 = { path = "../../packages/tg4", version = "0.13.0" }
Expand All @@ -35,6 +35,6 @@ thiserror = "1.0.21"
[dev-dependencies]
anyhow = "1"
cosmwasm-schema = "1.0.0"
cw-multi-test = "0.13.4"
cw-multi-test = "0.14.0"
derivative = "2"
tg-bindings-test = { version = "0.13.0", path = "../../packages/bindings-test" }
7 changes: 2 additions & 5 deletions contracts/tg4-engagement/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cosmwasm_std::{
};
use cw2::set_contract_version;
use cw_storage_plus::Bound;
use cw_utils::maybe_addr;
use cw_utils::{ensure_from_older_version, maybe_addr};
use tg4::{
HooksResponse, Member, MemberChangedHookMsg, MemberDiff, MemberInfo, MemberListResponse,
MemberResponse, TotalPointsResponse,
Expand All @@ -22,10 +22,7 @@ use crate::state::{
SHARES_SHIFT, SLASHERS, WITHDRAW_ADJUSTMENT,
};
use tg_bindings::{request_privileges, Privilege, PrivilegeChangeMsg, TgradeMsg, TgradeQuery};
use tg_utils::{
ensure_from_older_version, members, validate_portion, Duration, ADMIN, HOOKS, PREAUTH_HOOKS,
TOTAL,
};
use tg_utils::{members, validate_portion, Duration, ADMIN, HOOKS, PREAUTH_HOOKS, TOTAL};

pub type Response = cosmwasm_std::Response<TgradeMsg>;
pub type SubMsg = cosmwasm_std::SubMsg<TgradeMsg>;
Expand Down
5 changes: 2 additions & 3 deletions contracts/tg4-engagement/src/multitest/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ impl SuiteBuilder {
denom: denom.clone(),
amount: amount.into(),
recipient: addr.to_string(),
})
.into(),
}),
)?;
}

Expand Down Expand Up @@ -267,7 +266,7 @@ impl Suite {
)
}

pub fn is_slasher(&mut self, addr: &str) -> Result<bool, ContractError> {
pub fn is_slasher(&self, addr: &str) -> Result<bool, ContractError> {
let is_slasher: bool = self.app.wrap().query_wasm_smart(
self.contract.clone(),
&QueryMsg::IsSlasher {
Expand Down
10 changes: 5 additions & 5 deletions contracts/tg4-group/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ library = []

[dependencies]
cosmwasm-std = "1.0.0"
cw-utils = "0.13.4"
cw2 = "0.13.4"
cw4 = "0.13.4"
cw-controllers = "0.13.4"
cw-storage-plus = "0.13.4"
cw-utils = "0.14.0"
cw2 = "0.14.0"
cw4 = "0.14.0"
cw-controllers = "0.14.0"
cw-storage-plus = "0.14.0"
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
tg4 = { version = "0.13.0", path = "../../packages/tg4" }
Expand Down
10 changes: 5 additions & 5 deletions contracts/tg4-mixer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ library = []

[dependencies]
cosmwasm-std = "1.0.0"
cw-utils = "0.13.4"
cw2 = "0.13.4"
cw20 = "0.13.4"
cw-storage-plus = "0.13.4"
cw-utils = "0.14.0"
cw2 = "0.14.0"
cw20 = "0.14.0"
cw-storage-plus = "0.14.0"
integer-sqrt = "0.1.5"
rust_decimal = { version = "1.16", default-features = false, features = ["maths"] }
rust_decimal_macros = { version = "1.16", default-features = false }
Expand All @@ -41,7 +41,7 @@ tg-bindings = { path = "../../packages/bindings", version = "0.13.0" }
cosmwasm-schema = "1.0.0"
# bench dependencies
cosmwasm-vm = { version = "1.0.0" }
cw-multi-test = "0.13.4"
cw-multi-test = "0.14.0"
tg4-engagement = { path = "../tg4-engagement", version = "0.13.0", features = ["library"] }
tg4-stake = { path = "../tg4-stake", version = "0.13.0", features = ["library"] }

Expand Down
5 changes: 2 additions & 3 deletions contracts/tg4-mixer/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ use cosmwasm_std::{

use cw2::set_contract_version;
use cw_storage_plus::Bound;
use cw_utils::maybe_addr;
use cw_utils::{ensure_from_older_version, maybe_addr};

use tg_bindings::{TgradeMsg, TgradeQuery};
use tg_utils::{
ensure_from_older_version, validate_portion, SlashMsg, HOOKS, PREAUTH_HOOKS, PREAUTH_SLASHING,
SLASHERS, TOTAL,
validate_portion, SlashMsg, HOOKS, PREAUTH_HOOKS, PREAUTH_SLASHING, SLASHERS, TOTAL,
};

use tg4::{
Expand Down
8 changes: 4 additions & 4 deletions contracts/tg4-stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ library = []

[dependencies]
cosmwasm-std = "1.0.0"
cw-utils = "0.13.4"
cw2 = "0.13.4"
cw-controllers = "0.13.4"
cw-storage-plus = "0.13.4"
cw-utils = "0.14.0"
cw2 = "0.14.0"
cw-controllers = "0.14.0"
cw-storage-plus = "0.14.0"
itertools = "0.10"
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions contracts/tg4-stake/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::ops::Sub;

use cw2::set_contract_version;
use cw_storage_plus::Bound;
use cw_utils::maybe_addr;
use cw_utils::{ensure_from_older_version, maybe_addr};
use tg4::{
HooksResponse, Member, MemberChangedHookMsg, MemberDiff, MemberInfo, MemberListResponse,
MemberResponse, TotalPointsResponse,
Expand All @@ -18,8 +18,8 @@ use tg_bindings::{
request_privileges, Privilege, PrivilegeChangeMsg, TgradeMsg, TgradeQuery, TgradeSudoMsg,
};
use tg_utils::{
ensure_from_older_version, members, validate_portion, Duration, ADMIN, HOOKS, PREAUTH_HOOKS,
PREAUTH_SLASHING, SLASHERS, TOTAL,
members, validate_portion, Duration, ADMIN, HOOKS, PREAUTH_HOOKS, PREAUTH_SLASHING, SLASHERS,
TOTAL,
};

use crate::error::ContractError;
Expand Down
6 changes: 3 additions & 3 deletions contracts/tgrade-community-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ library = []

[dependencies]
cosmwasm-std = "1.0.0"
cw2 = "0.13.4"
cw-utils = "0.14.0"
cw2 = "0.14.0"
schemars = "0.8.1"
serde = { version = "1", default-features = false, features = ["derive"] }
tg-bindings = { path = "../../packages/bindings", version = "0.13.0" }
tg-utils = { path = "../../packages/utils", version = "0.13.0" }
tg-voting-contract = { version = "0.13.0", path = "../../packages/voting-contract" }
tg3 = { path = "../../packages/tg3", version = "0.13.0" }
tg4-engagement = { path = "../tg4-engagement", version = "0.13.0", features = ["library"] }
Expand All @@ -31,6 +31,6 @@ thiserror = "1"
[dev-dependencies]
anyhow = "1"
cosmwasm-schema = "1.0.0"
cw-multi-test = "0.13.4"
cw-multi-test = "0.14.0"
tg-bindings-test = { path = "../../packages/bindings-test", version = "0.13.0" }
tg4 = { path = "../../packages/tg4", version = "0.13.0" }
2 changes: 1 addition & 1 deletion contracts/tgrade-community-pool/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use cosmwasm_std::{
};

use cw2::set_contract_version;
use cw_utils::ensure_from_older_version;
use tg_bindings::{TgradeMsg, TgradeQuery};
use tg_utils::ensure_from_older_version;

use crate::msg::{ExecuteMsg, InstantiateMsg, Proposal, QueryMsg};
use crate::ContractError;
Expand Down
6 changes: 2 additions & 4 deletions contracts/tgrade-community-pool/src/multitest/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ impl Suite {
denom,
amount: amount.into(),
recipient: owner.to_string(),
})
.into(),
}),
)?;

Ok(())
Expand Down Expand Up @@ -227,8 +226,7 @@ impl Suite {
denom,
amount: amount.into(),
recipient: owner.to_string(),
})
.into(),
}),
)?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion contracts/tgrade-gov-reflect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ backtraces = ["cosmwasm-std/backtraces"]

[dependencies]
cosmwasm-std = "1.0.0"
cw-storage-plus = "0.13.4"
cw-storage-plus = "0.14.0"
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
tg-bindings = { version = "0.13.0", path = "../../packages/bindings" }
Expand Down
8 changes: 4 additions & 4 deletions contracts/tgrade-validator-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ library = []

[dependencies]
cosmwasm-std = "1.0.0"
cw2 = "0.13.4"
cw-utils = "0.14.0"
cw2 = "0.14.0"
schemars = "0.8.1"
serde = { version = "1", default-features = false, features = ["derive"] }
tg-bindings = { path = "../../packages/bindings", version = "0.13.0" }
tg-utils = { path = "../../packages/utils", version = "0.13.0" }
tg-voting-contract = { version = "0.13.0", path = "../../packages/voting-contract" }
tg3 = { path = "../../packages/tg3", version = "0.13.0" }
thiserror = "1"

[dev-dependencies]
anyhow = "1"
cosmwasm-schema = "1.0.0"
cw-multi-test = "0.13.4"
cw-storage-plus = "0.13.4"
cw-multi-test = "0.14.0"
cw-storage-plus = "0.14.0"
tg-bindings-test = { version = "0.13.0", path = "../../packages/bindings-test" }
tg-utils = { version = "0.13.0", path = "../../packages/utils" }
tg-voting-contract = { version = "0.13.0", path = "../../packages/voting-contract" }
Expand Down
2 changes: 1 addition & 1 deletion contracts/tgrade-validator-voting/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use cosmwasm_std::{
};

use cw2::set_contract_version;
use cw_utils::ensure_from_older_version;
use tg_bindings::{
request_privileges, BlockParams, ConsensusParams, EvidenceParams, GovProposal, Privilege,
PrivilegeChangeMsg, TgradeMsg, TgradeQuery, TgradeSudoMsg,
};
use tg_utils::ensure_from_older_version;

use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, ValidatorProposal};
use crate::ContractError;
Expand Down
10 changes: 5 additions & 5 deletions contracts/tgrade-valset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ integration = ["bech32", "cosmwasm-vm"]

[dependencies]
cosmwasm-std = "1.0.0"
cw2 = "0.13.4"
cw-utils = "0.13.4"
cw-controllers = "0.13.4"
cw-storage-plus = "0.13.4"
cw2 = "0.14.0"
cw-utils = "0.14.0"
cw-controllers = "0.14.0"
cw-storage-plus = "0.14.0"
schemars = "0.8"
semver = "1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
Expand All @@ -47,7 +47,7 @@ cosmwasm-vm = { version = "1.0.0", optional = true, default-features = false, fe
anyhow = "1"
assert_matches = "1.5"
cosmwasm-schema = "1.0.0"
cw-multi-test = "0.13.4"
cw-multi-test = "0.14.0"
derivative = "2"
tg4-engagement = { path = "../tg4-engagement", version = "0.13.0" }
tg4-stake = { path = "../tg4-stake", version = "0.13.0" }
Expand Down
Loading

0 comments on commit 001d45f

Please sign in to comment.