Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contracts and packages to cw 0.13.2 #220

Merged
merged 3 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions contracts/cw1-subkeys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cw1 = { path = "../../packages/cw1", version = "0.4.0" }
cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw1-whitelist = { path = "../cw1-whitelist", version = "0.4.0", features = ["library"] }
cosmwasm-std = { version = "0.12.2", features = ["iterator", "staking"] }
cosmwasm-storage = { version = "0.12.2", features = ["iterator"] }
cosmwasm-std = { version = "0.13.2", features = ["iterator", "staking"] }
cosmwasm-storage = { version = "0.13.2", features = ["iterator"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
6 changes: 3 additions & 3 deletions contracts/cw1-whitelist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ library = []
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cw1 = { path = "../../packages/cw1", version = "0.4.0" }
cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.12.2", features = ["iterator"] }
cosmwasm-std = { version = "0.13.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.13.2", features = ["iterator"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
6 changes: 3 additions & 3 deletions contracts/cw20-atomic-swap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ library = []
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw20 = { path = "../../packages/cw20", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.12.2", features = ["iterator"] }
cosmwasm-std = { version = "0.13.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.13.2", features = ["iterator"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }
hex = "0.3.1"
sha2 = "0.8.0"

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
6 changes: 3 additions & 3 deletions contracts/cw20-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ library = []
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw20 = { path = "../../packages/cw20", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.12.2", features = ["iterator"] }
cosmwasm-std = { version = "0.13.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.13.2", features = ["iterator"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
4 changes: 2 additions & 2 deletions contracts/cw20-bonding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw20 = { path = "../../packages/cw20", version = "0.4.0" }
cw20-base = { path = "../../contracts/cw20-base", version = "0.4.0", features = ["library"] }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2", features = ["staking"] }
cosmwasm-std = { version = "0.13.2", features = ["staking"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }
rust_decimal = { version = "1.8.1" }
num-integer = { version = "0.1.44" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
6 changes: 3 additions & 3 deletions contracts/cw20-escrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ library = []
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw20 = { path = "../../packages/cw20", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.12.2", features = ["iterator"] }
cosmwasm-std = { version = "0.13.2", features = ["iterator"] }
cosmwasm-storage = { version = "0.13.2", features = ["iterator"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
cw-multi-test = { path = "../../packages/multi-test", version = "0.4.0" }
cw20-base = { path = "../cw20-base", version = "0.4.0", features = ["library"] }
6 changes: 3 additions & 3 deletions contracts/cw20-staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw20 = { path = "../../packages/cw20", version = "0.4.0" }
cw-controllers = { path = "../../packages/controllers", version = "0.4.0" }
cw20-base = { path = "../../contracts/cw20-base", version = "0.4.0", features = ["library"] }
cosmwasm-std = { version = "0.12.2", features = ["staking"] }
cosmwasm-storage = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2", features = ["staking"] }
cosmwasm-storage = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
4 changes: 2 additions & 2 deletions contracts/cw3-fixed-multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw3 = { path = "../../packages/cw3", version = "0.4.0" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.4.0", features = ["iterator"] }
cosmwasm-std = { version = "0.12.2", features = ["iterator"] }
cosmwasm-std = { version = "0.13.2", features = ["iterator"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
4 changes: 2 additions & 2 deletions contracts/cw3-flex-multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw3 = { path = "../../packages/cw3", version = "0.4.0" }
cw4 = { path = "../../packages/cw4", version = "0.4.0" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.4.0", features = ["iterator"] }
cosmwasm-std = { version = "0.12.2", features = ["iterator"] }
cosmwasm-std = { version = "0.13.2", features = ["iterator"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
cw4-group = { path = "../cw4-group", version = "0.4.0" }
cw-multi-test = { path = "../../packages/multi-test", version = "0.4.0" }
4 changes: 2 additions & 2 deletions contracts/cw4-group/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw4 = { path = "../../packages/cw4", version = "0.4.0" }
cw-controllers = { path = "../../packages/controllers", version = "0.4.0" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.4.0", features = ["iterator"] }
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.21" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
4 changes: 2 additions & 2 deletions contracts/cw4-stake/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw4 = { path = "../../packages/cw4", version = "0.4.0" }
cw-controllers = { path = "../../packages/controllers", version = "0.4.0" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.4.0", features = ["iterator"] }
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.21" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
1 change: 1 addition & 0 deletions contracts/cw4-stake/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ pub fn handle_unbond(
})
}

#[allow(const_item_mutation)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this linter config the following error is thrown:

warning: taking a mutable reference to a `const` item
   --> contracts/cw4-stake/src/contract.rs:184:5
    |
184 | /     TOTAL.update(storage, |total| -> StdResult<_> {
185 | |         let res = total + new.unwrap_or_default() - old.unwrap_or_default();
186 | |         Ok(res)
187 | |     })?;
    | |______^
    |
    = note: `#[warn(const_item_mutation)]` on by default
    = note: each usage of a `const` item creates a new temporary
    = note: the mutable reference will refer to this temporary, not the original `const` item
note: mutable reference created due to call to this method
   --> /code/packages/storage-plus/src/item.rs:64:5
    |
64  | /     pub fn update<A, E>(&mut self, store: &mut dyn Storage, action: A) -> Result<T, E>
65  | |     where
66  | |         A: FnOnce(T) -> Result<T, E>,
67  | |         E: From<StdError>,
...   |
72  | |         Ok(output)
73  | |     }
    | |_____^
note: `const` item defined here
   --> contracts/cw4-stake/src/state.rs:25:1
    |
25  | pub const TOTAL: Item<u64> = Item::new(TOTAL_KEY);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: 1 warning emitted

Compiler assumes the TOTAL value is being mutated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you're using the same linter version than the CI:

export CLIP_VERSION="+1.47.0"
cargo $CLIP_VERSION clippy -- -D warnings

When doing that, this warning is not reported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clippy version mismatch is why you're hitting errors in the CI, by the way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah you are right, I was running on rust version 1.49

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug is the &mut self in update.
I think this was fixed (or at least reported).
I will check, we should definitely modify that - not disable the warning, but make it non mut

fn update_membership(
storage: &mut dyn Storage,
sender: HumanAddr,
Expand Down
4 changes: 2 additions & 2 deletions contracts/cw721-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cw2 = { path = "../../packages/cw2", version = "0.4.0" }
cw721 = { path = "../../packages/cw721", version = "0.4.0" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.4.0" , features = ["iterator"]}
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
2 changes: 1 addition & 1 deletion packages/controllers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ documentation = "https://docs.cosmwasm.com"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
cw0 = { path = "../cw0", version = "0.4.0" }
cw-storage-plus = { path = "../storage-plus", version = "0.4.0", features = ["iterator"] }
schemars = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion packages/cw0/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ documentation = "https://docs.cosmwasm.com"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.21" }
4 changes: 2 additions & 2 deletions packages/cw1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ homepage = "https://cosmwasm.com"
documentation = "https://docs.cosmwasm.com"

[dependencies]
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
2 changes: 1 addition & 1 deletion packages/cw2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = "https://cosmwasm.com"
documentation = "https://docs.cosmwasm.com"

[dependencies]
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.4.0" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
4 changes: 2 additions & 2 deletions packages/cw20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ documentation = "https://docs.cosmwasm.com"

[dependencies]
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
4 changes: 2 additions & 2 deletions packages/cw3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ documentation = "https://docs.cosmwasm.com"

[dependencies]
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
4 changes: 2 additions & 2 deletions packages/cw4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ homepage = "https://cosmwasm.com"
documentation = "https://docs.cosmwasm.com"

[dependencies]
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
4 changes: 2 additions & 2 deletions packages/cw721/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ documentation = "https://docs.cosmwasm.com"

[dependencies]
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "0.12.2" }
cosmwasm-schema = { version = "0.13.2" }
2 changes: 1 addition & 1 deletion packages/multi-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ iterator = ["cosmwasm-std/iterator"]

[dependencies]
cw0 = { path = "../../packages/cw0", version = "0.4.0" }
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
2 changes: 1 addition & 1 deletion packages/storage-plus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ documentation = "https://docs.cosmwasm.com"
iterator = ["cosmwasm-std/iterator"]

[dependencies]
cosmwasm-std = { version = "0.12.2" }
cosmwasm-std = { version = "0.13.2" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }