From 60ff9bd16d43d3475ba443069868959f0fdc5bd6 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 14 Aug 2024 13:19:32 -0500 Subject: [PATCH] Migrate CosmWasm workspace (#1315) * Remove cosmwasm directory * Update makefile to not reference cosmwasm directory * Remove redundant check docs step from releases.md * Remove cosmwasm dir from coverage.yaml * Remove cosmwasm dir from rust.yaml * Remove cosmwasm dir from upload-cw-clients.yaml * Remove mention of cosmwasm ics07 client from readme * Remove cosmwasm dir from Make lint rule * Remove link to cosmwasm dir from readme * Remove upload-cw-clients yaml file * Update readme links and add changelog * fix: add link for cosmwasm-ibc in README * fix: update dependabot.yml --------- Signed-off-by: Sean Chen Co-authored-by: Farhad Shabani --- .../1311-migrate-cosmwasm-workspace | 3 + .github/dependabot.yml | 4 - .github/workflows/coverage.yaml | 3 +- .github/workflows/rust.yaml | 11 +- .github/workflows/upload-cw-clients.yaml | 85 - Makefile | 11 +- README.md | 31 +- RELEASES.md | 13 +- cosmwasm/Cargo.lock | 3117 ----------------- cosmwasm/Cargo.toml | 38 - cosmwasm/Makefile | 37 - cosmwasm/README.md | 31 - cosmwasm/ibc-clients/cw-context/Cargo.toml | 42 - cosmwasm/ibc-clients/cw-context/src/api.rs | 18 - .../cw-context/src/context/client_ctx.rs | 201 -- .../cw-context/src/context/custom_ctx.rs | 79 - .../ibc-clients/cw-context/src/context/mod.rs | 290 -- .../ibc-clients/cw-context/src/handlers.rs | 200 -- cosmwasm/ibc-clients/cw-context/src/lib.rs | 25 - .../ibc-clients/cw-context/src/types/error.rs | 36 - .../cw-context/src/types/helper.rs | 31 - .../ibc-clients/cw-context/src/types/mod.rs | 9 - .../ibc-clients/cw-context/src/types/msgs.rs | 299 -- .../cw-context/src/types/response.rs | 48 - .../ibc-clients/cw-context/src/utils/codec.rs | 28 - .../ibc-clients/cw-context/src/utils/mod.rs | 3 - .../ibc-clients/ics07-tendermint/Cargo.toml | 41 - .../ibc-clients/ics07-tendermint/README.md | 71 - .../ics07-tendermint/src/client_type.rs | 12 - .../ics07-tendermint/src/entrypoint.rs | 32 - .../ibc-clients/ics07-tendermint/src/lib.rs | 18 - .../ics07-tendermint/src/tests/fixture.rs | 232 -- .../ics07-tendermint/src/tests/helper.rs | 34 - .../ics07-tendermint/src/tests/mod.rs | 128 - ibc-clients/README.md | 3 +- 35 files changed, 34 insertions(+), 5230 deletions(-) create mode 100644 .changelog/unreleased/breaking-changes/1311-migrate-cosmwasm-workspace delete mode 100644 .github/workflows/upload-cw-clients.yaml delete mode 100644 cosmwasm/Cargo.lock delete mode 100644 cosmwasm/Cargo.toml delete mode 100644 cosmwasm/Makefile delete mode 100644 cosmwasm/README.md delete mode 100644 cosmwasm/ibc-clients/cw-context/Cargo.toml delete mode 100644 cosmwasm/ibc-clients/cw-context/src/api.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/context/client_ctx.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/context/custom_ctx.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/context/mod.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/handlers.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/lib.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/types/error.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/types/helper.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/types/mod.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/types/msgs.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/types/response.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/utils/codec.rs delete mode 100644 cosmwasm/ibc-clients/cw-context/src/utils/mod.rs delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/Cargo.toml delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/README.md delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/src/client_type.rs delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/src/entrypoint.rs delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/src/lib.rs delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/src/tests/fixture.rs delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/src/tests/helper.rs delete mode 100644 cosmwasm/ibc-clients/ics07-tendermint/src/tests/mod.rs diff --git a/.changelog/unreleased/breaking-changes/1311-migrate-cosmwasm-workspace b/.changelog/unreleased/breaking-changes/1311-migrate-cosmwasm-workspace new file mode 100644 index 0000000000..b7c0c8eff7 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/1311-migrate-cosmwasm-workspace @@ -0,0 +1,3 @@ +- [cosmwasm] Migrated the `cosmwasm` workspace into its own separate repository + located at [https://github.com/informalsystems/cosmwasm-ibc]. + ([\#1311](https://github.com/cosmos/ibc-rs/issues/1311)) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0e2e3b557d..2555c05caf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,8 +10,6 @@ updates: ignore: - dependency-name: "tendermint*" - dependency-name: "ibc*" - - dependency-name: "cosmwasm*" - - dependency-name: "cw*" - package-ecosystem: "cargo" directory: "ci/no-std-check" schedule: @@ -19,8 +17,6 @@ updates: ignore: - dependency-name: "tendermint*" - dependency-name: "ibc*" - - dependency-name: "cosmwasm*" - - dependency-name: "cw*" - package-ecosystem: "cargo" directory: "ci/cw-check" schedule: diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 953c99280c..59b13eed77 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -5,9 +5,8 @@ on: - .codecov.yaml - .github/workflows/rust.yaml - .github/workflows/coverage.yaml - - '*.toml' + - "*.toml" - ci/** - - cosmwasm/** - ibc/** - ibc-core/** - ibc-apps/** diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 0aca295432..d331361848 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -6,7 +6,6 @@ on: - Makefile - '*.toml' - ci/** - - cosmwasm/** - ibc/** - ibc-core/** - ibc-apps/** @@ -49,25 +48,25 @@ jobs: - name: Install Rust nightly toolchain with rustfmt uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly - components: rustfmt + toolchain: nightly + components: rustfmt - name: Install Rust stable toolchain with clippy uses: actions-rust-lang/setup-rust-toolchain@v1 with: - components: clippy + components: clippy - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - name: Install Taplo uses: baptiste0928/cargo-install@v3 with: - crate: taplo-cli + crate: taplo-cli - name: Run Lint Checks (fmt, clippy, taplo) run: make lint - name: Spell Check with Typos uses: crate-ci/typos@master with: - config: ./.github/typos.toml + config: ./.github/typos.toml check-docs: name: Check Documentations diff --git a/.github/workflows/upload-cw-clients.yaml b/.github/workflows/upload-cw-clients.yaml deleted file mode 100644 index a3685c869f..0000000000 --- a/.github/workflows/upload-cw-clients.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: Upload precompiled CosmWasm clients -on: - pull_request: - paths: - - .github/workflows/upload-cw-clients.yaml - - Cargo.toml - - cosmwasm/** - - ibc/** - - ibc-core/** - - ibc-apps/** - - ibc-clients/** - - ibc-primitives/** - - ibc-testkit/** - - ibc-derive/** - push: - branches: main - paths: - - .github/workflows/upload-cw-clients.yaml - - Cargo.toml - - cosmwasm/** - - ibc/** - - ibc-core/** - - ibc-apps/** - - ibc-clients/** - - ibc-primitives/** - - ibc-testkit/** - - ibc-derive/** - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - upload-tendermint-cw-client: - name: Upload precompiled Tendermint CosmWasm client - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Create mount directories - run: mkdir -p "${HOME}/.cargo/registry" "$(pwd)"/target - - - name: Compile cosmwasm blob for tendermint light client - run: | - docker run \ - -v "$(pwd)":/code \ - -v "$(pwd)"/target:/target \ - -v "${HOME}/.cargo/registry":/usr/local/cargo/registry \ - cosmwasm/optimizer:0.16.0 ./cosmwasm/ibc-clients/ics07-tendermint - - - name: Fix permissions - run: | - sudo chown -R $(id -u):$(id -g) "$(pwd)"/target - sudo chown -R $(id -u):$(id -g) "${HOME}/.cargo/registry" - - - name: Install `cosmwasm-check` from crates.io - uses: baptiste0928/cargo-install@v3 - with: - crate: cosmwasm-check - - - name: Check compiled CosmWasm contract - working-directory: artifacts - run: | - sha256sum -c checksums.txt - cosmwasm-check ibc_client_tendermint_cw.wasm - - - name: Upload compiled CosmWasm contract - uses: actions/upload-artifact@v4 - with: - name: tendermint-cw-client - path: artifacts/ibc_client_tendermint_cw.wasm - # Retain the artifact for 1 week for PRs and 3 months for `main` branch - retention-days: ${{ github.event_name == 'pull_request' && 7 || 90 }} - overwrite: true - - # # An example workflow to download the artifact: - # - uses: actions/download-artifact@v4 - # with: - # name: tendermint-cw-client - # repository: cosmos/ibc-rs - # run-id: ${{ env.UPLOAD_WASM_RUN_ID }} - # github-token: ${{ secrets.GITHUB_TOKEN }} - # - run: ls ibc_client_tendermint_cw.wasm diff --git a/Makefile b/Makefile index ed6159f9cc..b396909e8c 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,6 @@ lint: ## Lint the code using rustfmt, clippy and whitespace lints. $(MAKE) fmt $(MAKE) clippy $(MAKE) lint-toml - $(MAKE) -C ./cosmwasm lint bash ./ci/code-quality/whitespace-lints.sh fmt: ## Format the code using nightly rustfmt. @@ -36,7 +35,6 @@ check-features: ## Check that project compiles with all combinations of features check-docs: ## Build documentation with all features and without default features. cargo doc --all --all-features --release cargo doc --all --no-default-features --release - $(MAKE) -C ./cosmwasm check-docs $@ check-no-std: ## Check that libraries compile with `no_std` feature. $(MAKE) -C ./ci/no-std-check $@ @@ -48,16 +46,11 @@ check-cw: ## Check that the CosmWasm smart contract compiles. test: ## Run tests with all features and without default features. cargo test --all-targets --all-features --no-fail-fast --release cargo test --all-targets --no-default-features --no-fail-fast --release - $(MAKE) -C ./cosmwasm test $@ check-release: ## Check that the release build compiles. cargo release --workspace --no-push --no-tag \ - --exclude ibc-derive \ + --exclude ibc-derive release: ## Perform an actual release and publishes to crates.io. cargo release --workspace --no-push --no-tag --allow-branch HEAD --execute \ - --exclude ibc-derive \ - $(MAKE) -C ./cosmwasm release $@ - -build-tendermint-cw: ## Build the WASM file for the ICS-07 Tendermint light client. - $(MAKE) -C ./cosmwasm build-tendermint-cw $@ + --exclude ibc-derive diff --git a/README.md b/README.md index d0cac37d54..819b27244f 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ sub-crates that can be used independently or together. | [ibc-testkit](ibc-testkit) | Provides testing toolkit to aid `ibc-rs` and host chains in writing integration tests. | | [ibc-query](ibc-query) | Contains utility traits and implementations for querying states of an integrated IBC module. | | [ibc-derive](ibc-derive) | Derive macros for `ClientState` and `ConsensusState` traits, reducing boilerplate. | -| [cosmwasm](cosmwasm) | Contains libraries that implement `ibc-rs` modules as CosmWasm contracts. | ## Contributing @@ -74,20 +73,21 @@ projects. The `ibc-rs` implementation, in particular, is used for IBC integration, testing, or development for some of the most technically compelling use cases. -| # | Integration use-case | Team | Used-Modules | Links | Phase | -| -: | ------------------------------- | :-----------: | :----------: | :---------------------------------------------------------: | :----------------------: | -| 1 | Solana IBC implementation | Composable | :100: | [Picasso Network][pica-network] | :white_check_mark: | -| 2 | Ethereum IBC relayer | Composable | :100: | [Picasso Network][pica-network] | :white_check_mark: | -| 3 | Polkadot SDK IBC implementation | Composable | :100: | [Picasso Network][pica-network] | :white_check_mark: | -| 4 | Nomic | Nomic | :100: | [Nomic network][nomic] | :white_check_mark: | -| 5 | Namada | Anoma | :100: | [Namada][namada] | :hourglass_flowing_sand: | -| 6 | Sovereign | Informal | :100: | [`sovereign-ibc`][sov-ibc] | :hourglass_flowing_sand: | -| 7 | Hermes IBC relayer | Informal | :100: | [`basecoin-rs`][basecoin-rs] | :hammer_and_pick: | -| 8 | Substrate pallet | Octopus | :100: | [Substrate IBC Pallet][substrate-ibc] | :hammer_and_pick: | -| 9 | Near Protocol | Octopus | :100: | [`near-ibc`][near-ibc] | :hourglass_flowing_sand: | -| 10 | Tendermint Light Client | Electron Labs | `ics07` | [`Electron-Labs/tendermint-rs`][electronlabs-tendermint-rs] | :hourglass_flowing_sand: | -| 11 | Starknet | Informal | :eyes: | :eyes: | :eyes: | -| 12 | SP1 Tendermint Light Client | Interchain | `ics07` | [`cosmos/sp1-ics07-tendermint`][sp1-tendermint] | :hourglass_flowing_sand: | +| # | Integration use-case | Team | Used-Modules | Links | Phase | +| -: | ------------------------------- | :-----------: | :----------: | :---------------------------------------------------------: | :----------------------: | +| 1 | Solana IBC implementation | Composable | :100: | [Picasso Network][pica-network] | :white_check_mark: | +| 2 | Ethereum IBC relayer | Composable | :100: | [Picasso Network][pica-network] | :white_check_mark: | +| 3 | Polkadot SDK IBC implementation | Composable | :100: | [Picasso Network][pica-network] | :white_check_mark: | +| 4 | Nomic | Nomic | :100: | [Nomic network][nomic] | :white_check_mark: | +| 5 | CosmWasm Tendermint Light Client | Informal | `ics07` | [cosmwasm-ibc][cosmwasm-ibc] | :white_check_mark: | +| 6 | Namada | Anoma | :100: | [Namada][namada] | :hourglass_flowing_sand: | +| 7 | Sovereign | Informal | :100: | [`sovereign-ibc`][sov-ibc] | :hourglass_flowing_sand: | +| 8 | Hermes IBC relayer | Informal | :100: | [`basecoin-rs`][basecoin-rs] | :hammer_and_pick: | +| 9 | Substrate pallet | Octopus | :100: | [Substrate IBC Pallet][substrate-ibc] | :hammer_and_pick: | +| 10 | Near Protocol | Octopus | :100: | [`near-ibc`][near-ibc] | :hourglass_flowing_sand: | +| 11 | Tendermint Light Client | Electron Labs | `ics07` | [`Electron-Labs/tendermint-rs`][electronlabs-tendermint-rs] | :hourglass_flowing_sand: | +| 12 | Starknet | Informal | :eyes: | :eyes: | :eyes: | +| 13 | SP1 Tendermint Light Client | Interchain | `ics07` | [`cosmos/sp1-ics07-tendermint`][sp1-tendermint] | :hourglass_flowing_sand: | Legend: @@ -139,6 +139,7 @@ specific language governing permissions and limitations under the License. [ibc]: https://github.com/cosmos/ibc [ibc-go]: https://github.com/cosmos/ibc-go [ibc-proto-rs]: https://github.com/cosmos/ibc-proto-rs +[cosmwasm-ibc]: https://github.com/informalsystems/cosmwasm-ibc [ibc-homepage]: https://cosmos.network/ibc [ibc-protocol]: https://ibcprotocol.dev [cosmos-link]: https://cosmos.network diff --git a/RELEASES.md b/RELEASES.md index 680b6126f1..21d7e386e0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -69,19 +69,16 @@ The release process for the main ibc-rs workspace is as follows: than 5 new crates or 30 existing crates by default. If we need to publish more than these limits, we need to update `release.toml` at workspace root. -5. Run `cargo doc -p ibc --all-features --open` locally to double-check that all - the documentation compiles and seems up-to-date and coherent. Fix any - potential issues here and push them to the release PR. -6. Mark the PR as **Ready for Review** and incorporate feedback on the release. +5. Mark the PR as **Ready for Review** and incorporate feedback on the release. Once approved, merge the PR. -7. Checkout the `main` and pull it with +6. Checkout the `main` and pull it with `git checkout main && git pull origin main`. -8. Create a signed tag `git tag -s -a vX.Y.Z`. In the tag message, write the +7. Create a signed tag `git tag -s -a vX.Y.Z`. In the tag message, write the version and the link to the corresponding section of the changelog. Then push the tag to GitHub with `git push origin vX.Y.Z`. - The [release workflow][release.yaml] will run the `cargo release --execute` command in a CI worker. -9. If some crates have not been released, check the cause of the failure and +8. If some crates have not been released, check the cause of the failure and act accordingly: 1. In case of intermittent problems with the registry, try `cargo release` locally to publish any missing crates from this release. This step @@ -91,7 +88,7 @@ The release process for the main ibc-rs workspace is as follows: 3. In case problems arise from the source files, fix them, bump a new patch version (e.g. `v0.48.1`) and repeat the process with its corresponding new tag. -10. Once the tag is pushed, wait for the CI bot to create a GitHub release, then +9. Once the tag is pushed, wait for the CI bot to create a GitHub release, then update the release description and append: `[đź“–CHANGELOG](https://github.com/cosmos/ibc-rs/blob/main/CHANGELOG.md#vXYZ)` diff --git a/cosmwasm/Cargo.lock b/cosmwasm/Cargo.lock deleted file mode 100644 index 1a22510cf8..0000000000 --- a/cosmwasm/Cargo.lock +++ /dev/null @@ -1,3117 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "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 = "anyhow" -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 0.10.7", - "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 0.10.7", - "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 = "arrayref" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "async-stream" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "async-trait" -version = "0.1.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "axum" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" -dependencies = [ - "async-trait", - "axum-core", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper 1.0.1", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper 0.1.2", - "tower-layer", - "tower-service", -] - -[[package]] -name = "backtrace" -version = "0.3.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -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 = "basecoin-store" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd18cd9983aad2c7dbe0552c597c1a2a8373c6e88ba327dce73860975554b3db" -dependencies = [ - "displaydoc", - "ics23", - "prost", - "serde", - "serde_json", - "sha2 0.10.8", - "tendermint", - "tracing", -] - -[[package]] -name = "bech32" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d965446196e3b7decd44aa7ee49e31d630118f90ef12f97900f262eb915c951d" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "blake3" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if", - "constant_time_eq", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bnum" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" - -[[package]] -name = "borsh" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" -dependencies = [ - "borsh-derive", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" -dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.72", - "syn_derive", -] - -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" -dependencies = [ - "serde", -] - -[[package]] -name = "cc" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "cosmwasm-core" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367fc87c43759098a476ef90f915aadc66c300480ad9c155b512081fbf327bc1" - -[[package]] -name = "cosmwasm-crypto" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7c41f3e371ea457d3b98bb592c38858b46efcf614e0e988ec2ebbdb973954f" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "cosmwasm-core", - "digest 0.10.7", - "ecdsa", - "ed25519-zebra", - "k256", - "num-traits", - "p256", - "rand_core", - "rayon", - "sha2 0.10.8", - "thiserror", -] - -[[package]] -name = "cosmwasm-derive" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c10510e8eb66cf7e109741b1e2c76ad18f30b5a1daa064f5f7115c1f733aaea0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "cosmwasm-schema" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79879b6b7ef6a331b05030ce91ce46a7c4b0baf1ed6b382cce2e9a168109380" -dependencies = [ - "cosmwasm-schema-derive", - "schemars", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cosmwasm-schema-derive" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b53e33c0e97170c7ac9cb440f4bc599a07f9cbb9b7e87916cca37b1239d57b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "cosmwasm-std" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92011c39570876f340d5f9defa68bf92797b1c44421f1b9ea9b04a31d6defd33" -dependencies = [ - "base64 0.22.1", - "bech32", - "bnum", - "cosmwasm-core", - "cosmwasm-crypto", - "cosmwasm-derive", - "derive_more 1.0.0-beta.7", - "hex", - "rand_core", - "schemars", - "serde", - "serde-json-wasm", - "sha2 0.10.8", - "static_assertions", - "thiserror", -] - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -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 = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest 0.10.7", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "curve25519-dalek-ng" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core", - "subtle-ng", - "zeroize", -] - -[[package]] -name = "cw-storage-plus" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" -dependencies = [ - "cosmwasm-std", - "schemars", - "serde", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_more" -version = "0.99.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "derive_more" -version = "1.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3249c0372e72f5f93b5c0ca54c0ab76bbf6216b6f718925476fd9bc4ffabb4fe" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0-beta.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d919ced7590fc17b5d5a3c63b662e8a7d2324212c4e4dbbed975cafd22d16d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", - "unicode-xid", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "dyn-clone" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", -] - -[[package]] -name = "ed25519" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" -dependencies = [ - "pkcs8", - "signature", -] - -[[package]] -name = "ed25519-consensus" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b" -dependencies = [ - "curve25519-dalek-ng", - "hex", - "rand_core", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "ed25519-zebra" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" -dependencies = [ - "curve25519-dalek", - "ed25519", - "hashbrown 0.14.5", - "hex", - "rand_core", - "sha2 0.10.8", - "zeroize", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "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 = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "flex-error" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" -dependencies = [ - "paste", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-core", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "gumdrop" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc700f989d2f6f0248546222d9b4258f5b02a171a431f8285a81c08142629e3" -dependencies = [ - "gumdrop_derive", -] - -[[package]] -name = "gumdrop_derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "h2" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap 2.3.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -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", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-timeout" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" -dependencies = [ - "hyper", - "hyper-util", - "pin-project-lite", - "tokio", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower", - "tower-service", - "tracing", -] - -[[package]] -name = "ibc" -version = "0.54.0" -dependencies = [ - "ibc-apps", - "ibc-clients", - "ibc-core", - "ibc-core-host-cosmos", - "ibc-derive", - "ibc-primitives", -] - -[[package]] -name = "ibc-app-nft-transfer" -version = "0.54.0" -dependencies = [ - "ibc-app-nft-transfer-types", - "ibc-core", - "serde-json-wasm", -] - -[[package]] -name = "ibc-app-nft-transfer-types" -version = "0.54.0" -dependencies = [ - "base64 0.22.1", - "borsh", - "derive_more 0.99.18", - "displaydoc", - "http", - "ibc-app-transfer-types", - "ibc-core", - "ibc-proto", - "mime", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "serde-json-wasm", -] - -[[package]] -name = "ibc-app-transfer" -version = "0.54.0" -dependencies = [ - "ibc-app-transfer-types", - "ibc-core", - "serde-json-wasm", -] - -[[package]] -name = "ibc-app-transfer-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core", - "ibc-proto", - "parity-scale-codec", - "primitive-types", - "scale-info", - "schemars", - "serde", - "uint", -] - -[[package]] -name = "ibc-apps" -version = "0.54.0" -dependencies = [ - "ibc-app-nft-transfer", - "ibc-app-transfer", -] - -[[package]] -name = "ibc-client-cw" -version = "0.54.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus", - "derive_more 0.99.18", - "ibc-client-wasm-types", - "ibc-core", - "prost", - "serde-json-wasm", -] - -[[package]] -name = "ibc-client-tendermint" -version = "0.54.0" -dependencies = [ - "derive_more 0.99.18", - "ibc-client-tendermint-types", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-primitives", - "serde", - "tendermint", - "tendermint-light-client-verifier", -] - -[[package]] -name = "ibc-client-tendermint-cw" -version = "0.54.0" -dependencies = [ - "cosmwasm-std", - "ibc-client-cw", - "ibc-client-tendermint", - "ibc-core", - "ibc-testkit", - "serde-json-wasm", - "tendermint", - "tendermint-testgen", -] - -[[package]] -name = "ibc-client-tendermint-types" -version = "0.54.0" -dependencies = [ - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "serde", - "tendermint", - "tendermint-light-client-verifier", - "tendermint-proto", -] - -[[package]] -name = "ibc-client-wasm-types" -version = "0.54.0" -dependencies = [ - "base64 0.22.1", - "displaydoc", - "ibc-core-client", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "schemars", - "serde", -] - -[[package]] -name = "ibc-clients" -version = "0.54.0" -dependencies = [ - "ibc-client-tendermint", - "ibc-client-wasm-types", -] - -[[package]] -name = "ibc-core" -version = "0.54.0" -dependencies = [ - "ibc-core-channel", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-connection", - "ibc-core-handler", - "ibc-core-host", - "ibc-core-router", - "ibc-derive", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-channel" -version = "0.54.0" -dependencies = [ - "ibc-core-channel-types", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-connection", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-core-router", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-channel-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "sha2 0.10.8", - "subtle-encoding", - "tendermint", -] - -[[package]] -name = "ibc-core-client" -version = "0.54.0" -dependencies = [ - "ibc-core-client-context", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-client-context" -version = "0.54.0" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-handler-types", - "ibc-core-host-types", - "ibc-primitives", - "subtle-encoding", - "tendermint", -] - -[[package]] -name = "ibc-core-client-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-commitment-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint", -] - -[[package]] -name = "ibc-core-commitment-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "ics23", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", -] - -[[package]] -name = "ibc-core-connection" -version = "0.54.0" -dependencies = [ - "ibc-client-wasm-types", - "ibc-core-client", - "ibc-core-connection-types", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-primitives", - "prost", -] - -[[package]] -name = "ibc-core-connection-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint", -] - -[[package]] -name = "ibc-core-handler" -version = "0.54.0" -dependencies = [ - "ibc-core-channel", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-connection", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-core-router", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-handler-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-channel-types", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-host-types", - "ibc-core-router-types", - "ibc-primitives", - "ibc-proto", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint", -] - -[[package]] -name = "ibc-core-host" -version = "0.54.0" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-core-channel-types", - "ibc-core-client-context", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-handler-types", - "ibc-core-host-types", - "ibc-primitives", - "subtle-encoding", -] - -[[package]] -name = "ibc-core-host-cosmos" -version = "0.54.0" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-app-transfer-types", - "ibc-client-tendermint", - "ibc-core-client-context", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-handler-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "serde", - "sha2 0.10.8", - "subtle-encoding", - "tendermint", -] - -[[package]] -name = "ibc-core-host-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-primitives", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", -] - -[[package]] -name = "ibc-core-router" -version = "0.54.0" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-core-channel-types", - "ibc-core-host-types", - "ibc-core-router-types", - "ibc-primitives", - "subtle-encoding", -] - -[[package]] -name = "ibc-core-router-types" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint", -] - -[[package]] -name = "ibc-derive" -version = "0.8.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "ibc-primitives" -version = "0.54.0" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-proto", - "parity-scale-codec", - "prost", - "scale-info", - "schemars", - "serde", - "tendermint", - "time", -] - -[[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", - "borsh", - "bytes", - "flex-error", - "ics23", - "informalsystems-pbjson", - "parity-scale-codec", - "prost", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint-proto", - "tonic", -] - -[[package]] -name = "ibc-query" -version = "0.54.0" -dependencies = [ - "displaydoc", - "ibc", - "ibc-proto", - "tonic", -] - -[[package]] -name = "ibc-testkit" -version = "0.54.0" -dependencies = [ - "basecoin-store", - "derive_more 0.99.18", - "displaydoc", - "ibc", - "ibc-proto", - "ibc-query", - "parking_lot", - "subtle-encoding", - "tendermint", - "tendermint-testgen", - "typed-builder", -] - -[[package]] -name = "ics23" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b17f1a5bd7d12ad30a21445cfa5f52fd7651cb3243ba866f9916b1ec112f12" -dependencies = [ - "anyhow", - "blake2", - "blake3", - "bytes", - "hex", - "informalsystems-pbjson", - "prost", - "ripemd", - "serde", - "sha2 0.10.8", - "sha3", -] - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "k256" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "sha2 0.10.8", -] - -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "libc" -version = "0.2.155" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" -dependencies = [ - "hermit-abi", - "libc", - "wasi", - "windows-sys", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "object" -version = "0.36.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2 0.10.8", -] - -[[package]] -name = "parity-scale-codec" -version = "3.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -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 = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-serde", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prost" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" -dependencies = [ - "anyhow", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "prost-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" -dependencies = [ - "prost", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "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" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -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 = "redox_syscall" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" -dependencies = [ - "bitflags", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "scale-info" -version = "2.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" -dependencies = [ - "cfg-if", - "derive_more 0.99.18", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "schemars" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.72", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "subtle", - "zeroize", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-json-wasm" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.204" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "serde_json" -version = "1.0.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[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", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core", -] - -[[package]] -name = "simple-error" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e2accd2c41a0e920d2abd91b2badcfa1da784662f54fbc47e0e3a51f1e2e1cf" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "subtle-encoding" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" -dependencies = [ - "zeroize", -] - -[[package]] -name = "subtle-ng" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys", -] - -[[package]] -name = "tendermint" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d9d6ffeb83b1de47c307c6e0d2dff56c6256989299010ad03cd80a8491e97" -dependencies = [ - "bytes", - "digest 0.10.7", - "ed25519", - "ed25519-consensus", - "flex-error", - "futures", - "num-traits", - "once_cell", - "prost", - "prost-types", - "serde", - "serde_bytes", - "serde_json", - "serde_repr", - "sha2 0.10.8", - "signature", - "subtle", - "subtle-encoding", - "tendermint-proto", - "time", - "zeroize", -] - -[[package]] -name = "tendermint-light-client-verifier" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2674adbf0dc51aa0c8eaf8462c7d6692ec79502713e50ed5432a442002be90" -dependencies = [ - "derive_more 0.99.18", - "flex-error", - "serde", - "tendermint", - "time", -] - -[[package]] -name = "tendermint-proto" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" -dependencies = [ - "bytes", - "flex-error", - "prost", - "prost-types", - "serde", - "serde_bytes", - "subtle-encoding", - "time", -] - -[[package]] -name = "tendermint-testgen" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae007e2918414ae96e4835426aace7538d23b8ddf96d71e23d241f58f386e877" -dependencies = [ - "ed25519-consensus", - "gumdrop", - "serde", - "serde_json", - "simple-error", - "tempfile", - "tendermint", - "time", -] - -[[package]] -name = "thiserror" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.63" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tokio" -version = "1.39.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "pin-project-lite", - "socket2", - "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tokio-stream" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.3.0", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tonic" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401" -dependencies = [ - "async-stream", - "async-trait", - "axum", - "base64 0.22.1", - "bytes", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-timeout", - "hyper-util", - "percent-encoding", - "pin-project", - "prost", - "socket2", - "tokio", - "tokio-stream", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typed-builder" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06fbd5b8de54c5f7c91f6fe4cebb949be2125d7758e630bb58b1d831dbce600" -dependencies = [ - "typed-builder-macro", -] - -[[package]] -name = "typed-builder-macro" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unicode-ident" -version = "1.0.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.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[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/cosmwasm/Cargo.toml b/cosmwasm/Cargo.toml deleted file mode 100644 index 4ba230d2ff..0000000000 --- a/cosmwasm/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[workspace] -resolver = "2" - -members = [ - "ibc-clients/cw-context", - "ibc-clients/ics07-tendermint", -] - -[workspace.package] -version = "0.54.0" -license = "Apache-2.0" -edition = "2021" -rust-version = "1.75.0" -readme = "README.md" -repository = "https://github.com/cosmos/ibc-rs" -authors = [ "Informal Systems " ] - -[workspace.dependencies] -# external dependencies -derive_more = { version = "0.99.18", default-features = false } -prost = { version = "0.13.1", default-features = false } -serde-json = { package = "serde-json-wasm", version = "1.0.1", default-features = false } - -# cosmwasm dependencies -cosmwasm-std = { version = "2.1.0" } -cosmwasm-schema = { version = "2.1.0" } -cw-storage-plus = { version = "2.0.0" } - -# ibc dependencies -ibc-core = { version = "0.54.0", path = "./../ibc-core", default-features = false } -ibc-client-cw = { version = "0.54.0", path = "./ibc-clients/cw-context", default-features = false } -ibc-client-tendermint = { version = "0.54.0", path = "./../ibc-clients/ics07-tendermint", default-features = false } -ibc-client-wasm-types = { version = "0.54.0", path = "./../ibc-clients/ics08-wasm/types", default-features = false } -ibc-testkit = { version = "0.54.0", path = "./../ibc-testkit", default-features = false } - -# cosmos dependencies -tendermint = { version = "0.38.0", default-features = false } -tendermint-testgen = { version = "0.38.0", default-features = false } diff --git a/cosmwasm/Makefile b/cosmwasm/Makefile deleted file mode 100644 index da83d71824..0000000000 --- a/cosmwasm/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -.PHONY: help - -help: ## Display help message. - @echo "Usage: make " - @awk 'BEGIN {FS = ":.*?## "}/^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) - -setup: ## Install development tools including nightly rustfmt, cargo-hack and cargo-release. - rustup target add wasm32-unknown-unknown - -lint: fmt clippy ## Lint the code using rustfmt, clippy. - -fmt: ## Format the code using nightly rustfmt. - cargo +nightly fmt --all --check - -clippy: ## Lint the code using clippy. - cargo clippy --all-targets --all-features - cargo clippy --all-targets --no-default-features - -check-docs: ## Build documentation with all features and without default features. - cargo doc --all --all-features --release - -test: ## Run tests with all features and without default features. - cargo test --all-targets --all-features --no-fail-fast --release - -check-release: ## Check that the release build compiles. - cargo release --workspace --no-push --no-tag \ - --exclude ibc-client-tendermint-cw - -release: ## Perform an actual release and publishes to crates.io. - cargo release --workspace --no-push --no-tag --allow-branch HEAD --execute \ - --exclude ibc-client-tendermint-cw - -build-tendermint-cw: ## Build the WASM file for the ICS-07 Tendermint light client. - @echo "Building the WASM file for the ICS-07 Tendermint light client" - RUSTFLAGS='-C link-arg=-s' cargo build -p ibc-client-tendermint-cw --target wasm32-unknown-unknown --release --lib --locked && \ - mkdir -p cw-contracts && \ - cp target/wasm32-unknown-unknown/release/ibc_client_tendermint_cw.wasm cw-contracts/ diff --git a/cosmwasm/README.md b/cosmwasm/README.md deleted file mode 100644 index bc6c323f72..0000000000 --- a/cosmwasm/README.md +++ /dev/null @@ -1,31 +0,0 @@ -
-

CosmWasm Integration

-
- -This collection is designed to offer libraries that facilitate the -implementation of various `ibc-rs` core, clients and applications as CosmWasm -contracts. Currently, the available packages are: - -## IBC Clients - -- [ibc-client-cw](./ibc-clients/cw-context): Provides utilities and a generic `Context` object - to streamline the implementation of any ibc-rs-powered light clients as - CosmWasm contracts. - - To utilize the CosmWasm contracts developed with this library, hosting - environments must support the CosmWasm module and be using the version of - `ibc-go` that supports the `08-wasm` proxy light client. - -> [!CAUTION] -> The `ibc-client-cw` is currently in development and should not be - deployed for production use. Users are advised to exercise caution and test - thoroughly in non-production environments. - -- [ibc-client-tendermint-cw](./ibc-clients/ics07-tendermint): CosmWasm Contract - -> [!TIP] -> The pre-compiled CosmWasm contract for `ibc-client-tendermint-cw` is available -> as Github workflow artifacts at -> [_Actions_](https://github.com/cosmos/ibc-rs/actions/workflows/upload-cw-clients.yaml) -> tab. They can be downloaded -> [during a Github workflow](https://github.com/cosmos/ibc-rs/blob/1098f252c04152812f026520e28e323f3bc0507e/.github/workflows/upload-cw-clients.yaml#L87-L96) -> using `actions/download-artifact@v4` action. diff --git a/cosmwasm/ibc-clients/cw-context/Cargo.toml b/cosmwasm/ibc-clients/cw-context/Cargo.toml deleted file mode 100644 index 619dfb93ab..0000000000 --- a/cosmwasm/ibc-clients/cw-context/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "ibc-client-cw" -authors = { workspace = true } -edition = { workspace = true } -license = { workspace = true } -repository = { workspace = true } -rust-version = { workspace = true } -version = { workspace = true } -keywords = [ "ibc", "light-client", "CosmWasm", "ICS-08" ] -readme = "./../../README.md" - -description = """ - Contains types and implementations that are needed to integrate a light client, built using ibc-rs, - into CosmWasm contract. It functions as a library, allowing users to import the ready-made `Context` - object that is generic across light clients, introduce their concrete client type and integrate - their assembled context into the CosmWasm contract's entrypoint. -""" - -[dependencies] -# external dependencies -derive_more = { workspace = true } -prost = { workspace = true } - -# ibc dependencies -ibc-core = { workspace = true } -ibc-client-wasm-types = { workspace = true, features = [ "schema" ] } - -# cosmwasm dependencies -cosmwasm-schema = { workspace = true } -cosmwasm-std = { workspace = true } -cw-storage-plus = { workspace = true } - -[dev-dependencies] -serde-json = { workspace = true } - -[features] -default = [ "std" ] -std = [ - "prost/std", - "ibc-core/std", - "ibc-client-wasm-types/std", -] diff --git a/cosmwasm/ibc-clients/cw-context/src/api.rs b/cosmwasm/ibc-clients/cw-context/src/api.rs deleted file mode 100644 index 0788520cc7..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/api.rs +++ /dev/null @@ -1,18 +0,0 @@ -use ibc_core::client::context::client_state::ClientStateExecution; -use ibc_core::client::context::consensus_state::ConsensusState as ConsensusStateTrait; -use ibc_core::client::types::error::ClientError; -use ibc_core::primitives::proto::Any; - -use crate::context::Context; - -/// Enables users to integrate their implemented light client by introducing -/// their client state and consensus state types into the generic [`Context`] -/// object. -pub trait ClientType<'a>: Sized -where - >::Error: Into, - >::Error: Into, -{ - type ClientState: ClientStateExecution>; - type ConsensusState: ConsensusStateTrait; -} diff --git a/cosmwasm/ibc-clients/cw-context/src/context/client_ctx.rs b/cosmwasm/ibc-clients/cw-context/src/context/client_ctx.rs deleted file mode 100644 index 87de4af280..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/context/client_ctx.rs +++ /dev/null @@ -1,201 +0,0 @@ -//! Implementation of the `ClientValidationContext` and `ClientExecutionContext` -//! traits for the `Context` type. -use ibc_client_wasm_types::client_state::ClientState as WasmClientState; -use ibc_client_wasm_types::consensus_state::ConsensusState as WasmConsensusState; -use ibc_core::client::context::{ClientExecutionContext, ClientValidationContext}; -use ibc_core::client::types::error::ClientError; -use ibc_core::client::types::Height; -use ibc_core::handler::types::error::ContextError; -use ibc_core::host::types::identifiers::ClientId; -use ibc_core::host::types::path::{ClientConsensusStatePath, ClientStatePath}; -use ibc_core::primitives::proto::{Any, Protobuf}; -use ibc_core::primitives::Timestamp; - -use super::{Context, StorageMut}; -use crate::api::ClientType; -use crate::context::CONSENSUS_STATE_HEIGHT_MAP; -use crate::utils::AnyCodec; - -impl<'a, C: ClientType<'a>> ClientValidationContext for Context<'a, C> -where - >::Error: Into, - >::Error: Into, -{ - type ClientStateRef = C::ClientState; - type ConsensusStateRef = C::ConsensusState; - - fn client_state(&self, _client_id: &ClientId) -> Result { - let client_state_value = self.retrieve(ClientStatePath::leaf())?; - - let any_wasm: WasmClientState = Protobuf::::decode(client_state_value.as_slice()) - .map_err(|e| ClientError::Other { - description: e.to_string(), - })?; - - let sov_client_state = C::ClientState::decode_any_vec(any_wasm.data)?; - - Ok(sov_client_state) - } - - fn consensus_state( - &self, - client_cons_state_path: &ClientConsensusStatePath, - ) -> Result { - let consensus_state_value = self.retrieve(client_cons_state_path.leaf())?; - - let any_wasm: WasmConsensusState = - C::ConsensusState::decode_any_vec(consensus_state_value)?; - - let consensus_state = C::ConsensusState::decode_any_vec(any_wasm.data)?; - - Ok(consensus_state) - } - - fn client_update_meta( - &self, - _client_id: &ClientId, - height: &Height, - ) -> Result<(Timestamp, Height), ContextError> { - let time_key = self.client_update_time_key(height); - - let time_vec = self.retrieve(time_key)?; - - let time = u64::from_be_bytes(time_vec.try_into().map_err(|_| ClientError::Other { - description: "time key cannot be converted to u64".to_string(), - })?); - - let timestamp = Timestamp::from_nanoseconds(time); - - let height_key = self.client_update_height_key(height); - - let revision_height_vec = self.retrieve(height_key)?; - - let revision_height = - u64::from_be_bytes( - revision_height_vec - .try_into() - .map_err(|_| ClientError::Other { - description: "revision height key cannot be converted to u64".to_string(), - })?, - ); - - let height = Height::new(0, revision_height)?; - - Ok((timestamp, height)) - } -} - -impl<'a, C: ClientType<'a>> ClientExecutionContext for Context<'a, C> -where - >::Error: Into, - >::Error: Into, -{ - type ClientStateMut = C::ClientState; - - fn store_client_state( - &mut self, - _client_state_path: ClientStatePath, - client_state: Self::ClientStateMut, - ) -> Result<(), ContextError> { - let prefixed_key = self.prefixed_key(ClientStatePath::leaf()); - - let encoded_client_state = self.encode_client_state(client_state)?; - - self.insert(prefixed_key, encoded_client_state); - - Ok(()) - } - - fn store_consensus_state( - &mut self, - consensus_state_path: ClientConsensusStatePath, - consensus_state: Self::ConsensusStateRef, - ) -> Result<(), ContextError> { - let prefixed_key = self.prefixed_key(consensus_state_path.leaf()); - - let encoded_consensus_state = C::ConsensusState::encode_to_any_vec(consensus_state); - - let wasm_consensus_state = WasmConsensusState { - data: encoded_consensus_state, - }; - - let encoded_wasm_consensus_state = - C::ConsensusState::encode_to_any_vec(wasm_consensus_state); - - self.insert(prefixed_key, encoded_wasm_consensus_state); - - Ok(()) - } - - fn delete_consensus_state( - &mut self, - consensus_state_path: ClientConsensusStatePath, - ) -> Result<(), ContextError> { - let prefixed_key = self.prefixed_key(consensus_state_path.leaf()); - - self.remove(prefixed_key); - - Ok(()) - } - - fn store_update_meta( - &mut self, - _client_id: ClientId, - height: Height, - host_timestamp: Timestamp, - host_height: Height, - ) -> Result<(), ContextError> { - let time_key = self.client_update_time_key(&height); - - let prefixed_time_key = self.prefixed_key(time_key); - - let time_vec = host_timestamp.nanoseconds().to_be_bytes(); - - self.insert(prefixed_time_key, time_vec); - - let height_key = self.client_update_height_key(&height); - - let prefixed_height_key = self.prefixed_key(height_key); - - let revision_height_vec = host_height.revision_height().to_be_bytes(); - - self.insert(prefixed_height_key, revision_height_vec); - - CONSENSUS_STATE_HEIGHT_MAP - .save( - self.storage_mut(), - (height.revision_number(), height.revision_height()), - &Default::default(), - ) - .map_err(|e| ClientError::Other { - description: e.to_string(), - })?; - - Ok(()) - } - - fn delete_update_meta( - &mut self, - _client_id: ClientId, - height: Height, - ) -> Result<(), ContextError> { - let time_key = self.client_update_time_key(&height); - - let prefixed_time_key = self.prefixed_key(time_key); - - self.remove(prefixed_time_key); - - let height_key = self.client_update_height_key(&height); - - let prefixed_height_key = self.prefixed_key(height_key); - - self.remove(prefixed_height_key); - - CONSENSUS_STATE_HEIGHT_MAP.remove( - self.storage_mut(), - (height.revision_number(), height.revision_height()), - ); - - Ok(()) - } -} diff --git a/cosmwasm/ibc-clients/cw-context/src/context/custom_ctx.rs b/cosmwasm/ibc-clients/cw-context/src/context/custom_ctx.rs deleted file mode 100644 index c8e8979b3f..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/context/custom_ctx.rs +++ /dev/null @@ -1,79 +0,0 @@ -//! Implementation of the `ExtClientValidationContext` trait for the `Context` -//! type. -use ibc_core::client::context::prelude::*; -use ibc_core::client::types::error::ClientError; -use ibc_core::client::types::Height; -use ibc_core::handler::types::error::ContextError; -use ibc_core::host::types::identifiers::ClientId; -use ibc_core::host::types::path::ClientConsensusStatePath; -use ibc_core::primitives::proto::Any; -use ibc_core::primitives::Timestamp; - -use super::Context; -use crate::api::ClientType; -use crate::types::HeightTravel; - -impl<'a, C: ClientType<'a>> ExtClientValidationContext for Context<'a, C> -where - >::Error: Into, - >::Error: Into, -{ - fn host_timestamp(&self) -> Result { - let time = self.env().block.time; - - let host_timestamp = Timestamp::from_nanoseconds(time.nanos()); - - Ok(host_timestamp) - } - - fn host_height(&self) -> Result { - let host_height = Height::new(0, self.env().block.height)?; - - Ok(host_height) - } - - fn consensus_state_heights(&self, _client_id: &ClientId) -> Result, ContextError> { - let heights = self.get_heights()?; - - Ok(heights) - } - fn next_consensus_state( - &self, - client_id: &ClientId, - height: &Height, - ) -> Result, ContextError> { - let next_height = self.get_adjacent_height(height, HeightTravel::Next)?; - - match next_height { - Some(h) => { - let cons_state_path = ClientConsensusStatePath::new( - client_id.clone(), - h.revision_number(), - h.revision_height(), - ); - self.consensus_state(&cons_state_path).map(Some) - } - None => Ok(None), - } - } - - fn prev_consensus_state( - &self, - client_id: &ClientId, - height: &Height, - ) -> Result, ContextError> { - let prev_height = self.get_adjacent_height(height, HeightTravel::Prev)?; - - match prev_height { - Some(prev_height) => { - let cons_state_path = ClientConsensusStatePath::new( - client_id.clone(), - prev_height.revision_number(), - prev_height.revision_height(), - ); - self.consensus_state(&cons_state_path).map(Some) - } - None => Ok(None), - } - } -} diff --git a/cosmwasm/ibc-clients/cw-context/src/context/mod.rs b/cosmwasm/ibc-clients/cw-context/src/context/mod.rs deleted file mode 100644 index bb8621cb85..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/context/mod.rs +++ /dev/null @@ -1,290 +0,0 @@ -pub mod client_ctx; -pub mod custom_ctx; - -use std::str::FromStr; - -use cosmwasm_std::{Binary, Deps, DepsMut, Empty, Env, Order, Storage}; -use cw_storage_plus::{Bound, Map}; -use ibc_client_wasm_types::client_state::ClientState as WasmClientState; -use ibc_core::client::context::client_state::ClientStateCommon; -use ibc_core::client::types::error::ClientError; -use ibc_core::client::types::Height; -use ibc_core::host::types::identifiers::ClientId; -use ibc_core::host::types::path::{ - ClientStatePath, ClientUpdateHeightPath, ClientUpdateTimePath, ITERATE_CONSENSUS_STATE_PREFIX, -}; -use ibc_core::primitives::proto::{Any, Protobuf}; -use prost::Message; - -use crate::api::ClientType; -use crate::types::{ContractError, HeightTravel, MigrationPrefix}; -use crate::utils::AnyCodec; - -/// - [`Height`] cannot be used directly as keys in the map, -/// as it doesn't implement some cw_storage specific traits. -/// - Only a sorted set is needed. So the value type is set to -/// [`Empty`] following -/// ([cosmwasm-book](https://book.cosmwasm.com/cross-contract/map-storage.html#maps-as-sets)). -pub const CONSENSUS_STATE_HEIGHT_MAP: Map<(u64, u64), Empty> = - Map::new(ITERATE_CONSENSUS_STATE_PREFIX); - -/// Context is a wrapper around the deps and env that provides access -/// to the methods under the ibc-rs Validation and Execution traits. -pub struct Context<'a, C: ClientType<'a>> -where - >::Error: Into, - >::Error: Into, -{ - deps: Option>, - deps_mut: Option>, - env: Env, - client_id: ClientId, - checksum: Option, - migration_prefix: MigrationPrefix, - client_type: std::marker::PhantomData, -} - -impl<'a, C: ClientType<'a>> Context<'a, C> -where - >::Error: Into, - >::Error: Into, -{ - /// Constructs a new Context object with the given deps and env. - pub fn new_ref(deps: Deps<'a>, env: Env) -> Result { - let client_id = ClientId::from_str(env.contract.address.as_str())?; - - Ok(Self { - deps: Some(deps), - deps_mut: None, - env, - client_id, - checksum: None, - migration_prefix: MigrationPrefix::None, - client_type: std::marker::PhantomData::, - }) - } - - /// Constructs a new Context object with the given deps_mut and env. - pub fn new_mut(deps_mut: DepsMut<'a>, env: Env) -> Result { - let client_id = ClientId::from_str(env.contract.address.as_str())?; - - Ok(Self { - deps: None, - deps_mut: Some(deps_mut), - env, - client_id, - checksum: None, - migration_prefix: MigrationPrefix::None, - client_type: std::marker::PhantomData::, - }) - } - - /// Returns the env of the context. - pub fn env(&self) -> &Env { - &self.env - } - - /// Logs the given message. - pub fn log(&self, msg: &str) -> Option<()> { - self.deps.map(|deps| deps.api.debug(msg)) - } - - /// Returns the client id of the context. - pub fn client_id(&self) -> ClientId { - self.client_id.clone() - } - - /// Sets the checksum of the context. - pub fn set_checksum(&mut self, checksum: Binary) { - self.checksum = Some(checksum); - } - - /// Enables the migration mode with the subject prefix. - pub fn set_subject_prefix(&mut self) { - self.migration_prefix = MigrationPrefix::Subject; - } - - /// Enables the migration mode with the substitute prefix. - pub fn set_substitute_prefix(&mut self) { - self.migration_prefix = MigrationPrefix::Substitute; - } - - /// Prefixes the given key with the migration prefix. - pub fn prefixed_key(&self, key: impl AsRef<[u8]>) -> Vec { - let mut prefixed_key = Vec::new(); - prefixed_key.extend_from_slice(self.migration_prefix.key()); - prefixed_key.extend_from_slice(key.as_ref()); - - prefixed_key - } - - /// Retrieves the value of the given key. - pub fn retrieve(&self, key: impl AsRef<[u8]>) -> Result, ClientError> { - let prefixed_key = self.prefixed_key(key); - - let value = self - .storage_ref() - .get(prefixed_key.as_ref()) - .ok_or(ClientError::Other { - description: "key not found upon retrieval".to_string(), - })?; - - Ok(value) - } - - /// Inserts the given key-value pair. - pub fn insert(&mut self, key: impl AsRef<[u8]>, value: impl AsRef<[u8]>) { - self.storage_mut().set(key.as_ref(), value.as_ref()); - } - - /// Removes the value of the given key. - pub fn remove(&mut self, key: impl AsRef<[u8]>) { - self.storage_mut().remove(key.as_ref()); - } - - /// Returns the storage of the context. - pub fn get_heights(&self) -> Result, ClientError> { - CONSENSUS_STATE_HEIGHT_MAP - .keys(self.storage_ref(), None, None, Order::Ascending) - .map(|deserialized_result| { - let (rev_number, rev_height) = - deserialized_result.map_err(|e| ClientError::Other { - description: e.to_string(), - })?; - Height::new(rev_number, rev_height) - }) - .collect() - } - - /// Searches for either the earliest next or latest previous height based on - /// the given height and travel direction. - pub fn get_adjacent_height( - &self, - height: &Height, - travel: HeightTravel, - ) -> Result, ClientError> { - let iterator = match travel { - HeightTravel::Prev => CONSENSUS_STATE_HEIGHT_MAP.range( - self.storage_ref(), - None, - Some(Bound::exclusive(( - height.revision_number(), - height.revision_height(), - ))), - Order::Descending, - ), - HeightTravel::Next => CONSENSUS_STATE_HEIGHT_MAP.range( - self.storage_ref(), - Some(Bound::exclusive(( - height.revision_number(), - height.revision_height(), - ))), - None, - Order::Ascending, - ), - }; - - iterator - .map(|deserialized_result| { - let ((rev_number, rev_height), _) = - deserialized_result.map_err(|e| ClientError::Other { - description: e.to_string(), - })?; - Height::new(rev_number, rev_height) - }) - .next() - .transpose() - } - - /// Returns the key for the client update time. - pub fn client_update_time_key(&self, height: &Height) -> Vec { - let client_update_time_path = ClientUpdateTimePath::new( - self.client_id(), - height.revision_number(), - height.revision_height(), - ); - - client_update_time_path.leaf().into_bytes() - } - - /// Returns the key for the client update height. - pub fn client_update_height_key(&self, height: &Height) -> Vec { - let client_update_height_path = ClientUpdateHeightPath::new( - self.client_id(), - height.revision_number(), - height.revision_height(), - ); - - client_update_height_path.leaf().into_bytes() - } - - /// Returns the checksum of the current contract. - pub fn obtain_checksum(&self) -> Result { - match &self.checksum { - Some(checksum) => Ok(checksum.clone()), - None => { - let client_state_value = self.retrieve(ClientStatePath::leaf())?; - - let wasm_client_state: WasmClientState = - Protobuf::::decode(client_state_value.as_slice()).map_err(|e| { - ClientError::Other { - description: e.to_string(), - } - })?; - - Ok(wasm_client_state.checksum.into()) - } - } - } - - /// Encodes the given client state into a byte vector. - pub fn encode_client_state( - &self, - client_state: C::ClientState, - ) -> Result, ClientError> { - let wasm_client_state = WasmClientState { - checksum: self.obtain_checksum()?.into(), - latest_height: client_state.latest_height(), - data: C::ClientState::encode_to_any_vec(client_state), - }; - - Ok(Any::from(wasm_client_state).encode_to_vec()) - } -} - -pub trait StorageRef { - fn storage_ref(&self) -> &dyn Storage; -} - -impl<'a, C: ClientType<'a>> StorageRef for Context<'a, C> -where - >::Error: Into, - >::Error: Into, -{ - fn storage_ref(&self) -> &dyn Storage { - match self.deps { - Some(ref deps) => deps.storage, - None => match self.deps_mut { - Some(ref deps) => deps.storage, - None => panic!("Either deps or deps_mut should be available"), - }, - } - } -} - -pub trait StorageMut: StorageRef { - fn storage_mut(&mut self) -> &mut dyn Storage; -} - -impl<'a, C: ClientType<'a>> StorageMut for Context<'a, C> -where - >::Error: Into, - >::Error: Into, -{ - fn storage_mut(&mut self) -> &mut dyn Storage { - match self.deps_mut { - Some(ref mut deps) => deps.storage, - None => panic!("deps_mut should be available"), - } - } -} diff --git a/cosmwasm/ibc-clients/cw-context/src/handlers.rs b/cosmwasm/ibc-clients/cw-context/src/handlers.rs deleted file mode 100644 index 76b07e1b23..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/handlers.rs +++ /dev/null @@ -1,200 +0,0 @@ -use cosmwasm_std::{to_json_binary, Binary}; -use ibc_core::client::context::prelude::*; -use ibc_core::client::types::error::ClientError; -use ibc_core::host::types::path::ClientConsensusStatePath; -use ibc_core::primitives::proto::Any; -use prost::Message; - -use crate::api::ClientType; -use crate::context::Context; -use crate::types::{ - CheckForMisbehaviourMsg, CheckForMisbehaviourResponse, ContractError, ContractResult, - InstantiateMsg, QueryMsg, StatusMsg, StatusResponse, SudoMsg, TimestampAtHeightResponse, - UpdateStateMsg, UpdateStateOnMisbehaviourMsg, VerifyClientMessageMsg, - VerifyClientMessageResponse, VerifyMembershipMsg, VerifyNonMembershipMsg, - VerifyUpgradeAndUpdateStateMsg, -}; - -impl<'a, C: ClientType<'a>> Context<'a, C> -where - >::Error: Into, - >::Error: Into, -{ - /// Instantiates a new client with the given [`InstantiateMsg`] message. - pub fn instantiate(&mut self, msg: InstantiateMsg) -> Result { - let any = Any::decode(&mut msg.client_state.as_slice())?; - - let client_state = C::ClientState::try_from(any).map_err(Into::into)?; - - let any_consensus_state = Any::decode(&mut msg.consensus_state.as_slice())?; - - self.set_checksum(msg.checksum); - - client_state.initialise(self, &self.client_id(), any_consensus_state)?; - - Ok(to_json_binary(&ContractResult::success())?) - } - - /// Executes the given [`SudoMsg`]. - pub fn sudo(&mut self, msg: SudoMsg) -> Result { - let client_id = self.client_id(); - - if let SudoMsg::MigrateClientStore(_) = msg { - self.set_subject_prefix(); - }; - - let client_state = self.client_state(&client_id)?; - - let result = match msg { - SudoMsg::UpdateState(msg_raw) => { - let msg = UpdateStateMsg::try_from(msg_raw)?; - - let heights = client_state.update_state(self, &client_id, msg.client_message)?; - - ContractResult::success().heights(heights) - } - SudoMsg::UpdateStateOnMisbehaviour(msg_raw) => { - let msg = UpdateStateOnMisbehaviourMsg::try_from(msg_raw)?; - - client_state.update_state_on_misbehaviour(self, &client_id, msg.client_message)?; - - ContractResult::success() - } - SudoMsg::VerifyMembership(msg) => { - let msg = VerifyMembershipMsg::try_from(msg)?; - - let client_cons_state_path = ClientConsensusStatePath::new( - self.client_id(), - msg.height.revision_number(), - msg.height.revision_height(), - ); - - let consensus_state = self.consensus_state(&client_cons_state_path)?; - - client_state.verify_membership_raw( - &msg.prefix, - &msg.proof, - consensus_state.root(), - msg.path, - msg.value, - )?; - - ContractResult::success() - } - SudoMsg::VerifyNonMembership(msg) => { - let msg = VerifyNonMembershipMsg::try_from(msg)?; - - let client_cons_state_path = ClientConsensusStatePath::new( - client_id.clone(), - msg.height.revision_number(), - msg.height.revision_height(), - ); - - let consensus_state = self.consensus_state(&client_cons_state_path)?; - - client_state.verify_non_membership_raw( - &msg.prefix, - &msg.proof, - consensus_state.root(), - msg.path, - )?; - - ContractResult::success() - } - SudoMsg::VerifyUpgradeAndUpdateState(msg) => { - let msg = VerifyUpgradeAndUpdateStateMsg::try_from(msg)?; - - let client_cons_state_path = ClientConsensusStatePath::new( - client_id.clone(), - client_state.latest_height().revision_number(), - client_state.latest_height().revision_height(), - ); - - let consensus_state = self.consensus_state(&client_cons_state_path)?; - - client_state.verify_upgrade_client( - msg.upgrade_client_state.clone(), - msg.upgrade_consensus_state.clone(), - msg.proof_upgrade_client, - msg.proof_upgrade_consensus_state, - consensus_state.root(), - )?; - - client_state.update_state_on_upgrade( - self, - &client_id, - msg.upgrade_client_state, - msg.upgrade_consensus_state, - )?; - - ContractResult::success() - } - SudoMsg::MigrateClientStore(_) => { - self.set_substitute_prefix(); - let substitute_client_state = self.client_state(&client_id)?; - let substitute_consensus_state = - self.consensus_state(&ClientConsensusStatePath::new( - client_id.clone(), - substitute_client_state.latest_height().revision_number(), - substitute_client_state.latest_height().revision_height(), - ))?; - - let substitute_client_state_any = substitute_client_state.into(); - - self.set_subject_prefix(); - client_state.check_substitute(self, substitute_client_state_any.clone())?; - - client_state.update_on_recovery( - self, - &self.client_id(), - substitute_client_state_any, - substitute_consensus_state.into(), - )?; - - ContractResult::success() - } - }; - Ok(to_json_binary(&result)?) - } - - /// Queries the client with the given [`QueryMsg`] message. - pub fn query(&self, msg: QueryMsg) -> Result { - let client_id = self.client_id(); - - let client_state = self.client_state(&client_id)?; - - match msg { - QueryMsg::Status(StatusMsg {}) => { - let status = client_state.status(self, &client_id)?; - to_json_binary(&StatusResponse { status }) - } - QueryMsg::TimestampAtHeight(msg) => { - let client_cons_state_path = ClientConsensusStatePath::new( - client_id, - msg.height.revision_number(), - msg.height.revision_height(), - ); - - let consensus_state = self.consensus_state(&client_cons_state_path)?; - let timestamp = consensus_state.timestamp().nanoseconds(); - to_json_binary(&TimestampAtHeightResponse { timestamp }) - } - QueryMsg::VerifyClientMessage(msg) => { - let msg = VerifyClientMessageMsg::try_from(msg)?; - - let is_valid = client_state - .verify_client_message(self, &client_id, msg.client_message) - .is_ok(); - to_json_binary(&VerifyClientMessageResponse { is_valid }) - } - QueryMsg::CheckForMisbehaviour(msg) => { - let msg = CheckForMisbehaviourMsg::try_from(msg)?; - - let found_misbehaviour = - client_state.check_for_misbehaviour(self, &client_id, msg.client_message)?; - to_json_binary(&CheckForMisbehaviourResponse { found_misbehaviour }) - } - } - .map_err(Into::into) - } -} diff --git a/cosmwasm/ibc-clients/cw-context/src/lib.rs b/cosmwasm/ibc-clients/cw-context/src/lib.rs deleted file mode 100644 index 4db776cdfd..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/lib.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! Contains types and implementations that are needed to integrate a light -//! client, built using ibc-rs, into a CosmWasm contract. This crate functions as -//! a library, allowing users to import the ready-made `Context` object that is -//! generic across light clients, introduce their concrete client type and -//! integrate their assembled context into the CosmWasm contract's entrypoint. -//! NOTE: To utilize the CosmWasm contract developed using this library, hosting -//! environments must support the CosmWasm module and be using one of the versions of -//! `ibc-go` that supports the `08-wasm` proxy light client. - -#![cfg_attr(not(test), deny(clippy::unwrap_used))] -#![deny( - warnings, - trivial_casts, - trivial_numeric_casts, - unused_import_braces, - unused_qualifications, - rust_2018_idioms -)] -#![forbid(unsafe_code)] - -pub mod api; -pub mod context; -pub mod handlers; -pub mod types; -pub mod utils; diff --git a/cosmwasm/ibc-clients/cw-context/src/types/error.rs b/cosmwasm/ibc-clients/cw-context/src/types/error.rs deleted file mode 100644 index d191638adf..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/types/error.rs +++ /dev/null @@ -1,36 +0,0 @@ -use cosmwasm_std::StdError; -use derive_more::{Display, From}; -use ibc_core::client::types::error::ClientError; -use ibc_core::commitment_types::error::CommitmentError; -use ibc_core::handler::types::error::ContextError; -use ibc_core::host::types::error::IdentifierError; -use ibc_core::host::types::path::PathError; -use prost::DecodeError; - -#[derive(From, Display, Debug)] -pub enum ContractError { - #[display(fmt = "CosmWasm standard error: {_0}")] - Std(StdError), - #[display(fmt = "IBC validation/execution context error: {_0}")] - Context(ContextError), - #[display(fmt = "IBC commitment error: {_0}")] - Commitment(CommitmentError), - #[display(fmt = "IBC identifier error: {_0}")] - Identifier(IdentifierError), - #[display(fmt = "IBC path error: {_0}")] - Path(PathError), - #[display(fmt = "Proto decoding error: {_0}")] - ProtoDecode(DecodeError), -} - -impl From for StdError { - fn from(err: ContractError) -> StdError { - StdError::generic_err(err.to_string()) - } -} - -impl From for ContractError { - fn from(err: ClientError) -> ContractError { - ContractError::Context(ContextError::ClientError(err)) - } -} diff --git a/cosmwasm/ibc-clients/cw-context/src/types/helper.rs b/cosmwasm/ibc-clients/cw-context/src/types/helper.rs deleted file mode 100644 index 05c82de7a2..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/types/helper.rs +++ /dev/null @@ -1,31 +0,0 @@ -use ibc_client_wasm_types::{SUBJECT_PREFIX, SUBSTITUTE_PREFIX}; - -/// The MigrationPrefix enumerates the prefix type used during migration mode. -/// The migration mode is activated when there is an incoming -/// [`MigrateClientStoreMsg`](crate::types::msgs::MigrateClientStoreMsg) -/// message. It specifies the prefix key for either the -/// subject or substitute store, or none if the migration is not active. -#[derive(Clone, Debug)] -pub enum MigrationPrefix { - Subject, - Substitute, - None, -} - -impl MigrationPrefix { - pub fn key(&self) -> &[u8] { - match self { - MigrationPrefix::Subject => SUBJECT_PREFIX, - MigrationPrefix::Substitute => SUBSTITUTE_PREFIX, - MigrationPrefix::None => b"", - } - } -} - -/// Travel is an enum to represent the direction of travel in the context of -/// height. -#[derive(Clone, Debug)] -pub enum HeightTravel { - Next, - Prev, -} diff --git a/cosmwasm/ibc-clients/cw-context/src/types/mod.rs b/cosmwasm/ibc-clients/cw-context/src/types/mod.rs deleted file mode 100644 index 28b7dfd351..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/types/mod.rs +++ /dev/null @@ -1,9 +0,0 @@ -mod error; -mod helper; -mod msgs; -mod response; - -pub use error::*; -pub use helper::*; -pub use msgs::*; -pub use response::*; diff --git a/cosmwasm/ibc-clients/cw-context/src/types/msgs.rs b/cosmwasm/ibc-clients/cw-context/src/types/msgs.rs deleted file mode 100644 index 499bb9548f..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/types/msgs.rs +++ /dev/null @@ -1,299 +0,0 @@ -//! Defines the messages sent to the CosmWasm contract by the 08-wasm proxy -//! light client. -use cosmwasm_schema::{cw_serde, QueryResponses}; -use cosmwasm_std::Binary; -use ibc_core::client::types::proto::v1::Height as RawHeight; -use ibc_core::client::types::Height; -use ibc_core::commitment_types::commitment::{CommitmentPrefix, CommitmentProofBytes}; -use ibc_core::host::types::path::PathBytes; -use ibc_core::primitives::proto::Any; -use prost::Message; - -use super::error::ContractError; - -// ------------------------------------------------------------ -// Implementation of the InstantiateMsg struct -// ------------------------------------------------------------ - -#[cw_serde] -pub struct InstantiateMsg { - pub client_state: Binary, - pub consensus_state: Binary, - pub checksum: Binary, -} - -// ------------------------------------------------------------ -// Implementation of the SudoMsg enum and its variants -// ------------------------------------------------------------ - -#[derive(derive_more::From)] -#[cw_serde] -pub enum SudoMsg { - UpdateState(UpdateStateMsgRaw), - UpdateStateOnMisbehaviour(UpdateStateOnMisbehaviourMsgRaw), - VerifyUpgradeAndUpdateState(VerifyUpgradeAndUpdateStateMsgRaw), - VerifyMembership(VerifyMembershipMsgRaw), - VerifyNonMembership(VerifyNonMembershipMsgRaw), - MigrateClientStore(MigrateClientStoreMsg), -} - -#[cw_serde] -pub struct UpdateStateOnMisbehaviourMsgRaw { - pub client_message: Binary, -} - -pub struct UpdateStateOnMisbehaviourMsg { - pub client_message: Any, -} - -impl TryFrom for UpdateStateOnMisbehaviourMsg { - type Error = ContractError; - - fn try_from(raw: UpdateStateOnMisbehaviourMsgRaw) -> Result { - let client_message = Any::decode(&mut raw.client_message.as_slice())?; - - Ok(Self { client_message }) - } -} - -#[cw_serde] -pub struct UpdateStateMsgRaw { - pub client_message: Binary, -} - -pub struct UpdateStateMsg { - pub client_message: Any, -} - -impl TryFrom for UpdateStateMsg { - type Error = ContractError; - - fn try_from(raw: UpdateStateMsgRaw) -> Result { - let client_message = Any::decode(&mut raw.client_message.as_slice())?; - - Ok(Self { client_message }) - } -} - -#[cw_serde] -pub struct CheckSubstituteAndUpdateStateMsg {} - -#[cw_serde] -pub struct VerifyUpgradeAndUpdateStateMsgRaw { - pub upgrade_client_state: Binary, - pub upgrade_consensus_state: Binary, - pub proof_upgrade_client: Binary, - pub proof_upgrade_consensus_state: Binary, -} - -pub struct VerifyUpgradeAndUpdateStateMsg { - pub upgrade_client_state: Any, - pub upgrade_consensus_state: Any, - pub proof_upgrade_client: CommitmentProofBytes, - pub proof_upgrade_consensus_state: CommitmentProofBytes, -} - -impl TryFrom for VerifyUpgradeAndUpdateStateMsg { - type Error = ContractError; - - fn try_from(raw: VerifyUpgradeAndUpdateStateMsgRaw) -> Result { - let upgrade_client_state = Any::decode(&mut raw.upgrade_client_state.as_slice())?; - - let upgrade_consensus_state = Any::decode(&mut raw.upgrade_consensus_state.as_slice())?; - - Ok(VerifyUpgradeAndUpdateStateMsg { - upgrade_client_state, - upgrade_consensus_state, - proof_upgrade_client: CommitmentProofBytes::try_from( - raw.proof_upgrade_client.to_vec(), - )?, - proof_upgrade_consensus_state: CommitmentProofBytes::try_from( - raw.proof_upgrade_consensus_state.to_vec(), - )?, - }) - } -} - -#[cw_serde] -pub struct MerklePath { - pub key_path: Vec, -} - -#[cw_serde] -pub struct VerifyMembershipMsgRaw { - pub proof: Binary, - pub merkle_path: MerklePath, - pub value: Binary, - pub height: RawHeight, - pub delay_block_period: u64, - pub delay_time_period: u64, -} - -pub struct VerifyMembershipMsg { - pub prefix: CommitmentPrefix, - pub proof: CommitmentProofBytes, - pub path: PathBytes, - pub value: Vec, - pub height: Height, - pub delay_block_period: u64, - pub delay_time_period: u64, -} - -impl TryFrom for VerifyMembershipMsg { - type Error = ContractError; - - fn try_from(mut raw: VerifyMembershipMsgRaw) -> Result { - let proof = CommitmentProofBytes::try_from(raw.proof.to_vec())?; - let prefix = CommitmentPrefix::from_bytes(raw.merkle_path.key_path.remove(0)); - let path = PathBytes::flatten(raw.merkle_path.key_path); - let height = Height::try_from(raw.height)?; - - Ok(Self { - proof, - path, - value: raw.value.into(), - height, - prefix, - delay_block_period: raw.delay_block_period, - delay_time_period: raw.delay_time_period, - }) - } -} - -#[cw_serde] -pub struct VerifyNonMembershipMsgRaw { - pub proof: Binary, - pub merkle_path: MerklePath, - pub height: RawHeight, - pub delay_block_period: u64, - pub delay_time_period: u64, -} - -pub struct VerifyNonMembershipMsg { - pub prefix: CommitmentPrefix, - pub proof: CommitmentProofBytes, - pub path: PathBytes, - pub height: Height, - pub delay_block_period: u64, - pub delay_time_period: u64, -} - -impl TryFrom for VerifyNonMembershipMsg { - type Error = ContractError; - - fn try_from(mut raw: VerifyNonMembershipMsgRaw) -> Result { - let proof = CommitmentProofBytes::try_from(raw.proof.to_vec())?; - let prefix = CommitmentPrefix::from_bytes(raw.merkle_path.key_path.remove(0)); - let path = PathBytes::flatten(raw.merkle_path.key_path); - let height = raw.height.try_into()?; - - Ok(Self { - proof, - path, - height, - prefix, - delay_block_period: raw.delay_block_period, - delay_time_period: raw.delay_time_period, - }) - } -} - -#[cw_serde] -pub struct MigrateClientStoreMsg {} - -// ------------------------------------------------------------ -// Implementation of the QueryMsg enum and its variants -// ------------------------------------------------------------ - -#[derive(QueryResponses, derive_more::From)] -#[cw_serde] -pub enum QueryMsg { - #[returns(crate::types::response::StatusResponse)] - Status(StatusMsg), - #[returns(crate::types::response::TimestampAtHeightResponse)] - TimestampAtHeight(TimestampAtHeightMsg), - #[returns(crate::types::response::VerifyClientMessageResponse)] - VerifyClientMessage(VerifyClientMessageRaw), - #[returns(crate::types::response::CheckForMisbehaviourResponse)] - CheckForMisbehaviour(CheckForMisbehaviourMsgRaw), -} - -#[cw_serde] -pub struct StatusMsg {} - -#[cw_serde] -pub struct TimestampAtHeightMsg { - pub height: Height, -} - -#[cw_serde] -pub struct VerifyClientMessageRaw { - pub client_message: Binary, -} - -pub struct VerifyClientMessageMsg { - pub client_message: Any, -} - -impl TryFrom for VerifyClientMessageMsg { - type Error = ContractError; - - fn try_from(raw: VerifyClientMessageRaw) -> Result { - let client_message = Any::decode(&mut raw.client_message.as_slice())?; - - Ok(Self { client_message }) - } -} - -#[cw_serde] -pub struct CheckForMisbehaviourMsgRaw { - pub client_message: Binary, -} - -pub struct CheckForMisbehaviourMsg { - pub client_message: Any, -} - -impl TryFrom for CheckForMisbehaviourMsg { - type Error = ContractError; - - fn try_from(raw: CheckForMisbehaviourMsgRaw) -> Result { - let client_message = Any::decode(&mut raw.client_message.as_slice())?; - - Ok(Self { client_message }) - } -} - -#[cfg(test)] -mod test { - use super::{InstantiateMsg, SudoMsg}; - - #[test] - fn verify_membership_from_json() { - let sudo_msg = r#"{ - "verify_membership":{ - "height": - {"revision_height":57}, - "delay_time_period":0, - "delay_block_period":0, - "proof":"CuECCt4CChhjb25uZWN0aW9ucy9jb25uZWN0aW9uLTASWgoPMDctdGVuZGVybWludC0wEiMKATESDU9SREVSX09SREVSRUQSD09SREVSX1VOT1JERVJFRBgCIiAKCTA4LXdhc20tMBIMY29ubmVjdGlvbi0wGgUKA2liYxoLCAEYASABKgMAAkgiKQgBEiUCBHAg3HTYmBAMxlr6u0mv6wCpm3ur2WQc7A3Af6aV7Ye0Fe0gIisIARIEBAZwIBohIHXEkQ9RIH08ZZYBIP6THxOOJiRmjXWGn1G4RCWT3V6rIisIARIEBgxwIBohIEUjGWV7YLPEzdFVLAb0lv4VvP7A+l1TqFkjpx1kDKAPIikIARIlCBhwILWsAKEot+2MknVyn5zcS0qsqVhRj4AHpgDx7fNPbfhtICIpCAESJQxAcCCzyYMGE+CdCltudr1ddHvCJrqv3kl/i7YnMLx3XWJt/yAK/AEK+QEKA2liYxIg2nvqL76rejXXGlX6ng/UKrbw+72C8uKKgM2vP0JKj1QaCQgBGAEgASoBACIlCAESIQEGuZwNgRn/HtvL4WXQ8ZM327wIDmd8iOV6oq52fr8PDyInCAESAQEaIKplBAbqDXbjndQ9LqapHj/aockI/CGnymjl5izIEVY5IiUIARIhAdt4G8DCLINAaaJnhUMIzv74AV3zZiugAyyZ/lWYRv+cIiUIARIhAf+sohoEV+uWeKThAPEbqCUivWT4H8KNT7Giw9//LsyvIicIARIBARogNHO4HC5KxPCwBdQGgBCscVtEKw+YSn2pnf654Y3Oxik=", - "merkle_path":{"key_path":["aWJj","Y29ubmVjdGlvbnMvY29ubmVjdGlvbi0w"]}, - "value":"Cg8wNy10ZW5kZXJtaW50LTASIwoBMRINT1JERVJfT1JERVJFRBIPT1JERVJfVU5PUkRFUkVEGAIiIAoJMDgtd2FzbS0wEgxjb25uZWN0aW9uLTAaBQoDaWJj" - } - }"#; - assert!(matches!( - serde_json::from_str::(sudo_msg).unwrap(), - SudoMsg::VerifyMembership(_) - )); - } - - #[test] - fn instantiate_msg_from_json() { - let instantiate_msg = r#"{ - "client_state":"Y2xpZW50X3N0YXRlCg==", - "consensus_state":"Y29uc2Vuc3VzX3N0YXRlCg==", - "checksum":"Y2hlY2tzdW0K" - }"#; - serde_json::from_str::(instantiate_msg).unwrap(); - } -} diff --git a/cosmwasm/ibc-clients/cw-context/src/types/response.rs b/cosmwasm/ibc-clients/cw-context/src/types/response.rs deleted file mode 100644 index 84dc3a0f0a..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/types/response.rs +++ /dev/null @@ -1,48 +0,0 @@ -//! Contains the response types for the CosmWasm contract. -use cosmwasm_schema::cw_serde; -use ibc_core::client::types::{Height, Status}; - -/// The response to [`super::msgs::QueryMsg::Status`] -#[cw_serde] -pub struct StatusResponse { - /// The status of the client - pub status: Status, -} - -/// The response to [`super::msgs::QueryMsg::TimestampAtHeight`] -#[cw_serde] -pub struct TimestampAtHeightResponse { - /// The timestamp at the given height - pub timestamp: u64, -} - -/// The response to [`super::QueryMsg::VerifyClientMessage`] -#[cw_serde] -pub struct VerifyClientMessageResponse { - /// Whether the client message is valid - pub is_valid: bool, -} - -/// The response to [`super::msgs::QueryMsg::CheckForMisbehaviour`] -#[cw_serde] -pub struct CheckForMisbehaviourResponse { - /// Whether misbehaviour was found - pub found_misbehaviour: bool, -} - -#[cw_serde] -pub struct ContractResult { - #[serde(skip_serializing_if = "Option::is_none")] - pub heights: Option>, -} - -impl ContractResult { - pub fn success() -> Self { - Self { heights: None } - } - - pub fn heights(mut self, heights: Vec) -> Self { - self.heights = Some(heights); - self - } -} diff --git a/cosmwasm/ibc-clients/cw-context/src/utils/codec.rs b/cosmwasm/ibc-clients/cw-context/src/utils/codec.rs deleted file mode 100644 index dc662ecff4..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/utils/codec.rs +++ /dev/null @@ -1,28 +0,0 @@ -use ibc_core::client::types::error::ClientError; -use ibc_core::primitives::proto::Any; -use prost::Message; - -/// AnyCodec is a convenient trait that provides a generic way to encode and -/// decode domain types through the `Any` type. -pub trait AnyCodec { - fn decode_any_vec(data: Vec) -> Result - where - C: TryFrom, - >::Error: Into, - { - let raw = Any::decode(&mut data.as_slice()).map_err(|e| ClientError::Other { - description: e.to_string(), - })?; - - C::try_from(raw).map_err(Into::into) - } - - fn encode_to_any_vec(value: C) -> Vec - where - C: Into, - { - value.into().encode_to_vec() - } -} - -impl AnyCodec for T where T: TryFrom + Into {} diff --git a/cosmwasm/ibc-clients/cw-context/src/utils/mod.rs b/cosmwasm/ibc-clients/cw-context/src/utils/mod.rs deleted file mode 100644 index 38e96fd598..0000000000 --- a/cosmwasm/ibc-clients/cw-context/src/utils/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod codec; - -pub use codec::*; diff --git a/cosmwasm/ibc-clients/ics07-tendermint/Cargo.toml b/cosmwasm/ibc-clients/ics07-tendermint/Cargo.toml deleted file mode 100644 index acedd5a272..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/Cargo.toml +++ /dev/null @@ -1,41 +0,0 @@ -[package] -name = "ibc-client-tendermint-cw" -authors = { workspace = true } -edition = { workspace = true } -license = { workspace = true } -repository = { workspace = true } -rust-version = { workspace = true } -version = { workspace = true } -keywords = [ "ibc", "light-client", "CosmWasm", "ICS-07", "Tendermint" ] -readme = "./../../README.md" - -description = """ - Contains the implementation of the ICS-07 Tendermint Client logic as a CosmWasm contract. - It leverages the `ibc-client-cw` crate to integrate the Tendermint light client into a CosmWasm contract. -""" - -[lib] -crate-type = [ "cdylib", "rlib" ] - -[dependencies] -# ibc dependencies -ibc-core = { workspace = true } -ibc-client-cw = { workspace = true } -ibc-client-tendermint = { workspace = true } - -# cosmwasm dependencies -cosmwasm-std = { workspace = true } - -[dev-dependencies] -ibc-testkit = { workspace = true } -serde-json = { workspace = true } -tendermint = { workspace = true } -tendermint-testgen = { workspace = true } - -[features] -default = [ "std" ] -std = [ - "ibc-core/std", - "ibc-client-cw/std", - "ibc-client-tendermint/std", -] diff --git a/cosmwasm/ibc-clients/ics07-tendermint/README.md b/cosmwasm/ibc-clients/ics07-tendermint/README.md deleted file mode 100644 index d306e9707d..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# `ibc-client-tendermint-cw` crate - -This crate showcases how to reuse an `ibc-rs` light client as a -[CosmWasm contract](https://github.com/cosmos/ibc/blob/main/spec/client/ics-008-wasm-client/README.md) -utilizing the `ibc-client-cw` crate. - -The `ibc-client-cw` crate exposes the requisite types and traits needed to reuse -the `ibc-rs` light clients. Notably, it offers a -[`ClientType`](https://docs.rs/ibc-client-cw/latest/ibc_client_cw/api/trait.ClientType.html) -trait, which requires two associated types: `ClientState` and `ConsensusState`. -These types take any type that implement the -[`ClientStateExecution`](https://docs.rs/ibc-core/latest/ibc_core/client/context/client_state/trait.ClientStateExecution.html) -and -[`ConsensusState`](https://docs.rs/ibc-core/latest/ibc_core/client/context/consensus_state/trait.ConsensusState.html) -traits from the `ibc-core` crate. - -For example, to reuse the existing -[`ibc-client-tendermint`](https://docs.rs/ibc-client-tendermint/latest/ibc_client_tendermint/): - -```rs -use ibc_client_cw::api::ClientType; -use ibc_client_tendermint::client_state::ClientState; -use ibc_client_tendermint::consensus_state::ConsensusState; - -#[derive(Clone, Debug)] -pub struct TendermintClient; - -impl<'a> ClientType<'a> for TendermintClient { - type ClientState = ClientState; - type ConsensusState = ConsensusState; -} -``` - -Once the `ClientType` trait is implemented, the `ibc-client-cw` crate can be -used to complete the entry points for the CosmWasm contract: - -```rs -use cosmwasm_std::{entry_point, Binary, Deps, DepsMut, Env, MessageInfo, Response}; -use ibc_client_cw::context::Context; -use ibc_client_cw::types::{ContractError, InstantiateMsg, QueryMsg, SudoMsg}; - -pub type TendermintContext<'a> = Context<'a, TendermintClient>; - -#[entry_point] -pub fn instantiate( - deps: DepsMut<'_>, - env: Env, - _info: MessageInfo, - msg: InstantiateMsg, -) -> Result { - let mut ctx = TendermintContext::new_mut(deps, env)?; - let data = ctx.instantiate(msg)?; - Ok(Response::default().set_data(data)) -} - -#[entry_point] -pub fn sudo(deps: DepsMut<'_>, env: Env, msg: SudoMsg) -> Result { - let mut ctx = TendermintContext::new_mut(deps, env)?; - let data = ctx.sudo(msg)?; - Ok(Response::default().set_data(data)) -} - -#[entry_point] -pub fn query(deps: Deps<'_>, env: Env, msg: QueryMsg) -> Result { - let ctx = TendermintContext::new_ref(deps, env)?; - ctx.query(msg) -} -``` - -The above snippets compile into a fully working CosmWasm contract that implements the -Tendermint IBC light client. diff --git a/cosmwasm/ibc-clients/ics07-tendermint/src/client_type.rs b/cosmwasm/ibc-clients/ics07-tendermint/src/client_type.rs deleted file mode 100644 index 0016572200..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/src/client_type.rs +++ /dev/null @@ -1,12 +0,0 @@ -use ibc_client_cw::api::ClientType; -use ibc_client_tendermint::client_state::ClientState; -use ibc_client_tendermint::consensus_state::ConsensusState; - -/// A unit struct that represents the Tendermint client type. -#[derive(Clone, Debug)] -pub struct TendermintClient; - -impl<'a> ClientType<'a> for TendermintClient { - type ClientState = ClientState; - type ConsensusState = ConsensusState; -} diff --git a/cosmwasm/ibc-clients/ics07-tendermint/src/entrypoint.rs b/cosmwasm/ibc-clients/ics07-tendermint/src/entrypoint.rs deleted file mode 100644 index e01e796b9d..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/src/entrypoint.rs +++ /dev/null @@ -1,32 +0,0 @@ -use cosmwasm_std::{entry_point, Binary, Deps, DepsMut, Env, MessageInfo, Response}; -use ibc_client_cw::context::Context; -use ibc_client_cw::types::{ContractError, InstantiateMsg, QueryMsg, SudoMsg}; - -use crate::client_type::TendermintClient; - -pub type TendermintContext<'a> = Context<'a, TendermintClient>; - -#[entry_point] -pub fn instantiate( - deps: DepsMut<'_>, - env: Env, - _info: MessageInfo, - msg: InstantiateMsg, -) -> Result { - let mut ctx = TendermintContext::new_mut(deps, env)?; - let data = ctx.instantiate(msg)?; - Ok(Response::default().set_data(data)) -} - -#[entry_point] -pub fn sudo(deps: DepsMut<'_>, env: Env, msg: SudoMsg) -> Result { - let mut ctx = TendermintContext::new_mut(deps, env)?; - let data = ctx.sudo(msg)?; - Ok(Response::default().set_data(data)) -} - -#[entry_point] -pub fn query(deps: Deps<'_>, env: Env, msg: QueryMsg) -> Result { - let ctx = TendermintContext::new_ref(deps, env)?; - ctx.query(msg) -} diff --git a/cosmwasm/ibc-clients/ics07-tendermint/src/lib.rs b/cosmwasm/ibc-clients/ics07-tendermint/src/lib.rs deleted file mode 100644 index 3b8e9492be..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/src/lib.rs +++ /dev/null @@ -1,18 +0,0 @@ -//! The CosmWasm contract implementation of the ICS-07 Tendermint light client -//! built using `ibc-rs`. -#![cfg_attr(not(test), deny(clippy::unwrap_used))] -#![deny( - warnings, - trivial_casts, - trivial_numeric_casts, - unused_import_braces, - unused_qualifications, - rust_2018_idioms -)] -#![forbid(unsafe_code)] - -pub mod client_type; -pub mod entrypoint; - -#[cfg(test)] -mod tests; diff --git a/cosmwasm/ibc-clients/ics07-tendermint/src/tests/fixture.rs b/cosmwasm/ibc-clients/ics07-tendermint/src/tests/fixture.rs deleted file mode 100644 index cc8042b338..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/src/tests/fixture.rs +++ /dev/null @@ -1,232 +0,0 @@ -use std::time::Duration; - -use cosmwasm_std::{from_json, Binary, Deps, DepsMut, Empty, Response, StdError, StdResult}; -use ibc_client_cw::types::{ - CheckForMisbehaviourMsgRaw, CheckForMisbehaviourResponse, ContractError, InstantiateMsg, - MigrationPrefix, QueryMsg, StatusMsg, StatusResponse, UpdateStateMsgRaw, - UpdateStateOnMisbehaviourMsgRaw, VerifyClientMessageRaw, VerifyClientMessageResponse, -}; -use ibc_client_cw::utils::AnyCodec; -use ibc_client_tendermint::client_state::ClientState as TmClientState; -use ibc_client_tendermint::consensus_state::ConsensusState as TmConsensusState; -use ibc_client_tendermint::types::Header; -use ibc_core::client::types::{Height, Status}; -use ibc_core::host::types::identifiers::ChainId; -use ibc_core::primitives::Timestamp; -use ibc_testkit::fixtures::clients::tendermint::ClientStateConfig; -use tendermint::Time; -use tendermint_testgen::{Generator, Validator}; - -use crate::entrypoint::TendermintContext; -use crate::tests::helper::{ - dummy_checksum, dummy_sov_consensus_state, mock_env_with_timestamp_now, -}; - -/// Test fixture -#[derive(Clone, Debug)] -pub struct Fixture { - pub chain_id: ChainId, - pub trusted_timestamp: Timestamp, - pub trusted_height: Height, - pub validators: Vec, - pub migration_prefix: MigrationPrefix, -} - -impl Default for Fixture { - fn default() -> Self { - Fixture { - chain_id: ChainId::new("test-chain").unwrap(), - trusted_timestamp: Timestamp::now(), - trusted_height: Height::new(0, 5).unwrap(), - validators: vec![ - Validator::new("1").voting_power(40), - Validator::new("2").voting_power(30), - Validator::new("3").voting_power(30), - ], - migration_prefix: MigrationPrefix::None, - } - } -} - -impl Fixture { - pub fn set_migration_prefix(&mut self, migration_mode: MigrationPrefix) { - self.migration_prefix = migration_mode; - } - - pub fn ctx_ref<'a>(&self, deps: Deps<'a, Empty>) -> TendermintContext<'a> { - let mut ctx = - TendermintContext::new_ref(deps, mock_env_with_timestamp_now()).expect("never fails"); - - match self.migration_prefix { - MigrationPrefix::None => {} - MigrationPrefix::Subject => { - ctx.set_subject_prefix(); - } - MigrationPrefix::Substitute => { - ctx.set_substitute_prefix(); - } - }; - - ctx - } - - pub fn ctx_mut<'a>(&self, deps: DepsMut<'a, Empty>) -> TendermintContext<'a> { - let mut ctx = - TendermintContext::new_mut(deps, mock_env_with_timestamp_now()).expect("never fails"); - - match self.migration_prefix { - MigrationPrefix::None => {} - MigrationPrefix::Subject => { - ctx.set_subject_prefix(); - } - MigrationPrefix::Substitute => { - ctx.set_substitute_prefix(); - } - }; - - ctx - } - - pub fn dummy_instantiate_msg(&self) -> InstantiateMsg { - // Setting the `trusting_period` to 1 second allows the quick - // client expiry for the tests. - let tm_client_state: TmClientState = ClientStateConfig::builder() - .trusting_period(Duration::from_secs(1)) - .build() - .into_client_state(self.chain_id.clone(), self.trusted_height) - .expect("never fails"); - - let tm_consensus_state = dummy_sov_consensus_state(self.trusted_timestamp); - - InstantiateMsg { - client_state: TmClientState::encode_to_any_vec(tm_client_state).into(), - consensus_state: TmConsensusState::encode_to_any_vec(tm_consensus_state).into(), - checksum: dummy_checksum(), - } - } - - fn dummy_header(&self, header_height: Height) -> Vec { - let header = tendermint_testgen::Header::new(&self.validators) - .chain_id(self.chain_id.as_str()) - .height(header_height.revision_height()) - .time(Time::now()) - .next_validators(&self.validators) - .app_hash(vec![0; 32].try_into().expect("never fails")); - - let light_block = tendermint_testgen::LightBlock::new_default_with_header(header) - .generate() - .expect("failed to generate light block"); - - let tm_header = Header { - signed_header: light_block.signed_header, - validator_set: light_block.validators, - trusted_height: self.trusted_height, - trusted_next_validator_set: light_block.next_validators, - }; - - Header::encode_to_any_vec(tm_header) - } - - pub fn dummy_client_message(&self, target_height: Height) -> Vec { - self.dummy_header(target_height) - } - - /// Constructs a dummy misbehaviour message that is one block behind the - /// trusted height, but with a future timestamp. - pub fn dummy_misbehaviour_message(&self) -> Vec { - let prev_height = self.trusted_height.decrement().expect("never fails"); - - self.dummy_header(prev_height) - } - - pub fn verify_client_message(&self, deps: Deps<'_>, client_message: Vec) { - let resp: VerifyClientMessageResponse = self - .query( - deps, - VerifyClientMessageRaw { - client_message: client_message.into(), - }, - ) - .and_then(from_json) - .unwrap(); - - assert!(resp.is_valid); - } - - pub fn check_for_misbehaviour(&self, deps: Deps<'_>, client_message: Vec) { - let resp: CheckForMisbehaviourResponse = self - .query( - deps, - CheckForMisbehaviourMsgRaw { - client_message: client_message.into(), - }, - ) - .and_then(from_json) - .unwrap(); - - assert!(resp.found_misbehaviour); - } - - pub fn check_client_status(&self, deps: Deps<'_>, expected: Status) { - let resp: StatusResponse = self.query(deps, StatusMsg {}).and_then(from_json).unwrap(); - - assert_eq!(resp.status, expected); - } - - pub fn query(&self, deps: Deps<'_>, msg: impl Into) -> StdResult { - let ctx = self.ctx_ref(deps); - - ctx.query(msg.into()) - .map_err(|e| StdError::generic_err(e.to_string())) - } - - pub fn create_client(&self, deps_mut: DepsMut<'_>) -> Result { - let mut ctx = self.ctx_mut(deps_mut); - - let instantiate_msg = self.dummy_instantiate_msg(); - - let data = ctx.instantiate(instantiate_msg)?; - - Ok(Response::default().set_data(data)) - } - - pub fn update_client( - &self, - deps_mut: DepsMut<'_>, - target_height: Height, - ) -> Result { - let client_message = self.dummy_client_message(target_height); - - self.verify_client_message(deps_mut.as_ref(), client_message.clone()); - - let mut ctx = self.ctx_mut(deps_mut); - - let data = ctx.sudo( - UpdateStateMsgRaw { - client_message: client_message.into(), - } - .into(), - )?; - - Ok(Response::default().set_data(data)) - } - - pub fn update_client_on_misbehaviour(&self, deps_mut: DepsMut<'_>) -> Response { - let client_message = self.dummy_misbehaviour_message(); - - self.check_for_misbehaviour(deps_mut.as_ref(), client_message.clone()); - - let mut ctx = self.ctx_mut(deps_mut); - - let data = ctx - .sudo( - UpdateStateOnMisbehaviourMsgRaw { - client_message: client_message.into(), - } - .into(), - ) - .unwrap(); - - Response::default().set_data(data) - } -} diff --git a/cosmwasm/ibc-clients/ics07-tendermint/src/tests/helper.rs b/cosmwasm/ibc-clients/ics07-tendermint/src/tests/helper.rs deleted file mode 100644 index 64f084ce35..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/src/tests/helper.rs +++ /dev/null @@ -1,34 +0,0 @@ -use std::str::FromStr; - -use cosmwasm_std::testing::mock_env; -use cosmwasm_std::{Binary, Checksum, Env, Timestamp as CwTimestamp}; -use ibc_client_tendermint::types::ConsensusState; -use ibc_core::primitives::Timestamp as IbcTimestamp; -use tendermint::Hash; - -pub fn dummy_checksum() -> Binary { - let hex_bytes = - Checksum::from_hex("2469f43c3ca20d476442bd3d98cbd97a180776ab37332aa7b02cae5a620acfc6") - .expect("Never fails"); - - hex_bytes.as_slice().into() -} - -pub fn dummy_sov_consensus_state(timestamp: IbcTimestamp) -> ConsensusState { - ConsensusState::new( - vec![0].into(), - timestamp.into_tm_time(), - // Hash of default validator set - Hash::from_str("D6B93922C33AAEBEC9043566CB4B1B48365B1358B67C7DEF986D9EE1861BC143") - .expect("Never fails"), - ) -} - -/// Returns a mock environment with the current timestamp. This is defined -/// to be used for testing client expiry and other time-sensitive operations. -pub fn mock_env_with_timestamp_now() -> Env { - let mut env = mock_env(); - let now_nanos = IbcTimestamp::now().nanoseconds(); - env.block.time = CwTimestamp::from_nanos(now_nanos); - env -} diff --git a/cosmwasm/ibc-clients/ics07-tendermint/src/tests/mod.rs b/cosmwasm/ibc-clients/ics07-tendermint/src/tests/mod.rs deleted file mode 100644 index 70bbf14e20..0000000000 --- a/cosmwasm/ibc-clients/ics07-tendermint/src/tests/mod.rs +++ /dev/null @@ -1,128 +0,0 @@ -use std::time::Duration; - -use cosmwasm_std::from_json; -use cosmwasm_std::testing::{mock_dependencies, mock_env}; -use ibc_client_cw::types::{ - ContractResult, MigrateClientStoreMsg, MigrationPrefix, VerifyClientMessageRaw, - VerifyClientMessageResponse, -}; -use ibc_core::client::types::{Height, Status}; - -use crate::entrypoint::sudo; - -pub mod fixture; -pub mod helper; - -use fixture::Fixture; - -#[test] -fn test_cw_create_client_ok() { - let fxt = Fixture::default(); - - let mut deps = mock_dependencies(); - - let resp = fxt.create_client(deps.as_mut()).unwrap(); - - assert_eq!(0, resp.messages.len()); - - let contract_result: ContractResult = from_json(resp.data.unwrap()).unwrap(); - - assert!(contract_result.heights.is_none()); - - fxt.check_client_status(deps.as_ref(), Status::Active); -} - -#[test] -fn test_cw_update_client_ok() { - let fxt = Fixture::default(); - - let mut deps = mock_dependencies(); - - // ------------------- Create client ------------------- - - fxt.create_client(deps.as_mut()).unwrap(); - - // ------------------- Verify and Update client ------------------- - - let target_height = Height::new(0, 10).unwrap(); - - let resp = fxt.update_client(deps.as_mut(), target_height).unwrap(); - - // ------------------- Check response ------------------- - - assert_eq!(0, resp.messages.len()); - - let contract_result: ContractResult = from_json(resp.data.unwrap()).unwrap(); - - assert_eq!(contract_result.heights, Some(vec![target_height])); - - fxt.check_client_status(deps.as_ref(), Status::Active); -} - -#[test] -fn test_cw_recovery_client_ok() { - let mut fxt = Fixture::default(); - - let mut deps = mock_dependencies(); - - // ------------------- Create subject client ------------------- - - fxt.set_migration_prefix(MigrationPrefix::Subject); - - fxt.create_client(deps.as_mut()).unwrap(); - - // ------------------- Freeze subject client ------------------- - - fxt.update_client_on_misbehaviour(deps.as_mut()); - - // ------------------- Create substitute client ------------------- - - fxt.set_migration_prefix(MigrationPrefix::Substitute); - - fxt.create_client(deps.as_mut()).unwrap(); - - // ------------------- Recover subject client ------------------- - - let resp = sudo(deps.as_mut(), mock_env(), MigrateClientStoreMsg {}.into()).unwrap(); - - assert_eq!(0, resp.messages.len()); - - fxt.check_client_status(deps.as_ref(), Status::Active); -} - -#[test] -fn test_cw_client_expiry() { - let fxt = Fixture::default(); - - let mut deps = mock_dependencies(); - - // ------------------- Create client ------------------- - - fxt.create_client(deps.as_mut()).unwrap(); - - // ------------------- Expire client ------------------- - - std::thread::sleep(Duration::from_millis(1200)); - - // ------------------- Try update client ------------------- - - let target_height = Height::new(0, 10).unwrap(); - - let client_message = fxt.dummy_client_message(target_height); - - let resp: VerifyClientMessageResponse = fxt - .query( - deps.as_ref(), - VerifyClientMessageRaw { - client_message: client_message.into(), - }, - ) - .and_then(from_json) - .unwrap(); - - assert!(!resp.is_valid); - - // ------------------- Check client status ------------------- - - fxt.check_client_status(deps.as_ref(), Status::Expired); -} diff --git a/ibc-clients/README.md b/ibc-clients/README.md index 4edd4abf13..a7602eec3b 100644 --- a/ibc-clients/README.md +++ b/ibc-clients/README.md @@ -25,7 +25,8 @@ IBC light clients: - [ibc-client-tendermint-types](./ics07-tendermint/types): Data Structures - [ibc-client-tendermint](./ics07-tendermint): Implementation -- [ibc-client-tendermint-cw](./../cosmwasm/ibc-clients/ics07-tendermint): CosmWasm Contract +- [ibc-client-tendermint-cw](https://github.com/informalsystems/cosmwasm-ibc/ibc-clients/ics07-tendermint): CosmWasm + Contract that lives under the [cosmwasm-ibc](https://github.com/informalsystems/cosmwasm-ibc) repository. ### ICS-08: WASM Proxy Light Client