From 809f707f13ce293f7e054ab74848c440b537caa5 Mon Sep 17 00:00:00 2001 From: kwt <4344285+kwtalley@users.noreply.github.com> Date: Fri, 9 Feb 2024 23:04:20 -0600 Subject: [PATCH] put template contract back to standalone project and fix cosmwasm-std version --- Cargo.lock | 125 ++++++------------ Cargo.toml | 28 ++-- contracts/attrs/src/contract.rs | 26 ++-- contracts/attrs/src/helpers.rs | 8 +- contracts/ibc/local/src/contract.rs | 10 +- contracts/ibc/local/src/ibc.rs | 14 +- contracts/ibc/remote/src/contract.rs | 6 +- contracts/marker/src/contract.rs | 12 +- contracts/name/src/contract.rs | 16 +-- contracts/nft/src/query/all_nft_info.rs | 4 +- contracts/nft/src/query/all_operators.rs | 4 +- contracts/nft/src/query/all_tokens.rs | 4 +- contracts/nft/src/query/approval.rs | 6 +- contracts/nft/src/query/approvals.rs | 4 +- contracts/nft/src/query/contract_info.rs | 4 +- contracts/nft/src/query/contract_owner.rs | 4 +- contracts/nft/src/query/contract_version.rs | 4 +- contracts/nft/src/query/minter.rs | 4 +- contracts/nft/src/query/nft_info.rs | 4 +- contracts/nft/src/query/num_tokens.rs | 4 +- contracts/nft/src/query/operator.rs | 4 +- contracts/nft/src/query/owner_of.rs | 4 +- contracts/nft/src/query/tokens.rs | 4 +- contracts/scope/src/contract.rs | 22 +-- contracts/template/Cargo.lock | 4 +- contracts/template/Cargo.toml | 34 +++-- contracts/template/src/query/query_owner.rs | 8 +- contracts/template/src/query/query_version.rs | 8 +- contracts/template/src/query/router.rs | 6 +- contracts/trigger/src/contract.rs | 6 +- contracts/tutorial/src/contract.rs | 8 +- packages/provwasm-mocks/src/querier.rs | 6 +- 32 files changed, 185 insertions(+), 220 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f23e284..d5d975d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,6 +61,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.7" @@ -112,12 +118,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bnum" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9008b6bb9fc80b5277f2fe481c09e828743d9151203e804583eb4c9e15b31d" - [[package]] name = "byteorder" version = "1.4.3" @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "1.5.3" +version = "1.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e3a2136e2a60e8b6582f5dffca5d1a683ed77bf38537d330bc1dfccd69010" +checksum = "e0864db0a1e0ba2abd35d1105d0487e779538f616daa0338697315cc1601bf24" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.3" +version = "1.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5d803bea6bd9ed61bd1ee0b4a2eb09ee20dbb539cc6e0b8795614d20952ebb1" +checksum = "2cd0f686ff907612ed63fdff97906b3eafe169d560ebd428e92ef400fb56479f" dependencies = [ "proc-macro2", "quote", @@ -207,13 +207,11 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "1.5.2" +version = "1.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad011ae7447188e26e4a7dbca2fcd0fc186aa21ae5c86df0503ea44c78f9e469" +checksum = "197ed654c41885e2d76b23bff8db11b0f9745bfdede0909de9daa564edb19187" dependencies = [ - "base64", - "bech32", - "bnum", + "base64 0.13.1", "cosmwasm-crypto", "cosmwasm-derive", "derivative", @@ -223,8 +221,8 @@ dependencies = [ "serde", "serde-json-wasm", "sha2 0.10.8", - "static_assertions", "thiserror", + "uint", ] [[package]] @@ -236,6 +234,12 @@ dependencies = [ "libc", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-bigint" version = "0.4.9" @@ -311,25 +315,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cw-multi-test" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d818f5323c80ed4890db7f89d65eda3f0261fe21878e628c27ea2d8de4b7ba4" -dependencies = [ - "anyhow", - "cosmwasm-std", - "cw-storage-plus", - "cw-utils", - "derivative", - "itertools 0.11.0", - "prost 0.12.3", - "schemars", - "serde", - "sha2 0.10.8", - "thiserror", -] - [[package]] name = "cw-ownable" version = "0.5.1" @@ -358,9 +343,9 @@ dependencies = [ [[package]] name = "cw-storage-plus" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" +checksum = "3f0e92a069d62067f3472c62e30adedb4cab1754725c0f2a682b3128d2bf3c79" dependencies = [ "cosmwasm-std", "schemars", @@ -369,9 +354,9 @@ dependencies = [ [[package]] name = "cw-utils" -version = "1.0.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" +checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -384,15 +369,14 @@ dependencies = [ [[package]] name = "cw2" -version = "1.1.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" +checksum = "29ac2dc7a55ad64173ca1e0a46697c31b7a5c51342f55a1e84a724da4eb99908" dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", "schemars", - "semver", "serde", "thiserror", ] @@ -939,7 +923,7 @@ dependencies = [ "bech32", "cosmwasm-schema", "cosmwasm-std", - "cw-multi-test 0.16.5", + "cw-multi-test", "cw-ownable", "cw-storage-plus", "cw-utils", @@ -1077,16 +1061,6 @@ dependencies = [ "prost-derive 0.11.9", ] -[[package]] -name = "prost" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" -dependencies = [ - "bytes", - "prost-derive 0.12.3", -] - [[package]] name = "prost-build" version = "0.11.9" @@ -1135,19 +1109,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "prost-derive" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" -dependencies = [ - "anyhow", - "itertools 0.11.0", - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "prost-types" version = "0.11.9" @@ -1214,7 +1175,7 @@ dependencies = [ name = "provwasm-std" version = "2.2.0" dependencies = [ - "base64", + "base64 0.21.7", "chrono", "cosmwasm-schema", "cosmwasm-std", @@ -1604,24 +1565,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "template" -version = "2.2.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-multi-test 0.17.0", - "cw-storage-plus", - "cw-utils", - "cw2", - "provwasm-mocks", - "provwasm-std", - "schemars", - "semver", - "serde", - "thiserror", -] - [[package]] name = "termcolor" version = "1.2.0" @@ -1688,6 +1631,18 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unicode-ident" version = "1.0.8" diff --git a/Cargo.toml b/Cargo.toml index 4b0221d7..4977f4ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,10 +14,12 @@ members = [ "contracts/name", "contracts/nft", "contracts/scope", - "contracts/template", "contracts/trigger", "contracts/tutorial" ] +exclude = [ + "contracts/template" +] [workspace.package] version = "2.2.0" @@ -27,9 +29,9 @@ license = "Apache-2.0" [workspace.dependencies] ### CosmWasm -cosmwasm-schema = { version = "1.2.5" } -cosmwasm-std = { version = "1.2.5", default-features = false } -cw-storage-plus = { version = "1.2.0" } +cosmwasm-schema = { version = "=1.2.8" } +cosmwasm-std = { version = "=1.2.8", default-features = false } +cw-storage-plus = { version = "=1.1.0" } ### ProvWasm provwasm-proto-build = { version = "0.1.0", path = "packages/proto-build" } @@ -38,15 +40,15 @@ provwasm-mocks = { version = "2.2.0", path = "packages/provwasm-mocks" } provwasm-proc-macro = { version = "0.1.0", path = "packages/provwasm-proc-macro" } provwasm-std = { version = "2.2.0", path = "packages/provwasm-std" } -base64 = "0.21.7" -chrono = { version = "0.4.33", default-features = false } -prost = { version = "0.11.9", default-features = false, features = ["prost-derive"] } -prost-types = { version = "0.11.9", default-features = false } -prost-build = "0.11.9" -schemars = "0.8.16" -serde = { version = "1.0.196", default-features = false, features = ["derive"] } -serde_json = { version = "1.0.113", features = ["std"] } -thiserror = { version = "1.0.56" } +base64 = "=0.21.7" +chrono = { version = "=0.4.33", default-features = false } +prost = { version = "=0.11.9", default-features = false, features = ["prost-derive"] } +prost-types = { version = "=0.11.9", default-features = false } +prost-build = "=0.11.9" +schemars = "=0.8.16" +serde = { version = "=1.0.196", default-features = false, features = ["derive"] } +serde_json = { version = "=1.0.113", features = ["std"] } +thiserror = { version = "=1.0.56" } [profile.release] opt-level = 3 diff --git a/contracts/attrs/src/contract.rs b/contracts/attrs/src/contract.rs index 9d39f17e..a61e848d 100644 --- a/contracts/attrs/src/contract.rs +++ b/contracts/attrs/src/contract.rs @@ -1,5 +1,5 @@ use cosmwasm_std::{ - entry_point, to_json_binary, Deps, DepsMut, Env, MessageInfo, QueryResponse, Response, StdError, + entry_point, to_binary, Deps, DepsMut, Env, MessageInfo, QueryResponse, Response, StdError, }; use provwasm_std::types::provenance::attribute::v1::{AttributeQuerier, AttributeType}; @@ -139,7 +139,7 @@ fn try_delete_distinct_label( env.contract.address.clone(), env.contract.address, &attr_name, - to_json_binary(&Label { text: value })?, + to_binary(&Label { text: value })?, )?; let res = Response::new() .add_message(msg) @@ -163,11 +163,11 @@ fn try_update_label( env.contract.address.clone(), env.contract.address, &attr_name, - to_json_binary(&Label { + to_binary(&Label { text: original_text, })?, AttributeType::Json, - to_json_binary(&Label { text: update_text })?, + to_binary(&Label { text: update_text })?, AttributeType::Json, )?; let res = Response::new() @@ -184,12 +184,12 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result to_json_binary(&LabelNameResponse { name: attr_name }), + QueryMsg::GetLabelName {} => to_binary(&LabelNameResponse { name: attr_name }), QueryMsg::GetLabels {} => { let querier = AttributeQuerier::new(&deps.querier); let labels: Vec