From 7ddcfb714a5c9b8a7b404d0d8ec5d6e352091415 Mon Sep 17 00:00:00 2001 From: srdtrk <59252793+srdtrk@users.noreply.github.com> Date: Sat, 10 Aug 2024 09:43:10 +0200 Subject: [PATCH] deps: bumped cosmwasm to v2.1 (#133) * deps: update to cosmwasm 2.0 * deps: bumped to cosmwasm 2.0 * imp: fixed tests * deps: updated testing contracts * imp(e2e): updated e2es * docs: improved docs a bit * imp: introduced ibc-proto to support the transfer memo field * fix(e2e): fix test * deps: updated 'Cargo.lock' * deps: bumped workflows and optimizer --- .github/workflows/e2e.yml | 14 +- .github/workflows/rust.yml | 12 +- Cargo.lock | 835 +++++++++------ Cargo.toml | 36 +- README.md | 3 +- e2e/interchaintestv8/contract_test.go | 2 +- .../types/callbackcounter/msgs.go | 527 ++++----- .../types/cwicacontroller/msgs.go | 998 +++++++++--------- .../types/cwicacontroller/query.go | 18 +- e2e/interchaintestv8/types/cwicaowner/msgs.go | 224 ++-- .../types/cwicaowner/query.go | 22 +- e2e/interchaintestv8/wasm_msg_test.go | 4 +- justfile | 10 +- src/contract.rs | 22 +- src/helpers.rs | 8 +- src/ibc/relay.rs | 11 +- src/ibc/types/packet.rs | 4 +- src/ibc/types/stargate.rs | 1 + src/types/cosmos_msg.rs | 22 +- src/types/query_msg.rs | 51 +- src/types/state.rs | 159 --- testing/Readme.md | 20 +- .../contracts/callback-counter/.cargo/config | 4 - testing/contracts/callback-counter/Cargo.lock | 711 +++++++++---- testing/contracts/callback-counter/Cargo.toml | 29 +- testing/contracts/cw-ica-owner/.cargo/config | 4 - testing/contracts/cw-ica-owner/Cargo.lock | 899 +++++++++------- testing/contracts/cw-ica-owner/Cargo.toml | 32 +- testing/contracts/cw-ica-owner/src/state.rs | 2 +- 29 files changed, 2563 insertions(+), 2121 deletions(-) delete mode 100644 testing/contracts/callback-counter/.cargo/config delete mode 100644 testing/contracts/cw-ica-owner/.cargo/config diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1912e8be..036c74ca 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -18,14 +18,14 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: - go-version: "1.21" - - uses: actions/checkout@v3 + go-version: "1.22" + - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v3.7.0 with: - version: v1.54 + version: v1.59 args: --timeout 5m working-directory: e2e/interchaintestv8 build: @@ -63,12 +63,12 @@ jobs: - name: Build Optimized Contract run: just build-optimize - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version: "1.22" check-latest: true cache-dependency-path: | - e2e/interchaintest/go.sum + e2e/interchaintestv8/go.sum - name: TestContract run: just e2e-test ${{ matrix.test }} - name: Upload Diagnostics on Failure diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4f89cc72..51ed4e71 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -21,7 +21,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.79.0 + toolchain: stable target: wasm32-unknown-unknown override: true @@ -52,7 +52,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.79.0 + toolchain: stable override: true - name: Run unit tests @@ -80,7 +80,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.79.0 + toolchain: stable override: true - name: Run unit tests @@ -108,7 +108,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.79.0 + toolchain: stable override: true - name: Run unit tests @@ -136,7 +136,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.79.0 + toolchain: stable override: true - name: Run unit tests @@ -164,7 +164,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.79.0 + toolchain: stable override: true components: rustfmt, clippy diff --git a/Cargo.lock b/Cargo.lock index bbe0abfc..76973b26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.7.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom", + "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -40,6 +47,127 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rayon", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -70,26 +198,11 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bech32" -version = "0.9.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "block-buffer" @@ -102,9 +215,9 @@ dependencies = [ [[package]] name = "bnum" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" [[package]] name = "bumpalo" @@ -120,18 +233,18 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] [[package]] name = "cc" -version = "1.1.6" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" [[package]] name = "cfg-if" @@ -166,54 +279,60 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cosmos-sdk-proto" -version = "0.20.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32560304ab4c365791fd307282f76637213d8083c1a98490c35159cd67852237" +checksum = "8b2f63ab112b8c8e7b8a29c891adc48f43145beb21c0bfbf562957072c1e0beb" dependencies = [ "prost", "prost-types", - "tendermint-proto 0.34.1", + "tendermint-proto", ] [[package]] -name = "cosmos-sdk-proto" -version = "0.21.1" +name = "cosmwasm-core" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e23f6ab56d5f031cde05b8b82a5fefd3a1a223595c79e32317a97189e612bc" -dependencies = [ - "prost", - "prost-types", - "tendermint-proto 0.35.0", -] +checksum = "d905990ef3afb5753bb709dc7de88e9e370aa32bcc2f31731d4b533b63e82490" [[package]] name = "cosmwasm-crypto" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd50718a2b6830ce9eb5d465de5a018a12e71729d66b70807ce97e6dd14f931d" +checksum = "5b2a7bd9c1dd9a377a4dc0f4ad97d24b03c33798cd5a6d7ceb8869b41c5d2f2d" dependencies = [ - "digest 0.10.7", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "digest", "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.4", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242e98e7a231c122e08f300d9db3262d1007b51758a8732cd6210b3e9faa4f3a" +checksum = "029910b409398fdf81955d7301b906caf81f2c42b013ea074fbd89720229c424" dependencies = [ - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] name = "cosmwasm-schema" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7879036156092ad1c22fe0d7316efc5a5eceec2bc3906462a2560215f2a2f929" +checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -224,33 +343,34 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb57855fbfc83327f8445ae0d413b1a05ac0d68c396ab4d122b2abd7bb82cb6" +checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "cosmwasm-std" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c1556156fdf892a55cced6115968b961eaaadd6f724a2c2cb7d1e168e32dd3" +checksum = "51dec99a2e478715c0a4277f0dbeadbb8466500eb7dec873d0924edd086e77f1" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bech32", "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "derive_more", "hex", + "rand_core", "schemars", "serde", - "serde-json-wasm 0.5.2", - "sha2 0.10.8", + "serde-json-wasm", + "sha2", "static_assertions", "thiserror", ] @@ -264,6 +384,31 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -271,7 +416,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -288,144 +433,58 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "cw-address-like" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451a4691083a88a3c0630a8a88799e9d4cd6679b7ce8ff22b8da2873ff31d380" -dependencies = [ - "cosmwasm-std", -] - -[[package]] -name = "cw-ica-controller" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcd5af76ac0cb5ea40a715191028cbddeb0f682c9771f7d1c57ea24f42dec704" -dependencies = [ - "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus", - "cw2", - "schemars", - "semver", - "serde", - "serde-json-wasm 0.5.2", - "thiserror", -] - -[[package]] -name = "cw-ica-controller" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83994aa638a9943eb0eca4fd82a21d9261c61763b609f2685a5fb01dff24aaa4" -dependencies = [ - "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus", - "cw2", - "schemars", - "semver", - "serde", - "serde-json-wasm 1.0.1", - "thiserror", -] - -[[package]] -name = "cw-ica-controller" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62b41020a146c640e6411ca43f43bc5857b8a8ba818099c40ae090cfae71c49" -dependencies = [ - "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema", - "cosmwasm-std", - "cw-ownable", - "cw-storage-plus", - "cw2", - "schemars", - "semver", - "serde", - "serde-json-wasm 1.0.1", - "thiserror", -] - -[[package]] -name = "cw-ica-controller" -version = "0.4.2" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb040438ea955087568b4269090a2c282cd3b433de7f8dc5d80cdbfbbe1a5ba" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema", - "cosmwasm-std", - "cw-ica-controller-derive", - "cw-ownable", - "cw-storage-plus", - "cw2", - "schemars", - "semver", - "serde", - "serde-json-wasm 1.0.1", - "thiserror", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] -name = "cw-ica-controller" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff14c2d8a7f11dbbbf5e6e758aa8634679dbe87ab7aac6ce2b8cc2b3eff4731a" +name = "cw-address-like" +version = "2.0.4" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ - "cosmos-sdk-proto 0.20.0", - "cosmwasm-schema", "cosmwasm-std", - "cw-ica-controller-derive", - "cw-ownable", - "cw-storage-plus", - "cw2", - "schemars", - "semver", - "serde", - "serde-json-wasm 1.0.1", - "thiserror", ] [[package]] name = "cw-ica-controller" -version = "0.6.1" +version = "0.7.0" dependencies = [ "anybuf", "base64 0.13.1", - "cosmos-sdk-proto 0.21.1", + "cosmos-sdk-proto", "cosmwasm-schema", "cosmwasm-std", - "cw-ica-controller 0.1.3", - "cw-ica-controller 0.2.0", - "cw-ica-controller 0.3.0", - "cw-ica-controller 0.4.2", - "cw-ica-controller 0.5.0", "cw-ica-controller-derive", "cw-ownable", "cw-storage-plus", "cw2", + "ibc-proto", "prost", "schemars", "semver", "serde", - "serde-json-wasm 1.0.1", + "serde-json-wasm", "serde_with", "thiserror", ] @@ -443,9 +502,8 @@ dependencies = [ [[package]] name = "cw-ownable" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093dfb4520c48b5848274dd88ea99e280a04bc08729603341c7fb0d758c74321" +version = "0.6.0" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -458,9 +516,8 @@ dependencies = [ [[package]] name = "cw-ownable-derive" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d3bf2e0f341bb6cc100d7d441d31cf713fbd3ce0c511f91e79f14b40a889af" +version = "0.6.0" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "proc-macro2", "quote", @@ -469,9 +526,9 @@ dependencies = [ [[package]] name = "cw-storage-plus" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" +checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" dependencies = [ "cosmwasm-std", "schemars", @@ -480,24 +537,22 @@ dependencies = [ [[package]] name = "cw-utils" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" +checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw2", "schemars", - "semver", "serde", "thiserror", ] [[package]] name = "cw2" -version = "1.1.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" +checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -529,7 +584,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -540,7 +595,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -575,12 +630,24 @@ dependencies = [ ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "generic-array", + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", + "unicode-xid", ] [[package]] @@ -589,7 +656,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "const-oid", "crypto-common", "subtle", @@ -608,25 +675,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest 0.10.7", + "digest", "elliptic-curve", "rfc6979", "signature", - "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", ] [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", - "hashbrown 0.12.3", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.4", - "serde", - "sha2 0.9.9", + "rand_core", + "sha2", "zeroize", ] @@ -644,12 +719,11 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.7", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", "subtle", "zeroize", @@ -667,10 +741,16 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "flex-error" version = "0.4.4" @@ -686,12 +766,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "forward_ref" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" - [[package]] name = "generic-array" version = "0.14.7" @@ -721,7 +795,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -730,6 +804,12 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ "ahash", ] @@ -739,6 +819,10 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "hex" @@ -752,7 +836,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -778,6 +862,37 @@ dependencies = [ "cc", ] +[[package]] +name = "ibc-proto" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1678333cf68c9094ca66aaf9a271269f1f6bf5c26881161def8bd88cee831a23" +dependencies = [ + "base64 0.22.1", + "bytes", + "flex-error", + "ics23", + "informalsystems-pbjson", + "prost", + "serde", + "subtle-encoding", + "tendermint-proto", +] + +[[package]] +name = "ics23" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b17f1a5bd7d12ad30a21445cfa5f52fd7651cb3243ba866f9916b1ec112f12" +dependencies = [ + "anyhow", + "bytes", + "hex", + "informalsystems-pbjson", + "prost", + "serde", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -797,20 +912,39 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown 0.14.5", "serde", ] +[[package]] +name = "informalsystems-pbjson" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "itertools" -version = "0.12.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -832,16 +966,14 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "once_cell", - "sha2 0.10.8", - "signature", + "sha2", ] [[package]] @@ -857,31 +989,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] -name = "num-conv" -version = "0.1.0" +name = "memchr" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "num-derive" -version = "0.3.3" +name = "num-bigint" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "num-integer", + "num-traits", ] [[package]] -name = "num-derive" -version = "0.4.2" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.71", + "num-traits", ] [[package]] @@ -900,10 +1035,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.1" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] [[package]] name = "paste" @@ -912,20 +1053,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "pkcs8" -version = "0.10.2" +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "der", - "spki", + "zerocopy", ] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro2" @@ -938,9 +1087,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" dependencies = [ "bytes", "prost-derive", @@ -948,22 +1097,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" dependencies = [ "anyhow", - "itertools", + "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" dependencies = [ "prost", ] @@ -978,10 +1127,24 @@ dependencies = [ ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] [[package]] name = "rand_core" @@ -992,6 +1155,26 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -1002,6 +1185,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "ryu" version = "1.0.18" @@ -1029,7 +1221,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1041,7 +1233,6 @@ dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] @@ -1054,22 +1245,13 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-json-wasm" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9213a07d53faa0b8dd81e767a54a8188a242fdb9be99ab75ec576a774bfdd7" -dependencies = [ - "serde", -] - [[package]] name = "serde-json-wasm" version = "1.0.1" @@ -1090,13 +1272,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1107,16 +1289,17 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1131,7 +1314,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.3.0", "serde", "serde_derive", "serde_json", @@ -1148,20 +1331,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.71", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "syn 2.0.72", ] [[package]] @@ -1172,7 +1342,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -1181,18 +1351,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", + "digest", + "rand_core", ] [[package]] @@ -1235,9 +1395,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -1246,32 +1406,12 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.34.1" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" +checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" dependencies = [ "bytes", "flex-error", - "num-derive 0.3.3", - "num-traits", - "prost", - "prost-types", - "serde", - "serde_bytes", - "subtle-encoding", - "time", -] - -[[package]] -name = "tendermint-proto" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff525d5540a9fc535c38dc0d92a98da3ee36fcdfbda99cecb9f3cce5cd4d41d7" -dependencies = [ - "bytes", - "flex-error", - "num-derive 0.4.2", - "num-traits", "prost", "prost-types", "serde", @@ -1297,7 +1437,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1343,11 +1483,17 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" @@ -1376,7 +1522,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-shared", ] @@ -1398,7 +1544,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1482,8 +1628,43 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] diff --git a/Cargo.toml b/Cargo.toml index c4c82c83..0441ace7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cw-ica-controller" -version = "0.6.1" +version = "0.7.0" authors = ["srdtrk "] edition = "2021" description = "This is a CosmWasm implementation of an ICS-27 interchain accounts controller." @@ -36,33 +36,29 @@ query = ["dep:prost"] optimize = """docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/optimizer:0.15.1 + cosmwasm/optimizer:0.16.0 """ [dependencies] -cosmwasm-schema = "1.5.0" -cosmwasm-std = { version = "1.5.0", features = [ +cosmwasm-schema = "2.1" +cosmwasm-std = { version = "2.1", features = [ "cosmwasm_1_4", - "ibc3", + "stargate", ] } -cw-storage-plus = "1.1.0" -cw2 = "1.1.1" -schemars = "0.8.10" +cw-storage-plus = "2.0" +cw2 = "2.0" +schemars = "0.8" serde = { version = "1.0", default-features = false, features = ["derive"] } -serde-json-wasm = "1.0.0" -thiserror = "1.0.50" -cosmos-sdk-proto = { version = "0.21.1", default-features = false, features = ["cosmwasm"] } +serde-json-wasm = "1.0" +thiserror = "1.0" +cosmos-sdk-proto = { version = "0.23", default-features = false, features = ["cosmwasm", "std"] } +ibc-proto = { version = "0.47", default-features = false, features = ["std", "serde"] } semver = "1.0" -cw-ownable = "0.5.1" +cw-ownable = { version = "0.6.0", git = "https://github.com/larry0x/cw-plus-plus.git", rev = "718351d4e9d66edbf3b6dbea2d13b56ef732f51c" } cw-ica-controller-derive = "0.4.2" -prost = { version = "0.12", optional = true } -anybuf = "0.5.0" -serde_with = "3.8.1" +prost = { version = "0.13", optional = true } +anybuf = "0.5" +serde_with = "3.8" [dev-dependencies] base64 = "0.13.1" -cw-ica-controller_v0_1_3 = { package = "cw-ica-controller", version = "=0.1.3" } -cw-ica-controller_v0_2_0 = { package = "cw-ica-controller", version = "=0.2.0" } -cw-ica-controller_v0_3_0 = { package = "cw-ica-controller", version = "=0.3.0" } -cw-ica-controller_v0_4_2= { package = "cw-ica-controller", version = "=0.4.2" } -cw-ica-controller_v0_5_0 = { package = "cw-ica-controller", version = "=0.5.0" } diff --git a/README.md b/README.md index 836bd1ce..6414421f 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,11 @@ [![E2E Status](https://github.com/srdtrk/cw-ica-controller/actions/workflows/e2e.yml/badge.svg?branch=main)](https://github.com/srdtrk/cw-ica-controller/tree/main/e2e) [![Tag](https://img.shields.io/github/tag/srdtrk/cw-ica-controller.svg)](https://github.com/srdtrk/cw-ica-controller/releases/latest) [![License: Apache-2.0](https://img.shields.io/github/license/srdtrk/cw-ica-controller.svg)](https://github.com/srdtrk/cw-ica-controller/blob/main/LICENSE) - [![Lines of Code](https://tokei.rs/b1/github/srdtrk/cw-ica-controller)](https://github.com/srdtrk/cw-ica-controller) ![cw-ica-controller](./docs/static/img/cw-ica-controller.svg) -This is a `CosmWasm` smart contract that communicates with the golang `ica/host` module on the counterparty chain to create and manage **one** interchain account. This contract can also execute callbacks based on the result of the interchain account transaction. Because this is a `CosmWasm` implementation of the entire ICA controller, the chain that this contract is deployed on need **not** have the ICA module enabled. Moreover, the counterparty chain need not have `CosmWasm` support. This contract can be deployed on chains that support `CosmWasm` `v1.4+`. +This is a `CosmWasm` smart contract that communicates with the golang `ica/host` module on the counterparty chain to create and manage **one** interchain account. This contract can also execute callbacks based on the result of the interchain account transaction. Because this is a `CosmWasm` implementation of the entire ICA controller, the chain that this contract is deployed on need **not** have the ICA module enabled. Moreover, the counterparty chain need not have `CosmWasm` support. This contract uses `CosmWasm` `v2.1` but can be deployed on chains that support `CosmWasm` `v1.4+`. **A documentation website for this contract is [here](https://srdtrk.github.io/cw-ica-controller/).** diff --git a/e2e/interchaintestv8/contract_test.go b/e2e/interchaintestv8/contract_test.go index 2496829e..ceae2339 100644 --- a/e2e/interchaintestv8/contract_test.go +++ b/e2e/interchaintestv8/contract_test.go @@ -407,7 +407,7 @@ func (s *ContractTestSuite) IcaContractExecutionTestWithOrdering(ordering cwicac Gov: &cwicacontroller.CosmosMsg_for_Empty_Gov{ Vote: &cwicacontroller.GovMsg_Vote{ ProposalId: 1, - Vote: "yes", + Option: cwicacontroller.VoteOption_Yes, }, }, } diff --git a/e2e/interchaintestv8/types/callbackcounter/msgs.go b/e2e/interchaintestv8/types/callbackcounter/msgs.go index 7c2d250f..e7b972cd 100644 --- a/e2e/interchaintestv8/types/callbackcounter/msgs.go +++ b/e2e/interchaintestv8/types/callbackcounter/msgs.go @@ -14,16 +14,30 @@ type QueryMsg struct { GetCallbackCounter *QueryMsg_GetCallbackCounter `json:"get_callback_counter,omitempty"` } -// The response for a successful ICA query. -type IcaQueryResponse struct { - // Response for a [`cosmwasm_std::BankQuery`]. - Bank *IcaQueryResponse_Bank `json:"bank,omitempty"` - // Response for a [`cosmwasm_std::QueryRequest::Stargate`]. Protobuf encoded bytes stored as [`cosmwasm_std::Binary`]. - Stargate *IcaQueryResponse_Stargate `json:"stargate,omitempty"` - // Response for a [`cosmwasm_std::WasmQuery`]. - Wasm *IcaQueryResponse_Wasm `json:"wasm,omitempty"` - // Response for a [`cosmwasm_std::StakingQuery`]. - Staking *IcaQueryResponse_Staking `json:"staking,omitempty"` +// IbcChannel defines all information on a channel. This is generally used in the hand-shake process, but can be queried directly. +type IbcChannel struct { + // The connection upon which this channel was created. If this is a multi-hop channel, we only expose the first hop. + ConnectionId string `json:"connection_id"` + CounterpartyEndpoint IbcEndpoint `json:"counterparty_endpoint"` + Endpoint IbcEndpoint `json:"endpoint"` + Order IbcOrder `json:"order"` + // Note: in ibcv3 this may be "", in the IbcOpenChannel handshake messages + Version string `json:"version"` +} + +// The data format returned from StakingRequest::Validator query +type ValidatorResponse struct { + Validator *Validator `json:"validator,omitempty"` +} + +// Delegation is the detailed information about a delegation. +type Delegation struct { + // Delegation amount. + Amount Coin `json:"amount"` + // The delegator address. + Delegator string `json:"delegator"` + // A validator address (e.g. cosmosvaloper1...) + Validator string `json:"validator"` } /* @@ -41,74 +55,153 @@ let c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ``` */ type Uint128 string +type Coin struct { + Amount Uint128 `json:"amount"` + Denom string `json:"denom"` +} + +// `IcaControllerCallbackMsg` is the type of message that this contract can send to other contracts. +type IcaControllerCallbackMsg struct { + // `OnAcknowledgementPacketCallback` is the callback that this contract makes to other contracts when it receives an acknowledgement packet. + OnAcknowledgementPacketCallback *IcaControllerCallbackMsg_OnAcknowledgementPacketCallback `json:"on_acknowledgement_packet_callback,omitempty"` + // `OnTimeoutPacketCallback` is the callback that this contract makes to other contracts when it receives a timeout packet. + OnTimeoutPacketCallback *IcaControllerCallbackMsg_OnTimeoutPacketCallback `json:"on_timeout_packet_callback,omitempty"` + // `OnChannelOpenAckCallback` is the callback that this contract makes to other contracts when it receives a channel open acknowledgement. + OnChannelOpenAckCallback *IcaControllerCallbackMsg_OnChannelOpenAckCallback `json:"on_channel_open_ack_callback,omitempty"` +} + +type BalanceResponse struct { + // Always returns a Coin with the requested denom. This may be of 0 amount if no such funds. + Amount Coin `json:"amount"` +} + +// Replicates the cosmos-sdk bank module Metadata type +type DenomMetadata struct { + Name string `json:"name"` + Symbol string `json:"symbol"` + Uri string `json:"uri"` + UriHash string `json:"uri_hash"` + Base string `json:"base"` + DenomUnits []DenomUnit `json:"denom_units"` + Description string `json:"description"` + Display string `json:"display"` +} + +// The response for a successful ICA query. +type IcaQueryResponse struct { + // Response for a [`cosmwasm_std::BankQuery`]. + Bank *IcaQueryResponse_Bank `json:"bank,omitempty"` + // Response for a [`cosmwasm_std::QueryRequest::Stargate`]. Protobuf encoded bytes stored as [`cosmwasm_std::Binary`]. + Stargate *IcaQueryResponse_Stargate `json:"stargate,omitempty"` + // Response for a [`cosmwasm_std::WasmQuery`]. + Wasm *IcaQueryResponse_Wasm `json:"wasm,omitempty"` + // Response for a [`cosmwasm_std::StakingQuery`]. + Staking *IcaQueryResponse_Staking `json:"staking,omitempty"` +} + +// The result of an ICA query packet. +type IcaQueryResult struct { + // The query was successful and the responses are included. + Success *IcaQueryResult_Success `json:"success,omitempty"` + // The query failed with an error message. The error string often does not contain useful information for the end user. + Error *IcaQueryResult_Error `json:"error,omitempty"` +} + // In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set. type IbcTimeout struct { Block *IbcTimeoutBlock `json:"block,omitempty"` Timestamp *Timestamp `json:"timestamp,omitempty"` } -/* -A point in time in nanosecond precision. +// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height) +type IbcTimeoutBlock struct { + // the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0) + Revision int `json:"revision"` + // block height after which the packet times out. the height within the given revision + Height int `json:"height"` +} -This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z. +// The response type for the [`cosmwasm_std::BankQuery`] queries. +type BankQueryResponse struct { + // Response for the [`cosmwasm_std::BankQuery::Supply`] query. + Supply *BankQueryResponse_Supply `json:"supply,omitempty"` + // Response for the [`cosmwasm_std::BankQuery::Balance`] query. + Balance *BankQueryResponse_Balance `json:"balance,omitempty"` + // Response for the [`cosmwasm_std::BankQuery::AllBalances`] query. + AllBalances *BankQueryResponse_AllBalances `json:"all_balances,omitempty"` + // Response for the [`cosmwasm_std::BankQuery::DenomMetadata`] query. + DenomMetadata *BankQueryResponse_DenomMetadata `json:"denom_metadata,omitempty"` + // Response for the [`cosmwasm_std::BankQuery::AllDenomMetadata`] query. + AllDenomMetadata *BankQueryResponse_AllDenomMetadata `json:"all_denom_metadata,omitempty"` +} -## Examples +/* +The essential data from wasmd's [CodeInfo]/[CodeInfoResponse]. -``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202); +`code_hash`/`data_hash` was renamed to `checksum` to follow the CosmWasm convention and naming in `instantiate2_address`. -let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ``` +[CodeInfo]: https://github.com/CosmWasm/wasmd/blob/v0.30.0/proto/cosmwasm/wasm/v1/types.proto#L62-L72 [CodeInfoResponse]: https://github.com/CosmWasm/wasmd/blob/v0.30.0/proto/cosmwasm/wasm/v1/query.proto#L184-L199 */ -type Timestamp Uint64 +type CodeInfoResponse struct { + // The hash of the Wasm blob + Checksum Checksum `json:"checksum"` + CodeId int `json:"code_id"` + // The address that initially stored the code + Creator Addr `json:"creator"` +} -// IbcChannel defines all information on a channel. This is generally used in the hand-shake process, but can be queried directly. -type IbcChannel struct { - Order IbcOrder `json:"order"` - // Note: in ibcv3 this may be "", in the IbcOpenChannel handshake messages - Version string `json:"version"` - // The connection upon which this channel was created. If this is a multi-hop channel, we only expose the first hop. - ConnectionId string `json:"connection_id"` - CounterpartyEndpoint IbcEndpoint `json:"counterparty_endpoint"` - Endpoint IbcEndpoint `json:"endpoint"` +type QueryMsg_GetCallbackCounter struct{} + +// Replicates the cosmos-sdk bank module DenomUnit type +type DenomUnit struct { + Denom string `json:"denom"` + Exponent int `json:"exponent"` + Aliases []string `json:"aliases"` } +// IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations. +type IbcOrder string + +const ( + IbcOrder_OrderUnordered IbcOrder = "ORDER_UNORDERED" + IbcOrder_OrderOrdered IbcOrder = "ORDER_ORDERED" +) + /* -A human readable address. +A point in time in nanosecond precision. -In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length. +This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z. -This type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances. +## Examples -This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance. +``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202); + +let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ``` */ -type Addr string +type Timestamp Uint64 -// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height) -type IbcTimeoutBlock struct { - // block height after which the packet times out. the height within the given revision - Height int `json:"height"` - // the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0) - Revision int `json:"revision"` +type SupplyResponse struct { + // Always returns a Coin with the requested denom. This will be of zero amount if the denom does not exist. + Amount Coin `json:"amount"` } -// Replicates the cosmos-sdk bank module DenomUnit type -type DenomUnit struct { - Aliases []string `json:"aliases"` - Denom string `json:"denom"` - Exponent int `json:"exponent"` +type DenomMetadataResponse struct { + // The metadata for the queried denom. + Metadata DenomMetadata `json:"metadata"` } // Instances are created in the querier. type Validator struct { - Commission Decimal `json:"commission"` - // The maximum daily increase of the commission - MaxChangeRate Decimal `json:"max_change_rate"` - MaxCommission Decimal `json:"max_commission"` /* The operator address of the validator (e.g. cosmosvaloper1...). See https://github.com/cosmos/cosmos-sdk/blob/v0.47.4/proto/cosmos/staking/v1beta1/staking.proto#L95-L96 for more information. This uses `String` instead of `Addr` since the bech32 address prefix is different from the ones that regular user accounts use. */ - Address string `json:"address"` + Address string `json:"address"` + Commission Decimal `json:"commission"` + // The maximum daily increase of the commission + MaxChangeRate Decimal `json:"max_change_rate"` + MaxCommission Decimal `json:"max_commission"` } /* @@ -125,84 +218,82 @@ let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ``` type Uint64 string /* -The essential data from wasmd's [CodeInfo]/[CodeInfoResponse]. - -`code_hash`/`data_hash` was renamed to `checksum` to follow the CosmWasm convention and naming in `instantiate2_address`. +Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline. -[CodeInfo]: https://github.com/CosmWasm/wasmd/blob/v0.30.0/proto/cosmwasm/wasm/v1/types.proto#L62-L72 [CodeInfoResponse]: https://github.com/CosmWasm/wasmd/blob/v0.30.0/proto/cosmwasm/wasm/v1/query.proto#L184-L199 +This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also . */ -type CodeInfoResponse struct { - // The hash of the Wasm blob - Checksum HexBinary `json:"checksum"` - CodeId int `json:"code_id"` - // The address that initially stored the code - Creator string `json:"creator"` -} - -// BondedDenomResponse is data format returned from StakingRequest::BondedDenom query -type BondedDenomResponse struct { - Denom string `json:"denom"` -} - -type ContractInfoResponse struct { - // if set, the contract is pinned to the cache, and thus uses less gas when called - Pinned bool `json:"pinned"` - // admin who can run migrations (if any) - Admin *string `json:"admin,omitempty"` - CodeId int `json:"code_id"` - // address that instantiated this contract - Creator string `json:"creator"` - // set if this contract has bound an IBC port - IbcPort *string `json:"ibc_port,omitempty"` -} +type Binary string -type DenomMetadataResponse struct { - // The metadata for the queried denom. - Metadata DenomMetadata `json:"metadata"` +// Response for the [`cosmwasm_std::StakingQuery::AllDelegations`] query over ICA. +type IcaAllDelegationsResponse struct { + // The delegations. + Delegations []Delegation `json:"delegations"` } -// IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations. -type IbcOrder string +/* +A human readable address. -const ( - IbcOrder_OrderUnordered IbcOrder = "ORDER_UNORDERED" - IbcOrder_OrderOrdered IbcOrder = "ORDER_ORDERED" -) +In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length. -/* -This is a wrapper around Vec to add hex de/serialization with serde. It also adds some helper methods to help encode inline. +This type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances. -This is similar to `cosmwasm_std::Binary` but uses hex. See also . +This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance. */ -type HexBinary string +type Addr string -// Response for the [`cosmwasm_std::StakingQuery::AllDelegations`] query over ICA. -type IcaAllDelegationsResponse struct { - // The delegations. - Delegations []Delegation `json:"delegations"` +// `Data` is the response to an ibc packet. It either contains a result or an error. +type Data struct { + // Result is the result of a successful transaction. + Result *Data_Result `json:"result,omitempty"` + // Error is the error message of a failed transaction. It is a string of the error message (not base64 encoded). + Error *Data_Error `json:"error,omitempty"` } -/* -A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0 +// The response type for the [`cosmwasm_std::WasmQuery`] queries. +type WasmQueryResponse struct { + // Response for the [`cosmwasm_std::WasmQuery::ContractInfo`] query. Returns `None` if the contract does not exist. The `pinned` field is not supported. + ContractInfo *ContractInfoResponse `json:"contract_info,omitempty"` + // Response for the [`cosmwasm_std::WasmQuery::CodeInfo`] query. Returns `None` if the code does not exist. + CodeInfo *CodeInfoResponse `json:"code_info,omitempty"` + // Response for the [`cosmwasm_std::WasmQuery::Raw`] query. + RawContractState *Binary `json:"raw_contract_state,omitempty"` + // Response for the [`cosmwasm_std::WasmQuery::Smart`] query. + SmartContractState *WasmQueryResponse_SmartContractState `json:"smart_contract_state,omitempty"` +} -The greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18) -*/ -type Decimal string +// `TxEncoding` is the encoding of the transactions sent to the ICA host. +type TxEncoding string -type AllBalanceResponse struct { - // Returns all non-zero coins held by this account. - Amount []Coin `json:"amount"` +const ( + // `Protobuf` is the protobuf serialization of the CosmosSDK's Any. + TxEncoding_Proto3 TxEncoding = "proto3" + // `Proto3Json` is the json serialization of the CosmosSDK's Any. + TxEncoding_Proto3Json TxEncoding = "proto3json" +) + +type ExecuteMsg_ReceiveIcaCallback IcaControllerCallbackMsg + +type AllDenomMetadataResponse struct { + // Always returns metadata for all token denoms on the base chain. + Metadata []DenomMetadata `json:"metadata"` + NextKey *Binary `json:"next_key,omitempty"` } -type SupplyResponse struct { - // Always returns a Coin with the requested denom. This will be of zero amount if the denom does not exist. - Amount Coin `json:"amount"` +type IbcPacket struct { + // The sequence number of the packet on the given channel + Sequence int `json:"sequence"` + // identifies the channel and port on the sending chain. + Src IbcEndpoint `json:"src"` + Timeout IbcTimeout `json:"timeout"` + // The raw data sent from the other side in the packet + Data Binary `json:"data"` + // identifies the channel and port on the receiving chain. + Dest IbcEndpoint `json:"dest"` } -// Response for the [`cosmwasm_std::StakingQuery::Delegation`] query over ICA. -type IcaDelegationResponse struct { - // The delegation response if it exists. - Delegation *Delegation `json:"delegation,omitempty"` +type IbcEndpoint struct { + ChannelId string `json:"channel_id"` + PortId string `json:"port_id"` } // The response type for the [`cosmwasm_std::StakingQuery`] queries. @@ -219,16 +310,6 @@ type StakingQueryResponse struct { Validator *StakingQueryResponse_Validator `json:"validator,omitempty"` } -// `TxEncoding` is the encoding of the transactions sent to the ICA host. -type TxEncoding string - -const ( - // `Protobuf` is the protobuf serialization of the CosmosSDK's Any. - TxEncoding_Proto3 TxEncoding = "proto3" - // `Proto3Json` is the json serialization of the CosmosSDK's Any. - TxEncoding_Proto3Json TxEncoding = "proto3json" -) - // CallbackCounter tracks the number of callbacks in store. type CallbackCounter struct { // The erroneous callbacks. @@ -240,170 +321,93 @@ type CallbackCounter struct { } /* -Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline. +A SHA-256 checksum of a Wasm blob, used to identify a Wasm code. This must remain stable since this checksum is stored in the blockchain state. -This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also . +This is often referred to as "code ID" in go-cosmwasm, even if code ID usually refers to an auto-incrementing number. */ -type Binary string +type Checksum string -// The result of an ICA query packet. -type IcaQueryResult struct { - // The query was successful and the responses are included. - Success *IcaQueryResult_Success `json:"success,omitempty"` - // The query failed with an error message. The error string often does not contain useful information for the end user. - Error *IcaQueryResult_Error `json:"error,omitempty"` +// BondedDenomResponse is data format returned from StakingRequest::BondedDenom query +type BondedDenomResponse struct { + Denom string `json:"denom"` } -type IbcEndpoint struct { - ChannelId string `json:"channel_id"` - PortId string `json:"port_id"` +// Response for the [`cosmwasm_std::StakingQuery::Delegation`] query over ICA. +type IcaDelegationResponse struct { + // The delegation response if it exists. + Delegation *Delegation `json:"delegation,omitempty"` } -// The response type for the [`cosmwasm_std::WasmQuery`] queries. -type WasmQueryResponse struct { - // Response for the [`cosmwasm_std::WasmQuery::ContractInfo`] query. Returns `None` if the contract does not exist. The `pinned` field is not supported. - ContractInfo *ContractInfoResponse `json:"contract_info,omitempty"` - // Response for the [`cosmwasm_std::WasmQuery::CodeInfo`] query. Returns `None` if the code does not exist. - CodeInfo *CodeInfoResponse `json:"code_info,omitempty"` - // Response for the [`cosmwasm_std::WasmQuery::Raw`] query. - RawContractState *Binary `json:"raw_contract_state,omitempty"` - // Response for the [`cosmwasm_std::WasmQuery::Smart`] query. - SmartContractState *WasmQueryResponse_SmartContractState `json:"smart_contract_state,omitempty"` +type AllBalanceResponse struct { + // Returns all non-zero coins held by this account. + Amount []Coin `json:"amount"` } -type IbcPacket struct { - // The raw data sent from the other side in the packet - Data Binary `json:"data"` - // identifies the channel and port on the receiving chain. - Dest IbcEndpoint `json:"dest"` - // The sequence number of the packet on the given channel - Sequence int `json:"sequence"` - // identifies the channel and port on the sending chain. - Src IbcEndpoint `json:"src"` - Timeout IbcTimeout `json:"timeout"` -} -type ExecuteMsg_ReceiveIcaCallback IcaControllerCallbackMsg +/* +A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0 -// The response type for the [`cosmwasm_std::BankQuery`] queries. -type BankQueryResponse struct { - // Response for the [`cosmwasm_std::BankQuery::Supply`] query. - Supply *BankQueryResponse_Supply `json:"supply,omitempty"` - // Response for the [`cosmwasm_std::BankQuery::Balance`] query. - Balance *BankQueryResponse_Balance `json:"balance,omitempty"` - // Response for the [`cosmwasm_std::BankQuery::AllBalances`] query. - AllBalances *BankQueryResponse_AllBalances `json:"all_balances,omitempty"` - // Response for the [`cosmwasm_std::BankQuery::DenomMetadata`] query. - DenomMetadata *BankQueryResponse_DenomMetadata `json:"denom_metadata,omitempty"` - // Response for the [`cosmwasm_std::BankQuery::AllDenomMetadata`] query. - AllDenomMetadata *BankQueryResponse_AllDenomMetadata `json:"all_denom_metadata,omitempty"` +The greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18) +*/ +type Decimal string + +type ContractInfoResponse struct { + // address that instantiated this contract + Creator Addr `json:"creator"` + // set if this contract has bound an IBC port + IbcPort *string `json:"ibc_port,omitempty"` + // if set, the contract is pinned to the cache, and thus uses less gas when called + Pinned bool `json:"pinned"` + // admin who can run migrations (if any) + Admin *Addr `json:"admin,omitempty"` + CodeId int `json:"code_id"` } // The data format returned from StakingRequest::AllValidators query type AllValidatorsResponse struct { Validators []Validator `json:"validators"` } +type StakingQueryResponse_AllDelegations IcaAllDelegationsResponse +type WasmQueryResponse_SmartContractState Binary -type AllDenomMetadataResponse struct { - // Always returns metadata for all token denoms on the base chain. - Metadata []DenomMetadata `json:"metadata"` - NextKey *Binary `json:"next_key,omitempty"` -} - -type BalanceResponse struct { - // Always returns a Coin with the requested denom. This may be of 0 amount if no such funds. - Amount Coin `json:"amount"` -} - -// `IcaControllerCallbackMsg` is the type of message that this contract can send to other contracts. -type IcaControllerCallbackMsg struct { - // `OnAcknowledgementPacketCallback` is the callback that this contract makes to other contracts when it receives an acknowledgement packet. - OnAcknowledgementPacketCallback *IcaControllerCallbackMsg_OnAcknowledgementPacketCallback `json:"on_acknowledgement_packet_callback,omitempty"` - // `OnTimeoutPacketCallback` is the callback that this contract makes to other contracts when it receives a timeout packet. - OnTimeoutPacketCallback *IcaControllerCallbackMsg_OnTimeoutPacketCallback `json:"on_timeout_packet_callback,omitempty"` - // `OnChannelOpenAckCallback` is the callback that this contract makes to other contracts when it receives a channel open acknowledgement. - OnChannelOpenAckCallback *IcaControllerCallbackMsg_OnChannelOpenAckCallback `json:"on_channel_open_ack_callback,omitempty"` -} - -// Replicates the cosmos-sdk bank module Metadata type -type DenomMetadata struct { - Name string `json:"name"` - Symbol string `json:"symbol"` - Uri string `json:"uri"` - UriHash string `json:"uri_hash"` - Base string `json:"base"` - DenomUnits []DenomUnit `json:"denom_units"` - Description string `json:"description"` - Display string `json:"display"` -} - -type QueryMsg_GetCallbackCounter struct{} - -type Coin struct { - Amount Uint128 `json:"amount"` - Denom string `json:"denom"` +type IcaQueryResult_Success struct { + // The height of the block at which the queries were executed on the counterparty chain. + Height int `json:"height"` + // The responses to the queries. + Responses []IcaQueryResponse `json:"responses"` } +type BankQueryResponse_DenomMetadata DenomMetadataResponse +type IcaQueryResponse_Wasm WasmQueryResponse -// `Data` is the response to an ibc packet. It either contains a result or an error. -type Data struct { - // Result is the result of a successful transaction. - Result *Data_Result `json:"result,omitempty"` - // Error is the error message of a failed transaction. It is a string of the error message (not base64 encoded). - Error *Data_Error `json:"error,omitempty"` -} +type IcaQueryResult_Error string +type StakingQueryResponse_BondedDenom BondedDenomResponse -// Delegation is the detailed information about a delegation. -type Delegation struct { - // Delegation amount. - Amount Coin `json:"amount"` - // The delegator address. - Delegator string `json:"delegator"` - // A validator address (e.g. cosmosvaloper1...) - Validator string `json:"validator"` +type IcaControllerCallbackMsg_OnTimeoutPacketCallback struct { + // The original packet that was sent + OriginalPacket IbcPacket `json:"original_packet"` + // The relayer that submitted acknowledgement packet + Relayer Addr `json:"relayer"` } +type BankQueryResponse_Balance BalanceResponse +type IcaQueryResponse_Staking StakingQueryResponse -// The data format returned from StakingRequest::Validator query -type ValidatorResponse struct { - Validator *Validator `json:"validator,omitempty"` -} -type IcaQueryResponse_Wasm WasmQueryResponse -type StakingQueryResponse_AllDelegations IcaAllDelegationsResponse -type BankQueryResponse_AllBalances AllBalanceResponse -type WasmQueryResponse_SmartContractState Binary +// Nullable_ContractInfoResponse is a nullable type of ContractInfoResponse +type Nullable_ContractInfoResponse = *ContractInfoResponse +type BankQueryResponse_Supply SupplyResponse // Nullable_CodeInfoResponse is a nullable type of CodeInfoResponse type Nullable_CodeInfoResponse = *CodeInfoResponse +type StakingQueryResponse_Delegation IcaDelegationResponse type IcaControllerCallbackMsg_OnChannelOpenAckCallback struct { + // The tx encoding this ICA channel uses. + TxEncoding TxEncoding `json:"tx_encoding"` // The channel that was opened. Channel IbcChannel `json:"channel"` // The address of the interchain account that was created. IcaAddress string `json:"ica_address"` - // The tx encoding this ICA channel uses. - TxEncoding TxEncoding `json:"tx_encoding"` } type StakingQueryResponse_Validator ValidatorResponse -// Nullable_ContractInfoResponse is a nullable type of ContractInfoResponse -type Nullable_ContractInfoResponse = *ContractInfoResponse - -// Nullable_Binary is a nullable type of Binary -type Nullable_Binary = *Binary -type StakingQueryResponse_BondedDenom BondedDenomResponse - -type IcaQueryResponse_Stargate struct { - // The response bytes. - Data Binary `json:"data"` - // The query grpc method - Path string `json:"path"` -} -type StakingQueryResponse_Delegation IcaDelegationResponse -type StakingQueryResponse_AllValidators AllValidatorsResponse -type BankQueryResponse_DenomMetadata DenomMetadataResponse -type IcaQueryResponse_Staking StakingQueryResponse -type Data_Result Binary -type IcaQueryResponse_Bank BankQueryResponse -type BankQueryResponse_AllDenomMetadata AllDenomMetadataResponse - type IcaControllerCallbackMsg_OnAcknowledgementPacketCallback struct { // The deserialized ICA acknowledgement data IcaAcknowledgement Data `json:"ica_acknowledgement"` @@ -414,23 +418,20 @@ type IcaControllerCallbackMsg_OnAcknowledgementPacketCallback struct { // The relayer that submitted acknowledgement packet Relayer Addr `json:"relayer"` } +type Data_Result Binary -type IcaQueryResult_Success struct { - // The height of the block at which the queries were executed on the counterparty chain. - Height int `json:"height"` - // The responses to the queries. - Responses []IcaQueryResponse `json:"responses"` -} +// Nullable_Binary is a nullable type of Binary +type Nullable_Binary = *Binary +type StakingQueryResponse_AllValidators AllValidatorsResponse -type IcaQueryResult_Error string -type BankQueryResponse_Balance BalanceResponse +type IcaQueryResponse_Stargate struct { + // The response bytes. + Data Binary `json:"data"` + // The query grpc method + Path string `json:"path"` +} +type IcaQueryResponse_Bank BankQueryResponse +type BankQueryResponse_AllBalances AllBalanceResponse type Data_Error string -type BankQueryResponse_Supply SupplyResponse - -type IcaControllerCallbackMsg_OnTimeoutPacketCallback struct { - // The original packet that was sent - OriginalPacket IbcPacket `json:"original_packet"` - // The relayer that submitted acknowledgement packet - Relayer Addr `json:"relayer"` -} +type BankQueryResponse_AllDenomMetadata AllDenomMetadataResponse diff --git a/e2e/interchaintestv8/types/cwicacontroller/msgs.go b/e2e/interchaintestv8/types/cwicacontroller/msgs.go index fdd042aa..295bc624 100644 --- a/e2e/interchaintestv8/types/cwicacontroller/msgs.go +++ b/e2e/interchaintestv8/types/cwicacontroller/msgs.go @@ -39,16 +39,213 @@ type QueryMsg struct { Ownership *QueryMsg_Ownership `json:"ownership,omitempty"` } -type CosmosMsg_for_Empty struct { - Bank *CosmosMsg_for_Empty_Bank `json:"bank,omitempty"` - Custom *CosmosMsg_for_Empty_Custom `json:"custom,omitempty"` - Staking *CosmosMsg_for_Empty_Staking `json:"staking,omitempty"` - Distribution *CosmosMsg_for_Empty_Distribution `json:"distribution,omitempty"` - // A Stargate message encoded the same way as a protobuf [Any](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto). This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) - Stargate *CosmosMsg_for_Empty_Stargate `json:"stargate,omitempty"` - Ibc *CosmosMsg_for_Empty_Ibc `json:"ibc,omitempty"` - Wasm *CosmosMsg_for_Empty_Wasm `json:"wasm,omitempty"` - Gov *CosmosMsg_for_Empty_Gov `json:"gov,omitempty"` +// The options needed to initialize the IBC channel. +type ChannelOpenInitOptions struct { + // The connection id on this chain. + ConnectionId string `json:"connection_id"` + // The counterparty connection id on the counterparty chain. + CounterpartyConnectionId string `json:"counterparty_connection_id"` + // The counterparty port id. If not specified, [`crate::ibc::types::keys::HOST_PORT_ID`] is used. Currently, this contract only supports the host port. + CounterpartyPortId *string `json:"counterparty_port_id,omitempty"` + // The order of the channel. If not specified, [`IbcOrder::Ordered`] is used. [`IbcOrder::Unordered`] is only supported if the counterparty chain is using `ibc-go` v8.1.0 or later. + ChannelOrdering *IbcOrder `json:"channel_ordering,omitempty"` +} + +type VoteOption string + +const ( + VoteOption_Yes VoteOption = "yes" + VoteOption_No VoteOption = "no" + VoteOption_Abstain VoteOption = "abstain" + VoteOption_NoWithVeto VoteOption = "no_with_veto" +) + +/* +The message types of the wasm module. + +See https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto +*/ +type WasmMsg struct { + /* + Dispatches a call to another contract at a known address (with known ABI). + + This is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address. + */ + Execute *WasmMsg_Execute `json:"execute,omitempty"` + /* + Instantiates a new contracts from previously uploaded Wasm code. + + The contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2. + + This is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address. + */ + Instantiate *WasmMsg_Instantiate `json:"instantiate,omitempty"` + /* + Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`]. + + This is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false. + */ + Instantiate2 *WasmMsg_Instantiate2 `json:"instantiate2,omitempty"` + /* + Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior. + + Only the contract admin (as defined in wasmd), if any, is able to make this call. + + This is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address. + */ + Migrate *WasmMsg_Migrate `json:"migrate,omitempty"` + // Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract. + UpdateAdmin *WasmMsg_UpdateAdmin `json:"update_admin,omitempty"` + // Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract. + ClearAdmin *WasmMsg_ClearAdmin `json:"clear_admin,omitempty"` +} + +type ExecuteMsg_CloseChannel struct{} + +// Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future) +type Expiration struct { + // AtHeight will expire when `env.block.height` >= height + AtHeight *Expiration_AtHeight `json:"at_height,omitempty"` + // AtTime will expire when `env.block.time` >= time + AtTime *Expiration_AtTime `json:"at_time,omitempty"` + // Never will never expire. Used to express the empty variant + Never *Expiration_Never `json:"never,omitempty"` +} + +/* +A point in time in nanosecond precision. + +This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z. + +## Examples + +``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202); + +let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ``` +*/ +type Timestamp Uint64 + +// State is the state of the IBC application's channel. This application only supports one channel. +type ChannelState struct { + // The IBC channel, as defined by cosmwasm. + Channel IbcChannel `json:"channel"` + // The status of the channel. + ChannelStatus ChannelStatus `json:"channel_status"` +} + +type IbcEndpoint struct { + ChannelId string `json:"channel_id"` + PortId string `json:"port_id"` +} + +// `TxEncoding` is the encoding of the transactions sent to the ICA host. +type TxEncoding string + +const ( + // `Protobuf` is the protobuf serialization of the CosmosSDK's Any. + TxEncoding_Proto3 TxEncoding = "proto3" + // `Proto3Json` is the json serialization of the CosmosSDK's Any. + TxEncoding_Proto3Json TxEncoding = "proto3json" +) + +type ExecuteMsg_UpdateCallbackAddress struct { + // The new callback address. If not specified, then no callbacks are sent. + CallbackAddress *string `json:"callback_address,omitempty"` +} + +type BankQuery struct { + // This calls into the native bank module for querying the total supply of one denomination. It does the same as the SupplyOf call in Cosmos SDK's RPC API. Return value is of type SupplyResponse. + Supply *BankQuery_Supply `json:"supply,omitempty"` + // This calls into the native bank module for one denomination Return value is BalanceResponse + Balance *BankQuery_Balance `json:"balance,omitempty"` + // This calls into the native bank module for all denominations. Note that this may be much more expensive than Balance and should be avoided if possible. Return value is AllBalanceResponse. + AllBalances *BankQuery_AllBalances `json:"all_balances,omitempty"` + // This calls into the native bank module for querying metadata for a specific bank token. Return value is DenomMetadataResponse + DenomMetadata *BankQuery_DenomMetadata `json:"denom_metadata,omitempty"` + // This calls into the native bank module for querying metadata for all bank tokens that have a metadata entry. Return value is AllDenomMetadataResponse + AllDenomMetadata *BankQuery_AllDenomMetadata `json:"all_denom_metadata,omitempty"` +} + +/* +Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline. + +This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also . +*/ +type Binary string + +// In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set. +type IbcTimeout struct { + Block *IbcTimeoutBlock `json:"block,omitempty"` + Timestamp *Timestamp `json:"timestamp,omitempty"` +} + +// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height) +type IbcTimeoutBlock struct { + // the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0) + Revision int `json:"revision"` + // block height after which the packet times out. the height within the given revision + Height int `json:"height"` +} + +type ExecuteMsg_CreateChannel struct { + // The options to initialize the IBC channel. If not specified, the options specified in the last channel creation are used. Must be `None` if the sender is not the owner. + ChannelOpenInitOptions *ChannelOpenInitOptions `json:"channel_open_init_options,omitempty"` +} + +/* +A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0 + +The greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18) +*/ +type Decimal string + +// These are queries to the various IBC modules to see the state of the contract's IBC connection. These will return errors if the contract is not "ibc enabled" +type IbcQuery struct { + /* + Gets the Port ID the current contract is bound to. + + Returns a `PortIdResponse`. + */ + PortId *IbcQuery_PortId `json:"port_id,omitempty"` + /* + Lists all channels that are bound to a given port. If `port_id` is omitted, this list all channels bound to the contract's port. + + Returns a `ListChannelsResponse`. + */ + ListChannels *IbcQuery_ListChannels `json:"list_channels,omitempty"` + /* + Lists all information for a (portID, channelID) pair. If port_id is omitted, it will default to the contract's own channel. (To save a PortId{} call) + + Returns a `ChannelResponse`. + */ + Channel *IbcQuery_Channel `json:"channel,omitempty"` +} + +/* +The message types of the bank module. + +See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto +*/ +type BankMsg struct { + /* + Sends native tokens from the contract to the given address. + + This is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address. + */ + Send *BankMsg_Send `json:"send,omitempty"` + // This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired. + Burn *BankMsg_Burn `json:"burn,omitempty"` +} + +// IbcChannel defines all information on a channel. This is generally used in the hand-shake process, but can be queried directly. +type IbcChannel struct { + Order IbcOrder `json:"order"` + // Note: in ibcv3 this may be "", in the IbcOpenChannel handshake messages + Version string `json:"version"` + // The connection upon which this channel was created. If this is a multi-hop channel, we only expose the first hop. + ConnectionId string `json:"connection_id"` + CounterpartyEndpoint IbcEndpoint `json:"counterparty_endpoint"` + Endpoint IbcEndpoint `json:"endpoint"` } // Actions that can be taken to alter the contract's ownership @@ -59,8 +256,8 @@ type Action interface { var _ Action = (*Action_TransferOwnership)(nil) type Action_TransferOwnership struct { - Expiry *Expiration `json:"expiry,omitempty"` - NewOwner string `json:"new_owner"` + NewOwner string `json:"new_owner"` + Expiry *Expiration `json:"expiry,omitempty"` } func (*Action_TransferOwnership) Implements_Action() {} @@ -93,17 +290,52 @@ const Action_RenounceOwnership_Value Action_RenounceOwnership = "renounce_owners func (*Action_RenounceOwnership) Implements_Action() {} -type Coin struct { - Amount Uint128 `json:"amount"` - Denom string `json:"denom"` -} +/* +An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message. + +It is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451) +*/ +type Empty struct{} /* -Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline. +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. -This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec. See also . +# Examples + +Use `from` to create instances of this and `u64` to get the value out: + +``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42); + +let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ``` */ -type Binary string +type Uint64 string + +type ExecuteMsg_SendCosmosMsgs struct { + // The stargate messages to convert and send to the ICA host. + Messages []CosmosMsg_for_Empty `json:"messages"` + // Optional memo to include in the ibc packet. + PacketMemo *string `json:"packet_memo,omitempty"` + // The stargate queries to convert and send to the ICA host. The queries are executed after the messages. + Queries []QueryRequest_for_Empty `json:"queries"` + // Optional timeout in seconds to include with the ibc packet. If not specified, the [default timeout](crate::ibc::types::packet::DEFAULT_TIMEOUT_SECONDS) is used. + TimeoutSeconds *int `json:"timeout_seconds,omitempty"` +} + +type Coin struct { + Amount Uint128 `json:"amount"` + Denom string `json:"denom"` +} + +type QueryRequest_for_Empty struct { + Bank *QueryRequest_for_Empty_Bank `json:"bank,omitempty"` + Custom *QueryRequest_for_Empty_Custom `json:"custom,omitempty"` + Staking *QueryRequest_for_Empty_Staking `json:"staking,omitempty"` + Distribution *QueryRequest_for_Empty_Distribution `json:"distribution,omitempty"` + // A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data. The format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md). The response is protobuf encoded data directly without a JSON response wrapper. The caller is responsible for compiling the proper protobuf definitions for both requests and responses. + Stargate *QueryRequest_for_Empty_Stargate `json:"stargate,omitempty"` + Ibc *QueryRequest_for_Empty_Ibc `json:"ibc,omitempty"` + Wasm *QueryRequest_for_Empty_Wasm `json:"wasm,omitempty"` +} type WasmQuery struct { // this queries the public API of another contract at a known address (with known ABI) Return value is whatever the contract returns (caller should know), wrapped in a ContractResult that is JSON encoded. @@ -116,72 +348,23 @@ type WasmQuery struct { CodeInfo *WasmQuery_CodeInfo `json:"code_info,omitempty"` } -type QueryMsg_Ownership struct{} - /* -A human readable address. - -In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length. - -This type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances. +The message types of the staking module. -This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance. -*/ -type Addr string - -type ExecuteMsg_CreateChannel struct { - // The options to initialize the IBC channel. If not specified, the options specified in the last channel creation are used. Must be `None` if the sender is not the owner. - ChannelOpenInitOptions *ChannelOpenInitOptions `json:"channel_open_init_options,omitempty"` -} - -// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height) -type IbcTimeoutBlock struct { - // block height after which the packet times out. the height within the given revision - Height int `json:"height"` - // the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0) - Revision int `json:"revision"` -} - -/* -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. - -# Examples - -Use `from` to create instances of this and `u128` to get the value out: - -``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123); - -let b = Uint128::from(42u64); assert_eq!(b.u128(), 42); - -let c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ``` +See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto */ -type Uint128 string - -type QueryRequest_for_Empty struct { - Bank *QueryRequest_for_Empty_Bank `json:"bank,omitempty"` - Custom *QueryRequest_for_Empty_Custom `json:"custom,omitempty"` - Staking *QueryRequest_for_Empty_Staking `json:"staking,omitempty"` - Distribution *QueryRequest_for_Empty_Distribution `json:"distribution,omitempty"` - // A Stargate query is encoded the same way as abci_query, with path and protobuf encoded request data. The format is defined in [ADR-21](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md). The response is protobuf encoded data directly without a JSON response wrapper. The caller is responsible for compiling the proper protobuf definitions for both requests and responses. - Stargate *QueryRequest_for_Empty_Stargate `json:"stargate,omitempty"` - Ibc *QueryRequest_for_Empty_Ibc `json:"ibc,omitempty"` - Wasm *QueryRequest_for_Empty_Wasm `json:"wasm,omitempty"` +type StakingMsg struct { + // This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address. + Delegate *StakingMsg_Delegate `json:"delegate,omitempty"` + // This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address. + Undelegate *StakingMsg_Undelegate `json:"undelegate,omitempty"` + // This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address. + Redelegate *StakingMsg_Redelegate `json:"redelegate,omitempty"` } -/* -A point in time in nanosecond precision. - -This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z. - -## Examples - -``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202); - -let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ``` -*/ -type Timestamp Uint64 +type QueryMsg_GetContractState struct{} -type QueryMsg_GetChannel struct{} +type QueryMsg_Ownership struct{} // Status is the status of an IBC channel. type ChannelStatus string @@ -203,53 +386,37 @@ const ( ChannelStatus_StateFlushcomplete ChannelStatus = "STATE_FLUSHCOMPLETE" ) -type ExecuteMsg_UpdateOwnership Action - /* -This message type allows the contract interact with the [x/gov] module in order to cast votes. - -## Examples - -Cast a simple vote: - -``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption}; - -#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, vote: VoteOption::Yes, })) } ``` - -Cast a weighted vote: - -``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = "cosmwasm_1_2")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption}; - -# #[cfg(feature = "cosmwasm_1_2")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ``` +The message types of the distribution module. -[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov +See https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto */ -type GovMsg struct { - // This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address. - Vote *GovMsg_Vote `json:"vote,omitempty"` - // This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address. - VoteWeighted *GovMsg_VoteWeighted `json:"vote_weighted,omitempty"` +type DistributionMsg struct { + // This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address. + SetWithdrawAddress *DistributionMsg_SetWithdrawAddress `json:"set_withdraw_address,omitempty"` + // This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address. + WithdrawDelegatorReward *DistributionMsg_WithdrawDelegatorReward `json:"withdraw_delegator_reward,omitempty"` + // This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address. + FundCommunityPool *DistributionMsg_FundCommunityPool `json:"fund_community_pool,omitempty"` } -// IbcChannel defines all information on a channel. This is generally used in the hand-shake process, but can be queried directly. -type IbcChannel struct { - Endpoint IbcEndpoint `json:"endpoint"` - Order IbcOrder `json:"order"` - // Note: in ibcv3 this may be "", in the IbcOpenChannel handshake messages - Version string `json:"version"` - // The connection upon which this channel was created. If this is a multi-hop channel, we only expose the first hop. - ConnectionId string `json:"connection_id"` - CounterpartyEndpoint IbcEndpoint `json:"counterparty_endpoint"` +type CosmosMsg_for_Empty struct { + Bank *CosmosMsg_for_Empty_Bank `json:"bank,omitempty"` + Custom *CosmosMsg_for_Empty_Custom `json:"custom,omitempty"` + Staking *CosmosMsg_for_Empty_Staking `json:"staking,omitempty"` + Distribution *CosmosMsg_for_Empty_Distribution `json:"distribution,omitempty"` + // This is the same structure as messages in `TxBody` from [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) + Stargate *CosmosMsg_for_Empty_Stargate `json:"stargate,omitempty"` + Ibc *CosmosMsg_for_Empty_Ibc `json:"ibc,omitempty"` + Wasm *CosmosMsg_for_Empty_Wasm `json:"wasm,omitempty"` + Gov *CosmosMsg_for_Empty_Gov `json:"gov,omitempty"` } -// The contract's ownership info -type Ownership_for_String struct { - // The contract's current owner. `None` if the ownership has been renounced. - Owner *string `json:"owner,omitempty"` - // The deadline for the pending owner to accept the ownership. `None` if there isn't a pending ownership transfer, or if a transfer exists and it doesn't have a deadline. - PendingExpiry *Expiration `json:"pending_expiry,omitempty"` - // The account who has been proposed to take over the ownership. `None` if there isn't a pending ownership transfer. - PendingOwner *string `json:"pending_owner,omitempty"` +// Simplified version of the PageRequest type for pagination from the cosmos-sdk +type PageRequest struct { + Key *Binary `json:"key,omitempty"` + Limit int `json:"limit"` + Reverse bool `json:"reverse"` } type DistributionQuery struct { @@ -263,18 +430,6 @@ type DistributionQuery struct { DelegatorValidators *DistributionQuery_DelegatorValidators `json:"delegator_validators,omitempty"` } -type WeightedVoteOption struct { - Option VoteOption `json:"option"` - Weight Decimal `json:"weight"` -} - -// Simplified version of the PageRequest type for pagination from the cosmos-sdk -type PageRequest struct { - Key *Binary `json:"key,omitempty"` - Limit int `json:"limit"` - Reverse bool `json:"reverse"` -} - // These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points) type IbcMsg struct { // Sends bank tokens owned by the contract to the given address on another chain. The channel must already be established between the ibctransfer module on this chain and a matching module on the remote chain. We cannot select the port_id, this is whatever the local chain has bound the ibctransfer module to. @@ -285,470 +440,322 @@ type IbcMsg struct { CloseChannel *IbcMsg_CloseChannel `json:"close_channel,omitempty"` } -type BankQuery struct { - // This calls into the native bank module for querying the total supply of one denomination. It does the same as the SupplyOf call in Cosmos SDK's RPC API. Return value is of type SupplyResponse. - Supply *BankQuery_Supply `json:"supply,omitempty"` - // This calls into the native bank module for one denomination Return value is BalanceResponse - Balance *BankQuery_Balance `json:"balance,omitempty"` - // This calls into the native bank module for all denominations. Note that this may be much more expensive than Balance and should be avoided if possible. Return value is AllBalanceResponse. - AllBalances *BankQuery_AllBalances `json:"all_balances,omitempty"` - // This calls into the native bank module for querying metadata for a specific bank token. Return value is DenomMetadataResponse - DenomMetadata *BankQuery_DenomMetadata `json:"denom_metadata,omitempty"` - // This calls into the native bank module for querying metadata for all bank tokens that have a metadata entry. Return value is AllDenomMetadataResponse - AllDenomMetadata *BankQuery_AllDenomMetadata `json:"all_denom_metadata,omitempty"` -} - -type ExecuteMsg_UpdateCallbackAddress struct { - // The new callback address. If not specified, then no callbacks are sent. - CallbackAddress *string `json:"callback_address,omitempty"` -} - -type ExecuteMsg_SendCosmosMsgs struct { - // The stargate messages to convert and send to the ICA host. - Messages []CosmosMsg_for_Empty `json:"messages"` - // Optional memo to include in the ibc packet. - PacketMemo *string `json:"packet_memo,omitempty"` - // The stargate queries to convert and send to the ICA host. The queries are executed after the messages. - Queries []QueryRequest_for_Empty `json:"queries"` - // Optional timeout in seconds to include with the ibc packet. If not specified, the [default timeout](crate::ibc::types::packet::DEFAULT_TIMEOUT_SECONDS) is used. - TimeoutSeconds *int `json:"timeout_seconds,omitempty"` +// The contract's ownership info +type Ownership_for_String struct { + // The account who has been proposed to take over the ownership. `None` if there isn't a pending ownership transfer. + PendingOwner *string `json:"pending_owner,omitempty"` + // The contract's current owner. `None` if the ownership has been renounced. + Owner *string `json:"owner,omitempty"` + // The deadline for the pending owner to accept the ownership. `None` if there isn't a pending ownership transfer, or if a transfer exists and it doesn't have a deadline. + PendingExpiry *Expiration `json:"pending_expiry,omitempty"` } -type StakingQuery struct { - // Returns the denomination that can be bonded (if there are multiple native tokens on the chain) - BondedDenom *StakingQuery_BondedDenom `json:"bonded_denom,omitempty"` - // AllDelegations will return all delegations by the delegator - AllDelegations *StakingQuery_AllDelegations `json:"all_delegations,omitempty"` - // Delegation will return more detailed info on a particular delegation, defined by delegator/validator pair - Delegation *StakingQuery_Delegation `json:"delegation,omitempty"` - /* - Returns all validators in the currently active validator set. - - The query response type is `AllValidatorsResponse`. - */ - AllValidators *StakingQuery_AllValidators `json:"all_validators,omitempty"` - /* - Returns the validator at the given address. Returns None if the validator is not part of the currently active validator set. - - The query response type is `ValidatorResponse`. - */ - Validator *StakingQuery_Validator `json:"validator,omitempty"` +type WeightedVoteOption struct { + Option VoteOption `json:"option"` + Weight Decimal `json:"weight"` } -/* -An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message. - -It is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451) -*/ -type Empty struct{} +type QueryMsg_GetChannel struct{} /* -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. - -# Examples +A human readable address. -Use `from` to create instances of this and `u64` to get the value out: +In Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length. -``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42); +This type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances. -let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ``` +This type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance. */ -type Uint64 string - -type QueryMsg_GetContractState struct{} - -// The options needed to initialize the IBC channel. -type ChannelOpenInitOptions struct { - // The order of the channel. If not specified, [`IbcOrder::Ordered`] is used. [`IbcOrder::Unordered`] is only supported if the counterparty chain is using `ibc-go` v8.1.0 or later. - ChannelOrdering *IbcOrder `json:"channel_ordering,omitempty"` - // The connection id on this chain. - ConnectionId string `json:"connection_id"` - // The counterparty connection id on the counterparty chain. - CounterpartyConnectionId string `json:"counterparty_connection_id"` - // The counterparty port id. If not specified, [`crate::ibc::types::keys::HOST_PORT_ID`] is used. Currently, this contract only supports the host port. - CounterpartyPortId *string `json:"counterparty_port_id,omitempty"` -} - -// Expiration represents a point in time when some event happens. It can compare with a BlockInfo and will return is_expired() == true once the condition is hit (and for every block in the future) -type Expiration struct { - // AtHeight will expire when `env.block.height` >= height - AtHeight *Expiration_AtHeight `json:"at_height,omitempty"` - // AtTime will expire when `env.block.time` >= time - AtTime *Expiration_AtTime `json:"at_time,omitempty"` - // Never will never expire. Used to express the empty variant - Never *Expiration_Never `json:"never,omitempty"` -} +type Addr string -type VoteOption string +// IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations. +type IbcOrder string const ( - VoteOption_Yes VoteOption = "yes" - VoteOption_No VoteOption = "no" - VoteOption_Abstain VoteOption = "abstain" - VoteOption_NoWithVeto VoteOption = "no_with_veto" + IbcOrder_OrderUnordered IbcOrder = "ORDER_UNORDERED" + IbcOrder_OrderOrdered IbcOrder = "ORDER_ORDERED" ) -/* -The message types of the bank module. +type ExecuteMsg_UpdateOwnership Action -See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto -*/ -type BankMsg struct { - /* - Sends native tokens from the contract to the given address. +/* +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. - This is translated to a [MsgSend](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28). `from_address` is automatically filled with the current contract's address. - */ - Send *BankMsg_Send `json:"send,omitempty"` - // This will burn the given coins from the contract's account. There is no Cosmos SDK message that performs this, but it can be done by calling the bank keeper. Important if a contract controls significant token supply that must be retired. - Burn *BankMsg_Burn `json:"burn,omitempty"` -} +# Examples -/* -A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0 +Use `from` to create instances of this and `u128` to get the value out: -The greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18) -*/ -type Decimal string +``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123); -/* -The message types of the distribution module. +let b = Uint128::from(42u64); assert_eq!(b.u128(), 42); -See https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto +let c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ``` */ -type DistributionMsg struct { - // This is translated to a [MsgSetWithdrawAddress](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37). `delegator_address` is automatically filled with the current contract's address. - SetWithdrawAddress *DistributionMsg_SetWithdrawAddress `json:"set_withdraw_address,omitempty"` - // This is translated to a [[MsgWithdrawDelegatorReward](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50). `delegator_address` is automatically filled with the current contract's address. - WithdrawDelegatorReward *DistributionMsg_WithdrawDelegatorReward `json:"withdraw_delegator_reward,omitempty"` - // This is translated to a [[MsgFundCommunityPool](https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#LL69C1-L76C2). `depositor` is automatically filled with the current contract's address. - FundCommunityPool *DistributionMsg_FundCommunityPool `json:"fund_community_pool,omitempty"` -} +type Uint128 string /* -The message types of the staking module. +This message type allows the contract interact with the [x/gov] module in order to cast votes. -See https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto -*/ -type StakingMsg struct { - // This is translated to a [MsgDelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90). `delegator_address` is automatically filled with the current contract's address. - Delegate *StakingMsg_Delegate `json:"delegate,omitempty"` - // This is translated to a [MsgUndelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121). `delegator_address` is automatically filled with the current contract's address. - Undelegate *StakingMsg_Undelegate `json:"undelegate,omitempty"` - // This is translated to a [MsgBeginRedelegate](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105). `delegator_address` is automatically filled with the current contract's address. - Redelegate *StakingMsg_Redelegate `json:"redelegate,omitempty"` -} +## Examples -type IbcEndpoint struct { - ChannelId string `json:"channel_id"` - PortId string `json:"port_id"` -} +Cast a simple vote: -// State is the state of the IBC application's channel. This application only supports one channel. -type ChannelState struct { - // The IBC channel, as defined by cosmwasm. - Channel IbcChannel `json:"channel"` - // The status of the channel. - ChannelStatus ChannelStatus `json:"channel_status"` -} +``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); use cosmwasm_std::{GovMsg, VoteOption}; -// `TxEncoding` is the encoding of the transactions sent to the ICA host. -type TxEncoding string +#[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::Vote { proposal_id: 4, option: VoteOption::Yes, })) } ``` -const ( - // `Protobuf` is the protobuf serialization of the CosmosSDK's Any. - TxEncoding_Proto3 TxEncoding = "proto3" - // `Proto3Json` is the json serialization of the CosmosSDK's Any. - TxEncoding_Proto3Json TxEncoding = "proto3json" -) +Cast a weighted vote: -// IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations. -type IbcOrder string +``` # use cosmwasm_std::{ # HexBinary, # Storage, Api, Querier, DepsMut, Deps, entry_point, Env, StdError, MessageInfo, # Response, QueryResponse, # }; # type ExecuteMsg = (); # #[cfg(feature = "cosmwasm_1_2")] use cosmwasm_std::{Decimal, GovMsg, VoteOption, WeightedVoteOption}; -const ( - IbcOrder_OrderUnordered IbcOrder = "ORDER_UNORDERED" - IbcOrder_OrderOrdered IbcOrder = "ORDER_ORDERED" -) +# #[cfg(feature = "cosmwasm_1_2")] #[entry_point] pub fn execute( deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg, ) -> Result { // ... Ok(Response::new().add_message(GovMsg::VoteWeighted { proposal_id: 4, options: vec![ WeightedVoteOption { option: VoteOption::Yes, weight: Decimal::percent(65), }, WeightedVoteOption { option: VoteOption::Abstain, weight: Decimal::percent(35), }, ], })) } ``` -// These are queries to the various IBC modules to see the state of the contract's IBC connection. These will return errors if the contract is not "ibc enabled" -type IbcQuery struct { - /* - Gets the Port ID the current contract is bound to. +[x/gov]: https://github.com/cosmos/cosmos-sdk/tree/v0.45.12/x/gov +*/ +type GovMsg struct { + // This maps directly to [MsgVote](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/proto/cosmos/gov/v1beta1/tx.proto#L46-L56) in the Cosmos SDK with voter set to the contract address. + Vote *GovMsg_Vote `json:"vote,omitempty"` + // This maps directly to [MsgVoteWeighted](https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/proto/cosmos/gov/v1beta1/tx.proto#L66-L78) in the Cosmos SDK with voter set to the contract address. + VoteWeighted *GovMsg_VoteWeighted `json:"vote_weighted,omitempty"` +} - Returns a `PortIdResponse`. - */ - PortId *IbcQuery_PortId `json:"port_id,omitempty"` +type StakingQuery struct { + // Returns the denomination that can be bonded (if there are multiple native tokens on the chain) + BondedDenom *StakingQuery_BondedDenom `json:"bonded_denom,omitempty"` + // AllDelegations will return all delegations by the delegator + AllDelegations *StakingQuery_AllDelegations `json:"all_delegations,omitempty"` + // Delegation will return more detailed info on a particular delegation, defined by delegator/validator pair + Delegation *StakingQuery_Delegation `json:"delegation,omitempty"` /* - Lists all channels that are bound to a given port. If `port_id` is omitted, this list all channels bound to the contract's port. + Returns all validators in the currently active validator set. - Returns a `ListChannelsResponse`. + The query response type is `AllValidatorsResponse`. */ - ListChannels *IbcQuery_ListChannels `json:"list_channels,omitempty"` + AllValidators *StakingQuery_AllValidators `json:"all_validators,omitempty"` /* - Lists all information for a (portID, channelID) pair. If port_id is omitted, it will default to the contract's own channel. (To save a PortId{} call) + Returns the validator at the given address. Returns None if the validator is not part of the currently active validator set. - Returns a `ChannelResponse`. + The query response type is `ValidatorResponse`. */ - Channel *IbcQuery_Channel `json:"channel,omitempty"` + Validator *StakingQuery_Validator `json:"validator,omitempty"` } -/* -The message types of the wasm module. - -See https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto -*/ -type WasmMsg struct { - /* - Dispatches a call to another contract at a known address (with known ABI). - - This is translated to a [MsgExecuteContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L68-L78). `sender` is automatically filled with the current contract's address. - */ - Execute *WasmMsg_Execute `json:"execute,omitempty"` - /* - Instantiates a new contracts from previously uploaded Wasm code. +// IcaInfo is the ICA address and channel ID. +type IcaInfo struct { + ChannelId string `json:"channel_id"` + Encoding TxEncoding `json:"encoding"` + IcaAddress string `json:"ica_address"` +} - The contract address is non-predictable. But it is guaranteed that when emitting the same Instantiate message multiple times, multiple instances on different addresses will be generated. See also Instantiate2. +// State is the state of the contract. +type State struct { + // The address of the callback contract. + CallbackAddress *Addr `json:"callback_address,omitempty"` + // The Interchain Account (ICA) info needed to send packets. This is set during the handshake. + IcaInfo *IcaInfo `json:"ica_info,omitempty"` +} - This is translated to a [MsgInstantiateContract](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L53-L71). `sender` is automatically filled with the current contract's address. - */ - Instantiate *WasmMsg_Instantiate `json:"instantiate,omitempty"` - /* - Instantiates a new contracts from previously uploaded Wasm code using a predictable address derivation algorithm implemented in [`cosmwasm_std::instantiate2_address`]. +type BankQuery_AllDenomMetadata struct { + Pagination *PageRequest `json:"pagination,omitempty"` +} - This is translated to a [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/blob/v0.29.2/proto/cosmwasm/wasm/v1/tx.proto#L73-L96). `sender` is automatically filled with the current contract's address. `fix_msg` is automatically set to false. - */ - Instantiate2 *WasmMsg_Instantiate2 `json:"instantiate2,omitempty"` - /* - Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior. +type DistributionMsg_FundCommunityPool struct { + // The amount to spend + Amount []Coin `json:"amount"` +} +type CosmosMsg_for_Empty_Distribution DistributionMsg - Only the contract admin (as defined in wasmd), if any, is able to make this call. +type DistributionQuery_DelegatorWithdrawAddress struct { + DelegatorAddress string `json:"delegator_address"` +} - This is translated to a [MsgMigrateContract](https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto#L86-L96). `sender` is automatically filled with the current contract's address. - */ - Migrate *WasmMsg_Migrate `json:"migrate,omitempty"` - // Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract. - UpdateAdmin *WasmMsg_UpdateAdmin `json:"update_admin,omitempty"` - // Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract. - ClearAdmin *WasmMsg_ClearAdmin `json:"clear_admin,omitempty"` +type WasmMsg_Migrate struct { + ContractAddr string `json:"contract_addr"` + // msg is the json-encoded MigrateMsg struct that will be passed to the new code + Msg Binary `json:"msg"` + // the code_id of the new logic to place in the given contract + NewCodeId int `json:"new_code_id"` } -// In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set. -type IbcTimeout struct { - Block *IbcTimeoutBlock `json:"block,omitempty"` - Timestamp *Timestamp `json:"timestamp,omitempty"` +type IbcQuery_ListChannels struct { + PortId *string `json:"port_id,omitempty"` } -// IcaInfo is the ICA address and channel ID. -type IcaInfo struct { +type IbcMsg_Transfer struct { + // when packet times out, measured on remote chain + Timeout IbcTimeout `json:"timeout"` + // address on the remote chain to receive these tokens + ToAddress string `json:"to_address"` + // packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20 + Amount Coin `json:"amount"` + // existing channel to send the tokens over ChannelId string `json:"channel_id"` - Encoding TxEncoding `json:"encoding"` - IcaAddress string `json:"ica_address"` -} - -// State is the state of the contract. -type State struct { - // The address of the callback contract. - CallbackAddress *Addr `json:"callback_address,omitempty"` - // The Interchain Account (ICA) info needed to send packets. This is set during the handshake. - IcaInfo *IcaInfo `json:"ica_info,omitempty"` -} + /* + An optional memo. See the blog post ["Moving Beyond Simple Token Transfers"](https://medium.com/the-interchain-foundation/moving-beyond-simple-token-transfers-d42b2b1dc29b) for more information. -type ExecuteMsg_CloseChannel struct{} + There is no difference between setting this to `None` or an empty string. -type BankQuery_AllDenomMetadata struct { - Pagination *PageRequest `json:"pagination,omitempty"` + This field is only supported on chains with CosmWasm >= 2.0 and silently ignored on older chains. If you need support for both 1.x and 2.x chain with the same codebase, it is recommended to use `CosmosMsg::Stargate` with a custom MsgTransfer protobuf encoder instead. + */ + Memo *string `json:"memo,omitempty"` } -type QueryRequest_for_Empty_Ibc IbcQuery -type Expiration_AtHeight int +type StakingQuery_AllValidators struct{} +type Expiration_AtTime Timestamp -type BankQuery_Supply struct { - Denom string `json:"denom"` +type DistributionQuery_DelegatorValidators struct { + DelegatorAddress string `json:"delegator_address"` } -type StakingMsg_Delegate struct { - Amount Coin `json:"amount"` - Validator string `json:"validator"` +type DistributionQuery_DelegationTotalRewards struct { + DelegatorAddress string `json:"delegator_address"` } -type StakingMsg_Undelegate struct { - Amount Coin `json:"amount"` - Validator string `json:"validator"` +type QueryRequest_for_Empty_Stargate struct { + // this is the expected protobuf message type (not any), binary encoded + Data Binary `json:"data"` + // this is the fully qualified service path used for routing, eg. "/cosmos_sdk.x.bank.v1.Query/QueryBalance" + Path string `json:"path"` } -type CosmosMsg_for_Empty_Stargate struct { - TypeUrl string `json:"type_url"` - Value Binary `json:"value"` +type WasmQuery_Raw struct { + ContractAddr string `json:"contract_addr"` + // Key is the raw key used in the contracts Storage + Key Binary `json:"key"` } -type CosmosMsg_for_Empty_Ibc IbcMsg type StakingQuery_AllDelegations struct { Delegator string `json:"delegator"` } -type IbcQuery_PortId struct{} +type DistributionQuery_DelegationRewards struct { + DelegatorAddress string `json:"delegator_address"` + ValidatorAddress string `json:"validator_address"` +} -type StakingQuery_Delegation struct { +type DistributionMsg_WithdrawDelegatorReward struct { + // The `validator_address` Validator string `json:"validator"` - Delegator string `json:"delegator"` } +type CosmosMsg_for_Empty_Bank BankMsg +type QueryRequest_for_Empty_Bank BankQuery -type DistributionQuery_DelegationTotalRewards struct { - DelegatorAddress string `json:"delegator_address"` +type Expiration_Never struct{} + +type GovMsg_VoteWeighted struct { + Options []WeightedVoteOption `json:"options"` + ProposalId int `json:"proposal_id"` +} +type CosmosMsg_for_Empty_Ibc IbcMsg + +type StakingQuery_Validator struct { + // The validator's address (e.g. (e.g. cosmosvaloper1...)) + Address string `json:"address"` } -type QueryRequest_for_Empty_Bank BankQuery type StakingQuery_BondedDenom struct{} -type DistributionQuery_DelegationRewards struct { - DelegatorAddress string `json:"delegator_address"` - ValidatorAddress string `json:"validator_address"` +type StakingQuery_Delegation struct { + Delegator string `json:"delegator"` + Validator string `json:"validator"` } +type CosmosMsg_for_Empty_Staking StakingMsg +type CosmosMsg_for_Empty_Custom Empty -type BankQuery_Balance struct { - Address string `json:"address"` - Denom string `json:"denom"` +type IbcMsg_CloseChannel struct { + ChannelId string `json:"channel_id"` } +type QueryRequest_for_Empty_Custom Empty +type CosmosMsg_for_Empty_Wasm WasmMsg type BankQuery_AllBalances struct { Address string `json:"address"` } -type CosmosMsg_for_Empty_Custom Empty type GovMsg_Vote struct { ProposalId int `json:"proposal_id"` /* The vote option. - This should be called "option" for consistency with Cosmos SDK. Sorry for that. See . + This used to be called "vote", but was changed for consistency with Cosmos SDK. */ - Vote VoteOption `json:"vote"` -} - -type BankMsg_Burn struct { - Amount []Coin `json:"amount"` -} - -type WasmQuery_Smart struct { - ContractAddr string `json:"contract_addr"` - // msg is the json-encoded QueryMsg struct - Msg Binary `json:"msg"` -} - -type WasmMsg_Execute struct { - // msg is the json-encoded ExecuteMsg struct (as raw Binary) - Msg Binary `json:"msg"` - ContractAddr string `json:"contract_addr"` - Funds []Coin `json:"funds"` -} -type CosmosMsg_for_Empty_Bank BankMsg - -type WasmMsg_ClearAdmin struct { - ContractAddr string `json:"contract_addr"` + Option VoteOption `json:"option"` } +type QueryRequest_for_Empty_Distribution DistributionQuery -type StakingQuery_Validator struct { - // The validator's address (e.g. (e.g. cosmosvaloper1...)) +type BankQuery_Balance struct { Address string `json:"address"` + Denom string `json:"denom"` } -type WasmQuery_CodeInfo struct { - CodeId int `json:"code_id"` +type DistributionMsg_SetWithdrawAddress struct { + // The `withdraw_address` + Address string `json:"address"` } +type QueryRequest_for_Empty_Ibc IbcQuery -type DistributionQuery_DelegatorValidators struct { - DelegatorAddress string `json:"delegator_address"` -} +type IbcQuery_PortId struct{} -type WasmQuery_Raw struct { - ContractAddr string `json:"contract_addr"` - // Key is the raw key used in the contracts Storage - Key Binary `json:"key"` +type IbcQuery_Channel struct { + ChannelId string `json:"channel_id"` + PortId *string `json:"port_id,omitempty"` } -type DistributionMsg_WithdrawDelegatorReward struct { - // The `validator_address` +type StakingMsg_Delegate struct { + Amount Coin `json:"amount"` Validator string `json:"validator"` } -type DistributionMsg_FundCommunityPool struct { - // The amount to spend - Amount []Coin `json:"amount"` -} +type Expiration_AtHeight int type WasmQuery_ContractInfo struct { ContractAddr string `json:"contract_addr"` } -type BankQuery_DenomMetadata struct { +type BankQuery_Supply struct { Denom string `json:"denom"` } -type DistributionMsg_SetWithdrawAddress struct { - // The `withdraw_address` - Address string `json:"address"` -} -type QueryRequest_for_Empty_Custom Empty -type CosmosMsg_for_Empty_Staking StakingMsg -type QueryRequest_for_Empty_Distribution DistributionQuery - -type StakingQuery_AllValidators struct{} - -type DistributionQuery_DelegatorWithdrawAddress struct { - DelegatorAddress string `json:"delegator_address"` +type WasmMsg_ClearAdmin struct { + ContractAddr string `json:"contract_addr"` } -type GovMsg_VoteWeighted struct { - Options []WeightedVoteOption `json:"options"` - ProposalId int `json:"proposal_id"` +type StakingMsg_Undelegate struct { + Amount Coin `json:"amount"` + Validator string `json:"validator"` } -type CosmosMsg_for_Empty_Gov GovMsg -type QueryRequest_for_Empty_Staking StakingQuery -type WasmMsg_UpdateAdmin struct { - Admin string `json:"admin"` - ContractAddr string `json:"contract_addr"` +type StakingMsg_Redelegate struct { + Amount Coin `json:"amount"` + DstValidator string `json:"dst_validator"` + SrcValidator string `json:"src_validator"` } -type IbcMsg_Transfer struct { - // when packet times out, measured on remote chain - Timeout IbcTimeout `json:"timeout"` - // address on the remote chain to receive these tokens +type BankMsg_Send struct { + Amount []Coin `json:"amount"` ToAddress string `json:"to_address"` - // packet data only supports one coin https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/applications/transfer/v1/transfer.proto#L11-L20 - Amount Coin `json:"amount"` - // existing channel to send the tokens over - ChannelId string `json:"channel_id"` } -type WasmMsg_Instantiate struct { - Admin *string `json:"admin,omitempty"` +type WasmQuery_CodeInfo struct { CodeId int `json:"code_id"` - Funds []Coin `json:"funds"` - /* - A human-readable label for the contract. +} - Valid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace - */ - Label string `json:"label"` - // msg is the JSON-encoded InstantiateMsg struct (as raw Binary) +type WasmMsg_Execute struct { + ContractAddr string `json:"contract_addr"` + Funds []Coin `json:"funds"` + // msg is the json-encoded ExecuteMsg struct (as raw Binary) Msg Binary `json:"msg"` } -type WasmMsg_Migrate struct { - // the code_id of the new logic to place in the given contract - NewCodeId int `json:"new_code_id"` +type WasmQuery_Smart struct { ContractAddr string `json:"contract_addr"` - // msg is the json-encoded MigrateMsg struct that will be passed to the new code + // msg is the json-encoded QueryMsg struct Msg Binary `json:"msg"` } -type CosmosMsg_for_Empty_Distribution DistributionMsg -type WasmMsg_Instantiate2 struct { - Salt Binary `json:"salt"` - Admin *string `json:"admin,omitempty"` - CodeId int `json:"code_id"` - Funds []Coin `json:"funds"` +type WasmMsg_Instantiate struct { + CodeId int `json:"code_id"` + Funds []Coin `json:"funds"` /* A human-readable label for the contract. @@ -756,48 +763,49 @@ type WasmMsg_Instantiate2 struct { */ Label string `json:"label"` // msg is the JSON-encoded InstantiateMsg struct (as raw Binary) - Msg Binary `json:"msg"` + Msg Binary `json:"msg"` + Admin *string `json:"admin,omitempty"` } -type IbcMsg_CloseChannel struct { - ChannelId string `json:"channel_id"` +type CosmosMsg_for_Empty_Stargate struct { + TypeUrl string `json:"type_url"` + Value Binary `json:"value"` } -type IbcQuery_Channel struct { - ChannelId string `json:"channel_id"` - PortId *string `json:"port_id,omitempty"` +type WasmMsg_UpdateAdmin struct { + Admin string `json:"admin"` + ContractAddr string `json:"contract_addr"` } +type CosmosMsg_for_Empty_Gov GovMsg +type QueryRequest_for_Empty_Wasm WasmQuery -type StakingMsg_Redelegate struct { - SrcValidator string `json:"src_validator"` - Amount Coin `json:"amount"` - DstValidator string `json:"dst_validator"` +type BankMsg_Burn struct { + Amount []Coin `json:"amount"` } -type CosmosMsg_for_Empty_Wasm WasmMsg -type IbcQuery_ListChannels struct { - PortId *string `json:"port_id,omitempty"` +type WasmMsg_Instantiate2 struct { + CodeId int `json:"code_id"` + Funds []Coin `json:"funds"` + /* + A human-readable label for the contract. + + Valid values should: - not be empty - not be bigger than 128 bytes (or some chain-specific limit) - not start / end with whitespace + */ + Label string `json:"label"` + // msg is the JSON-encoded InstantiateMsg struct (as raw Binary) + Msg Binary `json:"msg"` + Salt Binary `json:"salt"` + Admin *string `json:"admin,omitempty"` } +type QueryRequest_for_Empty_Staking StakingQuery type IbcMsg_SendPacket struct { - Data Binary `json:"data"` + ChannelId string `json:"channel_id"` + Data Binary `json:"data"` // when packet times out, measured on remote chain Timeout IbcTimeout `json:"timeout"` - ChannelId string `json:"channel_id"` -} - -type Expiration_Never struct{} - -type BankMsg_Send struct { - Amount []Coin `json:"amount"` - ToAddress string `json:"to_address"` } -type QueryRequest_for_Empty_Wasm WasmQuery -type Expiration_AtTime Timestamp -type QueryRequest_for_Empty_Stargate struct { - // this is the expected protobuf message type (not any), binary encoded - Data Binary `json:"data"` - // this is the fully qualified service path used for routing, eg. custom/cosmos_sdk.x.bank.v1.Query/QueryBalance - Path string `json:"path"` +type BankQuery_DenomMetadata struct { + Denom string `json:"denom"` } diff --git a/e2e/interchaintestv8/types/cwicacontroller/query.go b/e2e/interchaintestv8/types/cwicacontroller/query.go index 836e19ce..c1729d53 100644 --- a/e2e/interchaintestv8/types/cwicacontroller/query.go +++ b/e2e/interchaintestv8/types/cwicacontroller/query.go @@ -65,8 +65,8 @@ func (q *queryClient) queryContract(ctx context.Context, rawQueryData []byte, op return out.Data, nil } -func (q *queryClient) GetChannel(ctx context.Context, req *QueryMsg_GetChannel, opts ...grpc.CallOption) (*ChannelState, error) { - rawQueryData, err := json.Marshal(map[string]any{"get_channel": req}) +func (q *queryClient) GetContractState(ctx context.Context, req *QueryMsg_GetContractState, opts ...grpc.CallOption) (*State, error) { + rawQueryData, err := json.Marshal(map[string]any{"get_contract_state": req}) if err != nil { return nil, err } @@ -76,7 +76,7 @@ func (q *queryClient) GetChannel(ctx context.Context, req *QueryMsg_GetChannel, return nil, err } - var response ChannelState + var response State if err := json.Unmarshal(rawResponseData, &response); err != nil { return nil, err } @@ -84,8 +84,8 @@ func (q *queryClient) GetChannel(ctx context.Context, req *QueryMsg_GetChannel, return &response, nil } -func (q *queryClient) GetContractState(ctx context.Context, req *QueryMsg_GetContractState, opts ...grpc.CallOption) (*State, error) { - rawQueryData, err := json.Marshal(map[string]any{"get_contract_state": req}) +func (q *queryClient) Ownership(ctx context.Context, req *QueryMsg_Ownership, opts ...grpc.CallOption) (*Ownership_for_String, error) { + rawQueryData, err := json.Marshal(map[string]any{"ownership": req}) if err != nil { return nil, err } @@ -95,7 +95,7 @@ func (q *queryClient) GetContractState(ctx context.Context, req *QueryMsg_GetCon return nil, err } - var response State + var response Ownership_for_String if err := json.Unmarshal(rawResponseData, &response); err != nil { return nil, err } @@ -103,8 +103,8 @@ func (q *queryClient) GetContractState(ctx context.Context, req *QueryMsg_GetCon return &response, nil } -func (q *queryClient) Ownership(ctx context.Context, req *QueryMsg_Ownership, opts ...grpc.CallOption) (*Ownership_for_String, error) { - rawQueryData, err := json.Marshal(map[string]any{"ownership": req}) +func (q *queryClient) GetChannel(ctx context.Context, req *QueryMsg_GetChannel, opts ...grpc.CallOption) (*ChannelState, error) { + rawQueryData, err := json.Marshal(map[string]any{"get_channel": req}) if err != nil { return nil, err } @@ -114,7 +114,7 @@ func (q *queryClient) Ownership(ctx context.Context, req *QueryMsg_Ownership, op return nil, err } - var response Ownership_for_String + var response ChannelState if err := json.Unmarshal(rawResponseData, &response); err != nil { return nil, err } diff --git a/e2e/interchaintestv8/types/cwicaowner/msgs.go b/e2e/interchaintestv8/types/cwicaowner/msgs.go index bd5e6be2..53d31a23 100644 --- a/e2e/interchaintestv8/types/cwicaowner/msgs.go +++ b/e2e/interchaintestv8/types/cwicaowner/msgs.go @@ -27,6 +27,32 @@ type QueryMsg struct { GetIcaCount *QueryMsg_GetIcaCount `json:"get_ica_count,omitempty"` } +type ExecuteMsg_CreateIcaContract struct { + ChannelOpenInitOptions ChannelOpenInitOptions `json:"channel_open_init_options"` + Salt *string `json:"salt,omitempty"` +} + +// IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations. +type IbcOrder string + +const ( + IbcOrder_OrderUnordered IbcOrder = "ORDER_UNORDERED" + IbcOrder_OrderOrdered IbcOrder = "ORDER_ORDERED" +) + +type IbcPacket struct { + // identifies the channel and port on the sending chain. + Src IbcEndpoint `json:"src"` + Timeout IbcTimeout `json:"timeout"` + // The raw data sent from the other side in the packet + Data Binary `json:"data"` + // identifies the channel and port on the receiving chain. + Dest IbcEndpoint `json:"dest"` + // The sequence number of the packet on the given channel + Sequence int `json:"sequence"` +} +type ExecuteMsg_ReceiveIcaCallback IcaControllerCallbackMsg + /* 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. @@ -40,24 +66,38 @@ let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ``` */ type Uint64 string +// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height) +type IbcTimeoutBlock struct { + // block height after which the packet times out. the height within the given revision + Height int `json:"height"` + // the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0) + Revision int `json:"revision"` +} + type IbcEndpoint struct { ChannelId string `json:"channel_id"` PortId string `json:"port_id"` } -type QueryMsg_GetContractState struct{} +// IbcChannel defines all information on a channel. This is generally used in the hand-shake process, but can be queried directly. +type IbcChannel struct { + // Note: in ibcv3 this may be "", in the IbcOpenChannel handshake messages + Version string `json:"version"` + // The connection upon which this channel was created. If this is a multi-hop channel, we only expose the first hop. + ConnectionId string `json:"connection_id"` + CounterpartyEndpoint IbcEndpoint `json:"counterparty_endpoint"` + Endpoint IbcEndpoint `json:"endpoint"` + Order IbcOrder `json:"order"` +} + +type QueryMsg_GetIcaCount struct{} // IcaState is the state of the ICA. type IcaState struct { + TxEncoding TxEncoding `json:"tx_encoding"` ChannelState ChannelState `json:"channel_state"` IcaAddr string `json:"ica_addr"` IcaId int `json:"ica_id"` - TxEncoding TxEncoding `json:"tx_encoding"` -} - -type ExecuteMsg_CreateIcaContract struct { - ChannelOpenInitOptions ChannelOpenInitOptions `json:"channel_open_init_options"` - Salt *string `json:"salt,omitempty"` } type ExecuteMsg_SendPredefinedAction struct { @@ -67,14 +107,6 @@ type ExecuteMsg_SendPredefinedAction struct { ToAddress string `json:"to_address"` } -// IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height) -type IbcTimeoutBlock struct { - // the version that the client is currently on (e.g. after resetting the chain this could increment 1 as height drops to 0) - Revision int `json:"revision"` - // block height after which the packet times out. the height within the given revision - Height int `json:"height"` -} - /* A human readable address. @@ -88,53 +120,50 @@ type Addr string // The options needed to initialize the IBC channel. type ChannelOpenInitOptions struct { - // The connection id on this chain. - ConnectionId string `json:"connection_id"` // The counterparty connection id on the counterparty chain. CounterpartyConnectionId string `json:"counterparty_connection_id"` // The counterparty port id. If not specified, [`crate::ibc::types::keys::HOST_PORT_ID`] is used. Currently, this contract only supports the host port. CounterpartyPortId *string `json:"counterparty_port_id,omitempty"` // The order of the channel. If not specified, [`IbcOrder::Ordered`] is used. [`IbcOrder::Unordered`] is only supported if the counterparty chain is using `ibc-go` v8.1.0 or later. ChannelOrdering *IbcOrder `json:"channel_ordering,omitempty"` + // The connection id on this chain. + ConnectionId string `json:"connection_id"` } -// `Data` is the response to an ibc packet. It either contains a result or an error. -type Data struct { - // Result is the result of a successful transaction. - Result *Data_Result `json:"result,omitempty"` - // Error is the error message of a failed transaction. It is a string of the error message (not base64 encoded). - Error *Data_Error `json:"error,omitempty"` +// `IcaControllerCallbackMsg` is the type of message that this contract can send to other contracts. +type IcaControllerCallbackMsg struct { + // `OnAcknowledgementPacketCallback` is the callback that this contract makes to other contracts when it receives an acknowledgement packet. + OnAcknowledgementPacketCallback *IcaControllerCallbackMsg_OnAcknowledgementPacketCallback `json:"on_acknowledgement_packet_callback,omitempty"` + // `OnTimeoutPacketCallback` is the callback that this contract makes to other contracts when it receives a timeout packet. + OnTimeoutPacketCallback *IcaControllerCallbackMsg_OnTimeoutPacketCallback `json:"on_timeout_packet_callback,omitempty"` + // `OnChannelOpenAckCallback` is the callback that this contract makes to other contracts when it receives a channel open acknowledgement. + OnChannelOpenAckCallback *IcaControllerCallbackMsg_OnChannelOpenAckCallback `json:"on_channel_open_ack_callback,omitempty"` } -type IbcPacket struct { - // The raw data sent from the other side in the packet - Data Binary `json:"data"` - // identifies the channel and port on the receiving chain. - Dest IbcEndpoint `json:"dest"` - // The sequence number of the packet on the given channel - Sequence int `json:"sequence"` - // identifies the channel and port on the sending chain. - Src IbcEndpoint `json:"src"` - Timeout IbcTimeout `json:"timeout"` -} +/* +A point in time in nanosecond precision. -// In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set. -type IbcTimeout struct { - Block *IbcTimeoutBlock `json:"block,omitempty"` - Timestamp *Timestamp `json:"timestamp,omitempty"` -} +This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z. -type QueryMsg_GetIcaContractState struct { - IcaId int `json:"ica_id"` -} +## Examples -// ContractState is the state of the IBC application. -type ContractState struct { - // The admin of this contract. - Admin Addr `json:"admin"` - // The code ID of the cw-ica-controller contract. - IcaControllerCodeId int `json:"ica_controller_code_id"` -} +``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202); + +let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ``` +*/ +type Timestamp Uint64 + +// `TxEncoding` is the encoding of the transactions sent to the ICA host. +type TxEncoding string + +const ( + // `Protobuf` is the protobuf serialization of the CosmosSDK's Any. + TxEncoding_Proto3 TxEncoding = "proto3" + // `Proto3Json` is the json serialization of the CosmosSDK's Any. + TxEncoding_Proto3Json TxEncoding = "proto3json" +) + +type QueryMsg_GetContractState struct{} // Status is the status of an IBC channel. type ChannelStatus string @@ -156,36 +185,6 @@ const ( ChannelStatus_StateFlushcomplete ChannelStatus = "STATE_FLUSHCOMPLETE" ) -// IcaContractState is the state of the cw-ica-controller contract. -type IcaContractState struct { - ContractAddr Addr `json:"contract_addr"` - IcaState *IcaState `json:"ica_state,omitempty"` -} -type ExecuteMsg_ReceiveIcaCallback IcaControllerCallbackMsg - -/* -A point in time in nanosecond precision. - -This type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z. - -## Examples - -``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202); - -let ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ``` -*/ -type Timestamp Uint64 - -// `TxEncoding` is the encoding of the transactions sent to the ICA host. -type TxEncoding string - -const ( - // `Protobuf` is the protobuf serialization of the CosmosSDK's Any. - TxEncoding_Proto3 TxEncoding = "proto3" - // `Proto3Json` is the json serialization of the CosmosSDK's Any. - TxEncoding_Proto3Json TxEncoding = "proto3json" -) - /* Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline. @@ -193,43 +192,51 @@ This is only needed as serde-json-{core,wasm} has a horrible encoding for Vec Result { match result { SubMsgResult::Ok(resp) => { + #[allow(deprecated)] // TODO: Remove deprecated `.data` field let sequence = anybuf::Bufany::deserialize(&resp.data.unwrap_or_default())? .uint64(1) .unwrap(); @@ -352,14 +354,16 @@ mod tests { use crate::types::msg::options::ChannelOpenInitOptions; use super::*; - use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info}; + use cosmwasm_std::testing::{message_info, mock_dependencies, mock_env}; use cosmwasm_std::{Api, StdError, SubMsg}; #[test] fn test_instantiate() { let mut deps = mock_dependencies(); + + let creator = deps.api.addr_make("creator"); + let info = message_info(&creator, &[]); let env = mock_env(); - let info = mock_info("creator", &[]); let channel_open_init_options = ChannelOpenInitOptions { connection_id: "connection-0".to_string(), @@ -414,8 +418,9 @@ mod tests { fn test_update_callback_address() { let mut deps = mock_dependencies(); + let creator = deps.api.addr_make("creator"); + let info = message_info(&creator, &[]); let env = mock_env(); - let info = mock_info("creator", &[]); let channel_open_init_options = ChannelOpenInitOptions { connection_id: "connection-0".to_string(), @@ -438,7 +443,7 @@ mod tests { .unwrap(); // Ensure the contract admin can update the callback address - let new_callback_address = "new_callback_address".to_string(); + let new_callback_address = deps.api.addr_make("new_callback_address").to_string(); let msg = ExecuteMsg::UpdateCallbackAddress { callback_address: Some(new_callback_address.clone()), }; @@ -453,7 +458,8 @@ mod tests { ); // Ensure a non-admin cannot update the callback address - let info = mock_info("non-admin", &[]); + let non_admin = deps.api.addr_make("non-admin"); + let info = message_info(&non_admin, &[]); let msg = ExecuteMsg::UpdateCallbackAddress { callback_address: Some("new_callback_address".to_string()), }; @@ -471,7 +477,8 @@ mod tests { fn test_migrate() { let mut deps = mock_dependencies(); - let info = mock_info("creator", &[]); + let creator = deps.api.addr_make("creator"); + let info = message_info(&creator, &[]); let channel_open_init_options = ChannelOpenInitOptions { connection_id: "connection-0".to_string(), @@ -525,7 +532,8 @@ mod tests { fn test_migrate_with_encoding() { let mut deps = mock_dependencies(); - let info = mock_info("creator", &[]); + let creator = deps.api.addr_make("creator"); + let info = message_info(&creator, &[]); let channel_open_init_options = ChannelOpenInitOptions { connection_id: "connection-0".to_string(), diff --git a/src/helpers.rs b/src/helpers.rs index babf7000..f52bf768 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -165,8 +165,12 @@ impl CwIcaControllerCode { let creator_cannonical = api.addr_canonicalize(env.contract.address.as_str())?; let contract_addr = api.addr_humanize( - &instantiate2_address(&code_info.checksum, &creator_cannonical, salt.as_bytes()) - .map_err(|e| StdError::generic_err(e.to_string()))?, + &instantiate2_address( + code_info.checksum.as_slice(), + &creator_cannonical, + salt.as_bytes(), + ) + .map_err(|e| StdError::generic_err(e.to_string()))?, )?; let instantiate_msg = WasmMsg::Instantiate2 { diff --git a/src/ibc/relay.rs b/src/ibc/relay.rs index 3e002ae2..c22860f0 100644 --- a/src/ibc/relay.rs +++ b/src/ibc/relay.rs @@ -22,7 +22,7 @@ use super::types::{events, packet::acknowledgement::Data as AcknowledgementData} /// - The acknowledgement data is invalid. /// - [`ibc_packet_ack::success`] or [`ibc_packet_ack::error`] returns an error. #[entry_point] -#[allow(clippy::needless_pass_by_value)] // entry point needs this signature +#[allow(clippy::needless_pass_by_value)] pub fn ibc_packet_ack( deps: DepsMut, _env: Env, @@ -48,15 +48,14 @@ pub fn ibc_packet_ack( /// - [`ibc_packet_timeout::callback`] returns an error. /// - The channel state cannot be loaded or saved. #[entry_point] -#[allow(clippy::needless_pass_by_value)] // entry point needs this signature +#[allow(clippy::needless_pass_by_value)] pub fn ibc_packet_timeout( deps: DepsMut, _env: Env, msg: IbcPacketTimeoutMsg, ) -> Result { - let mut channel_state = state::CHANNEL_STATE.load(deps.storage)?; - // If the channel is ordered, close it. + let mut channel_state = state::CHANNEL_STATE.load(deps.storage)?; if channel_state.is_ordered() { channel_state.close(); state::CHANNEL_STATE.save(deps.storage, &channel_state)?; @@ -66,9 +65,11 @@ pub fn ibc_packet_timeout( } /// Implements the IBC module's `OnRecvPacket` handler. +/// +/// # Panics /// Always panics because the ICA controller cannot receive packets. #[entry_point] -#[allow(clippy::pedantic)] +#[allow(clippy::needless_pass_by_value, clippy::missing_errors_doc)] pub fn ibc_packet_receive( _deps: DepsMut, _env: Env, diff --git a/src/ibc/types/packet.rs b/src/ibc/types/packet.rs index 0cf7b04e..4e774b4e 100644 --- a/src/ibc/types/packet.rs +++ b/src/ibc/types/packet.rs @@ -280,7 +280,7 @@ mod tests { // Test result: // The following bytes refer to `{"result":"c3VjY2Vzcw=="}` // where `c3VjY2Vzcw==` is the base64 encoding of `success`. - let cw_success_binary = Binary(vec![ + let cw_success_binary = Binary::new(vec![ 123, 34, 114, 101, 115, 117, 108, 116, 34, 58, 34, 99, 51, 86, 106, 89, 50, 86, 122, 99, 119, 61, 61, 34, 125, ]); @@ -293,7 +293,7 @@ mod tests { // Test error: let error_bytes = br#"{"error":"ABCI code: 1: error handling packet: see events for details"}"#; - let cw_error_binary = Binary(error_bytes.to_vec()); + let cw_error_binary = Binary::from(error_bytes); let ack: AcknowledgementData = from_json(cw_error_binary).unwrap(); assert_eq!( ack, diff --git a/src/ibc/types/stargate.rs b/src/ibc/types/stargate.rs index 29e0c0bc..6eda4e96 100644 --- a/src/ibc/types/stargate.rs +++ b/src/ibc/types/stargate.rs @@ -47,6 +47,7 @@ pub mod channel { ordering, ); + #[allow(deprecated)] CosmosMsg::Stargate { type_url: "/ibc.core.channel.v1.MsgChannelOpenInit".into(), value: msg_channel_open_init.encode_to_vec().into(), diff --git a/src/types/cosmos_msg.rs b/src/types/cosmos_msg.rs index cdbf260e..f7599d06 100644 --- a/src/types/cosmos_msg.rs +++ b/src/types/cosmos_msg.rs @@ -19,8 +19,8 @@ use cosmwasm_std::CosmosMsg; /// ## List of supported [`CosmosMsg`] /// /// - [`CosmosMsg::Stargate`] -/// - [`CosmosMsg::Bank`] with [`BankMsg::Send`] -/// - [`CosmosMsg::Ibc`] with [`IbcMsg::Transfer`] +/// - [`CosmosMsg::Bank`] with [`cosmwasm_std::BankMsg::Send`] +/// - [`CosmosMsg::Ibc`] with [`cosmwasm_std::IbcMsg::Transfer`] /// - [`CosmosMsg::Wasm`] with [`cosmwasm_std::WasmMsg::Execute`] /// - [`CosmosMsg::Wasm`] with [`cosmwasm_std::WasmMsg::Instantiate`] /// - [`CosmosMsg::Wasm`] with [`cosmwasm_std::WasmMsg::Instantiate2`] @@ -37,6 +37,7 @@ use cosmwasm_std::CosmosMsg; /// - [`CosmosMsg::Distribution`] with [`cosmwasm_std::DistributionMsg::FundCommunityPool`] pub fn convert_to_proto_any(msg: CosmosMsg, from_address: String) -> Result { match msg { + #[allow(deprecated)] CosmosMsg::Stargate { type_url, value } => Ok(Any { type_url, value: value.to_vec(), @@ -67,11 +68,15 @@ mod convert_to_any { MsgClearAdmin, MsgExecuteContract, MsgInstantiateContract, MsgInstantiateContract2, MsgMigrateContract, MsgUpdateAdmin, }, - ibc::{applications::transfer::v1::MsgTransfer, core::client::v1::Height}, prost::EncodeError, Any, }; + use ibc_proto::{ + cosmos::base::v1beta1::Coin as IbcCoin, + ibc::{apps::transfer::v1::MsgTransfer, core::client::v1::Height}, + }; + use cosmwasm_std::{BankMsg, GovMsg, IbcMsg, VoteOption, WasmMsg}; #[cfg(feature = "staking")] use cosmwasm_std::{DistributionMsg, StakingMsg}; @@ -100,10 +105,11 @@ mod convert_to_any { to_address, amount, timeout, + memo, } => Any::from_msg(&MsgTransfer { source_port: "transfer".to_string(), source_channel: channel_id, - token: Some(ProtoCoin { + token: Some(IbcCoin { denom: amount.denom, amount: amount.amount.to_string(), }), @@ -114,6 +120,7 @@ mod convert_to_any { revision_height: block.height, }), timeout_timestamp: timeout.timestamp().map_or(0, |timestamp| timestamp.nanos()), + memo: memo.unwrap_or_default(), }), _ => panic!("Unsupported IbcMsg"), } @@ -217,10 +224,13 @@ mod convert_to_any { } match msg { - GovMsg::Vote { proposal_id, vote } => Any::from_msg(&MsgVote { + GovMsg::Vote { + proposal_id, + option, + } => Any::from_msg(&MsgVote { voter, proposal_id, - option: convert_to_proto_vote_option(&vote) as i32, + option: convert_to_proto_vote_option(&option) as i32, }), GovMsg::VoteWeighted { proposal_id, diff --git a/src/types/query_msg.rs b/src/types/query_msg.rs index 293122c0..a4ac1865 100644 --- a/src/types/query_msg.rs +++ b/src/types/query_msg.rs @@ -13,7 +13,8 @@ pub use response::*; pub fn query_to_protobuf(query: QueryRequest) -> (String, Vec, bool) { match query { QueryRequest::Bank(bank_query) => convert_to_protobuf::bank(bank_query), - QueryRequest::Stargate { path, data } => (path, data.0, true), + #[allow(deprecated)] + QueryRequest::Stargate { path, data } => (path, data.into(), true), QueryRequest::Wasm(wasm_query) => convert_to_protobuf::wasm(wasm_query), QueryRequest::Ibc(_) => panic!("ibc-go queries are not marked module safe (yet)"), QueryRequest::Custom(_) => panic!("custom queries are not supported"), @@ -251,7 +252,7 @@ mod convert_to_protobuf { ), BankQuery::AllDenomMetadata { pagination } => { let pagination = pagination.map(|pagination| PageRequest { - key: pagination.key.unwrap_or_default().0, + key: pagination.key.unwrap_or_default().into(), limit: u64::from(pagination.limit), reverse: pagination.reverse, offset: 0, @@ -432,12 +433,12 @@ pub mod from_protobuf { .commission_rates .unwrap_or_default(); - Ok(cosmwasm_std::Validator { - address: validator.operator_address, - commission: Decimal::from_str(&commission_rates.rate)?, - max_commission: Decimal::from_str(&commission_rates.max_rate)?, - max_change_rate: Decimal::from_str(&commission_rates.max_change_rate)?, - }) + Ok(cosmwasm_std::Validator::create( + validator.operator_address, + Decimal::from_str(&commission_rates.rate)?, + Decimal::from_str(&commission_rates.max_rate)?, + Decimal::from_str(&commission_rates.max_change_rate)?, + )) } /// Converts the response bytes to a [`IcaQueryResponse`] using the query path. @@ -451,7 +452,7 @@ pub mod from_protobuf { ) -> Result { if is_stargate { return Ok(IcaQueryResponse::Stargate { - data: Binary(resp.to_vec()), + data: Binary::from(resp), path: path.to_string(), }); } @@ -505,7 +506,7 @@ pub mod from_protobuf { .map(convert_to_metadata) .collect(), resp.pagination - .map(|pagination| Binary(pagination.next_key)), + .map(|pagination| Binary::new(pagination.next_key)), ), ))) } @@ -528,21 +529,21 @@ pub mod from_protobuf { let resp = QueryContractInfoResponse::decode(resp)?; Ok(IcaQueryResponse::Wasm(WasmQueryResponse::ContractInfo( resp.contract_info.map(|info| { - let mut contract_info = ContractInfoResponse::default(); - contract_info.code_id = info.code_id; - contract_info.creator = info.creator; - contract_info.admin = if info.admin.is_empty() { - None - } else { - Some(info.admin) - }; - contract_info.ibc_port = if info.ibc_port_id.is_empty() { - None - } else { - Some(info.ibc_port_id) - }; - - contract_info + ContractInfoResponse::new( + info.code_id, + cosmwasm_std::Addr::unchecked(info.creator), + if info.admin.is_empty() { + None + } else { + Some(cosmwasm_std::Addr::unchecked(info.admin)) + }, + false, + if info.ibc_port_id.is_empty() { + None + } else { + Some(info.ibc_port_id) + }, + ) }), ))) } diff --git a/src/types/state.rs b/src/types/state.rs index afd113d9..917bb68c 100644 --- a/src/types/state.rs +++ b/src/types/state.rs @@ -228,162 +228,3 @@ pub mod ica_query { pub is_stargate: bool, } } - -#[cfg(test)] -mod tests { - use super::*; - - use cw_ica_controller_v0_1_3::types::state as v0_1_3; - use cw_ica_controller_v0_2_0::types::state as v0_2_0; - use cw_ica_controller_v0_3_0::types::state as v0_3_0; - use cw_ica_controller_v0_4_2 as v0_4_2; - use cw_ica_controller_v0_5_0 as v0_5_0; - - mod v0_1_2 { - use super::*; - - /// This is the contract state at version 0.1.2. - #[cw_serde] - pub struct ContractState { - /// The address of the admin of the IBC application. - pub admin: Addr, - /// The Interchain Account (ICA) info needed to send packets. - /// This is set during the handshake. - #[serde(skip_serializing_if = "Option::is_none")] - pub ica_info: Option, - } - } - - #[test] - fn test_migration_from_v0_1_2_to_v0_1_3() { - let mock_state = v0_1_2::ContractState { - admin: Addr::unchecked("admin"), - ica_info: None, - }; - - let serialized = cosmwasm_std::to_json_binary(&mock_state).unwrap(); - - let deserialized: v0_1_3::ContractState = cosmwasm_std::from_json(serialized).unwrap(); - - let exp_state = v0_1_3::ContractState { - admin: Addr::unchecked("admin"), - ica_info: None, - allow_channel_open_init: false, - }; - - assert_eq!(deserialized, exp_state); - } - - #[test] - fn test_migration_from_v0_1_3_to_v0_2_0() { - let mock_state = v0_1_3::ContractState { - admin: Addr::unchecked("admin"), - ica_info: None, - allow_channel_open_init: false, - }; - - let serialized = cosmwasm_std::to_json_binary(&mock_state).unwrap(); - - let deserialized: v0_2_0::ContractState = cosmwasm_std::from_json(serialized).unwrap(); - - let exp_state = v0_2_0::ContractState { - admin: Addr::unchecked("admin"), - ica_info: None, - allow_channel_open_init: false, - callback_address: None, - }; - - assert_eq!(deserialized, exp_state); - } - - #[test] - fn test_migration_from_v0_2_0_to_v0_3_0() { - let mock_state = v0_2_0::ContractState { - admin: Addr::unchecked("admin"), - ica_info: None, - allow_channel_open_init: false, - callback_address: Some(Addr::unchecked("callback")), - }; - - let serialized = cosmwasm_std::to_json_binary(&mock_state).unwrap(); - - let deserialized: v0_3_0::ContractState = cosmwasm_std::from_json(serialized).unwrap(); - - let exp_state = v0_3_0::ContractState { - ica_info: None, - allow_channel_open_init: false, - callback_address: Some(Addr::unchecked("callback")), - }; - - assert_eq!(deserialized, exp_state); - } - - #[test] - fn test_migration_from_v0_4_2_to_v0_5_0() { - // Test channel open init options - let mock_options = v0_4_2::types::msg::options::ChannelOpenInitOptions { - connection_id: "connection-mock".to_string(), - counterparty_connection_id: "counterparty-connection-mock".to_string(), - counterparty_port_id: Some("counterparty-port-mock".to_string()), - tx_encoding: Some(v0_4_2::ibc::types::metadata::TxEncoding::Protobuf), - }; - - let serialized = cosmwasm_std::to_json_binary(&mock_options).unwrap(); - - let deserialized: v0_5_0::types::msg::options::ChannelOpenInitOptions = - cosmwasm_std::from_json(serialized).unwrap(); - - let exp_options = v0_5_0::types::msg::options::ChannelOpenInitOptions { - connection_id: "connection-mock".to_string(), - counterparty_connection_id: "counterparty-connection-mock".to_string(), - counterparty_port_id: Some("counterparty-port-mock".to_string()), - tx_encoding: Some(v0_5_0::ibc::types::metadata::TxEncoding::Protobuf), - channel_ordering: None, - }; - - assert_eq!(deserialized, exp_options); - - // Test contract state - let mock_state = v0_4_2::types::state::ContractState { - ica_info: None, - allow_channel_open_init: false, - callback_address: Some(Addr::unchecked("callback")), - }; - - let serialized = cosmwasm_std::to_json_binary(&mock_state).unwrap(); - - let deserialized: ContractState = cosmwasm_std::from_json(serialized).unwrap(); - - let exp_state = ContractState { - ica_info: None, - callback_address: Some(Addr::unchecked("callback")), - }; - - assert_eq!(deserialized, exp_state); - } - - #[test] - fn test_migration_from_v0_5_0_to_v0_6_0() { - let mock_channel_open_init_options = v0_5_0::types::msg::options::ChannelOpenInitOptions { - connection_id: "connection-mock".to_string(), - counterparty_connection_id: "counterparty-connection-mock".to_string(), - counterparty_port_id: Some("counterparty-port-mock".to_string()), - tx_encoding: Some(v0_5_0::ibc::types::metadata::TxEncoding::Proto3Json), - channel_ordering: Some(cosmwasm_std::IbcOrder::Ordered), - }; - - let serialized = cosmwasm_std::to_json_binary(&mock_channel_open_init_options).unwrap(); - - let deserialized: crate::types::msg::options::ChannelOpenInitOptions = - cosmwasm_std::from_json(serialized).unwrap(); - - let exp_channel_open_init_options = crate::types::msg::options::ChannelOpenInitOptions { - connection_id: "connection-mock".to_string(), - counterparty_connection_id: "counterparty-connection-mock".to_string(), - counterparty_port_id: Some("counterparty-port-mock".to_string()), - channel_ordering: Some(cosmwasm_std::IbcOrder::Ordered), - }; - - assert_eq!(deserialized, exp_channel_open_init_options); - } -} diff --git a/testing/Readme.md b/testing/Readme.md index 0c30702a..1109681e 100644 --- a/testing/Readme.md +++ b/testing/Readme.md @@ -15,22 +15,8 @@ This contract is used to test how the `cw-ica-controller` could be controlled by ## Building the Contracts -The contracts are built automatically in the github CI. To build the contracts manually, run the following commands in the root directory of this repository: +The test contracts are built in the github CI. To build the contracts manually, run the following command: -### `callback-counter` - -```text -docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_burner",target=/code/contracts/burner/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/optimizer:0.15.1 ./testing/contracts/callback-counter -``` - -### `cw-ica-owner` - -```text -docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="devcontract_cache_burner",target=/code/contracts/burner/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/optimizer:0.15.1 ./testing/contracts/cw-ica-owner +```sh +just build-test-contracts ``` diff --git a/testing/contracts/callback-counter/.cargo/config b/testing/contracts/callback-counter/.cargo/config deleted file mode 100644 index af5698e5..00000000 --- a/testing/contracts/callback-counter/.cargo/config +++ /dev/null @@ -1,4 +0,0 @@ -[alias] -wasm = "build --release --lib --target wasm32-unknown-unknown" -unit-test = "test --lib" -schema = "run --bin schema" diff --git a/testing/contracts/callback-counter/Cargo.lock b/testing/contracts/callback-counter/Cargo.lock index 3a6731ab..97be8513 100644 --- a/testing/contracts/callback-counter/Cargo.lock +++ b/testing/contracts/callback-counter/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.7.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom", + "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -40,6 +47,127 @@ version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rayon", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -64,26 +192,11 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bech32" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" - -[[package]] -name = "block-buffer" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "block-buffer" @@ -96,9 +209,9 @@ dependencies = [ [[package]] name = "bnum" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" [[package]] name = "bumpalo" @@ -114,9 +227,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] @@ -132,15 +245,15 @@ dependencies = [ "cw2", "schemars", "serde", - "serde-json-wasm 0.5.2", + "serde-json-wasm", "thiserror", ] [[package]] name = "cc" -version = "1.1.6" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" [[package]] name = "cfg-if" @@ -175,43 +288,60 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cosmos-sdk-proto" -version = "0.21.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e23f6ab56d5f031cde05b8b82a5fefd3a1a223595c79e32317a97189e612bc" +checksum = "8b2f63ab112b8c8e7b8a29c891adc48f43145beb21c0bfbf562957072c1e0beb" dependencies = [ "prost", "prost-types", "tendermint-proto", ] +[[package]] +name = "cosmwasm-core" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d905990ef3afb5753bb709dc7de88e9e370aa32bcc2f31731d4b533b63e82490" + [[package]] name = "cosmwasm-crypto" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd50718a2b6830ce9eb5d465de5a018a12e71729d66b70807ce97e6dd14f931d" +checksum = "5b2a7bd9c1dd9a377a4dc0f4ad97d24b03c33798cd5a6d7ceb8869b41c5d2f2d" dependencies = [ - "digest 0.10.7", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "digest", "ecdsa", "ed25519-zebra", "k256", - "rand_core 0.6.4", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242e98e7a231c122e08f300d9db3262d1007b51758a8732cd6210b3e9faa4f3a" +checksum = "029910b409398fdf81955d7301b906caf81f2c42b013ea074fbd89720229c424" dependencies = [ - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] name = "cosmwasm-schema" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7879036156092ad1c22fe0d7316efc5a5eceec2bc3906462a2560215f2a2f929" +checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -222,33 +352,34 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb57855fbfc83327f8445ae0d413b1a05ac0d68c396ab4d122b2abd7bb82cb6" +checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "cosmwasm-std" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c1556156fdf892a55cced6115968b961eaaadd6f724a2c2cb7d1e168e32dd3" +checksum = "51dec99a2e478715c0a4277f0dbeadbb8466500eb7dec873d0924edd086e77f1" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bech32", "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "derive_more", "hex", + "rand_core", "schemars", "serde", - "serde-json-wasm 0.5.2", - "sha2 0.10.8", + "serde-json-wasm", + "sha2", "static_assertions", "thiserror", ] @@ -262,6 +393,31 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -269,7 +425,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -286,29 +442,42 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "cw-address-like" -version = "1.0.4" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451a4691083a88a3c0630a8a88799e9d4cd6679b7ce8ff22b8da2873ff31d380" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "cw-address-like" +version = "2.0.4" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "cosmwasm-std", ] [[package]] name = "cw-ica-controller" -version = "0.6.1" +version = "0.7.0" dependencies = [ "anybuf", "cosmos-sdk-proto", @@ -318,11 +487,12 @@ dependencies = [ "cw-ownable", "cw-storage-plus", "cw2", + "ibc-proto", "prost", "schemars", "semver", "serde", - "serde-json-wasm 1.0.1", + "serde-json-wasm", "serde_with", "thiserror", ] @@ -340,9 +510,8 @@ dependencies = [ [[package]] name = "cw-ownable" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093dfb4520c48b5848274dd88ea99e280a04bc08729603341c7fb0d758c74321" +version = "0.6.0" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -355,9 +524,8 @@ dependencies = [ [[package]] name = "cw-ownable-derive" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d3bf2e0f341bb6cc100d7d441d31cf713fbd3ce0c511f91e79f14b40a889af" +version = "0.6.0" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "proc-macro2", "quote", @@ -366,9 +534,9 @@ dependencies = [ [[package]] name = "cw-storage-plus" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" +checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" dependencies = [ "cosmwasm-std", "schemars", @@ -377,24 +545,22 @@ dependencies = [ [[package]] name = "cw-utils" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" +checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw2", "schemars", - "semver", "serde", "thiserror", ] [[package]] name = "cw2" -version = "1.1.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" +checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -426,7 +592,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -437,7 +603,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -472,12 +638,24 @@ dependencies = [ ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "generic-array", + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", + "unicode-xid", ] [[package]] @@ -486,7 +664,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "const-oid", "crypto-common", "subtle", @@ -505,25 +683,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest 0.10.7", + "digest", "elliptic-curve", "rfc6979", "signature", - "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", ] [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", - "hashbrown 0.12.3", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.4", - "serde", - "sha2 0.9.9", + "rand_core", + "sha2", "zeroize", ] @@ -541,12 +727,11 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.7", + "digest", "ff", "generic-array", "group", - "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", "subtle", "zeroize", @@ -564,10 +749,16 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + [[package]] name = "flex-error" version = "0.4.4" @@ -583,12 +774,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "forward_ref" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" - [[package]] name = "generic-array" version = "0.14.7" @@ -618,7 +803,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -627,6 +812,12 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ "ahash", ] @@ -636,6 +827,10 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "hex" @@ -649,7 +844,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -675,6 +870,37 @@ dependencies = [ "cc", ] +[[package]] +name = "ibc-proto" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1678333cf68c9094ca66aaf9a271269f1f6bf5c26881161def8bd88cee831a23" +dependencies = [ + "base64 0.22.1", + "bytes", + "flex-error", + "ics23", + "informalsystems-pbjson", + "prost", + "serde", + "subtle-encoding", + "tendermint-proto", +] + +[[package]] +name = "ics23" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b17f1a5bd7d12ad30a21445cfa5f52fd7651cb3243ba866f9916b1ec112f12" +dependencies = [ + "anyhow", + "bytes", + "hex", + "informalsystems-pbjson", + "prost", + "serde", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -694,20 +920,39 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown 0.14.5", "serde", ] +[[package]] +name = "informalsystems-pbjson" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "itertools" -version = "0.12.1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -729,16 +974,14 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "once_cell", - "sha2 0.10.8", - "signature", + "sha2", ] [[package]] @@ -753,6 +996,22 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -760,14 +1019,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "num-derive" -version = "0.4.2" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.71", + "num-traits", ] [[package]] @@ -786,10 +1043,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.1" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] [[package]] name = "paste" @@ -798,20 +1061,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "pkcs8" -version = "0.10.2" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "der", - "spki", + "zerocopy", ] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro2" @@ -824,9 +1095,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" dependencies = [ "bytes", "prost-derive", @@ -834,22 +1105,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" dependencies = [ "anyhow", - "itertools", + "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" dependencies = [ "prost", ] @@ -864,10 +1135,24 @@ dependencies = [ ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] [[package]] name = "rand_core" @@ -878,6 +1163,26 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -888,6 +1193,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "ryu" version = "1.0.18" @@ -915,7 +1229,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -927,7 +1241,6 @@ dependencies = [ "base16ct", "der", "generic-array", - "pkcs8", "subtle", "zeroize", ] @@ -940,22 +1253,13 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-json-wasm" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9213a07d53faa0b8dd81e767a54a8188a242fdb9be99ab75ec576a774bfdd7" -dependencies = [ - "serde", -] - [[package]] name = "serde-json-wasm" version = "1.0.1" @@ -976,13 +1280,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -993,16 +1297,17 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1017,7 +1322,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.3.0", "serde", "serde_derive", "serde_json", @@ -1034,20 +1339,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.71", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "syn 2.0.72", ] [[package]] @@ -1058,7 +1350,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -1067,18 +1359,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", + "digest", + "rand_core", ] [[package]] @@ -1121,9 +1403,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -1132,14 +1414,12 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.35.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff525d5540a9fc535c38dc0d92a98da3ee36fcdfbda99cecb9f3cce5cd4d41d7" +checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" dependencies = [ "bytes", "flex-error", - "num-derive", - "num-traits", "prost", "prost-types", "serde", @@ -1165,7 +1445,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1211,11 +1491,17 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" @@ -1244,7 +1530,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-shared", ] @@ -1266,7 +1552,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1350,8 +1636,43 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] diff --git a/testing/contracts/callback-counter/Cargo.toml b/testing/contracts/callback-counter/Cargo.toml index 308a7eda..6abf972d 100644 --- a/testing/contracts/callback-counter/Cargo.toml +++ b/testing/contracts/callback-counter/Cargo.toml @@ -21,29 +21,16 @@ incremental = false overflow-checks = true [features] -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces"] # use library feature to disable all instantiate/execute/query exports library = [] -[package.metadata.scripts] -optimize = """docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/optimizer:0.15.1 -""" - [dependencies] -cosmwasm-schema = "1.4.0" -cosmwasm-std = { version = "1.4.0", features = [ - "cosmwasm_1_3", - # Enable this if you only deploy to chains that have CosmWasm 1.4 or higher - # "cosmwasm_1_4", -] } -cw-storage-plus = "1.1.0" -cw2 = "1.1.0" +cosmwasm-schema = "2.1" +cosmwasm-std = { version = "2.1", features = ["cosmwasm_1_4"] } +cw-storage-plus = "2.0" +cw2 = "2.0" cw-ica-controller = { path = "../../..", default-features = false, features = ["query", "staking"] } -schemars = "0.8.10" -serde = { version = "1.0.145", default-features = false, features = ["derive"] } -serde-json-wasm = "0.5.1" -thiserror = { version = "1.0.31" } +schemars = "0.8" +serde = { version = "1.0", default-features = false, features = ["derive"] } +serde-json-wasm = "1.0" +thiserror = "1.0" diff --git a/testing/contracts/cw-ica-owner/.cargo/config b/testing/contracts/cw-ica-owner/.cargo/config deleted file mode 100644 index af5698e5..00000000 --- a/testing/contracts/cw-ica-owner/.cargo/config +++ /dev/null @@ -1,4 +0,0 @@ -[alias] -wasm = "build --release --lib --target wasm32-unknown-unknown" -unit-test = "test --lib" -schema = "run --bin schema" diff --git a/testing/contracts/cw-ica-owner/Cargo.lock b/testing/contracts/cw-ica-owner/Cargo.lock index 74a7427d..db0366ca 100644 --- a/testing/contracts/cw-ica-owner/Cargo.lock +++ b/testing/contracts/cw-ica-owner/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.7.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "getrandom", + "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -41,16 +48,131 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] -name = "autocfg" -version = "1.3.0" +name = "ark-bls12-381" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] [[package]] -name = "base16ct" -version = "0.1.1" +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rayon", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base16ct" @@ -70,26 +192,11 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bech32" -version = "0.9.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] +checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" [[package]] name = "block-buffer" @@ -102,9 +209,9 @@ dependencies = [ [[package]] name = "bnum" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" [[package]] name = "bumpalo" @@ -120,18 +227,18 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] [[package]] name = "cc" -version = "1.1.6" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" [[package]] name = "cfg-if" @@ -166,43 +273,60 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cosmos-sdk-proto" -version = "0.21.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e23f6ab56d5f031cde05b8b82a5fefd3a1a223595c79e32317a97189e612bc" +checksum = "8b2f63ab112b8c8e7b8a29c891adc48f43145beb21c0bfbf562957072c1e0beb" dependencies = [ - "prost 0.12.6", + "prost", "prost-types", "tendermint-proto", ] +[[package]] +name = "cosmwasm-core" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d905990ef3afb5753bb709dc7de88e9e370aa32bcc2f31731d4b533b63e82490" + [[package]] name = "cosmwasm-crypto" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd50718a2b6830ce9eb5d465de5a018a12e71729d66b70807ce97e6dd14f931d" +checksum = "5b2a7bd9c1dd9a377a4dc0f4ad97d24b03c33798cd5a6d7ceb8869b41c5d2f2d" dependencies = [ - "digest 0.10.7", - "ecdsa 0.16.9", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "digest", + "ecdsa", "ed25519-zebra", - "k256 0.13.1", - "rand_core 0.6.4", + "k256", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", "thiserror", ] [[package]] name = "cosmwasm-derive" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242e98e7a231c122e08f300d9db3262d1007b51758a8732cd6210b3e9faa4f3a" +checksum = "029910b409398fdf81955d7301b906caf81f2c42b013ea074fbd89720229c424" dependencies = [ - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 2.0.72", ] [[package]] name = "cosmwasm-schema" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7879036156092ad1c22fe0d7316efc5a5eceec2bc3906462a2560215f2a2f929" +checksum = "4bc0d4d85e83438ab9a0fea9348446f7268bc016aacfebce37e998559f151294" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -213,33 +337,34 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb57855fbfc83327f8445ae0d413b1a05ac0d68c396ab4d122b2abd7bb82cb6" +checksum = "edf5c8adac41bb7751c050d7c4c18675be19ee128714454454575e894424eeef" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "cosmwasm-std" -version = "1.5.5" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c1556156fdf892a55cced6115968b961eaaadd6f724a2c2cb7d1e168e32dd3" +checksum = "51dec99a2e478715c0a4277f0dbeadbb8466500eb7dec873d0924edd086e77f1" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bech32", "bnum", + "cosmwasm-core", "cosmwasm-crypto", "cosmwasm-derive", - "derivative", - "forward_ref", + "derive_more", "hex", + "rand_core", "schemars", "serde", - "serde-json-wasm 0.5.2", - "sha2 0.10.8", + "serde-json-wasm", + "sha2", "static_assertions", "thiserror", ] @@ -254,17 +379,30 @@ dependencies = [ ] [[package]] -name = "crypto-bigint" -version = "0.4.9" +name = "crossbeam-deque" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "generic-array", - "rand_core 0.6.4", - "subtle", - "zeroize", + "crossbeam-epoch", + "crossbeam-utils", ] +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -272,7 +410,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -289,29 +427,42 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", "subtle", "zeroize", ] [[package]] -name = "cw-address-like" -version = "1.0.4" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451a4691083a88a3c0630a8a88799e9d4cd6679b7ce8ff22b8da2873ff31d380" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + +[[package]] +name = "cw-address-like" +version = "2.0.4" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "cosmwasm-std", ] [[package]] name = "cw-ica-controller" -version = "0.6.1" +version = "0.7.0" dependencies = [ "anybuf", "cosmos-sdk-proto", @@ -321,10 +472,11 @@ dependencies = [ "cw-ownable", "cw-storage-plus", "cw2", + "ibc-proto", "schemars", "semver", "serde", - "serde-json-wasm 1.0.1", + "serde-json-wasm", "serde_with", "thiserror", ] @@ -347,39 +499,18 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-ica-controller", - "cw-multi-test", "cw-storage-plus", "cw2", "schemars", "serde", - "serde-json-wasm 0.5.2", - "thiserror", -] - -[[package]] -name = "cw-multi-test" -version = "0.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "127c7bb95853b8e828bdab97065c81cb5ddc20f7339180b61b2300565aaa99d1" -dependencies = [ - "anyhow", - "cosmwasm-std", - "cw-storage-plus", - "cw-utils", - "derivative", - "itertools 0.10.5", - "k256 0.11.6", - "prost 0.9.0", - "schemars", - "serde", + "serde-json-wasm", "thiserror", ] [[package]] name = "cw-ownable" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093dfb4520c48b5848274dd88ea99e280a04bc08729603341c7fb0d758c74321" +version = "0.6.0" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -392,9 +523,8 @@ dependencies = [ [[package]] name = "cw-ownable-derive" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d3bf2e0f341bb6cc100d7d441d31cf713fbd3ce0c511f91e79f14b40a889af" +version = "0.6.0" +source = "git+https://github.com/larry0x/cw-plus-plus.git?rev=718351d4e9d66edbf3b6dbea2d13b56ef732f51c#718351d4e9d66edbf3b6dbea2d13b56ef732f51c" dependencies = [ "proc-macro2", "quote", @@ -403,9 +533,9 @@ dependencies = [ [[package]] name = "cw-storage-plus" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" +checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" dependencies = [ "cosmwasm-std", "schemars", @@ -414,24 +544,22 @@ dependencies = [ [[package]] name = "cw-utils" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" +checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw2", "schemars", - "semver", "serde", "thiserror", ] [[package]] name = "cw2" -version = "1.1.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" +checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -463,7 +591,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -474,17 +602,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.71", -] - -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", + "syn 2.0.72", ] [[package]] @@ -519,12 +637,24 @@ dependencies = [ ] [[package]] -name = "digest" -version = "0.9.0" +name = "derive_more" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" dependencies = [ - "generic-array", + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", + "unicode-xid", ] [[package]] @@ -533,7 +663,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "const-oid", "crypto-common", "subtle", @@ -547,42 +677,38 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.14.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", ] [[package]] -name = "ecdsa" -version = "0.16.9" +name = "ed25519" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "der 0.7.9", - "digest 0.10.7", - "elliptic-curve 0.13.8", - "rfc6979 0.4.0", - "signature 2.2.0", - "spki 0.7.3", + "signature", ] [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", - "hashbrown 0.12.3", + "ed25519", + "hashbrown 0.14.5", "hex", - "rand_core 0.6.4", - "serde", - "sha2 0.9.9", + "rand_core", + "sha2", "zeroize", ] @@ -592,41 +718,20 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array", - "group 0.12.1", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.5", - "digest 0.10.7", - "ff 0.13.0", + "base16ct", + "crypto-bigint", + "digest", + "ff", "generic-array", - "group 0.13.0", - "pkcs8 0.10.2", - "rand_core 0.6.4", - "sec1 0.7.3", + "group", + "rand_core", + "sec1", "subtle", "zeroize", ] @@ -639,23 +744,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "ff" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] [[package]] -name = "ff" -version = "0.13.0" +name = "fiat-crypto" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "flex-error" @@ -672,12 +773,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "forward_ref" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" - [[package]] name = "generic-array" version = "0.14.7" @@ -700,25 +795,14 @@ dependencies = [ "wasi", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", - "rand_core 0.6.4", + "ff", + "rand_core", "subtle", ] @@ -727,6 +811,12 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ "ahash", ] @@ -736,6 +826,10 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "hex" @@ -749,7 +843,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -775,6 +869,37 @@ dependencies = [ "cc", ] +[[package]] +name = "ibc-proto" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1678333cf68c9094ca66aaf9a271269f1f6bf5c26881161def8bd88cee831a23" +dependencies = [ + "base64 0.22.1", + "bytes", + "flex-error", + "ics23", + "informalsystems-pbjson", + "prost", + "serde", + "subtle-encoding", + "tendermint-proto", +] + +[[package]] +name = "ics23" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b17f1a5bd7d12ad30a21445cfa5f52fd7651cb3243ba866f9916b1ec112f12" +dependencies = [ + "anyhow", + "bytes", + "hex", + "informalsystems-pbjson", + "prost", + "serde", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -794,15 +919,25 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown 0.14.5", "serde", ] +[[package]] +name = "informalsystems-pbjson" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "itertools" version = "0.10.5" @@ -814,9 +949,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -838,28 +973,14 @@ dependencies = [ [[package]] name = "k256" -version = "0.11.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - -[[package]] -name = "k256" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" -dependencies = [ - "cfg-if", - "ecdsa 0.16.9", - "elliptic-curve 0.13.8", - "once_cell", - "sha2 0.10.8", - "signature 2.2.0", + "ecdsa", + "elliptic-curve", + "sha2", ] [[package]] @@ -874,6 +995,22 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -881,14 +1018,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] -name = "num-derive" -version = "0.4.2" +name = "num-integer" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.71", + "num-traits", ] [[package]] @@ -907,10 +1042,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "opaque-debug" -version = "0.3.1" +name = "p256" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] [[package]] name = "paste" @@ -919,30 +1060,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "pkcs8" -version = "0.9.0" +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] -name = "pkcs8" -version = "0.10.2" +name = "ppv-lite86" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "der 0.7.9", - "spki 0.7.3", + "zerocopy", ] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] [[package]] name = "proc-macro2" @@ -955,57 +1094,34 @@ dependencies = [ [[package]] name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes", - "prost-derive 0.9.0", -] - -[[package]] -name = "prost" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" dependencies = [ "bytes", - "prost-derive 0.12.6", -] - -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", + "prost-derive", ] [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" dependencies = [ - "prost 0.12.6", + "prost", ] [[package]] @@ -1018,10 +1134,24 @@ dependencies = [ ] [[package]] -name = "rand_core" -version = "0.5.1" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] [[package]] name = "rand_core" @@ -1033,14 +1163,23 @@ dependencies = [ ] [[package]] -name = "rfc6979" -version = "0.3.1" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "crypto-bigint 0.4.9", - "hmac", - "zeroize", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", ] [[package]] @@ -1053,6 +1192,15 @@ dependencies = [ "subtle", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "ryu" version = "1.0.18" @@ -1080,21 +1228,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.71", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array", - "pkcs8 0.9.0", - "subtle", - "zeroize", + "syn 2.0.72", ] [[package]] @@ -1103,10 +1237,9 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.9", + "base16ct", + "der", "generic-array", - "pkcs8 0.10.2", "subtle", "zeroize", ] @@ -1119,22 +1252,13 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-json-wasm" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9213a07d53faa0b8dd81e767a54a8188a242fdb9be99ab75ec576a774bfdd7" -dependencies = [ - "serde", -] - [[package]] name = "serde-json-wasm" version = "1.0.1" @@ -1155,13 +1279,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1172,16 +1296,17 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1196,7 +1321,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", + "indexmap 2.3.0", "serde", "serde_derive", "serde_json", @@ -1213,20 +1338,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.71", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "syn 2.0.72", ] [[package]] @@ -1237,17 +1349,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", + "digest", ] [[package]] @@ -1256,28 +1358,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der 0.7.9", + "digest", + "rand_core", ] [[package]] @@ -1320,9 +1402,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -1331,15 +1413,13 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.35.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff525d5540a9fc535c38dc0d92a98da3ee36fcdfbda99cecb9f3cce5cd4d41d7" +checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" dependencies = [ "bytes", "flex-error", - "num-derive", - "num-traits", - "prost 0.12.6", + "prost", "prost-types", "serde", "serde_bytes", @@ -1364,7 +1444,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1410,11 +1490,17 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wasi" @@ -1443,7 +1529,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-shared", ] @@ -1465,7 +1551,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1549,8 +1635,43 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] diff --git a/testing/contracts/cw-ica-owner/Cargo.toml b/testing/contracts/cw-ica-owner/Cargo.toml index 8bf6d595..2d3dd074 100644 --- a/testing/contracts/cw-ica-owner/Cargo.toml +++ b/testing/contracts/cw-ica-owner/Cargo.toml @@ -21,32 +21,16 @@ incremental = false overflow-checks = true [features] -# for more explicit tests, cargo test --features=backtraces -backtraces = ["cosmwasm-std/backtraces"] # use library feature to disable all instantiate/execute/query exports library = [] -[package.metadata.scripts] -optimize = """docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/optimizer:0.15.1 -""" - [dependencies] -cosmwasm-schema = "1.4.0" -cosmwasm-std = { version = "1.4.0", features = [ - "cosmwasm_1_3", - # Enable this if you only deploy to chains that have CosmWasm 1.4 or higher - # "cosmwasm_1_4", -] } -cw-storage-plus = "1.1.0" -cw2 = "1.1.0" +cosmwasm-schema = "2.1" +cosmwasm-std = { version = "2.1", features = ["cosmwasm_1_4"] } +cw-storage-plus = "2.0" +cw2 = "2.0" cw-ica-controller = { path = "../../..", default-features = false } -schemars = "0.8.10" -serde = { version = "1.0.145", default-features = false, features = ["derive"] } -serde-json-wasm = "0.5.1" -thiserror = { version = "1.0.31" } - -[dev-dependencies] -cw-multi-test = "0.16.5" +schemars = "0.8" +serde = { version = "1.0", default-features = false, features = ["derive"] } +serde-json-wasm = "1.0" +thiserror = "1.0" diff --git a/testing/contracts/cw-ica-owner/src/state.rs b/testing/contracts/cw-ica-owner/src/state.rs index 6dc2c77a..569768c2 100644 --- a/testing/contracts/cw-ica-owner/src/state.rs +++ b/testing/contracts/cw-ica-owner/src/state.rs @@ -39,7 +39,7 @@ mod contract { /// Checks if the address is the admin pub fn verify_admin(&self, sender: impl Into) -> Result<(), ContractError> { - if self.admin == sender.into() { + if self.admin.to_string() == sender.into() { Ok(()) } else { Err(ContractError::Unauthorized {})