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 to CosmWasm 1.0.0-soon2 #475

Merged
merged 2 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ jobs:
- run:
name: Install check_contract
# Uses --debug for compilation speed
command: cargo install --debug --version 1.0.0-soon --features iterator --example check_contract -- cosmwasm-vm
command: cargo install --debug --version 1.0.0-soon2 --features iterator --example check_contract -- cosmwasm-vm
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions contracts/cw1155-base/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Order, Pair, Response, StdResult,
to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Order, Record, Response, StdResult,
SubMsg, Uint128,
};
use cw_storage_plus::Bound;
Expand Down Expand Up @@ -478,7 +478,7 @@ pub fn query(deps: Deps, env: Env, msg: Cw1155QueryMsg) -> StdResult<Binary> {
}
}

fn parse_approval(item: StdResult<Pair<Expiration>>) -> StdResult<cw1155::Approval> {
fn parse_approval(item: StdResult<Record<Expiration>>) -> StdResult<cw1155::Approval> {
item.and_then(|(k, expires)| {
let spender = String::from_utf8(k)?;
Ok(cw1155::Approval { spender, expires })
Expand Down
4 changes: 2 additions & 2 deletions contracts/cw721-base/src/query.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::de::DeserializeOwned;
use serde::Serialize;

use cosmwasm_std::{to_binary, Binary, BlockInfo, Deps, Env, Order, Pair, StdError, StdResult};
use cosmwasm_std::{to_binary, Binary, BlockInfo, Deps, Env, Order, Record, StdError, StdResult};

use cw0::maybe_addr;
use cw721::{
Expand Down Expand Up @@ -206,7 +206,7 @@ where
}
}

fn parse_approval(item: StdResult<Pair<Expiration>>) -> StdResult<cw721::Approval> {
fn parse_approval(item: StdResult<Record<Expiration>>) -> StdResult<cw721::Approval> {
item.and_then(|(k, expires)| {
let spender = String::from_utf8(k)?;
Ok(cw721::Approval { spender, expires })
Expand Down
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 = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
cw0 = { path = "../cw0", version = "0.10.0-soon3" }
cw-storage-plus = { path = "../storage-plus", version = "0.10.0-soon3" }
schemars = "0.8.1"
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 = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.21" }
Expand Down
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 = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "=1.0.0-soon" }
cosmwasm-schema = { version = "=1.0.0-soon2" }
4 changes: 2 additions & 2 deletions packages/cw1155/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.10.0-soon3" }
cosmwasm-std = { version = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "=1.0.0-soon" }
cosmwasm-schema = { version = "=1.0.0-soon2" }
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 = "=1.0.0-soon", default-features = false }
cosmwasm-std = { version = "=1.0.0-soon2", default-features = false }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.10.0-soon3" }
schemars = "0.8.1"
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.10.0-soon3" }
cosmwasm-std = { version = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "=1.0.0-soon" }
cosmwasm-schema = { version = "=1.0.0-soon2" }
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.10.0-soon3" }
cosmwasm-std = { version = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

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

[dependencies]
cw-storage-plus = { path = "../storage-plus", version = "0.10.0-soon3" }
cosmwasm-std = { version = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "=1.0.0-soon" }
cosmwasm-schema = { version = "=1.0.0-soon2" }
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.10.0-soon3" }
cosmwasm-std = { version = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-schema = { version = "=1.0.0-soon" }
cosmwasm-schema = { version = "=1.0.0-soon2" }
4 changes: 2 additions & 2 deletions packages/multi-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ backtrace = ["anyhow/backtrace"]
[dependencies]
cw0 = { path = "../../packages/cw0", version = "0.10.0-soon3" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.10.0-soon3"}
cosmwasm-std = { version = "=1.0.0-soon", features = ["staking"] }
cosmwasm-storage = { version = "=1.0.0-soon" }
cosmwasm-std = { version = "=1.0.0-soon2", features = ["staking"] }
cosmwasm-storage = { version = "=1.0.0-soon2" }
itertools = "0.10.1"
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
Expand Down
40 changes: 20 additions & 20 deletions packages/multi-test/src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::ops::{Bound, RangeBounds};

use cosmwasm_std::Storage;
#[cfg(feature = "iterator")]
use cosmwasm_std::{Order, Pair};
use cosmwasm_std::{Order, Record};

use anyhow::Result as AnyResult;

Expand Down Expand Up @@ -87,7 +87,7 @@ impl<'a> Storage for StorageTransaction<'a> {
start: Option<&[u8]>,
end: Option<&[u8]>,
order: Order,
) -> Box<dyn Iterator<Item = Pair> + 'b> {
) -> Box<dyn Iterator<Item = Record> + 'b> {
let bounds = range_bounds(start, end);

// BTreeMap.range panics if range is start > end.
Expand Down Expand Up @@ -180,7 +180,7 @@ enum Delta {
struct MergeOverlay<'a, L, R>
where
L: Iterator<Item = BTreeMapPairRef<'a, Delta>>,
R: Iterator<Item = Pair>,
R: Iterator<Item = Record>,
{
left: Peekable<L>,
right: Peekable<R>,
Expand All @@ -191,7 +191,7 @@ where
impl<'a, L, R> MergeOverlay<'a, L, R>
where
L: Iterator<Item = BTreeMapPairRef<'a, Delta>>,
R: Iterator<Item = Pair>,
R: Iterator<Item = Record>,
{
fn new(left: L, right: R, order: Order) -> Self {
MergeOverlay {
Expand All @@ -201,7 +201,7 @@ where
}
}

fn pick_match(&mut self, lkey: Vec<u8>, rkey: Vec<u8>) -> Option<Pair> {
fn pick_match(&mut self, lkey: Vec<u8>, rkey: Vec<u8>) -> Option<Record> {
// compare keys - result is such that Ordering::Less => return left side
let order = match self.order {
Order::Ascending => lkey.cmp(&rkey),
Expand All @@ -221,7 +221,7 @@ where
}

/// take_left must only be called when we know self.left.next() will return Some
fn take_left(&mut self) -> Option<Pair> {
fn take_left(&mut self) -> Option<Record> {
let (lkey, lval) = self.left.next().unwrap();
match lval {
Delta::Set { value } => Some((lkey.clone(), value.clone())),
Expand All @@ -234,9 +234,9 @@ where
impl<'a, L, R> Iterator for MergeOverlay<'a, L, R>
where
L: Iterator<Item = BTreeMapPairRef<'a, Delta>>,
R: Iterator<Item = Pair>,
R: Iterator<Item = Record>,
{
type Item = Pair;
type Item = Record;

fn next(&mut self) -> Option<Self::Item> {
let (left, right) = (self.left.peek(), self.right.peek());
Expand Down Expand Up @@ -360,7 +360,7 @@ mod test {
// unbounded
{
let iter = store.range(None, None, Order::Ascending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(
elements,
vec![
Expand All @@ -374,7 +374,7 @@ mod test {
// unbounded (descending)
{
let iter = store.range(None, None, Order::Descending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(
elements,
vec![
Expand All @@ -388,14 +388,14 @@ mod test {
// bounded
{
let iter = store.range(Some(b"f"), Some(b"n"), Order::Ascending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(elements, vec![(b"foo".to_vec(), b"bar".to_vec())]);
}

// bounded (descending)
{
let iter = store.range(Some(b"air"), Some(b"loop"), Order::Descending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(
elements,
vec![
Expand All @@ -408,35 +408,35 @@ mod test {
// bounded empty [a, a)
{
let iter = store.range(Some(b"foo"), Some(b"foo"), Order::Ascending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(elements, vec![]);
}

// bounded empty [a, a) (descending)
{
let iter = store.range(Some(b"foo"), Some(b"foo"), Order::Descending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(elements, vec![]);
}

// bounded empty [a, b) with b < a
{
let iter = store.range(Some(b"z"), Some(b"a"), Order::Ascending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(elements, vec![]);
}

// bounded empty [a, b) with b < a (descending)
{
let iter = store.range(Some(b"z"), Some(b"a"), Order::Descending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(elements, vec![]);
}

// right unbounded
{
let iter = store.range(Some(b"f"), None, Order::Ascending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(
elements,
vec![
Expand All @@ -449,7 +449,7 @@ mod test {
// right unbounded (descending)
{
let iter = store.range(Some(b"f"), None, Order::Descending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(
elements,
vec![
Expand All @@ -462,14 +462,14 @@ mod test {
// left unbounded
{
let iter = store.range(None, Some(b"f"), Order::Ascending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(elements, vec![(b"ant".to_vec(), b"hill".to_vec()),]);
}

// left unbounded (descending)
{
let iter = store.range(None, Some(b"no"), Order::Descending);
let elements: Vec<Pair> = iter.collect();
let elements: Vec<Record> = iter.collect();
assert_eq!(
elements,
vec![
Expand Down
2 changes: 1 addition & 1 deletion packages/storage-plus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ default = ["iterator"]
iterator = ["cosmwasm-std/iterator"]

[dependencies]
cosmwasm-std = { version = "=1.0.0-soon", default-features = false }
cosmwasm-std = { version = "=1.0.0-soon2", default-features = false }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
Loading