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 v0.14.0 #289

Merged
merged 10 commits into from
May 3, 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
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,7 @@ jobs:
- run:
name: Install check_contract
# Uses --debug for compilation speed
# FIXME: Change when `check_contract` (part of `cosmwasm-0.14.0`) is published
#command: cargo install --debug --features iterator --example check_contract -- cosmwasm-vm
command: cargo install --debug --features iterator --git https://github.com/CosmWasm/cosmwasm --tag=v0.14.0-beta5 --example check_contract -- cosmwasm-vm
command: cargo install --debug --version 0.14.0 --features iterator --example check_contract -- cosmwasm-vm
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down
16 changes: 8 additions & 8 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/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.6.0-beta3" }
cw1 = { path = "../../packages/cw1", version = "0.6.0-beta3" }
cw2 = { path = "../../packages/cw2", version = "0.6.0-beta3" }
cw1-whitelist = { path = "../cw1-whitelist", version = "0.6.0-beta3", features = ["library"] }
cosmwasm-std = { version = "0.14.0-beta5", features = ["iterator", "staking"] }
cosmwasm-std = { version = "0.14.0", features = ["iterator", "staking"] }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.6.0-beta3", features = ["iterator"] }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.14.0-beta5" }
cosmwasm-schema = { version = "0.14.0" }
4 changes: 2 additions & 2 deletions contracts/cw1-subkeys/examples/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ fn main() {
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema_with_title(&mut schema_for!(ExecuteMsg), &out_dir, "ExecuteMsg");
export_schema_with_title(&mut schema_for!(QueryMsg), &out_dir, "QueryMsg");
export_schema_with_title(&schema_for!(ExecuteMsg), &out_dir, "ExecuteMsg");
export_schema_with_title(&schema_for!(QueryMsg), &out_dir, "QueryMsg");
export_schema(&schema_for!(Allowance), &out_dir);
export_schema(&schema_for!(AdminListResponse), &out_dir);
export_schema(&schema_for!(AllAllowancesResponse), &out_dir);
Expand Down
17 changes: 14 additions & 3 deletions contracts/cw1-subkeys/schema/all_allowances_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@
],
"properties": {
"at_time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
Expand All @@ -102,7 +100,20 @@
"$ref": "#/definitions/Coin"
}
},
"Timestamp": {
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.",
"allOf": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
Copy link
Contributor

Choose a reason for hiding this comment

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

These descriptions are a tad long / unreadable. Maybe we can improve on this in another iteration.

"type": "string"
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
}
}
Expand Down
17 changes: 14 additions & 3 deletions contracts/cw1-subkeys/schema/allowance.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@
],
"properties": {
"at_time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
Expand All @@ -84,7 +82,20 @@
"$ref": "#/definitions/Coin"
}
},
"Timestamp": {
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.",
"allOf": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
}
}
Expand Down
17 changes: 14 additions & 3 deletions contracts/cw1-subkeys/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@
],
"properties": {
"at_time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
Expand Down Expand Up @@ -507,7 +505,20 @@
}
]
},
"Timestamp": {
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.",
"allOf": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
},
"WasmMsg": {
Expand Down
1 change: 1 addition & 0 deletions contracts/cw1-subkeys/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
},
"WasmMsg": {
Expand Down
4 changes: 2 additions & 2 deletions contracts/cw1-subkeys/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ pub fn query_all_permissions(
#[cfg(test)]
mod tests {
use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info};
use cosmwasm_std::{coin, coins, Addr, StakingMsg};
use cosmwasm_std::{coin, coins, Addr, StakingMsg, Timestamp};

use cw0::NativeBalance;
use cw1_whitelist::msg::AdminListResponse;
Expand Down Expand Up @@ -906,7 +906,7 @@ mod tests {

let expires_height = Expiration::AtHeight(5432);
let expires_never = Expiration::Never {};
let expires_time = Expiration::AtTime(1234567890);
let expires_time = Expiration::AtTime(Timestamp::from_seconds(1234567890));
// Initially set first spender allowance with height expiration, the second with no expiration
let initial_expirations = vec![expires_height, expires_never];

Expand Down
4 changes: 2 additions & 2 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.6.0-beta3" }
cw1 = { path = "../../packages/cw1", version = "0.6.0-beta3" }
cw2 = { path = "../../packages/cw2", version = "0.6.0-beta3" }
cosmwasm-std = { version = "0.14.0-beta5", features = ["iterator", "staking"] }
cosmwasm-std = { version = "0.14.0", features = ["iterator", "staking"] }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.6.0-beta3", features = ["iterator"] }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = { version = "0.14.0-beta5" }
cosmwasm-schema = { version = "0.14.0" }
4 changes: 2 additions & 2 deletions contracts/cw1-whitelist/examples/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema_with_title(&mut schema_for!(ExecuteMsg), &out_dir, "ExecuteMsg");
export_schema_with_title(&mut schema_for!(QueryMsg), &out_dir, "QueryMsg");
export_schema_with_title(&schema_for!(ExecuteMsg), &out_dir, "ExecuteMsg");
export_schema_with_title(&schema_for!(QueryMsg), &out_dir, "QueryMsg");
export_schema(&schema_for!(AdminListResponse), &out_dir);
}
1 change: 1 addition & 0 deletions contracts/cw1-whitelist/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
},
"WasmMsg": {
Expand Down
1 change: 1 addition & 0 deletions contracts/cw1-whitelist/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
},
"WasmMsg": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw1155-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cw0 = { path = "../../packages/cw0", version = "0.6.0-beta3" }
cw2 = { path = "../../packages/cw2", version = "0.6.0-beta3" }
cw1155 = { path = "../../packages/cw1155", version = "0.6.0-beta3" }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.6.0-beta3" , features = ["iterator"]}
cosmwasm-std = { version = "0.14.0-beta5", features = ["iterator"] }
cosmwasm-std = { version = "0.14.0", features = ["iterator"] }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }
Expand Down
16 changes: 13 additions & 3 deletions contracts/cw1155-base/schema/approved_for_all_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@
],
"properties": {
"at_time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
Expand All @@ -82,6 +80,18 @@
"additionalProperties": false
}
]
},
"Timestamp": {
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.",
"allOf": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
}
}
}
1 change: 1 addition & 0 deletions contracts/cw1155-base/schema/balance_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"definitions": {
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
Expand Down
1 change: 1 addition & 0 deletions contracts/cw1155-base/schema/batch_balance_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"definitions": {
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
Expand Down
1 change: 1 addition & 0 deletions contracts/cw1155-base/schema/cw1155_batch_receive_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"type": "string"
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
Expand Down
17 changes: 14 additions & 3 deletions contracts/cw1155-base/schema/cw1155_execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,7 @@
],
"properties": {
"at_time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
"$ref": "#/definitions/Timestamp"
}
},
"additionalProperties": false
Expand All @@ -365,7 +363,20 @@
}
]
},
"Timestamp": {
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.",
"allOf": [
{
"$ref": "#/definitions/Uint64"
}
]
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
},
"Uint64": {
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
"type": "string"
}
}
Expand Down
1 change: 1 addition & 0 deletions contracts/cw1155-base/schema/cw1155_receive_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"type": "string"
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/cw20-atomic-swap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ library = []
cw0 = { path = "../../packages/cw0", version = "0.6.0-beta3" }
cw2 = { path = "../../packages/cw2", version = "0.6.0-beta3" }
cw20 = { path = "../../packages/cw20", version = "0.6.0-beta3" }
cosmwasm-std = { version = "0.14.0-beta5", features = ["iterator"] }
cosmwasm-std = { version = "0.14.0", features = ["iterator"] }
cw-storage-plus = { path = "../../packages/storage-plus", version = "0.6.0-beta3", features = ["iterator"] }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
Expand All @@ -27,4 +27,4 @@ hex = "0.3.1"
sha2 = "0.8.0"

[dev-dependencies]
cosmwasm-schema = { version = "0.14.0-beta5" }
cosmwasm-schema = { version = "0.14.0" }
Loading