diff --git a/.circleci/config.yml b/.circleci/config.yml index c83fc1946..de0e79fea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ workflows: - contract_cw20_merkle_airdrop - contract_cw1155_base - package_controllers - - package_cw0 + - package_utils - package_cw1 - package_cw2 - package_cw3 @@ -608,10 +608,10 @@ jobs: - target key: cargocache-v2-controllers:1.53.0-{{ checksum "~/project/Cargo.lock" }} - package_cw0: + package_utils: docker: - image: rust:1.53.0 - working_directory: ~/project/packages/cw0 + working_directory: ~/project/packages/utils steps: - checkout: path: ~/project @@ -620,7 +620,7 @@ jobs: command: rustc --version; cargo --version; rustup --version; rustup target list --installed - restore_cache: keys: - - cargocache-v2-cw0:1.53.0-{{ checksum "~/project/Cargo.lock" }} + - cargocache-v2-utils:1.53.0-{{ checksum "~/project/Cargo.lock" }} - run: name: Build library for native target command: cargo build --locked @@ -631,7 +631,7 @@ jobs: paths: - /usr/local/cargo/registry - target - key: cargocache-v2-cw0:1.53.0-{{ checksum "~/project/Cargo.lock" }} + key: cargocache-v2-utils:1.53.0-{{ checksum "~/project/Cargo.lock" }} package_cw1: docker: diff --git a/Cargo.lock b/Cargo.lock index 6b4db2388..295f5ee19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,10 +245,10 @@ version = "0.10.3" dependencies = [ "cosmwasm-std", "cw-storage-plus", - "cw0", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -259,13 +259,13 @@ dependencies = [ "cosmwasm-std", "cosmwasm-storage", "cw-storage-plus", - "cw0", "derivative", "itertools", "prost", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -277,18 +277,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cw0" -version = "0.10.3" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "prost", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "cw1" version = "0.10.3" @@ -306,7 +294,6 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw0", "cw1", "cw1-whitelist", "cw2", @@ -314,6 +301,7 @@ dependencies = [ "semver", "serde", "thiserror", + "utils", ] [[package]] @@ -326,13 +314,13 @@ dependencies = [ "cosmwasm-std", "cw-multi-test", "cw-storage-plus", - "cw0", "cw1", "cw2", "derivative", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -345,13 +333,13 @@ dependencies = [ "cosmwasm-std", "cw-multi-test", "cw-storage-plus", - "cw0", "cw1", "cw2", "derivative", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -360,9 +348,9 @@ version = "0.10.3" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw0", "schemars", "serde", + "utils", ] [[package]] @@ -372,12 +360,12 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw0", "cw1155", "cw2", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -396,9 +384,9 @@ version = "0.10.3" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw0", "schemars", "serde", + "utils", ] [[package]] @@ -408,7 +396,6 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw0", "cw2", "cw20", "hex 0.3.2", @@ -416,6 +403,7 @@ dependencies = [ "serde", "sha2 0.8.2", "thiserror", + "utils", ] [[package]] @@ -425,12 +413,12 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw0", "cw2", "cw20", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -440,7 +428,6 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw0", "cw2", "cw20", "cw20-base", @@ -450,6 +437,7 @@ dependencies = [ "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -460,13 +448,13 @@ dependencies = [ "cosmwasm-std", "cw-multi-test", "cw-storage-plus", - "cw0", "cw2", "cw20", "cw20-base", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -476,12 +464,12 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw0", "cw2", "cw20", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -491,7 +479,6 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw0", "cw2", "cw20", "hex 0.4.3", @@ -500,6 +487,7 @@ dependencies = [ "serde_json", "sha2 0.9.8", "thiserror", + "utils", ] [[package]] @@ -510,13 +498,13 @@ dependencies = [ "cosmwasm-std", "cw-controllers", "cw-storage-plus", - "cw0", "cw2", "cw20", "cw20-base", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -525,9 +513,9 @@ version = "0.10.3" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw0", "schemars", "serde", + "utils", ] [[package]] @@ -538,7 +526,6 @@ dependencies = [ "cosmwasm-std", "cw-multi-test", "cw-storage-plus", - "cw0", "cw2", "cw20", "cw20-base", @@ -546,6 +533,7 @@ dependencies = [ "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -556,7 +544,6 @@ dependencies = [ "cosmwasm-std", "cw-multi-test", "cw-storage-plus", - "cw0", "cw2", "cw3", "cw4", @@ -564,6 +551,7 @@ dependencies = [ "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -585,12 +573,12 @@ dependencies = [ "cosmwasm-std", "cw-controllers", "cw-storage-plus", - "cw0", "cw2", "cw4", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -601,13 +589,13 @@ dependencies = [ "cosmwasm-std", "cw-controllers", "cw-storage-plus", - "cw0", "cw2", "cw20", "cw4", "schemars", "serde", "thiserror", + "utils", ] [[package]] @@ -1179,6 +1167,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +[[package]] +name = "utils" +version = "0.10.3" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "prost", + "schemars", + "serde", + "thiserror", +] + [[package]] name = "version_check" version = "0.9.3" diff --git a/README.md b/README.md index 8918df40c..3f9098648 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ | Specification | Crates.io | Docs | | ---------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------| -| cw0 | [![cw0 on crates.io](https://img.shields.io/crates/v/cw0.svg)](https://crates.io/crates/cw0) | [![Docs](https://docs.rs/cw0/badge.svg)](https://docs.rs/cw0) | | cw1 | [![cw1 on crates.io](https://img.shields.io/crates/v/cw1.svg)](https://crates.io/crates/cw1) | [![Docs](https://docs.rs/cw1/badge.svg)](https://docs.rs/cw1) | | cw2 | [![cw2 on crates.io](https://img.shields.io/crates/v/cw2.svg)](https://crates.io/crates/cw2) | [![Docs](https://docs.rs/cw2/badge.svg)](https://docs.rs/cw2) | | cw3 | [![cw3 on crates.io](https://img.shields.io/crates/v/cw3.svg)](https://crates.io/crates/cw3) | [![Docs](https://docs.rs/cw3/badge.svg)](https://docs.rs/cw3) | @@ -17,6 +16,7 @@ | cw-controllers | [![cw-controllers on crates.io](https://img.shields.io/crates/v/cw-controllers.svg)](https://crates.io/crates/cw-controllers) | [![Docs](https://docs.rs/cw-controllers/badge.svg)](https://docs.rs/cw-controllers) | | cw-multi-test | [![cw-multi-test on crates.io](https://img.shields.io/crates/v/cw-multi-test.svg)](https://crates.io/crates/cw-multi-test) | [![Docs](https://docs.rs/cw-multi-test/badge.svg)](https://docs.rs/cw-multi-test) | | cw-storage-plus | [![cw-storage-plus on crates.io](https://img.shields.io/crates/v/cw-storage-plus.svg)](https://crates.io/crates/cw-storage-plus) | [![Docs](https://docs.rs/cw-storage-plus/badge.svg)](https://docs.rs/cw-storage-plus) | +| utils | [![utils on crates.io](https://img.shields.io/crates/v/utils.svg)](https://crates.io/crates/utils) | [![Docs](https://docs.rs/utils/badge.svg)](https://docs.rs/utils) | | Contracts | Download | Docs | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------| diff --git a/contracts/cw1-subkeys/Cargo.toml b/contracts/cw1-subkeys/Cargo.toml index 1924b6553..37af477d8 100644 --- a/contracts/cw1-subkeys/Cargo.toml +++ b/contracts/cw1-subkeys/Cargo.toml @@ -19,7 +19,7 @@ library = [] test-utils = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw1 = { path = "../../packages/cw1", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw1-whitelist = { path = "../cw1-whitelist", version = "0.10.3", features = ["library"] } diff --git a/contracts/cw1-subkeys/src/contract.rs b/contracts/cw1-subkeys/src/contract.rs index b4852225d..f20a65ec6 100644 --- a/contracts/cw1-subkeys/src/contract.rs +++ b/contracts/cw1-subkeys/src/contract.rs @@ -8,7 +8,6 @@ use cosmwasm_std::{ ensure, ensure_ne, to_binary, BankMsg, Binary, Coin, CosmosMsg, Deps, DepsMut, DistributionMsg, Empty, Env, MessageInfo, Order, Response, StakingMsg, StdResult, }; -use cw0::Expiration; use cw1::CanExecuteResponse; use cw1_whitelist::{ contract::{ @@ -21,6 +20,7 @@ use cw1_whitelist::{ use cw2::{get_contract_version, set_contract_version}; use cw_storage_plus::Bound; use semver::Version; +use utils::Expiration; use crate::error::ContractError; use crate::msg::{ @@ -479,9 +479,9 @@ mod tests { }; use cosmwasm_std::{coin, coins, OwnedDeps, StakingMsg, SubMsg, Timestamp}; - use cw0::NativeBalance; use cw1_whitelist::msg::AdminListResponse; use cw2::{get_contract_version, ContractVersion}; + use utils::NativeBalance; use crate::state::Permissions; diff --git a/contracts/cw1-subkeys/src/error.rs b/contracts/cw1-subkeys/src/error.rs index 203587e43..f79605f28 100644 --- a/contracts/cw1-subkeys/src/error.rs +++ b/contracts/cw1-subkeys/src/error.rs @@ -1,6 +1,6 @@ use cosmwasm_std::StdError; -use cw0::Expiration; use thiserror::Error; +use utils::Expiration; #[derive(Error, Debug, PartialEq)] pub enum ContractError { diff --git a/contracts/cw1-subkeys/src/msg.rs b/contracts/cw1-subkeys/src/msg.rs index 2d806a2da..a7ddf89dd 100644 --- a/contracts/cw1-subkeys/src/msg.rs +++ b/contracts/cw1-subkeys/src/msg.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; use cosmwasm_std::{Coin, CosmosMsg, Empty}; -use cw0::{Expiration, NativeBalance}; +use utils::{Expiration, NativeBalance}; use crate::state::Permissions; @@ -112,7 +112,7 @@ impl AllowanceInfo { /// Example: /// /// ``` - /// # use cw0::{Expiration, NativeBalance}; + /// # use utils::{Expiration, NativeBalance}; /// # use cw1_subkeys::msg::AllowanceInfo; /// # use cosmwasm_std::coin; /// diff --git a/contracts/cw1-subkeys/src/state.rs b/contracts/cw1-subkeys/src/state.rs index 38994a293..007354c17 100644 --- a/contracts/cw1-subkeys/src/state.rs +++ b/contracts/cw1-subkeys/src/state.rs @@ -3,8 +3,8 @@ use serde::{Deserialize, Serialize}; use std::fmt; use cosmwasm_std::Addr; -use cw0::{Expiration, NativeBalance}; use cw_storage_plus::Map; +use utils::{Expiration, NativeBalance}; // Permissions struct defines users message execution permissions. // Could have implemented permissions for each cosmos module(StakingPermissions, GovPermissions etc...) @@ -46,7 +46,7 @@ impl Allowance { /// Example: /// /// ``` - /// # use cw0::{Expiration, NativeBalance}; + /// # use utils::{Expiration, NativeBalance}; /// # use cw1_subkeys::state::Allowance; /// # use cosmwasm_std::coin; /// diff --git a/contracts/cw1-whitelist-ng/Cargo.toml b/contracts/cw1-whitelist-ng/Cargo.toml index bf670e367..820636d96 100644 --- a/contracts/cw1-whitelist-ng/Cargo.toml +++ b/contracts/cw1-whitelist-ng/Cargo.toml @@ -22,7 +22,7 @@ querier = ["library"] multitest = ["cw-multi-test", "anyhow"] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw1 = { path = "../../packages/cw1", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta", features = ["staking"] } diff --git a/contracts/cw1-whitelist/Cargo.toml b/contracts/cw1-whitelist/Cargo.toml index fd75e6a1f..524e9e3fc 100644 --- a/contracts/cw1-whitelist/Cargo.toml +++ b/contracts/cw1-whitelist/Cargo.toml @@ -19,7 +19,7 @@ library = [] test-utils = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw1 = { path = "../../packages/cw1", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta", features = ["staking"] } diff --git a/contracts/cw1155-base/Cargo.toml b/contracts/cw1155-base/Cargo.toml index dcbb7408c..3dd077bbd 100644 --- a/contracts/cw1155-base/Cargo.toml +++ b/contracts/cw1155-base/Cargo.toml @@ -18,7 +18,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw1155 = { path = "../../packages/cw1155", version = "0.10.3" } cw-storage-plus = { path = "../../packages/storage-plus", version = "0.10.3" } diff --git a/contracts/cw1155-base/src/contract.rs b/contracts/cw1155-base/src/contract.rs index a684503a6..d52940a7a 100644 --- a/contracts/cw1155-base/src/contract.rs +++ b/contracts/cw1155-base/src/contract.rs @@ -5,13 +5,13 @@ use cosmwasm_std::{ }; use cw_storage_plus::Bound; -use cw0::{maybe_addr, Event}; use cw1155::{ ApproveAllEvent, ApprovedForAllResponse, BalanceResponse, BatchBalanceResponse, Cw1155BatchReceiveMsg, Cw1155ExecuteMsg, Cw1155QueryMsg, Cw1155ReceiveMsg, Expiration, IsApprovedForAllResponse, TokenId, TokenInfoResponse, TokensResponse, TransferEvent, }; use cw2::set_contract_version; +use utils::{maybe_addr, Event}; use crate::error::ContractError; use crate::msg::InstantiateMsg; diff --git a/contracts/cw20-atomic-swap/Cargo.toml b/contracts/cw20-atomic-swap/Cargo.toml index b0fddaeb1..99f82105a 100644 --- a/contracts/cw20-atomic-swap/Cargo.toml +++ b/contracts/cw20-atomic-swap/Cargo.toml @@ -15,7 +15,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta" } diff --git a/contracts/cw20-base/Cargo.toml b/contracts/cw20-base/Cargo.toml index 84b6ff16b..b0c3a6785 100644 --- a/contracts/cw20-base/Cargo.toml +++ b/contracts/cw20-base/Cargo.toml @@ -18,7 +18,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } cw-storage-plus = { path = "../../packages/storage-plus", version = "0.10.3" } diff --git a/contracts/cw20-bonding/Cargo.toml b/contracts/cw20-bonding/Cargo.toml index 062f9720b..257d64fe5 100644 --- a/contracts/cw20-bonding/Cargo.toml +++ b/contracts/cw20-bonding/Cargo.toml @@ -20,7 +20,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } cw20-base = { path = "../../contracts/cw20-base", version = "0.10.3", features = ["library"] } diff --git a/contracts/cw20-bonding/src/contract.rs b/contracts/cw20-bonding/src/contract.rs index 389400c81..01a5b8b62 100644 --- a/contracts/cw20-bonding/src/contract.rs +++ b/contracts/cw20-bonding/src/contract.rs @@ -19,7 +19,7 @@ use crate::curves::DecimalPlaces; use crate::error::ContractError; use crate::msg::{CurveFn, CurveInfoResponse, ExecuteMsg, InstantiateMsg, QueryMsg}; use crate::state::{CurveState, CURVE_STATE, CURVE_TYPE}; -use cw0::{must_pay, nonpayable}; +use utils::{must_pay, nonpayable}; // version info for migration info const CONTRACT_NAME: &str = "crates.io:cw20-bonding"; @@ -314,7 +314,7 @@ mod tests { use crate::msg::CurveType; use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; use cosmwasm_std::{coin, Decimal, OverflowError, OverflowOperation, StdError, SubMsg}; - use cw0::PaymentError; + use utils::PaymentError; const DENOM: &str = "satoshi"; const CREATOR: &str = "creator"; diff --git a/contracts/cw20-bonding/src/error.rs b/contracts/cw20-bonding/src/error.rs index 5888e197e..dd2d577bf 100644 --- a/contracts/cw20-bonding/src/error.rs +++ b/contracts/cw20-bonding/src/error.rs @@ -1,6 +1,6 @@ use cosmwasm_std::StdError; -use cw0::PaymentError; use thiserror::Error; +use utils::PaymentError; #[derive(Error, Debug, PartialEq)] pub enum ContractError { diff --git a/contracts/cw20-escrow/Cargo.toml b/contracts/cw20-escrow/Cargo.toml index c7fc89e60..73ad16006 100644 --- a/contracts/cw20-escrow/Cargo.toml +++ b/contracts/cw20-escrow/Cargo.toml @@ -18,7 +18,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta" } diff --git a/contracts/cw20-ics20/Cargo.toml b/contracts/cw20-ics20/Cargo.toml index 4ad96c674..91b6f38f0 100644 --- a/contracts/cw20-ics20/Cargo.toml +++ b/contracts/cw20-ics20/Cargo.toml @@ -18,7 +18,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta", features = ["stargate"] } diff --git a/contracts/cw20-ics20/src/contract.rs b/contracts/cw20-ics20/src/contract.rs index a8ac840e0..a8834eb96 100644 --- a/contracts/cw20-ics20/src/contract.rs +++ b/contracts/cw20-ics20/src/contract.rs @@ -16,7 +16,7 @@ use crate::msg::{ TransferMsg, }; use crate::state::{Config, CHANNEL_INFO, CHANNEL_STATE, CONFIG}; -use cw0::{nonpayable, one_coin}; +use utils::{nonpayable, one_coin}; // version info for migration info const CONTRACT_NAME: &str = "crates.io:cw20-ics20"; @@ -193,7 +193,7 @@ mod test { use cosmwasm_std::testing::{mock_env, mock_info}; use cosmwasm_std::{coin, coins, CosmosMsg, IbcMsg, StdError, Uint128}; - use cw0::PaymentError; + use utils::PaymentError; #[test] fn setup_and_query() { diff --git a/contracts/cw20-ics20/src/error.rs b/contracts/cw20-ics20/src/error.rs index d2745f093..64082ef3c 100644 --- a/contracts/cw20-ics20/src/error.rs +++ b/contracts/cw20-ics20/src/error.rs @@ -3,7 +3,7 @@ use std::string::FromUtf8Error; use thiserror::Error; use cosmwasm_std::StdError; -use cw0::PaymentError; +use utils::PaymentError; /// Never is a placeholder to ensure we don't return any errors #[derive(Error, Debug)] diff --git a/contracts/cw20-merkle-airdrop/Cargo.toml b/contracts/cw20-merkle-airdrop/Cargo.toml index 9bbefed3b..3fd176381 100644 --- a/contracts/cw20-merkle-airdrop/Cargo.toml +++ b/contracts/cw20-merkle-airdrop/Cargo.toml @@ -19,7 +19,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta" } diff --git a/contracts/cw20-staking/Cargo.toml b/contracts/cw20-staking/Cargo.toml index aa37b3ff6..75ba91acc 100644 --- a/contracts/cw20-staking/Cargo.toml +++ b/contracts/cw20-staking/Cargo.toml @@ -20,7 +20,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } cw-controllers = { path = "../../packages/controllers", version = "0.10.3" } diff --git a/contracts/cw20-staking/src/contract.rs b/contracts/cw20-staking/src/contract.rs index 6c69fce63..672162155 100644 --- a/contracts/cw20-staking/src/contract.rs +++ b/contracts/cw20-staking/src/contract.rs @@ -438,8 +438,8 @@ mod tests { coins, Coin, CosmosMsg, Decimal, FullDelegation, OverflowError, OverflowOperation, Validator, }; - use cw0::{Duration, DAY, HOUR, WEEK}; use cw_controllers::Claim; + use utils::{Duration, DAY, HOUR, WEEK}; fn sample_validator(addr: &str) -> Validator { Validator { diff --git a/contracts/cw20-staking/src/msg.rs b/contracts/cw20-staking/src/msg.rs index c3fe3c443..facf326ed 100644 --- a/contracts/cw20-staking/src/msg.rs +++ b/contracts/cw20-staking/src/msg.rs @@ -2,9 +2,9 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{Binary, Coin, Decimal, Uint128}; -use cw0::Duration; use cw20::Expiration; pub use cw_controllers::ClaimsResponse; +use utils::Duration; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct InstantiateMsg { diff --git a/contracts/cw20-staking/src/state.rs b/contracts/cw20-staking/src/state.rs index 2b5cd04ab..3e23fdca3 100644 --- a/contracts/cw20-staking/src/state.rs +++ b/contracts/cw20-staking/src/state.rs @@ -2,9 +2,9 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{Addr, Decimal, Uint128}; -use cw0::Duration; use cw_controllers::Claims; use cw_storage_plus::Item; +use utils::Duration; pub const CLAIMS: Claims = Claims::new("claims"); diff --git a/contracts/cw3-fixed-multisig/Cargo.toml b/contracts/cw3-fixed-multisig/Cargo.toml index 444188ce1..2c5a917da 100644 --- a/contracts/cw3-fixed-multisig/Cargo.toml +++ b/contracts/cw3-fixed-multisig/Cargo.toml @@ -18,7 +18,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw3 = { path = "../../packages/cw3", version = "0.10.3" } cw-storage-plus = { path = "../../packages/storage-plus", version = "0.10.3" } diff --git a/contracts/cw3-fixed-multisig/src/contract.rs b/contracts/cw3-fixed-multisig/src/contract.rs index b9c14e865..287946334 100644 --- a/contracts/cw3-fixed-multisig/src/contract.rs +++ b/contracts/cw3-fixed-multisig/src/contract.rs @@ -7,13 +7,13 @@ use cosmwasm_std::{ Response, StdResult, }; -use cw0::Expiration; use cw2::set_contract_version; use cw3::{ ProposalListResponse, ProposalResponse, Status, ThresholdResponse, Vote, VoteInfo, VoteListResponse, VoteResponse, VoterDetail, VoterListResponse, VoterResponse, }; use cw_storage_plus::Bound; +use utils::Expiration; use crate::error::ContractError; use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -436,8 +436,8 @@ mod tests { use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; use cosmwasm_std::{coin, from_binary, BankMsg}; - use cw0::Duration; use cw2::{get_contract_version, ContractVersion}; + use utils::Duration; use crate::msg::Voter; diff --git a/contracts/cw3-fixed-multisig/src/integration_tests.rs b/contracts/cw3-fixed-multisig/src/integration_tests.rs index be6d964a7..6da82182d 100644 --- a/contracts/cw3-fixed-multisig/src/integration_tests.rs +++ b/contracts/cw3-fixed-multisig/src/integration_tests.rs @@ -3,11 +3,11 @@ use crate::contract::{execute, instantiate, query}; use crate::msg::{ExecuteMsg, InstantiateMsg, Voter}; use cosmwasm_std::{to_binary, Addr, Empty, Uint128, WasmMsg}; -use cw0::Duration; use cw20::{BalanceResponse, MinterResponse}; use cw20_base::msg::QueryMsg; use cw3::Vote; use cw_multi_test::{App, Contract, ContractWrapper, Executor}; +use utils::Duration; fn mock_app() -> App { App::default() diff --git a/contracts/cw3-fixed-multisig/src/msg.rs b/contracts/cw3-fixed-multisig/src/msg.rs index a42be8399..41aae35eb 100644 --- a/contracts/cw3-fixed-multisig/src/msg.rs +++ b/contracts/cw3-fixed-multisig/src/msg.rs @@ -2,8 +2,8 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{CosmosMsg, Empty}; -use cw0::{Duration, Expiration}; use cw3::Vote; +use utils::{Duration, Expiration}; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct InstantiateMsg { diff --git a/contracts/cw3-fixed-multisig/src/state.rs b/contracts/cw3-fixed-multisig/src/state.rs index 6d5b9f718..e3b35c27b 100644 --- a/contracts/cw3-fixed-multisig/src/state.rs +++ b/contracts/cw3-fixed-multisig/src/state.rs @@ -4,9 +4,9 @@ use std::convert::TryInto; use cosmwasm_std::{Addr, BlockInfo, CosmosMsg, Empty, StdError, StdResult, Storage}; -use cw0::{Duration, Expiration}; use cw3::{Status, Vote}; use cw_storage_plus::{Item, Map}; +use utils::{Duration, Expiration}; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct Config { diff --git a/contracts/cw3-flex-multisig/Cargo.toml b/contracts/cw3-flex-multisig/Cargo.toml index 102b55203..0d23ed746 100644 --- a/contracts/cw3-flex-multisig/Cargo.toml +++ b/contracts/cw3-flex-multisig/Cargo.toml @@ -18,7 +18,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw3 = { path = "../../packages/cw3", version = "0.10.3" } cw4 = { path = "../../packages/cw4", version = "0.10.3" } diff --git a/contracts/cw3-flex-multisig/src/contract.rs b/contracts/cw3-flex-multisig/src/contract.rs index c0d143523..eafc2b221 100644 --- a/contracts/cw3-flex-multisig/src/contract.rs +++ b/contracts/cw3-flex-multisig/src/contract.rs @@ -7,7 +7,6 @@ use cosmwasm_std::{ Response, StdResult, }; -use cw0::{maybe_addr, Expiration}; use cw2::set_contract_version; use cw3::{ ProposalListResponse, ProposalResponse, Status, ThresholdResponse, Vote, VoteInfo, @@ -15,6 +14,7 @@ use cw3::{ }; use cw4::{Cw4Contract, MemberChangedHookMsg, MemberDiff}; use cw_storage_plus::Bound; +use utils::{maybe_addr, Expiration}; use crate::error::ContractError; use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; @@ -429,11 +429,11 @@ fn list_voters( mod tests { use cosmwasm_std::{coin, coins, Addr, BankMsg, Coin, Decimal, Timestamp}; - use cw0::Duration; use cw2::{query_contract_info, ContractVersion}; use cw4::{Cw4ExecuteMsg, Member}; use cw4_group::helpers::Cw4GroupContract; use cw_multi_test::{next_block, App, AppBuilder, Contract, ContractWrapper, Executor}; + use utils::Duration; use super::*; use crate::msg::Threshold; diff --git a/contracts/cw3-flex-multisig/src/msg.rs b/contracts/cw3-flex-multisig/src/msg.rs index 57e90e757..1bb2301d4 100644 --- a/contracts/cw3-flex-multisig/src/msg.rs +++ b/contracts/cw3-flex-multisig/src/msg.rs @@ -3,9 +3,9 @@ use serde::{Deserialize, Serialize}; use crate::error::ContractError; use cosmwasm_std::{CosmosMsg, Decimal, Empty}; -use cw0::{Duration, Expiration}; use cw3::{ThresholdResponse, Vote}; use cw4::MemberChangedHookMsg; +use utils::{Duration, Expiration}; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct InstantiateMsg { diff --git a/contracts/cw3-flex-multisig/src/state.rs b/contracts/cw3-flex-multisig/src/state.rs index 7e08688e0..844ec8408 100644 --- a/contracts/cw3-flex-multisig/src/state.rs +++ b/contracts/cw3-flex-multisig/src/state.rs @@ -6,10 +6,10 @@ use cosmwasm_std::{ Addr, BlockInfo, CosmosMsg, Decimal, Empty, StdError, StdResult, Storage, Uint128, }; -use cw0::{Duration, Expiration}; use cw3::{Status, Vote}; use cw4::Cw4Contract; use cw_storage_plus::{Item, Map}; +use utils::{Duration, Expiration}; use crate::msg::Threshold; diff --git a/contracts/cw4-group/Cargo.toml b/contracts/cw4-group/Cargo.toml index 2c3592e63..76c9ef038 100644 --- a/contracts/cw4-group/Cargo.toml +++ b/contracts/cw4-group/Cargo.toml @@ -26,7 +26,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw4 = { path = "../../packages/cw4", version = "0.10.3" } cw-controllers = { path = "../../packages/controllers", version = "0.10.3" } diff --git a/contracts/cw4-group/src/contract.rs b/contracts/cw4-group/src/contract.rs index 35890b763..1600d020e 100644 --- a/contracts/cw4-group/src/contract.rs +++ b/contracts/cw4-group/src/contract.rs @@ -4,13 +4,13 @@ use cosmwasm_std::{ attr, to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Order, Response, StdResult, SubMsg, }; -use cw0::maybe_addr; use cw2::set_contract_version; use cw4::{ Member, MemberChangedHookMsg, MemberDiff, MemberListResponse, MemberResponse, TotalWeightResponse, }; use cw_storage_plus::Bound; +use utils::maybe_addr; use crate::error::ContractError; use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; diff --git a/contracts/cw4-stake/Cargo.toml b/contracts/cw4-stake/Cargo.toml index 586a5b04d..1c07977e3 100644 --- a/contracts/cw4-stake/Cargo.toml +++ b/contracts/cw4-stake/Cargo.toml @@ -26,7 +26,7 @@ backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw2 = { path = "../../packages/cw2", version = "0.10.3" } cw4 = { path = "../../packages/cw4", version = "0.10.3" } cw20 = { path = "../../packages/cw20", version = "0.10.3" } diff --git a/contracts/cw4-stake/src/contract.rs b/contracts/cw4-stake/src/contract.rs index fb1588141..2b4d86774 100644 --- a/contracts/cw4-stake/src/contract.rs +++ b/contracts/cw4-stake/src/contract.rs @@ -5,7 +5,6 @@ use cosmwasm_std::{ Response, StdResult, Storage, SubMsg, Uint128, WasmMsg, }; -use cw0::{maybe_addr, NativeBalance}; use cw2::set_contract_version; use cw20::{Balance, Cw20CoinVerified, Cw20ExecuteMsg, Cw20ReceiveMsg, Denom}; use cw4::{ @@ -13,6 +12,7 @@ use cw4::{ TotalWeightResponse, }; use cw_storage_plus::Bound; +use utils::{maybe_addr, NativeBalance}; use crate::error::ContractError; use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg, ReceiveMsg, StakedResponse}; @@ -362,10 +362,10 @@ mod tests { use cosmwasm_std::{ coin, from_slice, CosmosMsg, OverflowError, OverflowOperation, StdError, Storage, }; - use cw0::Duration; use cw20::Denom; use cw4::{member_key, TOTAL_KEY}; use cw_controllers::{AdminError, Claim, HookError}; + use utils::Duration; use crate::error::ContractError; diff --git a/contracts/cw4-stake/src/msg.rs b/contracts/cw4-stake/src/msg.rs index d17c673a5..6c5d76bb4 100644 --- a/contracts/cw4-stake/src/msg.rs +++ b/contracts/cw4-stake/src/msg.rs @@ -2,9 +2,9 @@ use cosmwasm_std::Uint128; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use cw0::Duration; use cw20::{Cw20ReceiveMsg, Denom}; pub use cw_controllers::ClaimsResponse; +use utils::Duration; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct InstantiateMsg { diff --git a/contracts/cw4-stake/src/state.rs b/contracts/cw4-stake/src/state.rs index 224c52aae..0a60a4a18 100644 --- a/contracts/cw4-stake/src/state.rs +++ b/contracts/cw4-stake/src/state.rs @@ -2,11 +2,11 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{Addr, Uint128}; -use cw0::Duration; use cw20::Denom; use cw4::TOTAL_KEY; use cw_controllers::{Admin, Claims, Hooks}; use cw_storage_plus::{Item, Map, SnapshotMap, Strategy}; +use utils::Duration; pub const CLAIMS: Claims = Claims::new("claims"); diff --git a/packages/controllers/Cargo.toml b/packages/controllers/Cargo.toml index f27986918..f41a29f16 100644 --- a/packages/controllers/Cargo.toml +++ b/packages/controllers/Cargo.toml @@ -13,7 +13,7 @@ documentation = "https://docs.cosmwasm.com" [dependencies] cosmwasm-std = { version = "1.0.0-beta" } -cw0 = { path = "../cw0", version = "0.10.3" } +utils = { path = "../utils", version = "0.10.3" } cw-storage-plus = { path = "../storage-plus", version = "0.10.3" } schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/packages/controllers/src/admin.rs b/packages/controllers/src/admin.rs index 623bcc5fe..61e0edf94 100644 --- a/packages/controllers/src/admin.rs +++ b/packages/controllers/src/admin.rs @@ -6,7 +6,7 @@ use thiserror::Error; use cosmwasm_std::{attr, Addr, Deps, DepsMut, MessageInfo, Response, StdError, StdResult}; use cw_storage_plus::Item; -// TODO: should the return values end up in cw0, so eg. cw4 can import them as well as this module? +// TODO: should the return values end up in utils, so eg. cw4 can import them as well as this module? /// Returned from Admin.query_admin() #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct AdminResponse { diff --git a/packages/controllers/src/claim.rs b/packages/controllers/src/claim.rs index b260225ef..693fd2e7e 100644 --- a/packages/controllers/src/claim.rs +++ b/packages/controllers/src/claim.rs @@ -2,16 +2,16 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{Addr, BlockInfo, Deps, StdResult, Storage, Uint128}; -use cw0::Expiration; use cw_storage_plus::Map; +use utils::Expiration; -// TODO: pull into cw0? +// TODO: pull into utils? #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct ClaimsResponse { pub claims: Vec, } -// TODO: pull into cw0? +// TODO: pull into utils? #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct Claim { pub amount: Uint128, diff --git a/packages/controllers/src/hooks.rs b/packages/controllers/src/hooks.rs index b2f7f6dcb..c42af5b85 100644 --- a/packages/controllers/src/hooks.rs +++ b/packages/controllers/src/hooks.rs @@ -11,7 +11,7 @@ use cw_storage_plus::Item; use crate::admin::{Admin, AdminError}; // this is copied from cw4 -// TODO: pull into cw0 as common dep +// TODO: pull into utils as common dep #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] pub struct HooksResponse { pub hooks: Vec, diff --git a/packages/cw1155/Cargo.toml b/packages/cw1155/Cargo.toml index 808cf9b4c..65a1ffc85 100644 --- a/packages/cw1155/Cargo.toml +++ b/packages/cw1155/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://cosmwasm.com" documentation = "https://docs.cosmwasm.com" [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta" } schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/packages/cw1155/src/event.rs b/packages/cw1155/src/event.rs index 12d49855c..cfe58f378 100644 --- a/packages/cw1155/src/event.rs +++ b/packages/cw1155/src/event.rs @@ -1,5 +1,5 @@ use cosmwasm_std::{attr, Response, Uint128}; -use cw0::Event; +use utils::Event; /// Tracks token transfer/mint/burn actions pub struct TransferEvent<'a> { diff --git a/packages/cw1155/src/lib.rs b/packages/cw1155/src/lib.rs index 3324b2046..13c67588d 100644 --- a/packages/cw1155/src/lib.rs +++ b/packages/cw1155/src/lib.rs @@ -1,4 +1,4 @@ -pub use cw0::Expiration; +pub use utils::Expiration; pub use crate::event::{ApproveAllEvent, MetadataEvent, TransferEvent}; pub use crate::msg::{Cw1155ExecuteMsg, TokenId}; diff --git a/packages/cw1155/src/msg.rs b/packages/cw1155/src/msg.rs index bae102a4d..d22612b3c 100644 --- a/packages/cw1155/src/msg.rs +++ b/packages/cw1155/src/msg.rs @@ -2,7 +2,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::{Binary, Uint128}; -use cw0::Expiration; +use utils::Expiration; pub type TokenId = String; diff --git a/packages/cw1155/src/query.rs b/packages/cw1155/src/query.rs index 2bc3f6b62..911e207b5 100644 --- a/packages/cw1155/src/query.rs +++ b/packages/cw1155/src/query.rs @@ -2,7 +2,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::Uint128; -use cw0::Expiration; +use utils::Expiration; use crate::msg::TokenId; diff --git a/packages/cw20/Cargo.toml b/packages/cw20/Cargo.toml index 8a7178a7f..eb618d550 100644 --- a/packages/cw20/Cargo.toml +++ b/packages/cw20/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://cosmwasm.com" documentation = "https://docs.cosmwasm.com" [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta" } schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/packages/cw20/src/balance.rs b/packages/cw20/src/balance.rs index e98976052..17af539e9 100644 --- a/packages/cw20/src/balance.rs +++ b/packages/cw20/src/balance.rs @@ -3,7 +3,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::fmt; -use cw0::NativeBalance; +use utils::NativeBalance; use crate::Cw20CoinVerified; diff --git a/packages/cw20/src/lib.rs b/packages/cw20/src/lib.rs index aa0a99147..125fc682c 100644 --- a/packages/cw20/src/lib.rs +++ b/packages/cw20/src/lib.rs @@ -1,4 +1,4 @@ -pub use cw0::Expiration; +pub use utils::Expiration; pub use crate::balance::Balance; pub use crate::coin::{Cw20Coin, Cw20CoinVerified}; diff --git a/packages/cw20/src/msg.rs b/packages/cw20/src/msg.rs index 5aaf4c546..16df9e5b6 100644 --- a/packages/cw20/src/msg.rs +++ b/packages/cw20/src/msg.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use crate::logo::Logo; use cosmwasm_std::{Binary, Uint128}; -use cw0::Expiration; +use utils::Expiration; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] #[serde(rename_all = "snake_case")] diff --git a/packages/cw20/src/query.rs b/packages/cw20/src/query.rs index a63612d5b..c697ef61f 100644 --- a/packages/cw20/src/query.rs +++ b/packages/cw20/src/query.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use cosmwasm_std::{Addr, Binary, Uint128}; use crate::logo::LogoInfo; -use cw0::Expiration; +use utils::Expiration; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] #[serde(rename_all = "snake_case")] diff --git a/packages/cw3/Cargo.toml b/packages/cw3/Cargo.toml index 7452c10da..dc07798b6 100644 --- a/packages/cw3/Cargo.toml +++ b/packages/cw3/Cargo.toml @@ -10,7 +10,7 @@ homepage = "https://cosmwasm.com" documentation = "https://docs.cosmwasm.com" [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cosmwasm-std = { version = "1.0.0-beta" } schemars = "0.8.1" serde = { version = "1.0.103", default-features = false, features = ["derive"] } diff --git a/packages/cw3/src/helpers.rs b/packages/cw3/src/helpers.rs index acf8c35ee..ba095f3c5 100644 --- a/packages/cw3/src/helpers.rs +++ b/packages/cw3/src/helpers.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use cosmwasm_std::{to_binary, Addr, CosmosMsg, StdResult, WasmMsg}; use crate::msg::{Cw3ExecuteMsg, Vote}; -use cw0::Expiration; +use utils::Expiration; /// Cw3Contract is a wrapper around Addr that provides a lot of helpers /// for working with this. diff --git a/packages/cw3/src/msg.rs b/packages/cw3/src/msg.rs index 9559326d2..1abe72740 100644 --- a/packages/cw3/src/msg.rs +++ b/packages/cw3/src/msg.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; use cosmwasm_std::{CosmosMsg, Empty}; -use cw0::Expiration; +use utils::Expiration; #[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)] #[serde(rename_all = "snake_case")] diff --git a/packages/cw3/src/query.rs b/packages/cw3/src/query.rs index 9255460fd..5cfd17189 100644 --- a/packages/cw3/src/query.rs +++ b/packages/cw3/src/query.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; use cosmwasm_std::{CosmosMsg, Decimal, Empty}; -use cw0::Expiration; +use utils::Expiration; use crate::msg::Vote; diff --git a/packages/multi-test/Cargo.toml b/packages/multi-test/Cargo.toml index 4b03bccba..4199b1390 100644 --- a/packages/multi-test/Cargo.toml +++ b/packages/multi-test/Cargo.toml @@ -18,7 +18,7 @@ staking = ["cosmwasm-std/staking"] backtrace = ["anyhow/backtrace"] [dependencies] -cw0 = { path = "../../packages/cw0", version = "0.10.3" } +utils = { path = "../../packages/utils", version = "0.10.3" } cw-storage-plus = { path = "../../packages/storage-plus", version = "0.10.3"} cosmwasm-std = { version = "1.0.0-beta", features = ["staking"] } cosmwasm-storage = { version = "1.0.0-beta" } diff --git a/packages/multi-test/src/app.rs b/packages/multi-test/src/app.rs index ca4650c6f..7af9792e2 100644 --- a/packages/multi-test/src/app.rs +++ b/packages/multi-test/src/app.rs @@ -2441,7 +2441,7 @@ mod test { mod protobuf_wrapped_data { use super::*; use crate::test_helpers::contracts::echo::EXECUTE_REPLY_BASE_ID; - use cw0::parse_instantiate_response_data; + use utils::parse_instantiate_response_data; #[test] fn instantiate_wrapped_properly() { diff --git a/packages/multi-test/src/bank.rs b/packages/multi-test/src/bank.rs index 13b1d682e..f8585ac9c 100644 --- a/packages/multi-test/src/bank.rs +++ b/packages/multi-test/src/bank.rs @@ -7,8 +7,8 @@ use cosmwasm_std::{ BlockInfo, Coin, Event, Querier, Storage, }; use cosmwasm_storage::{prefixed, prefixed_read}; -use cw0::NativeBalance; use cw_storage_plus::Map; +use utils::NativeBalance; use crate::app::CosmosRouter; use crate::executor::AppResponse; diff --git a/packages/multi-test/src/executor.rs b/packages/multi-test/src/executor.rs index db9e57320..6e1e8678d 100644 --- a/packages/multi-test/src/executor.rs +++ b/packages/multi-test/src/executor.rs @@ -4,9 +4,9 @@ use cosmwasm_std::{ to_binary, Addr, Attribute, BankMsg, Binary, Coin, CosmosMsg, Event, SubMsgExecutionResponse, WasmMsg, }; -use cw0::{parse_execute_response_data, parse_instantiate_response_data}; use schemars::JsonSchema; use serde::Serialize; +use utils::{parse_execute_response_data, parse_instantiate_response_data}; use anyhow::Result as AnyResult; diff --git a/packages/multi-test/src/test_helpers/contracts/echo.rs b/packages/multi-test/src/test_helpers/contracts/echo.rs index 1c3fc1804..cfbd41465 100644 --- a/packages/multi-test/src/test_helpers/contracts/echo.rs +++ b/packages/multi-test/src/test_helpers/contracts/echo.rs @@ -13,8 +13,8 @@ use crate::{test_helpers::EmptyMsg, Contract, ContractWrapper}; use schemars::JsonSchema; use std::fmt::Debug; -use cw0::{parse_execute_response_data, parse_instantiate_response_data}; use derivative::Derivative; +use utils::{parse_execute_response_data, parse_instantiate_response_data}; // Choosing a reply id less than ECHO_EXECUTE_BASE_ID indicates an Instantiate message reply by convention. // An Execute message reply otherwise. diff --git a/packages/multi-test/src/wasm.rs b/packages/multi-test/src/wasm.rs index 0e57975b9..9b98bf509 100644 --- a/packages/multi-test/src/wasm.rs +++ b/packages/multi-test/src/wasm.rs @@ -867,7 +867,7 @@ where } } -// TODO: replace with code in cw0 +// TODO: replace with code in utils #[derive(Clone, PartialEq, Message)] struct InstantiateResponse { @@ -877,7 +877,7 @@ struct InstantiateResponse { pub data: ::prost::alloc::vec::Vec, } -// TODO: encode helpers in cw0 +// TODO: encode helpers in utils fn instantiate_response(data: Option, contact_address: &Addr) -> Binary { let data = data.unwrap_or_default().to_vec(); let init_data = InstantiateResponse { diff --git a/packages/cw0/Cargo.toml b/packages/utils/Cargo.toml similarity index 97% rename from packages/cw0/Cargo.toml rename to packages/utils/Cargo.toml index 458bd72bd..1254a7f2b 100644 --- a/packages/cw0/Cargo.toml +++ b/packages/utils/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cw0" +name = "utils" version = "0.10.3" authors = ["Ethan Frey "] edition = "2018" diff --git a/packages/cw0/NOTICE b/packages/utils/NOTICE similarity index 91% rename from packages/cw0/NOTICE rename to packages/utils/NOTICE index f186cdd50..6ce7d69d2 100644 --- a/packages/cw0/NOTICE +++ b/packages/utils/NOTICE @@ -1,4 +1,4 @@ -CW0: Common types and helpers for CosmWasm specs +Utils: Common types and helpers for CosmWasm specs Copyright (C) 2020 Confio OÜ Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/packages/cw0/README.md b/packages/utils/README.md similarity index 84% rename from packages/cw0/README.md rename to packages/utils/README.md index dedaab140..cfff5a1f5 100644 --- a/packages/cw0/README.md +++ b/packages/utils/README.md @@ -1,4 +1,4 @@ -# CW0: Common Types for specs +# Utils: Common types / utilities for specs This is a collection of common types shared among many specs. For example `Expiration`, which is embedded in many places. diff --git a/packages/cw0/src/balance.rs b/packages/utils/src/balance.rs similarity index 100% rename from packages/cw0/src/balance.rs rename to packages/utils/src/balance.rs diff --git a/packages/cw0/src/event.rs b/packages/utils/src/event.rs similarity index 100% rename from packages/cw0/src/event.rs rename to packages/utils/src/event.rs diff --git a/packages/cw0/src/expiration.rs b/packages/utils/src/expiration.rs similarity index 100% rename from packages/cw0/src/expiration.rs rename to packages/utils/src/expiration.rs diff --git a/packages/cw0/src/lib.rs b/packages/utils/src/lib.rs similarity index 100% rename from packages/cw0/src/lib.rs rename to packages/utils/src/lib.rs diff --git a/packages/cw0/src/pagination.rs b/packages/utils/src/pagination.rs similarity index 100% rename from packages/cw0/src/pagination.rs rename to packages/utils/src/pagination.rs diff --git a/packages/cw0/src/parse_reply.rs b/packages/utils/src/parse_reply.rs similarity index 100% rename from packages/cw0/src/parse_reply.rs rename to packages/utils/src/parse_reply.rs diff --git a/packages/cw0/src/payment.rs b/packages/utils/src/payment.rs similarity index 100% rename from packages/cw0/src/payment.rs rename to packages/utils/src/payment.rs diff --git a/scripts/publish.sh b/scripts/publish.sh index 785f596ca..74b2c98f4 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -5,7 +5,7 @@ command -v shellcheck > /dev/null && shellcheck "$0" # this should really more to cosmwasm... STORAGE_PACKAGES="storage-plus" # these are imported by other packages -BASE_PACKAGES="cw0" +BASE_PACKAGES="utils" ALL_PACKAGES="controllers cw1 cw2 cw3 cw4 cw20 cw1155 multi-test" # these are imported by other contracts