diff --git a/.changelog/unreleased/breaking-changes/1229-auto-derive-ser-commitment-prefix.md b/.changelog/unreleased/breaking-changes/1229-auto-derive-ser-commitment-prefix.md new file mode 100644 index 000000000..4b022abf2 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/1229-auto-derive-ser-commitment-prefix.md @@ -0,0 +1,2 @@ +- [ics23] Auto-derive `serde::Serialize` for `CommitmentPrefix`. + ([\#1229](https://github.com/cosmos/ibc-rs/issues/1229)) diff --git a/.changelog/v0.53.0/bug-fixes/1198-reject-packets-without-timeouts.md b/.changelog/v0.53.0/bug-fixes/1198-reject-packets-without-timeouts.md new file mode 100644 index 000000000..969081559 --- /dev/null +++ b/.changelog/v0.53.0/bug-fixes/1198-reject-packets-without-timeouts.md @@ -0,0 +1,2 @@ +- [ibc-core] Reject IBC packets without height and timestamp timeout. + ([\#1198](https://github.com/cosmos/ibc-rs/issues/1198)) diff --git a/.changelog/v0.53.0/bug-fixes/1217-fix-packet-timeout-on-closed-channel.md b/.changelog/v0.53.0/bug-fixes/1217-fix-packet-timeout-on-closed-channel.md new file mode 100644 index 000000000..e98541b39 --- /dev/null +++ b/.changelog/v0.53.0/bug-fixes/1217-fix-packet-timeout-on-closed-channel.md @@ -0,0 +1,2 @@ +- [ibc-core] Fix proof verification for `PacketTimeout` on a closed channel. + ([\#1217](https://github.com/cosmos/ibc-rs/issues/1217)) diff --git a/.changelog/unreleased/improvements/1044-introduce-host-trait.md b/.changelog/v0.53.0/improvements/1044-introduce-host-trait.md similarity index 100% rename from .changelog/unreleased/improvements/1044-introduce-host-trait.md rename to .changelog/v0.53.0/improvements/1044-introduce-host-trait.md diff --git a/.changelog/v0.53.0/improvements/1109-revamp-ibc-testkit.md b/.changelog/v0.53.0/improvements/1109-revamp-ibc-testkit.md new file mode 100644 index 000000000..58dd859e8 --- /dev/null +++ b/.changelog/v0.53.0/improvements/1109-revamp-ibc-testkit.md @@ -0,0 +1,3 @@ +- [ibc-testkit] Major refactor of the `ibc-testkit` via + [ADR-09](https://github.com/cosmos/ibc-rs/blob/main/docs/architecture/adr-009-revamp-testkit.md). + ([\#1109](https://github.com/cosmos/ibc-rs/issues/1109)) diff --git a/.changelog/v0.53.0/improvements/1203-rm-error-type-restriction.md b/.changelog/v0.53.0/improvements/1203-rm-error-type-restriction.md new file mode 100644 index 000000000..1e95230f6 --- /dev/null +++ b/.changelog/v0.53.0/improvements/1203-rm-error-type-restriction.md @@ -0,0 +1,3 @@ +- [ibc-core] Replace fixed `ClientError` associated type restriction with an + `Into` trait bound. + ([\#1203](https://github.com/cosmos/ibc-rs/issues/1203)) diff --git a/.changelog/unreleased/improvements/1212-update-ibc-proto-and-tendermint-deps.md b/.changelog/v0.53.0/improvements/1212-update-ibc-proto-and-tendermint-deps.md similarity index 100% rename from .changelog/unreleased/improvements/1212-update-ibc-proto-and-tendermint-deps.md rename to .changelog/v0.53.0/improvements/1212-update-ibc-proto-and-tendermint-deps.md diff --git a/.changelog/v0.53.0/summary.md b/.changelog/v0.53.0/summary.md new file mode 100644 index 000000000..03a7d24eb --- /dev/null +++ b/.changelog/v0.53.0/summary.md @@ -0,0 +1,22 @@ +This release overhauls the `ibc-testkit` crate such that it is now able to: + +- simulate more realistic IBC workflows by utilizing real IBC and relayer + interfaces (as opposed to mocked versions) +- validate code paths that were not easily testable beforehand, such as Merkle + proof generation +- compose tests in a much more succinct and readable fashion + +Note that the drastic changes made to `ibc-testkit`'s structs and types are +breaking changes. + +For more information and background context on the changes to `ibc-testkit` and +the rationale behind the overhaul, please refer to [ADR 009][adr-009]. + +This release also includes two fixes. One is to reject packets without height +and timestamp timeout. The other is to correct the proof verification logic for +a `PacketTimeout` due to a closed channel, which was verifying an incorrect +field. It also bumps the minimum-supported version of `ibc-proto` to 0.44, and +the version of `tendermint` to 0.36. Note that the minimum-supported Rust +version was reverted back to 1.71.1. + +[adr-009]: https://github.com/cosmos/ibc-rs/blob/main/docs/architecture/adr-009-revamp-testkit.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 33ee6a971..0e2e3b557 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -30,3 +30,7 @@ updates: - dependency-name: "ibc*" - dependency-name: "cosmwasm*" - dependency-name: "cw*" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/typos.toml b/.github/typos.toml index fc71242c0..800f45933 100644 --- a/.github/typos.toml +++ b/.github/typos.toml @@ -1,3 +1,7 @@ [default.extend-words] # for serde serialization ser = "ser" + +[default] +# random string +extend-ignore-re = [ "[0-9A-Za-z+/]{20,}" ] diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml index 2c8286bfc..b4f1f3118 100644 --- a/.github/workflows/audit.yaml +++ b/.github/workflows/audit.yaml @@ -8,9 +8,9 @@ jobs: name: Security Audit runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache cargo bin - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.cargo/bin key: ${{ runner.os }}-cargo-audit-v0.11.2 diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml index 307efeee0..0254773d2 100644 --- a/.github/workflows/code-quality.yaml +++ b/.github/workflows/code-quality.yaml @@ -16,7 +16,7 @@ jobs: run: bash ci/code-quality/whitespace-lints.sh - name: Spell Check with Typos - uses: crate-ci/typos@v1.19.0 # NOTE: Newer versions detect false positives. Test locally before upgrading. + uses: crate-ci/typos@v1.21.0 with: config: ./.github/typos.toml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index bd234f66b..60346fe1f 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -41,7 +41,7 @@ jobs: name: Code Coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: @@ -53,7 +53,7 @@ jobs: - name: Generate code coverage run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/markdown-link-check.yaml b/.github/workflows/markdown-link-check.yaml index 6a2932200..b95f1c746 100644 --- a/.github/workflows/markdown-link-check.yaml +++ b/.github/workflows/markdown-link-check.yaml @@ -9,7 +9,7 @@ jobs: md-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: markdown-link-check uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 with: diff --git a/.github/workflows/no-std.yaml b/.github/workflows/no-std.yaml index 27ba597bf..03919ddda 100644 --- a/.github/workflows/no-std.yaml +++ b/.github/workflows/no-std.yaml @@ -30,7 +30,7 @@ jobs: name: Check no_std panic conflict runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -42,7 +42,7 @@ jobs: name: Check no_std substrate support runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly-2024-02-24 diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index e6e522820..e1053e897 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -51,7 +51,7 @@ jobs: nightly_fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: nightly # Since fmt uses unstable features for organizing imports @@ -64,7 +64,7 @@ jobs: clippy_all_features: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -77,7 +77,7 @@ jobs: clippy_no_default_features: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -90,7 +90,7 @@ jobs: doc_all_features: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -102,7 +102,7 @@ jobs: doc_no_default_features: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -115,7 +115,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -146,7 +146,7 @@ jobs: ] runs-on: ${{ matrix.param.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download cargo-msrv uses: dsaltares/fetch-gh-release-asset@master diff --git a/CHANGELOG.md b/CHANGELOG.md index 772427d3b..2d5326ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,55 @@ # CHANGELOG +## v0.53.0 + +*May 13, 2024* + +This release overhauls the `ibc-testkit` crate such that it is now able to: + +- simulate more realistic IBC workflows by utilizing real IBC and relayer + interfaces (as opposed to mocked versions) +- validate code paths that were not easily testable beforehand, such as Merkle + proof generation +- compose tests in a much more succinct and readable fashion + +Note that the drastic changes made to `ibc-testkit`'s structs and types are +breaking changes. + +For more information and background context on the changes to `ibc-testkit` and +the rationale behind the overhaul, please refer to [ADR 009][adr-009]. + +This release also includes two fixes. One is to reject packets without height +and timestamp timeout. The other is to correct the proof verification logic for +a `PacketTimeout` due to a closed channel, which was verifying an incorrect +field. It also bumps the minimum-supported version of `ibc-proto` to 0.44, and +the version of `tendermint` to 0.36. Note that the minimum-supported Rust +version was reverted back to 1.71.1. + +[adr-009]: https://github.com/cosmos/ibc-rs/blob/main/docs/architecture/adr-009-revamp-testkit.md + +### BUG FIXES + +- [ibc-core] Reject IBC packets without height and timestamp timeout. + ([\#1198](https://github.com/cosmos/ibc-rs/issues/1198)) +- [ibc-core] Fix proof verification for `PacketTimeout` on a closed channel. + ([\#1217](https://github.com/cosmos/ibc-rs/issues/1217)) + +### IMPROVEMENTS + +- [ibc-testkit] Replace `HostBlock` and `HostType` enums with a `Host` trait to + eliminate manual delegations by utilizing monomorphization. + ([\#1044](https://github.com/cosmos/ibc-rs/issues/1044)) +- [ibc-testkit] Major refactor of the `ibc-testkit` via + [ADR-09](https://github.com/cosmos/ibc-rs/blob/main/docs/architecture/adr-009-revamp-testkit.md). + ([\#1109](https://github.com/cosmos/ibc-rs/issues/1109)) +- [ibc-core] Replace fixed `ClientError` associated type restriction with an + `Into` trait bound. + ([\#1203](https://github.com/cosmos/ibc-rs/issues/1203)) +- Update `ibc-proto` to v0.44.0 and `tendermint` dependencies to v0.36.0. + ([\#1212](https://github.com/cosmos/ibc-rs/issues/1212)) +- Revert Rust minimum supported version to `1.71.1`. + ([\#1206](https://github.com/cosmos/ibc-rs/pull/1206)) + ## v0.52.0 *April 26, 2024* diff --git a/Makefile b/Makefile index 7947b9501..fd1f04070 100644 --- a/Makefile +++ b/Makefile @@ -37,10 +37,16 @@ test: ## Run tests with all features and without default features. cargo test --all-targets --no-default-features check-release: ## Check that the release build compiles. - cargo release --workspace --no-push --no-tag --no-publish --exclude ibc-derive --exclude ibc-client-tendermint-cw + cargo release --workspace --no-push --no-tag \ + --exclude ibc-derive \ + --exclude ibc-primitives \ + --exclude ibc-client-tendermint-cw release: ## Perform an actual release and publishes to crates.io. - cargo release --workspace --no-push --no-tag --exclude ibc-derive --exclude ibc-client-tendermint-cw --allow-branch HEAD --execute + cargo release --workspace --no-push --no-tag --allow-branch HEAD --execute \ + --exclude ibc-derive \ + --exclude ibc-primitives \ + --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" diff --git a/RELEASES.md b/RELEASES.md index 06d94af6b..9e260ab10 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -24,53 +24,74 @@ Our release process is as follows: 4. Bump the versions of all crates to the new version in their Cargo.toml and in the root `Cargo.toml` as well, and push these changes to the release PR. - If you released a new version of `ibc-derive` in step 3, make sure to - update that dependency. - - Verify that there is no dev-dependency among the workspace crates, - except `ibc-testkit`. This is important, as `cargo-release` ignores - dev-dependency edges. You may use `cargo-depgraph`: - ```sh - cargo depgraph --all-features --workspace-only --dev-deps | dot -Tpng > graph.png - ``` + update that dependency. + - Verify that there is no dev-dependency among the workspace crates. This is + important, as `cargo-release` ignores dev-dependency edges. You may use + `cargo-depgraph`: + ```sh + cargo depgraph --all-features --workspace-only --dev-deps | dot -Tpng > graph.png + ``` The command will generate a graph similar to this: - ![alt test](docs/dev-deps-graph.png) - The blue lines indicate dev dependencies; there should only be one blue line - referring to the `ibc-testkit` dependency. So the above example would result - in an unsuccessful release. - - In order to resolve such a situation, the dev dependencies other than `ibc-testkit` - can be manually released to crates.io first so that the subsequent crates that - depend on them can then be released via the release process. For instructions - on how to release a crate on crates.io, refer [here](https://doc.rust-lang.org/cargo/reference/publishing.html). -5. Run `cargo doc -p ibc --all-features --open` locally to double-check that all + ![alt test](docs/dev-deps-graph.png) The dev dependencies are colored with + blue arrows. Currently, there are no blue arrows, i.e. there is no dev + dependency among the IBC crates. It is advised to avoid any dev dependency + because of release order complicacy (except maybe inside `ibc-testkit`, as + it is the top crate that depends on `ibc` crate and no other crate depends + on it). + - In order to resolve such a situation, the dev dependencies other than + `ibc-testkit` can be manually released to crates.io first so that the + subsequent crates that depend on them can then be released via the release + process. For instructions on how to release a crate on crates.io, refer + [here](https://doc.rust-lang.org/cargo/reference/publishing.html). +5. Beware of [crates-io rate limit][cargo-release-rate-limit]. It is 5 for + publishing new crates and 30 for publishing existing crates. But the number + of our crates has reached 31. So we publish a leaf crate, `ibc-primitives` + manually and release the rest of the 30 crates via CI. + - Release `ibc-primitives` by running: + ```sh + cargo release -p ibc-primitives --no-push --no-tag --allow-branch main --execute + ``` + - Validate the number of crates that need to be released via CI, it can not + be more than 30. + - There should be a 10 minutes delay between the release of `ibc-primitives` + and the release of the rest of the crates on CI. + - If new crates are added, we need to recompute the set of crates that we + want to release via CI. The rest must be released manually. +6. 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. +7. 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 `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 +8. Checkout the `main` and pull it with + `git checkout main && git pull origin main`. +9. 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 - act accordingly: + command in a CI worker. +10. 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 - requires the appropriate privileges to push crates to [crates.io]. + locally to publish any missing crates from this release. This step + requires the appropriate privileges to push crates to [crates.io]. 2. If there is any new crate published locally, add - [ibcbot](https://crates.io/users/ibcbot) to its owners list. - 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 update the release description and append: - `[📖CHANGELOG](https://github.com/cosmos/ibc-rs/blob/main/CHANGELOG.md#vXYZ)` + [ibcbot](https://crates.io/users/ibcbot) to its owners list. + 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. +11. 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)` ### Communications (non-technical) release pipeline -- Notify the communications team about the pending release and prepare an announcement. -- Coordinate with other organizations that are active in IBC development (e.g., Interchain) and keep them in the loop. +- Notify the communications team about the pending release and prepare an + announcement. +- Coordinate with other organizations that are active in IBC development (e.g., + Interchain) and keep them in the loop. All done! 🎉 [crates.io]: https://crates.io [release.yaml]: https://github.com/cosmos/ibc-rs/blob/main/.github/workflows/release.yaml +[cargo-release-rate-limit]: https://github.com/crate-ci/cargo-release/blob/4b09269/src/steps/mod.rs#L214-L268 diff --git a/ci/cw-check/Cargo.lock b/ci/cw-check/Cargo.lock index e8a733fce..508b87196 100644 --- a/ci/cw-check/Cargo.lock +++ b/ci/cw-check/Cargo.lock @@ -15,9 +15,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "arrayref" @@ -33,9 +33,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "base16ct" @@ -51,9 +51,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -136,9 +136,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -160,9 +160,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "cosmwasm-crypto" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b4c3f9c4616d6413d4b5fc4c270a4cc32a374b9be08671e80e1a019f805d8f" +checksum = "dd50718a2b6830ce9eb5d465de5a018a12e71729d66b70807ce97e6dd14f931d" dependencies = [ "digest 0.10.7", "ecdsa", @@ -174,18 +174,18 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c586ced10c3b00e809ee664a895025a024f60d65d34fe4c09daed4a4db68a3f3" +checksum = "242e98e7a231c122e08f300d9db3262d1007b51758a8732cd6210b3e9faa4f3a" dependencies = [ "syn 1.0.109", ] [[package]] name = "cosmwasm-schema" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8467874827d384c131955ff6f4d47d02e72a956a08eb3c0ff24f8c903a5517b4" +checksum = "7879036156092ad1c22fe0d7316efc5a5eceec2bc3906462a2560215f2a2f929" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6db85d98ac80922aef465e564d5b21fa9cfac5058cb62df7f116c3682337393" +checksum = "0bb57855fbfc83327f8445ae0d413b1a05ac0d68c396ab4d122b2abd7bb82cb6" dependencies = [ "proc-macro2", "quote", @@ -207,9 +207,9 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712fe58f39d55c812f7b2c84e097cdede3a39d520f89b6dc3153837e31741927" +checksum = "78c1556156fdf892a55cced6115968b961eaaadd6f724a2c2cb7d1e168e32dd3" dependencies = [ "base64 0.21.7", "bech32", @@ -359,7 +359,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -546,9 +546,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -598,7 +598,7 @@ dependencies = [ [[package]] name = "ibc-app-transfer" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-app-transfer-types", "ibc-core", @@ -607,7 +607,7 @@ dependencies = [ [[package]] name = "ibc-app-transfer-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -622,14 +622,14 @@ dependencies = [ [[package]] name = "ibc-apps" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-app-transfer", ] [[package]] name = "ibc-core" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-channel", "ibc-core-client", @@ -644,7 +644,7 @@ dependencies = [ [[package]] name = "ibc-core-channel" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-channel-types", "ibc-core-client", @@ -658,7 +658,7 @@ dependencies = [ [[package]] name = "ibc-core-channel-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -679,7 +679,7 @@ dependencies = [ [[package]] name = "ibc-core-client" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-client-context", "ibc-core-client-types", @@ -691,7 +691,7 @@ dependencies = [ [[package]] name = "ibc-core-client-context" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -706,7 +706,7 @@ dependencies = [ [[package]] name = "ibc-core-client-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -724,7 +724,7 @@ dependencies = [ [[package]] name = "ibc-core-commitment-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -740,7 +740,7 @@ dependencies = [ [[package]] name = "ibc-core-connection" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-client", "ibc-core-connection-types", @@ -751,7 +751,7 @@ dependencies = [ [[package]] name = "ibc-core-connection-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -770,7 +770,7 @@ dependencies = [ [[package]] name = "ibc-core-handler" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-channel", "ibc-core-client", @@ -784,7 +784,7 @@ dependencies = [ [[package]] name = "ibc-core-handler-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -806,7 +806,7 @@ dependencies = [ [[package]] name = "ibc-core-host" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -823,7 +823,7 @@ dependencies = [ [[package]] name = "ibc-core-host-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -836,7 +836,7 @@ dependencies = [ [[package]] name = "ibc-core-router" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -849,7 +849,7 @@ dependencies = [ [[package]] name = "ibc-core-router-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -870,12 +870,12 @@ version = "0.7.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] name = "ibc-primitives" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -895,7 +895,7 @@ version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "flex-error", "ics23", @@ -1008,9 +1008,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "memchr" @@ -1026,9 +1026,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1047,9 +1047,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "byte-slice-cast", @@ -1059,11 +1059,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.2", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -1071,9 +1071,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pin-project-lite" @@ -1116,29 +1116,18 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.2" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_datetime", - "toml_edit 0.20.2", + "toml_edit", ] [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -1155,15 +1144,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1220,15 +1209,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "scale-info" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "cfg-if", "derive_more", @@ -1238,11 +1227,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -1250,9 +1239,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.17" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f55c82c700538496bdc329bb4918a81f87cc8888811bd123cf325a0f2f8d309" +checksum = "fc6e7ed6919cb46507fb01ff1654309219f62b4d603822501b0b80d42f6f21ef" dependencies = [ "dyn-clone", "schemars_derive", @@ -1262,14 +1251,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.17" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83263746fe5e32097f06356968a077f96089739c927a61450efa069905eec108" +checksum = "185f2b7aa7e02d418e453790dde16890256bbd2bcd04b7dc5348811052b53f49" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1288,9 +1277,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.199" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] @@ -1324,13 +1313,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.199" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1341,14 +1330,14 @@ checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1363,7 +1352,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1454,9 +1443,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" dependencies = [ "proc-macro2", "quote", @@ -1508,29 +1497,29 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "num-conv", @@ -1548,9 +1537,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -1558,26 +1547,15 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" - -[[package]] -name = "toml_edit" -version = "0.19.15" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "toml_datetime", @@ -1646,5 +1624,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] diff --git a/ci/no-std-check/Cargo.lock b/ci/no-std-check/Cargo.lock index 381a663b8..f16deb620 100644 --- a/ci/no-std-check/Cargo.lock +++ b/ci/no-std-check/Cargo.lock @@ -96,9 +96,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "ark-bls12-377" @@ -249,9 +249,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" @@ -288,9 +288,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -484,9 +484,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -622,7 +622,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -676,7 +676,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -719,7 +719,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -743,7 +743,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.60", + "syn 2.0.63", "termcolor", "toml 0.8.12", "walkdir", @@ -891,7 +891,7 @@ dependencies = [ "prettier-please", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -906,9 +906,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "fixed-hash" @@ -1003,7 +1003,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1049,9 +1049,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1197,7 +1197,7 @@ dependencies = [ [[package]] name = "ibc" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-apps", "ibc-clients", @@ -1209,7 +1209,7 @@ dependencies = [ [[package]] name = "ibc-app-transfer" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-app-transfer-types", "ibc-core", @@ -1218,7 +1218,7 @@ dependencies = [ [[package]] name = "ibc-app-transfer-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1231,14 +1231,14 @@ dependencies = [ [[package]] name = "ibc-apps" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-app-transfer", ] [[package]] name = "ibc-client-tendermint" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "ibc-client-tendermint-types", @@ -1254,7 +1254,7 @@ dependencies = [ [[package]] name = "ibc-client-tendermint-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "displaydoc", "ibc-core-client-types", @@ -1270,7 +1270,7 @@ dependencies = [ [[package]] name = "ibc-client-wasm-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "base64 0.21.7", "displaydoc", @@ -1283,7 +1283,7 @@ dependencies = [ [[package]] name = "ibc-clients" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-client-tendermint", "ibc-client-wasm-types", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "ibc-core" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-channel", "ibc-core-client", @@ -1306,7 +1306,7 @@ dependencies = [ [[package]] name = "ibc-core-channel" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-channel-types", "ibc-core-client", @@ -1320,7 +1320,7 @@ dependencies = [ [[package]] name = "ibc-core-channel-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1338,7 +1338,7 @@ dependencies = [ [[package]] name = "ibc-core-client" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-client-context", "ibc-core-client-types", @@ -1350,7 +1350,7 @@ dependencies = [ [[package]] name = "ibc-core-client-context" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1365,7 +1365,7 @@ dependencies = [ [[package]] name = "ibc-core-client-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "ibc-core-commitment-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1393,7 +1393,7 @@ dependencies = [ [[package]] name = "ibc-core-connection" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-client", "ibc-core-connection-types", @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "ibc-core-connection-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1420,7 +1420,7 @@ dependencies = [ [[package]] name = "ibc-core-handler" -version = "0.52.0" +version = "0.53.0" dependencies = [ "ibc-core-channel", "ibc-core-client", @@ -1434,7 +1434,7 @@ dependencies = [ [[package]] name = "ibc-core-handler-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1453,7 +1453,7 @@ dependencies = [ [[package]] name = "ibc-core-host" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1470,7 +1470,7 @@ dependencies = [ [[package]] name = "ibc-core-host-cosmos" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1492,7 +1492,7 @@ dependencies = [ [[package]] name = "ibc-core-host-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1502,7 +1502,7 @@ dependencies = [ [[package]] name = "ibc-core-router" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1515,7 +1515,7 @@ dependencies = [ [[package]] name = "ibc-core-router-types" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1533,12 +1533,12 @@ version = "0.7.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] name = "ibc-primitives" -version = "0.52.0" +version = "0.53.0" dependencies = [ "derive_more", "displaydoc", @@ -1555,7 +1555,7 @@ version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "borsh", "bytes", "flex-error", @@ -1710,9 +1710,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libsecp256k1" @@ -1833,7 +1833,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "syn 2.0.60", + "syn 2.0.63", "tendermint", "tendermint-light-client-verifier", "tendermint-proto", @@ -1847,11 +1847,10 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -1883,9 +1882,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1936,9 +1935,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -1951,11 +1950,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -1997,9 +1996,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -2063,7 +2062,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2073,7 +2072,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2095,7 +2094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" dependencies = [ "proc-macro2", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2120,25 +2119,6 @@ dependencies = [ "toml 0.5.11", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -2150,9 +2130,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -2169,15 +2149,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" dependencies = [ "anyhow", "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2251,22 +2231,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2334,9 +2314,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hex" @@ -2355,15 +2335,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2376,9 +2356,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "bitvec", "cfg-if", @@ -2390,11 +2370,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -2402,9 +2382,9 @@ dependencies = [ [[package]] name = "schnellru" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +checksum = "6b0cf7da6fc4477944d5529807234f66802fcb618fc62b9c05bedca7f9be6c43" dependencies = [ "ahash 0.8.11", "cfg-if", @@ -2480,15 +2460,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.199" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] @@ -2513,20 +2493,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.199" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -2541,7 +2521,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2736,7 +2716,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2856,7 +2836,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -3039,9 +3019,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" dependencies = [ "proc-macro2", "quote", @@ -3123,22 +3103,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -3153,9 +3133,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "num-conv", @@ -3172,9 +3152,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -3225,28 +3205,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -3268,7 +3226,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.7", + "winnow 0.6.8", ] [[package]] @@ -3290,7 +3248,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -3492,7 +3450,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", "wasm-bindgen-shared", ] @@ -3514,7 +3472,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3649,9 +3607,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -3667,22 +3625,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -3702,5 +3660,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] diff --git a/docs/architecture/adr-009-revamp-testkit.md b/docs/architecture/adr-009-revamp-testkit.md index 8bf5af3e2..9f4541638 100644 --- a/docs/architecture/adr-009-revamp-testkit.md +++ b/docs/architecture/adr-009-revamp-testkit.md @@ -304,16 +304,16 @@ The following provides the concrete implementations of the proposed changes: #### MockIbcStore The modified `MockIbcStore` with Merkle store lives at -[`testapp/ibc/core/types.rs`](https://github.com/cosmos/ibc-rs/blob/feat/refactor-testkit/ibc-testkit/src/testapp/ibc/core/types.rs#L43-L96). +[`testapp/ibc/core/types.rs`](https://github.com/cosmos/ibc-rs/blob/main/ibc-testkit/src/testapp/ibc/core/types.rs#L43-L96). #### TestHost The Rust trait lives at -[`hosts/mod.rs`](https://github.com/cosmos/ibc-rs/blob/feat/refactor-testkit/ibc-testkit/src/hosts/mod.rs#L27). +[`hosts/mod.rs`](https://github.com/cosmos/ibc-rs/blob/main/ibc-testkit/src/hosts/mod.rs#L27). The `Mock` and `Tendermint` host implementations live in -[`hosts/mock.rs`](https://github.com/cosmos/ibc-rs/blob/feat/refactor-testkit/ibc-testkit/src/hosts/mock.rs#L30) +[`hosts/mock.rs`](https://github.com/cosmos/ibc-rs/blob/main/ibc-testkit/src/hosts/mock.rs#L30) and -[`hosts/tendermint.rs`](https://github.com/cosmos/ibc-rs/blob/feat/refactor-testkit/ibc-testkit/src/hosts/tendermint.rs#L42) +[`hosts/tendermint.rs`](https://github.com/cosmos/ibc-rs/blob/main/ibc-testkit/src/hosts/tendermint.rs#L42) respectively. #### Renaming `MockContext` to `StoreGenericTestContext` @@ -328,14 +328,14 @@ have `Mock` in their name. #### StoreGenericTestContext -[`StoreGenericTestContext`](https://github.com/cosmos/ibc-rs/blob/feat/refactor-testkit/ibc-testkit/src/context.rs#L34-L52) +[`StoreGenericTestContext`](https://github.com/cosmos/ibc-rs/blob/main/ibc-testkit/src/context.rs#L34-L52) is actually what is described as `MockContext` in the ADR. For convenience, we defined `TestContext` to have a concrete store implementation - -[`MockStore`](https://github.com/cosmos/ibc-rs/blob/feat/refactor-testkit/ibc-testkit/src/context.rs#L55-L56). +[`MockStore`](https://github.com/cosmos/ibc-rs/blob/main/ibc-testkit/src/context.rs#L55-L56). ```rs // A mock store type using basecoin-storage implementations. -pub type MockStore = RevertibleStore>; +pub type MockStore = InMemoryStore; pub type TestContext = StoreGenericTestContext; ``` diff --git a/docs/dev-deps-graph.png b/docs/dev-deps-graph.png index 7386f9cf2..f5b0e05cc 100644 Binary files a/docs/dev-deps-graph.png and b/docs/dev-deps-graph.png differ diff --git a/ibc-apps/ics20-transfer/src/context.rs b/ibc-apps/ics20-transfer/src/context.rs index c427d4ad6..8c22ad386 100644 --- a/ibc-apps/ics20-transfer/src/context.rs +++ b/ibc-apps/ics20-transfer/src/context.rs @@ -21,7 +21,7 @@ pub trait TokenTransferValidationContext { /// Validates that the tokens can be escrowed successfully. /// - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// escrow validation. fn escrow_coins_validate( &self, @@ -50,7 +50,7 @@ pub trait TokenTransferValidationContext { /// Validates the sender account and the coin input before burning. /// - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// burn validation. fn burn_coins_validate( &self, @@ -70,7 +70,7 @@ pub trait TokenTransferValidationContext { pub trait TokenTransferExecutionContext: TokenTransferValidationContext { /// Executes the escrow of the tokens in a user account. /// - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// escrow execution. fn escrow_coins_execute( &mut self, @@ -99,7 +99,7 @@ pub trait TokenTransferExecutionContext: TokenTransferValidationContext { /// Executes burning of the tokens in a user account. /// - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// burn execution. fn burn_coins_execute( &mut self, diff --git a/ibc-apps/ics20-transfer/types/src/denom.rs b/ibc-apps/ics20-transfer/types/src/denom.rs index 8ac632fea..4bd30f60c 100644 --- a/ibc-apps/ics20-transfer/types/src/denom.rs +++ b/ibc-apps/ics20-transfer/types/src/denom.rs @@ -90,7 +90,7 @@ impl TracePrefix { /// it returns a tuple of the removed [`TracePrefix`] and the substring after the prefix. /// /// If the substring is empty, it returns `None`. - /// Otherwise the substring starts with `/`. In that case, + /// Otherwise, the substring starts with `/`. In that case, /// the leading `/` is stripped and returned. /// /// If the string does not start with a [`TracePrefix`], this method returns `None`. @@ -174,7 +174,7 @@ impl TracePath { /// [`TracePath`] and the substring after the [`TracePath`]. /// /// If the substring is empty, it returns `None`. - /// Otherwise the substring starts with `/`. In that case, + /// Otherwise, the substring starts with `/`. In that case, /// the leading `/` is stripped and returned. /// /// If the string does not contain any [`TracePrefix`], it returns the original string. @@ -273,7 +273,7 @@ impl PrefixedDenom { } } -/// Returns true if the denomination originally came from the sender chain and +/// Returns true if the denomination originally came from the sender chain, and /// false otherwise. /// /// Note: It is better to think of the "source" chain as the chain that @@ -305,7 +305,7 @@ pub fn is_sender_chain_source( !is_receiver_chain_source(source_port, source_channel, denom) } -/// Returns true if the denomination originally came from the receiving chain and false otherwise. +/// Returns true if the denomination originally came from the receiving chain, and false otherwise. pub fn is_receiver_chain_source( source_port: PortId, source_channel: ChannelId, diff --git a/ibc-apps/ics20-transfer/types/src/error.rs b/ibc-apps/ics20-transfer/types/src/error.rs index 7bd938408..a394eb77d 100644 --- a/ibc-apps/ics20-transfer/types/src/error.rs +++ b/ibc-apps/ics20-transfer/types/src/error.rs @@ -43,7 +43,7 @@ pub enum TokenTransferError { MalformedTrace(String), /// trace length must be even but got: `{len}` InvalidTraceLength { len: u64 }, - /// invalid amount error: `{0}` + /// invalid amount: `{0}` InvalidAmount(FromDecStrErr), /// invalid token InvalidToken, @@ -75,7 +75,7 @@ pub enum TokenTransferError { UnknownMsgType { msg_type: String }, /// invalid coin string: `{coin}` InvalidCoin { coin: String }, - /// decoding raw bytes as UTF8 string error: `{0}` + /// decoding raw bytes as UTF-8 string error: `{0}` Utf8Decode(Utf8Error), /// other error: `{0}` Other(String), diff --git a/ibc-apps/ics20-transfer/types/src/lib.rs b/ibc-apps/ics20-transfer/types/src/lib.rs index 9ef3e8413..2e5df5bf0 100644 --- a/ibc-apps/ics20-transfer/types/src/lib.rs +++ b/ibc-apps/ics20-transfer/types/src/lib.rs @@ -46,8 +46,8 @@ pub const PORT_ID_STR: &str = "transfer"; /// ICS20 application current version. pub const VERSION: &str = "ics20-1"; -/// The successful string used for creating an acknowledgement status, -/// equivalent to `base64::encode(0x01)`. +/// The successful string, used for creating an acknowledgement status. +/// It is equivalent to `base64::encode(0x01)`. pub const ACK_SUCCESS_B64: &str = "AQ=="; use ibc_core::channel::types::acknowledgement::StatusValue; diff --git a/ibc-apps/ics721-nft-transfer/src/context.rs b/ibc-apps/ics721-nft-transfer/src/context.rs index 34fec88dd..ede6ee898 100644 --- a/ibc-apps/ics721-nft-transfer/src/context.rs +++ b/ibc-apps/ics721-nft-transfer/src/context.rs @@ -67,7 +67,7 @@ pub trait NftTransferValidationContext { /// Validates that the tokens can be escrowed successfully. /// /// The owner of the NFT should be checked in this validation. - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// escrow validation. fn escrow_nft_validate( &self, @@ -109,7 +109,7 @@ pub trait NftTransferValidationContext { /// Validates the sender account and the coin input before burning. /// /// The owner of the NFT should be checked in this validation. - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// burn validation. fn burn_nft_validate( &self, @@ -153,7 +153,7 @@ pub trait NftTransferExecutionContext: NftTransferValidationContext { /// Executes the escrow of the NFT in a user account. /// - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// escrow execution. fn escrow_nft_execute( &mut self, @@ -187,7 +187,7 @@ pub trait NftTransferExecutionContext: NftTransferValidationContext { /// Executes burning of the NFT in a user account. /// - /// `memo` field allows to incorporate additional contextual details in the + /// `memo` field allows incorporating additional contextual details in the /// burn execution. fn burn_nft_execute( &mut self, diff --git a/ibc-apps/ics721-nft-transfer/types/src/class.rs b/ibc-apps/ics721-nft-transfer/types/src/class.rs index a10154530..ff088e1e7 100644 --- a/ibc-apps/ics721-nft-transfer/types/src/class.rs +++ b/ibc-apps/ics721-nft-transfer/types/src/class.rs @@ -92,7 +92,7 @@ impl PrefixedClassId { } } -/// Returns true if the class ID originally came from the sender chain and false otherwise. +/// Returns true if the class ID originally came from the sender chain, and false otherwise. pub fn is_sender_chain_source( source_port: PortId, source_channel: ChannelId, @@ -101,7 +101,7 @@ pub fn is_sender_chain_source( !is_receiver_chain_source(source_port, source_channel, class_id) } -/// Returns true if the class ID originally came from the receiving chain and false otherwise. +/// Returns true if the class ID originally came from the receiving chain, and false otherwise. pub fn is_receiver_chain_source( source_port: PortId, source_channel: ChannelId, diff --git a/ibc-apps/ics721-nft-transfer/types/src/error.rs b/ibc-apps/ics721-nft-transfer/types/src/error.rs index 7651e7cb7..94c230add 100644 --- a/ibc-apps/ics721-nft-transfer/types/src/error.rs +++ b/ibc-apps/ics721-nft-transfer/types/src/error.rs @@ -86,7 +86,7 @@ pub enum NftTransferError { DecodeRawMsg { reason: String }, /// unknown msg type: `{msg_type}` UnknownMsgType { msg_type: String }, - /// decoding raw bytes as UTF8 string error: `{0}` + /// decoding raw bytes as UTF-8 string error: `{0}` Utf8Decode(Utf8Error), /// other error: `{0}` Other(String), diff --git a/ibc-apps/ics721-nft-transfer/types/src/lib.rs b/ibc-apps/ics721-nft-transfer/types/src/lib.rs index 7a55e1368..6992c98f0 100644 --- a/ibc-apps/ics721-nft-transfer/types/src/lib.rs +++ b/ibc-apps/ics721-nft-transfer/types/src/lib.rs @@ -45,8 +45,8 @@ pub const PORT_ID_STR: &str = "nft-transfer"; /// ICS-721 application current version. pub const VERSION: &str = "ics721-1"; -/// The successful string used for creating an acknowledgement status, -/// equivalent to `base64::encode(0x01)`. +/// The successful string, used for creating an acknowledgement status. +/// It is equivalent to `base64::encode(0x01)`. pub const ACK_SUCCESS_B64: &str = "AQ=="; use ibc_core::channel::types::acknowledgement::StatusValue; diff --git a/ibc-clients/cw-context/src/context/mod.rs b/ibc-clients/cw-context/src/context/mod.rs index 4c483e946..40a027528 100644 --- a/ibc-clients/cw-context/src/context/mod.rs +++ b/ibc-clients/cw-context/src/context/mod.rs @@ -23,7 +23,7 @@ use crate::utils::AnyCodec; type Checksum = Vec; -/// - [`Height`] can not be used directly as keys in the map, +/// - [`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 @@ -31,8 +31,8 @@ type Checksum = Vec; 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 gives access to the -/// methods under the ibc-rs Validation and Execution traits. +/// 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, diff --git a/ibc-clients/cw-context/src/lib.rs b/ibc-clients/cw-context/src/lib.rs index b1f72df01..4db776cdf 100644 --- a/ibc-clients/cw-context/src/lib.rs +++ b/ibc-clients/cw-context/src/lib.rs @@ -1,10 +1,10 @@ //! Contains types and implementations that are needed to integrate a light -//! client, built using ibc-rs, into CosmWasm contract. This crate functions as +//! 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 CosmWasm module and be using one the versions of +//! 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))] diff --git a/ibc-clients/ics07-tendermint/Cargo.toml b/ibc-clients/ics07-tendermint/Cargo.toml index e9983c8ec..93cab56a6 100644 --- a/ibc-clients/ics07-tendermint/Cargo.toml +++ b/ibc-clients/ics07-tendermint/Cargo.toml @@ -1,13 +1,14 @@ [package] -name = "ibc-client-tendermint" -version = { workspace = true } -authors = { workspace = true } -edition = { workspace = true } +name = "ibc-client-tendermint" +version = { workspace = true } +authors = { workspace = true } +edition = { workspace = true } rust-version = { workspace = true } -license = { workspace = true } -repository = { workspace = true } -readme = "./../README.md" -keywords = [ "blockchain", "consensus", "cosmos", "ibc", "tendermint" ] +license = { workspace = true } +repository = { workspace = true } +readme = "./../README.md" +keywords = [ "blockchain", "consensus", "cosmos", "ibc", "tendermint" ] + description = """ Maintained by `ibc-rs`, contains the implementation of the ICS-07 Tendermint Client logic and re-exports essential data structures and domain types from `ibc-client-tendermint-types` crate. diff --git a/ibc-clients/ics07-tendermint/cw-contract/README.md b/ibc-clients/ics07-tendermint/cw-contract/README.md new file mode 100644 index 000000000..d306e9707 --- /dev/null +++ b/ibc-clients/ics07-tendermint/cw-contract/README.md @@ -0,0 +1,71 @@ +# `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/ibc-clients/ics07-tendermint/src/client_state.rs b/ibc-clients/ics07-tendermint/src/client_state.rs index d1b3e1ab6..0adb68f22 100644 --- a/ibc-clients/ics07-tendermint/src/client_state.rs +++ b/ibc-clients/ics07-tendermint/src/client_state.rs @@ -27,7 +27,7 @@ pub use misbehaviour::*; pub use update_client::*; pub use validation::*; -/// Newtype wrapper around the `ClientState` type imported from the +/// Newtype wrapper around the `ClientState` type, imported from the /// `ibc-client-tendermint-types` crate. This wrapper exists so that we can /// bypass Rust's orphan rules and implement traits from /// `ibc::core::client::context` on the `ClientState` type. diff --git a/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs b/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs index 79d2b6ea9..65fd175c5 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs @@ -16,7 +16,7 @@ use tendermint_light_client_verifier::Verifier; use crate::types::Header; -/// Determines whether or not two conflicting headers at the same height would +/// Determines if two conflicting headers at the same height would /// have convinced the light client. pub fn verify_misbehaviour( ctx: &V, diff --git a/ibc-clients/ics07-tendermint/src/client_state/validation.rs b/ibc-clients/ics07-tendermint/src/client_state/validation.rs index aca62f5e5..116b84dd8 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/validation.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/validation.rs @@ -137,8 +137,8 @@ where /// 1 - fork: /// Assumes at least one consensus state before the fork point exists. Let /// existing consensus states on chain B be: [Sn,.., Sf, Sf-1, S0] with -/// `Sf-1` being the most recent state before fork. Chain A is queried for a -/// header `Hf'` at `Sf.height` and if it is different than the `Hf` in the +/// `Sf-1` being the most recent state before the fork. Chain A is queried for +/// a header `Hf'` at `Sf.height` and if it is different from the `Hf` in the /// event for the client update (the one that has generated `Sf` on chain), /// then the two headers are included in the evidence and submitted. Note /// that in this case the headers are different but have the same height. diff --git a/ibc-clients/ics07-tendermint/types/src/client_state.rs b/ibc-clients/ics07-tendermint/types/src/client_state.rs index 474aa32f5..bcd42a525 100644 --- a/ibc-clients/ics07-tendermint/types/src/client_state.rs +++ b/ibc-clients/ics07-tendermint/types/src/client_state.rs @@ -365,50 +365,6 @@ impl From for Any { } } -#[cfg(all(test, feature = "serde"))] -pub(crate) mod serde_tests { - use serde::de::DeserializeOwned; - use serde::Serialize; - use tendermint_rpc::endpoint::abci_query::AbciQuery; - - pub fn test_serialization_roundtrip(json_data: &str) - where - T: core::fmt::Debug + PartialEq + Serialize + DeserializeOwned, - { - let parsed0 = serde_json::from_str::(json_data); - assert!(parsed0.is_ok()); - let parsed0 = parsed0.unwrap(); - - let serialized = serde_json::to_string(&parsed0); - assert!(serialized.is_ok()); - let serialized = serialized.unwrap(); - - let parsed1 = serde_json::from_str::(&serialized); - assert!(parsed1.is_ok()); - let parsed1 = parsed1.unwrap(); - - assert_eq!(parsed0, parsed1); - } - - #[test] - fn serialization_roundtrip_no_proof() { - let json_data = include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/../../../ibc-testkit/tests/data/json/client_state.json" - )); - test_serialization_roundtrip::(json_data); - } - - #[test] - fn serialization_roundtrip_with_proof() { - let json_data = include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/../../../ibc-testkit/tests/data/json/client_state_proof.json" - )); - test_serialization_roundtrip::(json_data); - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/ibc-clients/ics07-tendermint/types/src/consensus_state.rs b/ibc-clients/ics07-tendermint/types/src/consensus_state.rs index e48b016c3..bc4e675c8 100644 --- a/ibc-clients/ics07-tendermint/types/src/consensus_state.rs +++ b/ibc-clients/ics07-tendermint/types/src/consensus_state.rs @@ -147,28 +147,3 @@ impl From
for ConsensusState { Self::from(header.signed_header.header) } } - -#[cfg(all(test, feature = "serde"))] -mod tests { - use tendermint_rpc::endpoint::abci_query::AbciQuery; - - use crate::serde_tests::test_serialization_roundtrip; - - #[test] - fn serialization_roundtrip_no_proof() { - let json_data = include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/../../../ibc-testkit/tests/data/json/consensus_state.json" - )); - test_serialization_roundtrip::(json_data); - } - - #[test] - fn serialization_roundtrip_with_proof() { - let json_data = include_str!(concat!( - env!("CARGO_MANIFEST_DIR"), - "/../../../ibc-testkit/tests/data/json/consensus_state_proof.json" - )); - test_serialization_roundtrip::(json_data); - } -} diff --git a/ibc-clients/ics07-tendermint/types/src/error.rs b/ibc-clients/ics07-tendermint/types/src/error.rs index 4376e902e..c4e25e094 100644 --- a/ibc-clients/ics07-tendermint/types/src/error.rs +++ b/ibc-clients/ics07-tendermint/types/src/error.rs @@ -52,7 +52,7 @@ pub enum Error { MissingUnbondingPeriod, /// negative max clock drift NegativeMaxClockDrift, - /// missing latest height + /// missing the latest height MissingLatestHeight, /// invalid raw header error: `{0}` InvalidRawHeader(TendermintError), @@ -79,7 +79,7 @@ pub enum Error { VerificationError { detail: Box }, /// Processed time or height for the client `{client_id}` at height `{height}` not found UpdateMetaDataNotFound { client_id: ClientId, height: Height }, - /// The given hash of the validators does not matches the given hash in the signed header. Expected: `{signed_header_validators_hash}`, got: `{validators_hash}` + /// The given hash of the validators does not match the given hash in the signed header. Expected: `{signed_header_validators_hash}`, got: `{validators_hash}` MismatchValidatorsHashes { validators_hash: Hash, signed_header_validators_hash: Hash, @@ -91,7 +91,7 @@ pub enum Error { }, /// headers block hashes are equal MisbehaviourHeadersBlockHashesEqual, - /// headers are not at same height and are monotonically increasing + /// headers are not at the same height and are monotonically increasing MisbehaviourHeadersNotAtSameHeight, } diff --git a/ibc-clients/ics07-tendermint/types/src/trust_threshold.rs b/ibc-clients/ics07-tendermint/types/src/trust_threshold.rs index 07f2bbb70..830bba74d 100644 --- a/ibc-clients/ics07-tendermint/types/src/trust_threshold.rs +++ b/ibc-clients/ics07-tendermint/types/src/trust_threshold.rs @@ -12,7 +12,7 @@ use tendermint::trust_threshold::TrustThresholdFraction; /// [`TrustThreshold`] defines the level of trust that a client has /// towards a set of validators of a chain. /// -/// A trust threshold is represented as a fraction, i.e., a numerator and +/// A trust threshold is represented as a fraction, i.e., a numerator /// and a denominator. /// A typical trust threshold is 1/3 in practice. /// This type accepts even a value of 0, (numerator = 0, denominator = 0), diff --git a/ibc-core/ics02-client/context/src/client_state.rs b/ibc-core/ics02-client/context/src/client_state.rs index e6becbf58..974d9b43b 100644 --- a/ibc-core/ics02-client/context/src/client_state.rs +++ b/ibc-core/ics02-client/context/src/client_state.rs @@ -27,7 +27,7 @@ pub trait ClientStateCommon: Convertible { /// Type of client associated with this state (eg. Tendermint) fn client_type(&self) -> ClientType; - /// Latest height the client was updated to + /// The latest height the client was updated to fn latest_height(&self) -> Height; /// Validate that the client is at a sufficient height @@ -36,7 +36,7 @@ pub trait ClientStateCommon: Convertible { /// Verify the upgraded client and consensus states and validate proofs /// against the given root. /// - /// NOTE: proof heights are not included as upgrade to a new revision is + /// NOTE: proof heights are not included, as upgrade to a new revision is /// expected to pass only on the last height committed by the current /// revision. Clients are responsible for ensuring that the planned last /// height of the current revision is somehow encoded in the proof @@ -205,7 +205,7 @@ where /// Primary client trait. Defines all the methods that clients must implement. /// -/// `ClientState` is broken up in 3 separate traits to avoid needing to use +/// `ClientState` is broken up into 3 separate traits to avoid needing to use /// fully qualified syntax for every method call (see ADR 7 for more details). /// One only needs to implement [`ClientStateCommon`], [`ClientStateValidation`] /// and [`ClientStateExecution`]; a blanket implementation will automatically diff --git a/ibc-core/ics02-client/types/src/error.rs b/ibc-core/ics02-client/types/src/error.rs index 9eb5c51da..08c6d2114 100644 --- a/ibc-core/ics02-client/types/src/error.rs +++ b/ibc-core/ics02-client/types/src/error.rs @@ -97,7 +97,7 @@ pub enum ClientError { Ics23Verification(CommitmentError), /// misbehaviour handling failed with reason: `{reason}` MisbehaviourHandlingFailure { reason: String }, - /// client specific error: `{description}` + /// client-specific error: `{description}` ClientSpecific { description: String }, /// client counter overflow error CounterOverflow, diff --git a/ibc-core/ics02-client/types/src/height.rs b/ibc-core/ics02-client/types/src/height.rs index db809591a..96eda4c92 100644 --- a/ibc-core/ics02-client/types/src/height.rs +++ b/ibc-core/ics02-client/types/src/height.rs @@ -158,7 +158,7 @@ pub enum HeightError { }, /// attempted to parse an invalid zero height ZeroHeight, - /// the height(`{raw_height}`) is not valid format, this format must be used: \[revision_number\]-\[revision_height\] + /// the height(`{raw_height}`) is not a valid format, this format must be used: \[revision_number\]-\[revision_height\] InvalidFormat { raw_height: String }, } diff --git a/ibc-core/ics02-client/types/src/msgs/misbehaviour.rs b/ibc-core/ics02-client/types/src/msgs/misbehaviour.rs index fc13aa91f..0b4031fe5 100644 --- a/ibc-core/ics02-client/types/src/msgs/misbehaviour.rs +++ b/ibc-core/ics02-client/types/src/msgs/misbehaviour.rs @@ -28,7 +28,7 @@ pub const SUBMIT_MISBEHAVIOUR_TYPE_URL: &str = "/ibc.core.client.v1.MsgSubmitMis pub struct MsgSubmitMisbehaviour { /// client unique identifier pub client_id: ClientId, - /// misbehaviour used for freezing the light client + /// misbehaviour, used for freezing the light client pub misbehaviour: ProtoAny, /// signer address pub signer: Signer, diff --git a/ibc-core/ics02-client/types/src/msgs/update_client.rs b/ibc-core/ics02-client/types/src/msgs/update_client.rs index ace553b40..df79446ef 100644 --- a/ibc-core/ics02-client/types/src/msgs/update_client.rs +++ b/ibc-core/ics02-client/types/src/msgs/update_client.rs @@ -13,7 +13,7 @@ pub const UPDATE_CLIENT_TYPE_URL: &str = "/ibc.core.client.v1.MsgUpdateClient"; /// Represents the message that triggers the update of an on-chain (IBC) client /// either with new headers, or evidence of misbehaviour. -/// Note that some types of misbehaviour can be detected when a headers +/// Note that some types of misbehaviour can be detected when the headers /// are updated (`UpdateKind::UpdateClient`). #[cfg_attr( feature = "borsh", diff --git a/ibc-core/ics03-connection/types/src/connection.rs b/ibc-core/ics03-connection/types/src/connection.rs index 34f615b9d..1a6499193 100644 --- a/ibc-core/ics03-connection/types/src/connection.rs +++ b/ibc-core/ics03-connection/types/src/connection.rs @@ -484,7 +484,7 @@ impl State { } } - /// Parses the State out from a i32. + /// Parses the State out from an i32. pub fn from_i32(s: i32) -> Result { match s { 0 => Ok(Self::Uninitialized), @@ -498,13 +498,13 @@ impl State { } } - /// Returns whether or not this connection state is `Open`. + /// Returns if this connection state is `Open`. pub fn is_open(self) -> bool { self == State::Open } - /// Returns whether or not this connection with this state - /// has progressed less or the same than the argument. + /// Returns if this connection with this state + /// has progressed less than or the same as the argument. /// /// # Example /// ```rust,ignore diff --git a/ibc-core/ics03-connection/types/src/error.rs b/ibc-core/ics03-connection/types/src/error.rs index bdd7e1299..478b2d537 100644 --- a/ibc-core/ics03-connection/types/src/error.rs +++ b/ibc-core/ics03-connection/types/src/error.rs @@ -69,12 +69,12 @@ pub enum ConnectionError { }, /// invalid client state: `{reason}` InvalidClientState { reason: String }, - /// not enough blocks elapsed, current height `{current_host_height}` is still less than earliest acceptable height `{earliest_valid_height}` + /// not enough blocks elapsed, current height `{current_host_height}` is still less than the earliest acceptable height `{earliest_valid_height}` NotEnoughBlocksElapsed { current_host_height: Height, earliest_valid_height: Height, }, - /// not enough time elapsed, current timestamp `{current_host_time}` is still less than earliest acceptable timestamp `{earliest_valid_time}` + /// not enough time elapsed, current timestamp `{current_host_time}` is still less than the earliest acceptable timestamp `{earliest_valid_time}` NotEnoughTimeElapsed { current_host_time: Timestamp, earliest_valid_time: Timestamp, diff --git a/ibc-core/ics03-connection/types/src/msgs/conn_open_ack.rs b/ibc-core/ics03-connection/types/src/msgs/conn_open_ack.rs index 417e99d4d..dc3056b2a 100644 --- a/ibc-core/ics03-connection/types/src/msgs/conn_open_ack.rs +++ b/ibc-core/ics03-connection/types/src/msgs/conn_open_ack.rs @@ -21,9 +21,9 @@ pub const CONN_OPEN_ACK_TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnectionO #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct MsgConnectionOpenAck { - /// ConnectionId that chain A has chosen for it's ConnectionEnd + /// ConnectionId that chain A has chosen for its ConnectionEnd pub conn_id_on_a: ConnectionId, - /// ConnectionId that chain B has chosen for it's ConnectionEnd + /// ConnectionId that chain B has chosen for its ConnectionEnd pub conn_id_on_b: ConnectionId, /// ClientState of client tracking chain A on chain B pub client_state_of_a_on_b: Any, diff --git a/ibc-core/ics03-connection/types/src/msgs/conn_open_confirm.rs b/ibc-core/ics03-connection/types/src/msgs/conn_open_confirm.rs index ec4bcce7c..e18821d57 100644 --- a/ibc-core/ics03-connection/types/src/msgs/conn_open_confirm.rs +++ b/ibc-core/ics03-connection/types/src/msgs/conn_open_confirm.rs @@ -19,7 +19,7 @@ pub const CONN_OPEN_CONFIRM_TYPE_URL: &str = "/ibc.core.connection.v1.MsgConnect #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[derive(Clone, Debug, PartialEq, Eq)] pub struct MsgConnectionOpenConfirm { - /// ConnectionId that chain B has chosen for it's ConnectionEnd + /// ConnectionId that chain B has chosen for its ConnectionEnd pub conn_id_on_b: ConnectionId, /// proof of ConnectionEnd stored on Chain A during ConnOpenInit pub proof_conn_end_on_a: CommitmentProofBytes, diff --git a/ibc-core/ics03-connection/types/src/msgs/mod.rs b/ibc-core/ics03-connection/types/src/msgs/mod.rs index 406001e36..d3be3dcf6 100644 --- a/ibc-core/ics03-connection/types/src/msgs/mod.rs +++ b/ibc-core/ics03-connection/types/src/msgs/mod.rs @@ -6,7 +6,7 @@ //! //! One departure from ICS3 is that we abstract the three counterparty fields (connection id, //! prefix, and client id) into a single field of type `Counterparty`; this applies to messages -//! `MsgConnectionOpenInit` and `MsgConnectionOpenTry`. One other difference with regards to +//! `MsgConnectionOpenInit` and `MsgConnectionOpenTry`. One other difference with regard to //! abstraction is that all proof-related attributes in a message are encapsulated in `Proofs` type. //! //! Another difference to ICS3 specs is that each message comprises an additional field called diff --git a/ibc-core/ics03-connection/types/src/version.rs b/ibc-core/ics03-connection/types/src/version.rs index 2979e2622..a4446d113 100644 --- a/ibc-core/ics03-connection/types/src/version.rs +++ b/ibc-core/ics03-connection/types/src/version.rs @@ -112,7 +112,7 @@ impl Display for Version { /// selects the first version with a version identifier that is supported by the /// counterparty. The returned version contains a feature set with the /// intersection of the features supported by the source and counterparty -/// chains. If the feature set intersection is nil then the search for a +/// chains. If the feature set intersection is nil, the search for a /// compatible version continues. This function is called in the `conn_open_try` /// handshake procedure. /// diff --git a/ibc-core/ics04-channel/src/handler/timeout_on_close.rs b/ibc-core/ics04-channel/src/handler/timeout_on_close.rs index 0aa5a4027..8366a5d26 100644 --- a/ibc-core/ics04-channel/src/handler/timeout_on_close.rs +++ b/ibc-core/ics04-channel/src/handler/timeout_on_close.rs @@ -109,7 +109,7 @@ where client_state_of_b_on_a .verify_membership( prefix_on_b, - &msg.proof_unreceived_on_b, + &msg.proof_close_on_b, consensus_state_of_b_on_a.root(), Path::ChannelEnd(chan_end_path_on_b), expected_chan_end_on_b.encode_vec(), diff --git a/ibc-core/ics04-channel/types/src/channel.rs b/ibc-core/ics04-channel/types/src/channel.rs index 95f6aa877..846696561 100644 --- a/ibc-core/ics04-channel/types/src/channel.rs +++ b/ibc-core/ics04-channel/types/src/channel.rs @@ -314,7 +314,7 @@ impl ChannelEnd { /// Checks if the `connection_hops` has a length of `expected`. /// - /// Note: Current IBC version only supports one connection hop. + /// Note: The current IBC version only supports one connection hop. pub fn verify_connection_hops_length(&self) -> Result<(), ChannelError> { verify_connection_hops_length(&self.connection_hops, 1) } @@ -556,13 +556,13 @@ impl State { } } - /// Returns whether or not this channel state is `Open`. + /// Returns if this channel state is `Open`. pub fn is_open(self) -> bool { self == State::Open } - /// Returns whether or not the channel with this state - /// has progressed less or the same than the argument. + /// Returns if the channel with this state + /// has progressed less than or the same as the argument. /// /// # Example /// ```rust,ignore diff --git a/ibc-core/ics04-channel/types/src/commitment.rs b/ibc-core/ics04-channel/types/src/commitment.rs index 1f1fc464c..8066b13b6 100644 --- a/ibc-core/ics04-channel/types/src/commitment.rs +++ b/ibc-core/ics04-channel/types/src/commitment.rs @@ -42,7 +42,7 @@ impl From> for PacketCommitment { } } -/// Acknowledgement commitment to be stored +/// Acknowledgement of commitment to be stored #[cfg_attr( feature = "parity-scale-codec", derive( @@ -106,7 +106,7 @@ pub fn compute_ack_commitment(ack: &Acknowledgement) -> AcknowledgementCommitmen /// Helper function to hash a byte slice using SHA256. /// -/// Note that computing commitments with anything other than SHA256 will +/// Note that computing commitments with anything apart from SHA256 will /// break the Merkle proofs of the IBC provable store. fn hash(data: &[u8]) -> [u8; 32] { use sha2::Digest; diff --git a/ibc-core/ics04-channel/types/src/error.rs b/ibc-core/ics04-channel/types/src/error.rs index 9fb77c7c0..2b7b760ef 100644 --- a/ibc-core/ics04-channel/types/src/error.rs +++ b/ibc-core/ics04-channel/types/src/error.rs @@ -1,4 +1,4 @@ -//! Defines the main channel, port and packet error types +//! Defines the main channel, port, and packet error types use displaydoc::Display; use ibc_core_client_types::{error as client_error, Height}; @@ -101,7 +101,7 @@ pub enum PacketError { PacketReceiptNotFound { sequence: Sequence }, /// The stored commitment of the packet `{sequence}` is incorrect IncorrectPacketCommitment { sequence: Sequence }, - /// implementation specific error + /// implementation-specific error ImplementationSpecific, /// Undefined counterparty connection for `{connection_id}` UndefinedConnectionCounterparty { connection_id: ConnectionId }, diff --git a/ibc-core/ics04-channel/types/src/msgs/acknowledgement.rs b/ibc-core/ics04-channel/types/src/msgs/acknowledgement.rs index e37fa6300..a93f7a622 100644 --- a/ibc-core/ics04-channel/types/src/msgs/acknowledgement.rs +++ b/ibc-core/ics04-channel/types/src/msgs/acknowledgement.rs @@ -25,7 +25,7 @@ pub struct MsgAcknowledgement { pub acknowledgement: Acknowledgement, /// Proof of packet acknowledgement on the receiving chain pub proof_acked_on_b: CommitmentProofBytes, - /// Height at which the commitment proof in this message were taken + /// Height at which the commitment proof in this message was taken pub proof_height_on_b: Height, pub signer: Signer, } diff --git a/ibc-core/ics04-channel/types/src/msgs/chan_open_try.rs b/ibc-core/ics04-channel/types/src/msgs/chan_open_try.rs index 4b1d54384..c6cbd918b 100644 --- a/ibc-core/ics04-channel/types/src/msgs/chan_open_try.rs +++ b/ibc-core/ics04-channel/types/src/msgs/chan_open_try.rs @@ -41,7 +41,7 @@ pub struct MsgChannelOpenTry { impl MsgChannelOpenTry { /// Checks if the `connection_hops` has a length of `expected`. /// - /// Note: Current IBC version only supports one connection hop. + /// Note: The current IBC version only supports one connection hop. pub fn verify_connection_hops_length(&self) -> Result<(), ChannelError> { verify_connection_hops_length(&self.connection_hops_on_b, 1) } diff --git a/ibc-core/ics04-channel/types/src/packet.rs b/ibc-core/ics04-channel/types/src/packet.rs index 0017e0518..5caeb4eb3 100644 --- a/ibc-core/ics04-channel/types/src/packet.rs +++ b/ibc-core/ics04-channel/types/src/packet.rs @@ -129,7 +129,7 @@ impl Packet { /// event is timed-out relative to the current state of the /// destination chain. /// - /// Checks both for time-out relative to the destination chain's + /// Checks for time-out relative to the destination chain's /// current timestamp `dst_chain_ts` as well as relative to /// the height `dst_chain_height`. /// diff --git a/ibc-core/ics23-commitment/types/src/commitment.rs b/ibc-core/ics23-commitment/types/src/commitment.rs index 25f4ca579..bc0707d9c 100644 --- a/ibc-core/ics23-commitment/types/src/commitment.rs +++ b/ibc-core/ics23-commitment/types/src/commitment.rs @@ -141,7 +141,7 @@ impl<'a> TryFrom<&'a CommitmentProofBytes> for MerkleProof { feature = "borsh", derive(borsh::BorshSerialize, borsh::BorshDeserialize) )] -#[cfg_attr(feature = "serde", derive(serde::Deserialize))] +#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] #[derive(Clone, PartialEq, Eq, Hash)] pub struct CommitmentPrefix { @@ -183,13 +183,3 @@ impl fmt::Debug for CommitmentPrefix { } } } - -#[cfg(feature = "serde")] -impl serde::Serialize for CommitmentPrefix { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - format!("{self:?}").serialize(serializer) - } -} diff --git a/ibc-core/ics24-host/cosmos/src/upgrade_proposal/context.rs b/ibc-core/ics24-host/cosmos/src/upgrade_proposal/context.rs index 925ab547f..056bd4e46 100644 --- a/ibc-core/ics24-host/cosmos/src/upgrade_proposal/context.rs +++ b/ibc-core/ics24-host/cosmos/src/upgrade_proposal/context.rs @@ -22,7 +22,7 @@ pub type UpgradedConsensusStateRef = pub trait UpgradeValidationContext { type V: ClientValidationContext; - /// Returns the upgrade plan that is scheduled and not have been executed yet. + /// Returns the upgrade plan that is scheduled and has not been executed yet. fn upgrade_plan(&self) -> Result; /// Returns the upgraded client state at the specified upgrade path. diff --git a/ibc-core/ics24-host/cosmos/src/upgrade_proposal/handler.rs b/ibc-core/ics24-host/cosmos/src/upgrade_proposal/handler.rs index 2b76c089f..8c7ee72cf 100644 --- a/ibc-core/ics24-host/cosmos/src/upgrade_proposal/handler.rs +++ b/ibc-core/ics24-host/cosmos/src/upgrade_proposal/handler.rs @@ -11,7 +11,7 @@ use crate::upgrade_proposal::{UpgradeClientProposal, UpgradeExecutionContext, Up /// /// It clears both IBC client and consensus states if a previous plan was set. /// Then it will schedule an upgrade and finally set the upgraded client state -/// in upgrade store. +/// in the upgrade store. pub fn execute_upgrade_client_proposal( ctx: &mut Ctx, proposal: UpgradeProposal, diff --git a/ibc-core/ics24-host/cosmos/src/validate_self_client.rs b/ibc-core/ics24-host/cosmos/src/validate_self_client.rs index 72974ab75..7064fdcd8 100644 --- a/ibc-core/ics24-host/cosmos/src/validate_self_client.rs +++ b/ibc-core/ics24-host/cosmos/src/validate_self_client.rs @@ -132,16 +132,16 @@ pub trait ValidateSelfClientContext { Ok(()) } - /// Returns the host chain id + /// Returns the chain id of the host fn chain_id(&self) -> &ChainId; /// Returns the host current height fn host_current_height(&self) -> Height; - /// Returns the host proof specs + /// Returns the proof specs of the host fn proof_specs(&self) -> &ProofSpecs; - /// Returns the host unbonding period + /// Returns the unbonding period of the host fn unbonding_period(&self) -> Duration; /// Returns the host upgrade path. May be empty. diff --git a/ibc-core/ics24-host/src/context.rs b/ibc-core/ics24-host/src/context.rs index 612768a32..da858968d 100644 --- a/ibc-core/ics24-host/src/context.rs +++ b/ibc-core/ics24-host/src/context.rs @@ -150,7 +150,7 @@ pub trait ExecutionContext: ValidationContext { fn get_client_execution_context(&mut self) -> &mut Self::E; /// Called upon client creation. - /// Increases the counter which keeps track of how many clients have been created. + /// Increases the counter, that keeps track of how many clients have been created. fn increase_client_counter(&mut self) -> Result<(), ContextError>; /// Stores the given connection_end at path @@ -230,7 +230,7 @@ pub trait ExecutionContext: ValidationContext { ) -> Result<(), ContextError>; /// Called upon channel identifier creation (Init or Try message processing). - /// Increases the counter which keeps track of how many channels have been created. + /// Increases the counter, that keeps track of how many channels have been created. fn increase_channel_counter(&mut self) -> Result<(), ContextError>; /// Emit the given IBC event diff --git a/ibc-core/ics24-host/types/src/identifiers/chain_id.rs b/ibc-core/ics24-host/types/src/identifiers/chain_id.rs index 28c0b7123..328d6750a 100644 --- a/ibc-core/ics24-host/types/src/identifiers/chain_id.rs +++ b/ibc-core/ics24-host/types/src/identifiers/chain_id.rs @@ -44,7 +44,7 @@ impl ChainId { /// based on their requirements. /// /// If the chain identifier is in the {chain name}-{revision number} format, - /// the revision number is parsed. Otherwise, revision number is set to 0. + /// the revision number is parsed. Otherwise, the revision number is set to 0. /// /// ``` /// use ibc_core_host_types::identifiers::ChainId; diff --git a/ibc-core/ics24-host/types/src/identifiers/client_type.rs b/ibc-core/ics24-host/types/src/identifiers/client_type.rs index 847f46452..8f0547aa4 100644 --- a/ibc-core/ics24-host/types/src/identifiers/client_type.rs +++ b/ibc-core/ics24-host/types/src/identifiers/client_type.rs @@ -32,7 +32,7 @@ impl ClientType { validate_client_type(client_type).map(|()| Self(client_type.into())) } - /// Constructs a new [`ClientId`] with this types client type and given + /// Constructs a new [`ClientId`] with this type of client type and given /// `counter`. /// /// This is equivalent to `ClientId::new(self.as_str(), counter)` but diff --git a/ibc-core/ics24-host/types/src/validate.rs b/ibc-core/ics24-host/types/src/validate.rs index 8346ff912..75e3494ef 100644 --- a/ibc-core/ics24-host/types/src/validate.rs +++ b/ibc-core/ics24-host/types/src/validate.rs @@ -90,7 +90,7 @@ pub fn validate_client_type(id: &str) -> Result<(), Error> { /// Default validator function for Client identifiers. /// -/// A valid client identifier must be between 9-64 characters as specified in +/// A valid client identifier must be between 9-64 characters, as specified in /// the ICS-24 spec. pub fn validate_client_identifier(id: &str) -> Result<(), Error> { validate_identifier_chars(id)?; @@ -99,7 +99,7 @@ pub fn validate_client_identifier(id: &str) -> Result<(), Error> { /// Default validator function for Connection identifiers. /// -/// A valid connection identifier must be between 10-64 characters as specified +/// A valid connection identifier must be between 10-64 characters, as specified /// in the ICS-24 spec. pub fn validate_connection_identifier(id: &str) -> Result<(), Error> { validate_identifier_chars(id)?; @@ -110,7 +110,7 @@ pub fn validate_connection_identifier(id: &str) -> Result<(), Error> { /// Default validator function for Port identifiers. /// -/// A valid port identifier must be between 2-128 characters as specified in the +/// A valid port identifier must be between 2-128 characters, as specified in the /// ICS-24 spec. pub fn validate_port_identifier(id: &str) -> Result<(), Error> { validate_identifier_chars(id)?; @@ -119,7 +119,7 @@ pub fn validate_port_identifier(id: &str) -> Result<(), Error> { /// Default validator function for Channel identifiers. /// -/// A valid channel identifier must be between 8-64 characters as specified in +/// A valid channel identifier must be between 8-64 characters, as specified in /// the ICS-24 spec. pub fn validate_channel_identifier(id: &str) -> Result<(), Error> { validate_identifier_chars(id)?; diff --git a/ibc-core/ics25-handler/src/lib.rs b/ibc-core/ics25-handler/src/lib.rs index 203c98c2f..783e8e628 100644 --- a/ibc-core/ics25-handler/src/lib.rs +++ b/ibc-core/ics25-handler/src/lib.rs @@ -7,7 +7,7 @@ //! an error, the runtime is expected to rollback all state modifications made //! to the context (e.g. [`ExecutionContext`](ibc_core_host::ExecutionContext)) //! while processing `M`. If the transaction containing `M` consists of multiple -//! messages, then typically the state modifications from all messages is +//! messages, then typically the state modifications from all messages are //! expected to be rolled back as well. #![no_std] #![forbid(unsafe_code)] diff --git a/ibc-core/ics25-handler/types/src/lib.rs b/ibc-core/ics25-handler/types/src/lib.rs index 60d03ad14..c30845afc 100644 --- a/ibc-core/ics25-handler/types/src/lib.rs +++ b/ibc-core/ics25-handler/types/src/lib.rs @@ -1,4 +1,4 @@ -//! Encapsulates essential data structures facilitating the seamless +//! Encapsulates essential data structures, facilitating the seamless //! interaction between an implemented IBC module using ibc-rs and the //! underlying host blockchain. #![no_std] diff --git a/ibc-core/src/lib.rs b/ibc-core/src/lib.rs index da0deda7a..30d04e384 100644 --- a/ibc-core/src/lib.rs +++ b/ibc-core/src/lib.rs @@ -75,7 +75,7 @@ pub mod derive { /// - `#[execution()]` /// /// The argument to the `validation` or `execution` attributes may contain - /// lifetimes or generic types and even that types might be bounded by + /// lifetimes or generic types, and even that types might be bounded by /// traits. For instance: /// /// - `#[validation(Context)]` diff --git a/ibc-data-types/src/lib.rs b/ibc-data-types/src/lib.rs index 6056d869e..ab9ffd8b2 100644 --- a/ibc-data-types/src/lib.rs +++ b/ibc-data-types/src/lib.rs @@ -1,7 +1,7 @@ //! Re-exports data structures of various specifications within the //! Inter-Blockchain Communication (IBC) protocol. Designed for universal -//! application, enabling diverse projects across IBC ecosystem to build using a -//! shared language. +//! application, enabling diverse projects across the IBC ecosystem to +//! build using a shared language. #![no_std] #![forbid(unsafe_code)] #![cfg_attr(not(test), deny(clippy::unwrap_used))] diff --git a/ibc-derive/src/client_state/traits/client_state_common.rs b/ibc-derive/src/client_state/traits/client_state_common.rs index 56bfe9349..bac320ff8 100644 --- a/ibc-derive/src/client_state/traits/client_state_common.rs +++ b/ibc-derive/src/client_state/traits/client_state_common.rs @@ -138,7 +138,7 @@ pub(crate) fn impl_ClientStateCommon( /// /// `enum_name`: The user's enum identifier (e.g. `HostClientState`) /// `enum_variants`: An iterator of all enum variants (e.g. `[HostClientState::Tendermint, HostClientState::Mock]`) -/// `fn_call`: The tokens for the function call. Fully-qualified syntax is assumed, where the name for `self` +/// `fn_call`: The tokens for the function call. Fully qualified syntax is assumed, where the name for `self` /// is `cs` (e.g. `client_type(cs)`). /// /// For example, diff --git a/ibc-primitives/src/traits/proto.rs b/ibc-primitives/src/traits/proto.rs index 686350b2d..54dc35846 100644 --- a/ibc-primitives/src/traits/proto.rs +++ b/ibc-primitives/src/traits/proto.rs @@ -5,7 +5,7 @@ use ibc_proto::Protobuf; use crate::prelude::*; -/// Types that implement this trait are able to be converted to +/// Types that implement this trait can be converted to /// a raw Protobuf `Any` type. pub trait ToProto

: Protobuf

where diff --git a/ibc-primitives/src/types/timestamp.rs b/ibc-primitives/src/types/timestamp.rs index 4973283fc..b2db7be1a 100644 --- a/ibc-primitives/src/types/timestamp.rs +++ b/ibc-primitives/src/types/timestamp.rs @@ -84,8 +84,8 @@ impl scale_info::TypeInfo for Timestamp { /// - If the left timestamp is strictly after the right timestamp, the result is `Expired`. /// - Otherwise, the result is `NotExpired`. /// -/// User of this result may want to determine whether error should be raised, -/// when either of the timestamp being compared is invalid. +/// Users of this result may want to determine whether an error should be raised, +/// when either of the timestamps being compared is invalid. #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)] pub enum Expiry { @@ -135,7 +135,7 @@ impl Timestamp { /// Computes the duration difference of another `Timestamp` from the current one. /// Returns the difference in time as an [`core::time::Duration`]. /// Returns `None` if the other `Timestamp` is more advanced - /// than the current or if either of the `Timestamp`s is not set. + /// than the current, or if either of the `Timestamp`s is not set. pub fn duration_since(&self, other: &Self) -> Option { match (self.time, other.time) { (Some(time1), Some(time2)) => time1.duration_since(time2).ok(), diff --git a/ibc-primitives/src/utils/mod.rs b/ibc-primitives/src/utils/mod.rs index b61030b5d..576e377cf 100644 --- a/ibc-primitives/src/utils/mod.rs +++ b/ibc-primitives/src/utils/mod.rs @@ -1,4 +1,4 @@ -//! Contains various internally-used utilities. +//! Contains various internally used utilities. pub mod pretty; pub use pretty::*; diff --git a/ibc-query/Cargo.toml b/ibc-query/Cargo.toml index 531629343..38ec2e048 100644 --- a/ibc-query/Cargo.toml +++ b/ibc-query/Cargo.toml @@ -1,13 +1,14 @@ [package] -name = "ibc-query" -version = { workspace = true } -authors = { workspace = true } -edition = { workspace = true } +name = "ibc-query" +version = { workspace = true } +authors = { workspace = true } +edition = { workspace = true } rust-version = { workspace = true } -license = { workspace = true } -repository = { workspace = true } -readme = "README.md" -keywords = [ "blockchain", "cosmos", "ibc", "rpc", "grpc" ] +license = { workspace = true } +repository = { workspace = true } +readme = "README.md" +keywords = [ "blockchain", "cosmos", "ibc", "rpc", "grpc" ] + description = """ Maintained by `ibc-rs`, contains essential IBC query types, utility functions and gRPC service implementations for the IBC core. diff --git a/ibc-query/src/core/channel/query.rs b/ibc-query/src/core/channel/query.rs index 19875c78f..793ce5700 100644 --- a/ibc-query/src/core/channel/query.rs +++ b/ibc-query/src/core/channel/query.rs @@ -212,7 +212,7 @@ where } /// Queries for the packet commitment associated with a channel by the given -/// sequence, channel and port ids +/// sequence, channel, and port ids pub fn query_packet_commitment( ibc_ctx: &I, request: &QueryPacketCommitmentRequest, @@ -269,7 +269,7 @@ where } /// Queries for the packet receipt associated with a channel by the given -/// sequence, channel and port ids +/// sequence, channel, and port ids pub fn query_packet_receipt( ibc_ctx: &I, request: &QueryPacketReceiptRequest, @@ -304,7 +304,7 @@ where } /// Queries for the packet acknowledgement associated with a channel by the -/// given sequence, channel and port ids +/// given sequence, channel, and port ids pub fn query_packet_acknowledgement( ibc_ctx: &I, request: &QueryPacketAcknowledgementRequest, diff --git a/ibc-query/src/core/channel/service.rs b/ibc-query/src/core/channel/service.rs index 9c4f7fa26..561778bc7 100644 --- a/ibc-query/src/core/channel/service.rs +++ b/ibc-query/src/core/channel/service.rs @@ -128,7 +128,7 @@ where .into_response() } - /// Returns all the acknowledgements if sequences is omitted. + /// Returns all the acknowledgements if sequences are omitted. async fn packet_acknowledgements( &self, request: Request, @@ -137,7 +137,7 @@ where .into_response() } - /// Returns all the unreceived packets if sequences is omitted. + /// Returns all the unreceived packets if sequences are omitted. async fn unreceived_packets( &self, request: Request, @@ -145,7 +145,7 @@ where query_unreceived_packets(&self.ibc_context, &request.try_into_domain()?)?.into_response() } - /// Returns all the unreceived acknowledgements if sequences is omitted. + /// Returns all the unreceived acknowledgements if sequences are omitted. async fn unreceived_acks( &self, request: Request, diff --git a/ibc-query/src/core/client/types/request.rs b/ibc-query/src/core/client/types/request.rs index 99e5f61a7..1cc5e4769 100644 --- a/ibc-query/src/core/client/types/request.rs +++ b/ibc-query/src/core/client/types/request.rs @@ -220,7 +220,7 @@ impl From for QueryUpgradedClientStateRequest { #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] pub struct QueryUpgradedConsensusStateRequest { - /// Height at which the chain is scheduled to halt for upgrade. + /// The height at which the chain is scheduled to halt for upgrade. pub upgrade_height: Option, /// The height at which to query the upgraded consensus state. If not /// provided, the latest height should be used. diff --git a/ibc-query/src/lib.rs b/ibc-query/src/lib.rs index 504298398..710654c94 100644 --- a/ibc-query/src/lib.rs +++ b/ibc-query/src/lib.rs @@ -4,7 +4,7 @@ //! Therefore, some ready-to-use Query structs for each layer of the client, //! connection, and channel have been implemented and exposed by this crate. //! -//! The provided structs includes blanket implementation of their corresponding +//! The provided structs include blanket implementation of their corresponding //! gRPC service traits, if the host implements the following _context_ traits: //! - [`ValidationContext`](ibc::core::host::ValidationContext) //! - [`ProvableContext`](crate::core::context::ProvableContext) diff --git a/ibc-query/src/types.rs b/ibc-query/src/types.rs index 147307a98..bc1ff1975 100644 --- a/ibc-query/src/types.rs +++ b/ibc-query/src/types.rs @@ -13,12 +13,12 @@ pub struct PageRequest { /// querying the next page most efficiently. Only one of offset or key /// should be set. pub key: Vec, - /// offset is a numeric offset that can be used when key is unavailable. - /// It is less efficient than using key. Only one of offset or key should - /// be set. + /// offset is a numeric offset that can be used when the key is unavailable. + /// It is less efficient than using the key. + /// Only one of offset or key should be set. pub offset: u64, - /// limit is the total number of results to be returned in the result page. - /// If left empty it will default to a value to be set by each app. + /// limit is the total number of results to be returned to the result page. + /// If left empty, it will default to a value to be set by each app. pub limit: u64, /// count_total is set to true to indicate that the result set should include /// a count of the total number of items available for pagination in UIs. @@ -70,7 +70,7 @@ pub struct PageResponse { /// query the next page most efficiently. It will be empty if /// there are no more results. pub next_key: Vec, - /// total is total number of results available if PageRequest.count_total + /// total is the total number of results available if PageRequest.count_total /// was set, its value is undefined otherwise pub total: u64, } diff --git a/ibc-testkit/Cargo.toml b/ibc-testkit/Cargo.toml index 0ab0ed09e..1ce60b37c 100644 --- a/ibc-testkit/Cargo.toml +++ b/ibc-testkit/Cargo.toml @@ -25,38 +25,28 @@ schemars = { workspace = true, optional = true } serde = { workspace = true, optional = true } serde_json = { workspace = true, optional = true } subtle-encoding = { workspace = true } -tracing = { version = "0.1.40", default-features = false } typed-builder = { version = "0.18.0" } # ibc dependencies -ibc = { workspace = true, features = [ "std" ] } -ibc-proto = { workspace = true } -ibc-client-cw = { workspace = true } -ibc-client-tendermint-cw = { workspace = true } -ibc-query = { workspace = true } +ibc = { workspace = true, features = [ "std" ] } +ibc-proto = { workspace = true } +ibc-query = { workspace = true } # basecoin dependencies -basecoin-store = { git = "https://github.com/informalsystems/basecoin-rs", rev = "8496b3f" } +basecoin-store = { version = "0.1.0" } # cosmos dependencies tendermint = { workspace = true } tendermint-testgen = { workspace = true } [dev-dependencies] -env_logger = { version = "0.11.0" } -tracing-subscriber = { version = "0.3.17", features = [ "fmt", "env-filter", "json" ] } -test-log = { version = "0.2.13", features = [ "trace" ] } -hex = { version = "0.4.2" } -rstest = { workspace = true } -cosmwasm-vm = { workspace = true } -cosmwasm-std = { workspace = true } +hex = { version = "0.4.2" } +rstest = { workspace = true } [features] default = [ "std" ] std = [ "serde/std", - "tracing/std", - "tracing-subscriber/std", "serde_json/std", "ibc/std", "ibc-proto/std", diff --git a/ibc-testkit/src/context.rs b/ibc-testkit/src/context.rs index 74d141f2e..4380de474 100644 --- a/ibc-testkit/src/context.rs +++ b/ibc-testkit/src/context.rs @@ -2,7 +2,7 @@ use core::fmt::Debug; use core::time::Duration; use basecoin_store::context::ProvableStore; -use basecoin_store::impls::{GrowingStore, InMemoryStore, RevertibleStore}; +use basecoin_store::impls::InMemoryStore; use ibc::core::channel::types::channel::ChannelEnd; use ibc::core::channel::types::commitment::PacketCommitment; use ibc::core::client::context::client_state::ClientStateValidation; @@ -53,7 +53,7 @@ where } /// A mock store type using basecoin-storage implementations. -pub type MockStore = RevertibleStore>; +pub type MockStore = InMemoryStore; /// A [`StoreGenericTestContext`] using [`MockStore`]. pub type TestContext = StoreGenericTestContext; /// A [`StoreGenericTestContext`] using [`MockStore`] and [`MockHost`]. @@ -83,7 +83,7 @@ where H: TestHost, HostClientState: ClientStateValidation>, { - /// Returns a immutable reference to the IBC store. + /// Returns an immutable reference to the IBC store. pub fn ibc_store(&self) -> &MockIbcStore { &self.ibc_store } @@ -93,7 +93,7 @@ where &mut self.ibc_store } - /// Returns a immutable reference to the IBC router. + /// Returns an immutable reference to the IBC router. pub fn ibc_router(&self) -> &MockRouter { &self.ibc_router } @@ -139,7 +139,7 @@ where /// Advance the first height of the host chain by generating a genesis block. /// - /// This method is exactly the same as [`Self::advance_genesis_height`]. + /// This method is same as [`Self::advance_genesis_height`]. /// But it bootstraps the genesis block by height 1 and `genesis_time`. /// /// The method starts and ends with [`Self::end_block`] and [`Self::begin_block`], just @@ -366,7 +366,7 @@ where self } - /// Bootstraps a IBC connection to this context. + /// Bootstraps an IBC connection to this context. /// /// This does not bootstrap any light client. pub fn with_connection( @@ -381,7 +381,7 @@ where self } - /// Bootstraps a IBC channel to this context. + /// Bootstraps an IBC channel to this context. /// /// This does not bootstrap any corresponding IBC connection or light client. pub fn with_channel( @@ -429,7 +429,7 @@ where self } - /// Bootstraps a ack sequence to this context. + /// Bootstraps an ack sequence to this context. /// /// This does not bootstrap any corresponding IBC channel, connection or light client. pub fn with_ack_sequence( @@ -479,7 +479,7 @@ where /// A datagram passes from the relayer to the IBC module (on host chain). /// Alternative method to `Ics18Context::send` that does not exercise any serialization. - /// Used in testing the Ics18 algorithms, hence this may return a Ics18Error. + /// Used in testing the Ics18 algorithms, hence this may return an Ics18Error. pub fn deliver(&mut self, msg: MsgEnvelope) -> Result<(), RelayerError> { self.dispatch(msg) .map_err(RelayerError::TransactionFailed)?; diff --git a/ibc-testkit/tests/data/json/signed_header.json b/ibc-testkit/src/data/json/signed_header.json similarity index 100% rename from ibc-testkit/tests/data/json/signed_header.json rename to ibc-testkit/src/data/json/signed_header.json diff --git a/ibc-testkit/src/fixtures/clients/tendermint.rs b/ibc-testkit/src/fixtures/clients/tendermint.rs index 47b885a52..aaa49a5d7 100644 --- a/ibc-testkit/src/fixtures/clients/tendermint.rs +++ b/ibc-testkit/src/fixtures/clients/tendermint.rs @@ -117,7 +117,7 @@ pub fn dummy_tendermint_header() -> tendermint::block::Header { serde_json::from_str::(include_str!(concat!( env!("CARGO_MANIFEST_DIR"), - "/tests/data/json/signed_header.json" + "/src/data/json/signed_header.json" ))) .expect("Never fails") .header @@ -147,7 +147,7 @@ pub fn dummy_ics07_header() -> Header { // Build a SignedHeader from a JSON file. let shdr = serde_json::from_str::(include_str!(concat!( env!("CARGO_MANIFEST_DIR"), - "/tests/data/json/signed_header.json" + "/src/data/json/signed_header.json" ))) .expect("Never fails"); @@ -174,7 +174,6 @@ pub fn dummy_ics07_header() -> Header { #[cfg(all(test, feature = "serde"))] mod tests { - use ibc::primitives::proto::Any; use rstest::rstest; diff --git a/ibc-testkit/src/fixtures/core/channel/acknowledgement.rs b/ibc-testkit/src/fixtures/core/channel/acknowledgement.rs index 299278789..ac09a89e0 100644 --- a/ibc-testkit/src/fixtures/core/channel/acknowledgement.rs +++ b/ibc-testkit/src/fixtures/core/channel/acknowledgement.rs @@ -7,7 +7,7 @@ use super::{dummy_proof, dummy_raw_packet}; use crate::fixtures::core::signer::dummy_bech32_account; /// Returns a dummy `RawMsgAcknowledgement`, for testing purposes only! -/// The `height` parametrizes both the proof height as well as the timeout height. +/// The `height` parametrizes the proof height as well as the timeout height. pub fn dummy_raw_msg_acknowledgement(height: u64) -> RawMsgAcknowledgement { dummy_raw_msg_ack_with_packet(dummy_raw_packet(height, 1), height) } diff --git a/ibc-testkit/src/fixtures/core/channel/recv_packet.rs b/ibc-testkit/src/fixtures/core/channel/recv_packet.rs index 0faeff71a..57403a69e 100644 --- a/ibc-testkit/src/fixtures/core/channel/recv_packet.rs +++ b/ibc-testkit/src/fixtures/core/channel/recv_packet.rs @@ -27,7 +27,7 @@ pub fn dummy_msg_recv_packet( } /// Returns a dummy `RawMsgRecvPacket`, for testing purposes only! The `height` -/// parametrizes both the proof height as well as the timeout height. +/// parametrizes the proof height as well as the timeout height. pub fn dummy_raw_msg_recv_packet(height: u64) -> RawMsgRecvPacket { let timestamp = Timestamp::now().add(Duration::from_secs(9)); RawMsgRecvPacket { diff --git a/ibc-testkit/src/fixtures/core/channel/timeout.rs b/ibc-testkit/src/fixtures/core/channel/timeout.rs index 960dd4d57..97719aafd 100644 --- a/ibc-testkit/src/fixtures/core/channel/timeout.rs +++ b/ibc-testkit/src/fixtures/core/channel/timeout.rs @@ -5,7 +5,7 @@ use super::{dummy_proof, dummy_raw_packet}; use crate::fixtures::core::signer::dummy_bech32_account; /// Returns a dummy `RawMsgTimeout`, for testing purposes only! -/// The `height` parametrizes both the proof height as well as the timeout height. +/// The `height` parametrizes the proof height as well as the timeout height. pub fn dummy_raw_msg_timeout( proof_height: u64, timeout_height: u64, diff --git a/ibc-testkit/src/fixtures/core/channel/timeout_on_close.rs b/ibc-testkit/src/fixtures/core/channel/timeout_on_close.rs index 2fc633160..165d0299f 100644 --- a/ibc-testkit/src/fixtures/core/channel/timeout_on_close.rs +++ b/ibc-testkit/src/fixtures/core/channel/timeout_on_close.rs @@ -5,7 +5,7 @@ use super::{dummy_proof, dummy_raw_packet}; use crate::fixtures::core::signer::dummy_bech32_account; /// Returns a dummy `RawMsgTimeoutOnClose`, for testing purposes only! -/// The `height` parametrizes both the proof height as well as the timeout height. +/// The `height` parametrizes the proof height as well as the timeout height. pub fn dummy_raw_msg_timeout_on_close(height: u64, timeout_timestamp: u64) -> RawMsgTimeoutOnClose { RawMsgTimeoutOnClose { packet: Some(dummy_raw_packet(height, timeout_timestamp)), diff --git a/ibc-testkit/src/hosts/mod.rs b/ibc-testkit/src/hosts/mod.rs index 426b69066..86b17cc54 100644 --- a/ibc-testkit/src/hosts/mod.rs +++ b/ibc-testkit/src/hosts/mod.rs @@ -30,7 +30,7 @@ pub trait TestHost: Default + Debug + Sized { /// The type of client state produced by the host. type ClientState: Into + Debug; - /// The type of block parameters to produce a block. + /// The type of block parameter to produce a block. type BlockParams: Debug + Default; /// The type of light client parameters to produce a light client state. diff --git a/ibc-testkit/src/relayer/context.rs b/ibc-testkit/src/relayer/context.rs index 232fb6074..9ea3bd196 100644 --- a/ibc-testkit/src/relayer/context.rs +++ b/ibc-testkit/src/relayer/context.rs @@ -34,22 +34,22 @@ where Self { ctx_a, ctx_b } } - /// Returns immutable reference to the first context. + /// Returns an immutable reference to the first context. pub fn get_ctx_a(&self) -> &TestContext { &self.ctx_a } - /// Returns immutable reference to the second context. + /// Returns an immutable reference to the second context. pub fn get_ctx_b(&self) -> &TestContext { &self.ctx_b } - /// Returns mutable reference to the first context. + /// Returns a mutable reference to the first context. pub fn get_ctx_a_mut(&mut self) -> &mut TestContext { &mut self.ctx_a } - /// Returns mutable reference to the second context. + /// Returns a mutable reference to the second context. pub fn get_ctx_b_mut(&mut self) -> &mut TestContext { &mut self.ctx_b } @@ -306,9 +306,11 @@ where ) } - /// Sends a packet from the first context to the second context. + /// Sends a packet from the first context to the second context by + /// submitting on receive packet on the second context. + /// /// The IBC packet is created by an IBC application on the first context. - pub fn send_packet_on_a(&mut self, packet: Packet, signer: Signer) { + pub fn submit_packet_on_b(&mut self, packet: Packet, signer: Signer) { let conn_id_on_a = self .ctx_a .ibc_store() @@ -347,7 +349,7 @@ where .client_id() .clone(); - TypedRelayerOps::::send_packet_on_a( + TypedRelayerOps::::submit_packet_on_b( &mut self.ctx_a, &mut self.ctx_b, packet, @@ -356,4 +358,187 @@ where signer, ) } + + /// Times out a packet from the first context to the second context by waiting + /// for the timeout period and then sending a timeout packet to the first context. + /// + /// The IBC packet is created by an IBC application on the first context. + pub fn timeout_packet_from_a(&mut self, packet: Packet, signer: Signer) { + let conn_id_on_a = self + .ctx_a + .ibc_store() + .channel_end(&ChannelEndPath::new( + &packet.port_id_on_a, + &packet.chan_id_on_a, + )) + .expect("connection exists") + .connection_hops()[0] + .clone(); + + let conn_id_on_b = self + .ctx_b + .ibc_store() + .channel_end(&ChannelEndPath::new( + &packet.port_id_on_b, + &packet.chan_id_on_b, + )) + .expect("connection exists") + .connection_hops()[0] + .clone(); + + let client_id_on_a = self + .ctx_a + .ibc_store() + .connection_end(&conn_id_on_a) + .expect("connection exists") + .client_id() + .clone(); + + let client_id_on_b = self + .ctx_b + .ibc_store() + .connection_end(&conn_id_on_b) + .expect("connection exists") + .client_id() + .clone(); + + TypedRelayerOps::::timeout_packet_from_a( + &mut self.ctx_a, + &mut self.ctx_b, + packet, + client_id_on_a, + client_id_on_b, + signer, + ) + } + + /// Timeouts a packet from the first context to the second context by closing the + /// corresponding channel is closed and then sending a timeout packet to the first context. + /// + /// The IBC packet is created by an IBC application on the first context. + pub fn timeout_packet_from_a_on_channel_close(&mut self, packet: Packet, signer: Signer) { + let conn_id_on_a = self + .ctx_a + .ibc_store() + .channel_end(&ChannelEndPath::new( + &packet.port_id_on_a, + &packet.chan_id_on_a, + )) + .expect("connection exists") + .connection_hops()[0] + .clone(); + + let conn_id_on_b = self + .ctx_b + .ibc_store() + .channel_end(&ChannelEndPath::new( + &packet.port_id_on_b, + &packet.chan_id_on_b, + )) + .expect("connection exists") + .connection_hops()[0] + .clone(); + + let client_id_on_a = self + .ctx_a + .ibc_store() + .connection_end(&conn_id_on_a) + .expect("connection exists") + .client_id() + .clone(); + + let client_id_on_b = self + .ctx_b + .ibc_store() + .connection_end(&conn_id_on_b) + .expect("connection exists") + .client_id() + .clone(); + + TypedRelayerOps::::timeout_packet_from_a_on_channel_close( + &mut self.ctx_a, + &mut self.ctx_b, + packet, + client_id_on_a, + client_id_on_b, + signer, + ) + } + + /// Submit a + /// [`DummyTransferModule`](crate::testapp::ibc::applications::transfer::types::DummyTransferModule) + /// packet on the first context. + /// + /// Requires `serde` feature because of [`ibc::apps::transfer::handler::send_transfer`]. + #[cfg(feature = "serde")] + pub fn send_dummy_transfer_packet_on_a( + &mut self, + chan_id_on_a: ChannelId, + signer: Signer, + ) -> Packet { + use ibc::apps::transfer::handler::send_transfer; + use ibc::apps::transfer::types::msgs::transfer::MsgTransfer; + use ibc::apps::transfer::types::packet::PacketData; + use ibc::core::handler::types::events::IbcEvent; + use ibc::primitives::Timestamp; + + use crate::testapp::ibc::applications::transfer::types::DummyTransferModule; + + // generate packet for DummyTransferModule + let packet_data = PacketData { + token: "1000uibc".parse().expect("valid prefixed coin"), + sender: signer.clone(), + receiver: signer.clone(), + memo: "sample memo".into(), + }; + + // packet with ibc metadata + // either height timeout or timestamp timeout must be set + let msg = MsgTransfer { + port_id_on_a: PortId::transfer(), + chan_id_on_a: chan_id_on_a.clone(), + packet_data, + // setting timeout height to 10 blocks from B's current height. + timeout_height_on_b: self.get_ctx_b().latest_height().add(10).into(), + // not setting timeout timestamp. + timeout_timestamp_on_b: Timestamp::none(), + }; + + // module creates the send_packet + send_transfer( + self.get_ctx_a_mut().ibc_store_mut(), + &mut DummyTransferModule, + msg, + ) + .expect("successfully created send_packet"); + + // send_packet wasn't committed, hence produce a block + self.get_ctx_a_mut().advance_block_height(); + + // retrieve the send_packet event + let Some(IbcEvent::SendPacket(send_packet_event)) = self + .get_ctx_a() + .ibc_store() + .events + .lock() + .iter() + .rev() + .nth(2) + .cloned() + else { + panic!("unexpected event") + }; + + // create the IBC packet type + Packet { + port_id_on_a: send_packet_event.port_id_on_a().clone(), + chan_id_on_a: send_packet_event.chan_id_on_a().clone(), + seq_on_a: *send_packet_event.seq_on_a(), + data: send_packet_event.packet_data().to_vec(), + timeout_height_on_b: *send_packet_event.timeout_height_on_b(), + timeout_timestamp_on_b: *send_packet_event.timeout_timestamp_on_b(), + port_id_on_b: send_packet_event.port_id_on_b().clone(), + chan_id_on_b: send_packet_event.chan_id_on_b().clone(), + } + } } diff --git a/ibc-testkit/src/relayer/error.rs b/ibc-testkit/src/relayer/error.rs index 2e5c368c8..20a995461 100644 --- a/ibc-testkit/src/relayer/error.rs +++ b/ibc-testkit/src/relayer/error.rs @@ -8,13 +8,13 @@ use ibc::core::host::types::identifiers::ClientId; pub enum RelayerError { /// client state on destination chain not found, (client id: `{client_id}`) ClientStateNotFound { client_id: ClientId }, - /// the client on destination chain is already up-to-date (client id: `{client_id}`, source height: `{source_height}`, dest height: `{destination_height}`) + /// the client on the destination chain is already up-to-date (client id: `{client_id}`, source height: `{source_height}`, dest height: `{destination_height}`) ClientAlreadyUpToDate { client_id: ClientId, source_height: Height, destination_height: Height, }, - /// the client on destination chain is at a higher height (client id: `{client_id}`, source height: `{source_height}`, dest height: `{destination_height}`) + /// the client on the destination chain is at a higher height (client id: `{client_id}`, source height: `{source_height}`, dest height: `{destination_height}`) ClientAtHigherHeight { client_id: ClientId, source_height: Height, diff --git a/ibc-testkit/src/relayer/integration.rs b/ibc-testkit/src/relayer/integration.rs index 85df3cd9c..145ed5004 100644 --- a/ibc-testkit/src/relayer/integration.rs +++ b/ibc-testkit/src/relayer/integration.rs @@ -1,25 +1,18 @@ -use core::str::FromStr; - -use ibc::apps::transfer::handler::send_transfer; -use ibc::apps::transfer::types::msgs::transfer::MsgTransfer; -use ibc::apps::transfer::types::packet::PacketData; -use ibc::apps::transfer::types::PrefixedCoin; -use ibc::core::channel::types::packet::Packet; use ibc::core::client::context::client_state::ClientStateValidation; -use ibc::core::handler::types::events::IbcEvent; use ibc::core::host::types::identifiers::{ChannelId, ConnectionId, PortId}; -use ibc::primitives::Timestamp; use crate::context::TestContext; use crate::fixtures::core::signer::dummy_account_id; use crate::hosts::{HostClientState, TestHost}; use crate::relayer::context::RelayerContext; -use crate::testapp::ibc::applications::transfer::types::DummyTransferModule; use crate::testapp::ibc::core::types::DefaultIbcStore; -/// Integration test for IBC implementation. -/// This test creates clients, connections, channels, and sends packets between two [`TestHost`]s. -/// This uses [`DummyTransferModule`] to simulate the transfer of tokens between two contexts. +/// Integration test for IBC implementation. This test creates clients, +/// connections, channels between two [`TestHost`]s. +/// +/// If `serde` feature is enabled, this also exercises packet relay between [`TestHost`]s. This uses +/// [`DummyTransferModule`](crate::testapp::ibc::applications::transfer::types::DummyTransferModule) +/// to simulate the transfer of tokens between two contexts. pub fn ibc_integration_test() where A: TestHost, @@ -91,67 +84,82 @@ where assert_eq!(chan_id_on_a, ChannelId::new(1)); assert_eq!(chan_id_on_b, ChannelId::new(1)); - // send packet from A to B - - // generate packet for DummyTransferModule - let packet_data = PacketData { - token: PrefixedCoin::from_str("1000uibc").expect("valid prefixed coin"), - sender: signer.clone(), - receiver: signer.clone(), - memo: "sample memo".into(), - }; - - // packet with ibc metadata - // either height timeout or timestamp timeout must be set - let msg = MsgTransfer { - port_id_on_a: PortId::transfer(), - chan_id_on_a: chan_id_on_a.clone(), - packet_data, - // setting timeout height to 10 blocks from B's current height. - timeout_height_on_b: relayer.get_ctx_b().latest_height().add(10).into(), - // not setting timeout timestamp. - timeout_timestamp_on_b: Timestamp::none(), - }; - - // module creates the send_packet - send_transfer( - relayer.get_ctx_a_mut().ibc_store_mut(), - &mut DummyTransferModule, - msg, - ) - .expect("successfully created send_packet"); - - // send_packet wasn't committed, hence produce a block - relayer.get_ctx_a_mut().advance_block_height(); - - // retrieve the send_packet event - let Some(IbcEvent::SendPacket(send_packet_event)) = relayer - .get_ctx_a() - .ibc_store() - .events - .lock() - .iter() - .rev() - .nth(2) - .cloned() - else { - panic!("unexpected event") - }; - - // create the IBC packet type - let packet = Packet { - port_id_on_a: send_packet_event.port_id_on_a().clone(), - chan_id_on_a: send_packet_event.chan_id_on_a().clone(), - seq_on_a: *send_packet_event.seq_on_a(), - data: send_packet_event.packet_data().to_vec(), - timeout_height_on_b: *send_packet_event.timeout_height_on_b(), - timeout_timestamp_on_b: *send_packet_event.timeout_timestamp_on_b(), - port_id_on_b: send_packet_event.port_id_on_b().clone(), - chan_id_on_b: send_packet_event.chan_id_on_b().clone(), - }; - - // continue packet relay starting from recv_packet at B - relayer.send_packet_on_a(packet, signer); + #[cfg(feature = "serde")] + { + use ibc::core::handler::types::events::IbcEvent; + + { + // ------------------------ + // send packet from A to B + // ------------------------ + + let packet = + relayer.send_dummy_transfer_packet_on_a(chan_id_on_a.clone(), signer.clone()); + + // continue packet relay; submitting recv_packet at B + relayer.submit_packet_on_b(packet, signer.clone()); + + // retrieve the ack_packet event + let Some(IbcEvent::AcknowledgePacket(_)) = relayer + .get_ctx_a() + .ibc_store() + .events + .lock() + .last() + .cloned() + else { + panic!("unexpected event") + }; + } + + { + // -------------------------- + // timeout packet from A to B + // -------------------------- + + let packet = + relayer.send_dummy_transfer_packet_on_a(chan_id_on_a.clone(), signer.clone()); + + // timeout the packet on B; by never submitting the packet to B + relayer.timeout_packet_from_a(packet.clone(), signer.clone()); + + // retrieve the timeout_packet event + let Some(IbcEvent::TimeoutPacket(_)) = relayer + .get_ctx_a() + .ibc_store() + .events + .lock() + .last() + .cloned() + else { + panic!("unexpected event") + }; + } + + { + // ------------------------------------------------ + // timeout packet from A to B; using closed channel + // ------------------------------------------------ + + let packet = + relayer.send_dummy_transfer_packet_on_a(chan_id_on_a.clone(), signer.clone()); + + // timeout the packet on B; close the corresponding channel + relayer.timeout_packet_from_a_on_channel_close(packet.clone(), signer.clone()); + + // retrieve the timeout_packet event + let Some(IbcEvent::TimeoutPacket(_)) = relayer + .get_ctx_a() + .ibc_store() + .events + .lock() + .last() + .cloned() + else { + panic!("unexpected event") + }; + } + } } #[cfg(test)] diff --git a/ibc-testkit/src/relayer/mod.rs b/ibc-testkit/src/relayer/mod.rs index 5c70430ef..961de7885 100644 --- a/ibc-testkit/src/relayer/mod.rs +++ b/ibc-testkit/src/relayer/mod.rs @@ -1,7 +1,4 @@ pub mod context; pub mod error; -pub mod utils; - -// `ibc::apps::transfer::handler::send_transfer` requires `serde` -#[cfg(feature = "serde")] pub mod integration; +pub mod utils; diff --git a/ibc-testkit/src/relayer/utils.rs b/ibc-testkit/src/relayer/utils.rs index 9d4c96bd6..cd3c5f0a3 100644 --- a/ibc-testkit/src/relayer/utils.rs +++ b/ibc-testkit/src/relayer/utils.rs @@ -10,6 +10,7 @@ use ibc::core::channel::types::msgs::{ MsgTimeoutOnClose, PacketMsg, }; use ibc::core::channel::types::packet::Packet; +use ibc::core::channel::types::timeout::TimeoutHeight; use ibc::core::channel::types::Version as ChannelVersion; use ibc::core::client::context::client_state::ClientStateValidation; use ibc::core::client::context::ClientValidationContext; @@ -620,7 +621,7 @@ where }; } - /// `A` initiates the channel closing with the other end on `B`. + /// `A` initiates the channel closing, with the other end on `B`. /// `A` stops processing the channel. pub fn channel_close_init_on_a( ctx_a: &mut TestContext, @@ -949,14 +950,14 @@ where ctx_a.deliver(msg_for_a).expect("success"); - let Some(IbcEvent::ChannelClosed(_)) = ctx_a.ibc_store().events.lock().last().cloned() + let Some(IbcEvent::TimeoutPacket(_)) = ctx_a.ibc_store().events.lock().last().cloned() else { panic!("unexpected event") }; } /// Sends a packet from an IBC application on `A` to `B` using the IBC packet relay protocol. - pub fn send_packet_on_a( + pub fn submit_packet_on_b( ctx_a: &mut TestContext, ctx_b: &mut TestContext, packet: Packet, @@ -998,4 +999,88 @@ where signer.clone(), ); } + + /// Times out a packet from an IBC application on `A` to `B` after waiting timeout period. + pub fn timeout_packet_from_a( + ctx_a: &mut TestContext, + ctx_b: &mut TestContext, + packet: Packet, + client_id_on_a: ClientId, + client_id_on_b: ClientId, + signer: Signer, + ) { + // packet is passed from module + + let TimeoutHeight::At(timeout_height) = packet.timeout_height_on_b else { + panic!("timeout height is set") + }; + + // progress `B`'s block height to the timeout height. + // packet is timed out at the timeout height + 1 + while ctx_b.latest_height() <= timeout_height { + ctx_b.advance_block_height(); + } + + // update client on `A` with the latest header from `B`. + TypedRelayerOps::::update_client_on_a_with_sync( + ctx_a, + ctx_b, + client_id_on_a.clone(), + signer.clone(), + ); + + // timeout the packet on `A`. + TypedRelayerOps::::packet_timeout_on_a(ctx_a, ctx_b, packet.clone(), signer.clone()); + + // `A` has progressed; update client on `B` with the latest header from `A`. + TypedRelayerOps::::update_client_on_a_with_sync( + ctx_b, + ctx_a, + client_id_on_b, + signer.clone(), + ); + } + + /// Times out a packet from an IBC application on `A` to `B` after closing the channel. + pub fn timeout_packet_from_a_on_channel_close( + ctx_a: &mut TestContext, + ctx_b: &mut TestContext, + packet: Packet, + client_id_on_a: ClientId, + client_id_on_b: ClientId, + signer: Signer, + ) { + // packet is passed from module + + // close the channel on `A`. + TypedRelayerOps::::close_channel_on_a( + ctx_a, + ctx_b, + client_id_on_a.clone(), + packet.chan_id_on_a.clone(), + packet.port_id_on_a.clone(), + client_id_on_b.clone(), + packet.chan_id_on_b.clone(), + packet.port_id_on_b.clone(), + signer.clone(), + ); + + // timeout the packet on `A`. + TypedRelayerOps::::packet_timeout_on_close_on_a( + ctx_a, + ctx_b, + packet.clone(), + packet.chan_id_on_b.clone(), + packet.port_id_on_b.clone(), + signer.clone(), + ); + + // `A` has progressed; update client on `B` with the latest header from `A`. + TypedRelayerOps::::update_client_on_a_with_sync( + ctx_b, + ctx_a, + client_id_on_b, + signer.clone(), + ); + } } diff --git a/ibc-testkit/src/testapp/ibc/core/core_ctx.rs b/ibc-testkit/src/testapp/ibc/core/core_ctx.rs index 386a83efb..d650cccd1 100644 --- a/ibc-testkit/src/testapp/ibc/core/core_ctx.rs +++ b/ibc-testkit/src/testapp/ibc/core/core_ctx.rs @@ -647,7 +647,7 @@ where } /// Called upon client creation. - /// Increases the counter which keeps track of how many clients have been created. + /// Increases the counter, that keeps track of how many clients have been created. fn increase_client_counter(&mut self) -> Result<(), ContextError> { let current_sequence = self .client_counter @@ -699,7 +699,7 @@ where } /// Called upon connection identifier creation (Init or Try process). - /// Increases the counter which keeps track of how many connections have been created. + /// Increases the counter, that keeps track of how many connections have been created. fn increase_connection_counter(&mut self) -> Result<(), ContextError> { let current_sequence = self .conn_counter diff --git a/ibc-testkit/src/testapp/ibc/core/router/types.rs b/ibc-testkit/src/testapp/ibc/core/router/types.rs index b48cd7fbd..739c0ba4f 100644 --- a/ibc-testkit/src/testapp/ibc/core/router/types.rs +++ b/ibc-testkit/src/testapp/ibc/core/router/types.rs @@ -12,7 +12,7 @@ use crate::testapp::ibc::applications::transfer::types::DummyTransferModule; pub struct MockRouter { pub router: BTreeMap>, - /// Maps ports to the the module that owns it + /// Maps ports to the module that owns it pub port_to_module: BTreeMap, } diff --git a/ibc-testkit/src/utils/mod.rs b/ibc-testkit/src/utils/mod.rs index 80eb0bad4..94163e32e 100644 --- a/ibc-testkit/src/utils/mod.rs +++ b/ibc-testkit/src/utils/mod.rs @@ -1,13 +1,15 @@ use ibc::primitives::Timestamp; +#[cfg(feature = "serde")] +use serde::{de::DeserializeOwned, Serialize}; use tendermint::Time; -/// Returns a `Timestamp` representation of beginning of year 2023. +/// Returns a `Timestamp` representation of the beginning of year 2023. /// /// This is introduced to initialize [`StoreGenericTestContext`](crate::context::StoreGenericTestContext)s /// with the same latest timestamp by default. /// If two [`StoreGenericTestContext`](crate::context::StoreGenericTestContext) -/// are initialized using [`Time::now()`], second one will have a greater timestamp than the first one. -/// So, the latest header of the second context can not be submitted to first one. +/// are initialized using [`Time::now()`], the second one will have a greater timestamp than the first one. +/// So, the latest header of the second context cannot be submitted to first one. /// We can still set a custom timestamp via [`TestContextConfig`](crate::fixtures::core::context::TestContextConfig). pub fn year_2023() -> Timestamp { // Sun Jan 01 2023 00:00:00 GMT+0000 @@ -15,3 +17,26 @@ pub fn year_2023() -> Timestamp { .expect("should be a valid time") .into() } + +/// Utility function that asserts that the given JSON input can be +/// serialized into and deserialized from the specified type `T`. +#[cfg(feature = "serde")] +pub fn test_serialization_roundtrip(json_data: &str) +where + T: core::fmt::Debug + PartialEq + Serialize + DeserializeOwned, +{ + let parsed0 = serde_json::from_str::(json_data); + assert!(parsed0.is_ok()); + let parsed0 = parsed0.expect("should not fail"); + + let serialized = serde_json::to_string(&parsed0); + assert!(serialized.is_ok()); + let serialized = serialized.expect("should not fail"); + assert_eq!(serialized, json_data); + + let parsed1 = serde_json::from_str::(&serialized); + assert!(parsed1.is_ok()); + let parsed1 = parsed1.expect("should not fail"); + + assert_eq!(parsed0, parsed1); +} diff --git a/ibc/src/lib.rs b/ibc/src/lib.rs index 66b64d168..a6e22ba20 100644 --- a/ibc/src/lib.rs +++ b/ibc/src/lib.rs @@ -79,7 +79,7 @@ pub mod derive { /// - `#[execution()]` /// /// The argument to the `validation` or `execution` attributes may contain - /// lifetimes or generic types and even that types might be bounded by + /// lifetimes or generic types, and even that types might be bounded by /// traits. For instance: /// /// - `#[validation(Context)]` diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml new file mode 100644 index 000000000..26877042b --- /dev/null +++ b/tests-integration/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "tests-integration" +version = "0.1.0" +authors = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +readme = "README.md" +keywords = [ "blockchain", "consensus", "cosmos", "ibc", "tendermint" ] +publish = false +description = "Integration tests using `ibc-testkit` and the other IBC crates." + +[dependencies] +# external dependencies +serde = { workspace = true, optional = true } +serde_json = { workspace = true, optional = true } +subtle-encoding = { workspace = true } +tracing = { version = "0.1.40", default-features = false } + +# ibc dependencies +ibc = { workspace = true } +ibc-core-client-types = { workspace = true } +ibc-core-commitment-types = { workspace = true } +ibc-client-cw = { workspace = true } +ibc-client-tendermint-cw = { workspace = true } +ibc-client-tendermint-types = { workspace = true } +ibc-core-host-types = { workspace = true } +ibc-primitives = { workspace = true } +ibc-query = { workspace = true } +ibc-testkit = { workspace = true } + +# basecoin dependencies +basecoin-store = { version = "0.1.0" } + +# cosmos dependencies +tendermint = { workspace = true } +tendermint-testgen = { workspace = true } + +[dev_dependencies] +cosmwasm-std = { workspace = true } +hex = { version = "0.4.2" } +rstest = { workspace = true } +test-log = { version = "0.2.13", features = [ "trace" ] } +tendermint-rpc = { workspace = true } + +[features] +default = [ "std" ] +std = [ + "serde/std", + "serde_json/std", + "ibc/std", + "ibc/serde", + "ibc-testkit/serde", + "tendermint/std", + "dep:serde", + "dep:serde_json", +] diff --git a/tests-integration/README.md b/tests-integration/README.md new file mode 100644 index 000000000..cc6ec8863 --- /dev/null +++ b/tests-integration/README.md @@ -0,0 +1,3 @@ +Integration tests that make use of the types exposed by `ibc-testkit`. These +tests also depend upon the other IBC crates. They live in a separate crate, that +is not meant to be published, to avoid circular dependencies. diff --git a/tests-integration/src/lib.rs b/tests-integration/src/lib.rs new file mode 100644 index 000000000..7913c79d6 --- /dev/null +++ b/tests-integration/src/lib.rs @@ -0,0 +1 @@ +#![doc = include_str!("../README.md")] diff --git a/ibc-testkit/tests/applications/mod.rs b/tests-integration/tests/applications/mod.rs similarity index 100% rename from ibc-testkit/tests/applications/mod.rs rename to tests-integration/tests/applications/mod.rs diff --git a/ibc-testkit/tests/applications/nft_transfer.rs b/tests-integration/tests/applications/nft_transfer.rs similarity index 100% rename from ibc-testkit/tests/applications/nft_transfer.rs rename to tests-integration/tests/applications/nft_transfer.rs diff --git a/ibc-testkit/tests/applications/transfer.rs b/tests-integration/tests/applications/transfer.rs similarity index 100% rename from ibc-testkit/tests/applications/transfer.rs rename to tests-integration/tests/applications/transfer.rs diff --git a/tests-integration/tests/clients/ics07_tendermint/client_state.rs b/tests-integration/tests/clients/ics07_tendermint/client_state.rs new file mode 100644 index 000000000..9e2e3ece4 --- /dev/null +++ b/tests-integration/tests/clients/ics07_tendermint/client_state.rs @@ -0,0 +1,23 @@ +#[cfg(all(test, feature = "serde"))] +mod tests { + use ibc_testkit::utils::test_serialization_roundtrip; + use tendermint_rpc::endpoint::abci_query::AbciQuery; + + #[test] + fn serialization_roundtrip_no_proof() { + let json_data = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/data/json/client_state.json" + )); + test_serialization_roundtrip::(json_data); + } + + #[test] + fn serialization_roundtrip_with_proof() { + let json_data = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/data/json/client_state_proof.json" + )); + test_serialization_roundtrip::(json_data); + } +} diff --git a/tests-integration/tests/clients/ics07_tendermint/consensus_state.rs b/tests-integration/tests/clients/ics07_tendermint/consensus_state.rs new file mode 100644 index 000000000..564bb4715 --- /dev/null +++ b/tests-integration/tests/clients/ics07_tendermint/consensus_state.rs @@ -0,0 +1,23 @@ +#[cfg(feature = "serde")] +mod tests { + use ibc_testkit::utils::test_serialization_roundtrip; + use tendermint_rpc::endpoint::abci_query::AbciQuery; + + #[test] + fn serialization_roundtrip_no_proof() { + let json_data = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/data/json/consensus_state.json" + )); + test_serialization_roundtrip::(json_data); + } + + #[test] + fn serialization_roundtrip_with_proof() { + let json_data = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/data/json/consensus_state_proof.json" + )); + test_serialization_roundtrip::(json_data); + } +} diff --git a/tests-integration/tests/clients/ics07_tendermint/mod.rs b/tests-integration/tests/clients/ics07_tendermint/mod.rs new file mode 100644 index 000000000..620c017de --- /dev/null +++ b/tests-integration/tests/clients/ics07_tendermint/mod.rs @@ -0,0 +1,2 @@ +pub mod client_state; +pub mod consensus_state; diff --git a/tests-integration/tests/clients/mod.rs b/tests-integration/tests/clients/mod.rs new file mode 100644 index 000000000..cc3da1b01 --- /dev/null +++ b/tests-integration/tests/clients/mod.rs @@ -0,0 +1 @@ +pub mod ics07_tendermint; diff --git a/ibc-testkit/tests/core/ics02_client/create_client.rs b/tests-integration/tests/core/ics02_client/create_client.rs similarity index 96% rename from ibc-testkit/tests/core/ics02_client/create_client.rs rename to tests-integration/tests/core/ics02_client/create_client.rs index 3f8bd4bc8..4e5dd9e77 100644 --- a/ibc-testkit/tests/core/ics02_client/create_client.rs +++ b/tests-integration/tests/core/ics02_client/create_client.rs @@ -16,9 +16,9 @@ use ibc::core::host::types::path::{ClientConsensusStatePath, NextClientSequenceP use ibc::core::host::{ClientStateRef, ValidationContext}; use ibc_query::core::context::ProvableContext; use ibc_testkit::context::{MockContext, TendermintContext}; -use ibc_testkit::fixtures::clients::tendermint::{ - dummy_tendermint_header, dummy_tm_client_state_from_header, -}; +#[cfg(feature = "serde")] +use ibc_testkit::fixtures::clients::tendermint::dummy_tendermint_header; +use ibc_testkit::fixtures::clients::tendermint::dummy_tm_client_state_from_header; use ibc_testkit::fixtures::core::context::TestContextConfig; use ibc_testkit::fixtures::core::signer::dummy_account_id; use ibc_testkit::testapp::ibc::clients::mock::client_state::{ @@ -63,6 +63,7 @@ fn test_create_client_ok() { assert_eq!(ctx.client_state(&client_id).unwrap(), expected_client_state); } +#[cfg(feature = "serde")] #[test] fn test_tm_create_client_ok() { let signer = dummy_account_id(); @@ -100,6 +101,7 @@ fn test_tm_create_client_ok() { assert_eq!(ctx.client_state(&client_id).unwrap(), expected_client_state); } +#[cfg(feature = "serde")] #[test] fn test_invalid_frozen_tm_client_creation() { let signer = dummy_account_id(); diff --git a/ibc-testkit/tests/core/ics02_client/mod.rs b/tests-integration/tests/core/ics02_client/mod.rs similarity index 100% rename from ibc-testkit/tests/core/ics02_client/mod.rs rename to tests-integration/tests/core/ics02_client/mod.rs diff --git a/ibc-testkit/tests/core/ics02_client/recover_client.rs b/tests-integration/tests/core/ics02_client/recover_client.rs similarity index 99% rename from ibc-testkit/tests/core/ics02_client/recover_client.rs rename to tests-integration/tests/core/ics02_client/recover_client.rs index 28f1de076..f40f15f52 100644 --- a/ibc-testkit/tests/core/ics02_client/recover_client.rs +++ b/tests-integration/tests/core/ics02_client/recover_client.rs @@ -284,6 +284,6 @@ fn test_recover_client_with_matching_heights() { signer, }; - dbg!(recover_client::validate(ctx.ibc_store(), msg)) + recover_client::validate(ctx.ibc_store(), msg) .expect_err("expected client recovery validation to fail"); } diff --git a/ibc-testkit/tests/core/ics02_client/update_client.rs b/tests-integration/tests/core/ics02_client/update_client.rs similarity index 99% rename from ibc-testkit/tests/core/ics02_client/update_client.rs rename to tests-integration/tests/core/ics02_client/update_client.rs index 9dbc49030..d5f19f8eb 100644 --- a/ibc-testkit/tests/core/ics02_client/update_client.rs +++ b/tests-integration/tests/core/ics02_client/update_client.rs @@ -1562,7 +1562,7 @@ where /// Serves to test both ICS-26 `dispatch` & `build_client_update_datagram` functions. /// Implements a "ping pong" of client update messages, so that two chains repeatedly -/// process a client update message and update their height in succession. +/// process a client update message and update their height in sequence. #[rstest] fn client_update_ping_pong() { let chain_a_start_height = Height::new(1, 11).unwrap(); diff --git a/ibc-testkit/tests/core/ics02_client/upgrade_client.rs b/tests-integration/tests/core/ics02_client/upgrade_client.rs similarity index 100% rename from ibc-testkit/tests/core/ics02_client/upgrade_client.rs rename to tests-integration/tests/core/ics02_client/upgrade_client.rs diff --git a/ibc-testkit/tests/core/ics03_connection/conn_open_ack.rs b/tests-integration/tests/core/ics03_connection/conn_open_ack.rs similarity index 96% rename from ibc-testkit/tests/core/ics03_connection/conn_open_ack.rs rename to tests-integration/tests/core/ics03_connection/conn_open_ack.rs index 37733b60c..8860e3227 100644 --- a/ibc-testkit/tests/core/ics03_connection/conn_open_ack.rs +++ b/tests-integration/tests/core/ics03_connection/conn_open_ack.rs @@ -1,6 +1,5 @@ use core::str::FromStr; -use basecoin_store::impls::{GrowingStore, InMemoryStore, RevertibleStore}; use ibc::core::client::types::Height; use ibc::core::commitment_types::commitment::CommitmentPrefix; use ibc::core::connection::types::error::ConnectionError; @@ -20,7 +19,7 @@ use ibc_testkit::fixtures::core::context::TestContextConfig; use ibc_testkit::fixtures::{Expect, Fixture}; use ibc_testkit::hosts::MockHost; use ibc_testkit::testapp::ibc::core::router::MockRouter; -use ibc_testkit::testapp::ibc::core::types::{LightClientState, MockIbcStore}; +use ibc_testkit::testapp::ibc::core::types::{DefaultIbcStore, LightClientState}; use test_log::test; enum Ctx { @@ -168,7 +167,7 @@ fn conn_open_ack_execute(fxt: &mut Fixture, expect: Expect let IbcEvent::OpenAckConnection(conn_open_try_event) = event else { unreachable!() }; - let conn_end = >> as ValidationContext>::connection_end( + let conn_end = ::connection_end( &fxt.ctx, conn_open_try_event.conn_id_on_a(), ) diff --git a/ibc-testkit/tests/core/ics03_connection/conn_open_confirm.rs b/tests-integration/tests/core/ics03_connection/conn_open_confirm.rs similarity index 100% rename from ibc-testkit/tests/core/ics03_connection/conn_open_confirm.rs rename to tests-integration/tests/core/ics03_connection/conn_open_confirm.rs diff --git a/ibc-testkit/tests/core/ics03_connection/conn_open_init.rs b/tests-integration/tests/core/ics03_connection/conn_open_init.rs similarity index 100% rename from ibc-testkit/tests/core/ics03_connection/conn_open_init.rs rename to tests-integration/tests/core/ics03_connection/conn_open_init.rs diff --git a/ibc-testkit/tests/core/ics03_connection/conn_open_try.rs b/tests-integration/tests/core/ics03_connection/conn_open_try.rs similarity index 100% rename from ibc-testkit/tests/core/ics03_connection/conn_open_try.rs rename to tests-integration/tests/core/ics03_connection/conn_open_try.rs diff --git a/ibc-testkit/tests/core/ics03_connection/mod.rs b/tests-integration/tests/core/ics03_connection/mod.rs similarity index 100% rename from ibc-testkit/tests/core/ics03_connection/mod.rs rename to tests-integration/tests/core/ics03_connection/mod.rs diff --git a/ibc-testkit/tests/core/ics04_channel/acknowledgement.rs b/tests-integration/tests/core/ics04_channel/acknowledgement.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/acknowledgement.rs rename to tests-integration/tests/core/ics04_channel/acknowledgement.rs diff --git a/ibc-testkit/tests/core/ics04_channel/chan_close_confirm.rs b/tests-integration/tests/core/ics04_channel/chan_close_confirm.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/chan_close_confirm.rs rename to tests-integration/tests/core/ics04_channel/chan_close_confirm.rs diff --git a/ibc-testkit/tests/core/ics04_channel/chan_close_init.rs b/tests-integration/tests/core/ics04_channel/chan_close_init.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/chan_close_init.rs rename to tests-integration/tests/core/ics04_channel/chan_close_init.rs diff --git a/ibc-testkit/tests/core/ics04_channel/chan_open_ack.rs b/tests-integration/tests/core/ics04_channel/chan_open_ack.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/chan_open_ack.rs rename to tests-integration/tests/core/ics04_channel/chan_open_ack.rs diff --git a/ibc-testkit/tests/core/ics04_channel/chan_open_confirm.rs b/tests-integration/tests/core/ics04_channel/chan_open_confirm.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/chan_open_confirm.rs rename to tests-integration/tests/core/ics04_channel/chan_open_confirm.rs diff --git a/ibc-testkit/tests/core/ics04_channel/chan_open_init.rs b/tests-integration/tests/core/ics04_channel/chan_open_init.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/chan_open_init.rs rename to tests-integration/tests/core/ics04_channel/chan_open_init.rs diff --git a/ibc-testkit/tests/core/ics04_channel/chan_open_try.rs b/tests-integration/tests/core/ics04_channel/chan_open_try.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/chan_open_try.rs rename to tests-integration/tests/core/ics04_channel/chan_open_try.rs diff --git a/ibc-testkit/tests/core/ics04_channel/mod.rs b/tests-integration/tests/core/ics04_channel/mod.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/mod.rs rename to tests-integration/tests/core/ics04_channel/mod.rs diff --git a/ibc-testkit/tests/core/ics04_channel/recv_packet.rs b/tests-integration/tests/core/ics04_channel/recv_packet.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/recv_packet.rs rename to tests-integration/tests/core/ics04_channel/recv_packet.rs diff --git a/ibc-testkit/tests/core/ics04_channel/send_packet.rs b/tests-integration/tests/core/ics04_channel/send_packet.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/send_packet.rs rename to tests-integration/tests/core/ics04_channel/send_packet.rs diff --git a/ibc-testkit/tests/core/ics04_channel/timeout.rs b/tests-integration/tests/core/ics04_channel/timeout.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/timeout.rs rename to tests-integration/tests/core/ics04_channel/timeout.rs diff --git a/ibc-testkit/tests/core/ics04_channel/timeout_on_close.rs b/tests-integration/tests/core/ics04_channel/timeout_on_close.rs similarity index 100% rename from ibc-testkit/tests/core/ics04_channel/timeout_on_close.rs rename to tests-integration/tests/core/ics04_channel/timeout_on_close.rs diff --git a/ibc-testkit/tests/core/mod.rs b/tests-integration/tests/core/mod.rs similarity index 100% rename from ibc-testkit/tests/core/mod.rs rename to tests-integration/tests/core/mod.rs diff --git a/ibc-testkit/tests/core/router.rs b/tests-integration/tests/core/router.rs similarity index 100% rename from ibc-testkit/tests/core/router.rs rename to tests-integration/tests/core/router.rs diff --git a/ibc-testkit/tests/cosmwasm/fixture.rs b/tests-integration/tests/cosmwasm/fixture.rs similarity index 100% rename from ibc-testkit/tests/cosmwasm/fixture.rs rename to tests-integration/tests/cosmwasm/fixture.rs diff --git a/ibc-testkit/tests/cosmwasm/helper.rs b/tests-integration/tests/cosmwasm/helper.rs similarity index 92% rename from ibc-testkit/tests/cosmwasm/helper.rs rename to tests-integration/tests/cosmwasm/helper.rs index 666a7e83f..f1c9ad74b 100644 --- a/ibc-testkit/tests/cosmwasm/helper.rs +++ b/tests-integration/tests/cosmwasm/helper.rs @@ -25,8 +25,8 @@ pub fn dummy_sov_consensus_state(timestamp: IbcTimestamp) -> ConsensusState { ) } -/// Returns a mock environment with the current timestamp. This is define to use -/// for testing client expiry and other time-sensitive operations. +/// 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(); diff --git a/ibc-testkit/tests/cosmwasm/mod.rs b/tests-integration/tests/cosmwasm/mod.rs similarity index 100% rename from ibc-testkit/tests/cosmwasm/mod.rs rename to tests-integration/tests/cosmwasm/mod.rs diff --git a/ibc-testkit/tests/data/json/client_state.json b/tests-integration/tests/data/json/client_state.json similarity index 100% rename from ibc-testkit/tests/data/json/client_state.json rename to tests-integration/tests/data/json/client_state.json diff --git a/ibc-testkit/tests/data/json/client_state_proof.json b/tests-integration/tests/data/json/client_state_proof.json similarity index 100% rename from ibc-testkit/tests/data/json/client_state_proof.json rename to tests-integration/tests/data/json/client_state_proof.json diff --git a/ibc-testkit/tests/data/json/consensus_state.json b/tests-integration/tests/data/json/consensus_state.json similarity index 100% rename from ibc-testkit/tests/data/json/consensus_state.json rename to tests-integration/tests/data/json/consensus_state.json diff --git a/ibc-testkit/tests/data/json/consensus_state_proof.json b/tests-integration/tests/data/json/consensus_state_proof.json similarity index 100% rename from ibc-testkit/tests/data/json/consensus_state_proof.json rename to tests-integration/tests/data/json/consensus_state_proof.json diff --git a/ibc-testkit/tests/mod.rs b/tests-integration/tests/mod.rs similarity index 92% rename from ibc-testkit/tests/mod.rs rename to tests-integration/tests/mod.rs index 8b6f6bf3e..d9b64093d 100644 --- a/ibc-testkit/tests/mod.rs +++ b/tests-integration/tests/mod.rs @@ -7,5 +7,6 @@ rust_2018_idioms )] pub mod applications; +pub mod clients; pub mod core; pub mod cosmwasm;