diff --git a/.changelog/unreleased/improvements/1212-update-ibc-proto-and-tendermint-deps.md b/.changelog/unreleased/improvements/1212-update-ibc-proto-and-tendermint-deps.md new file mode 100644 index 000000000..849ca0ac6 --- /dev/null +++ b/.changelog/unreleased/improvements/1212-update-ibc-proto-and-tendermint-deps.md @@ -0,0 +1,4 @@ +- 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)) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 321a36376..33ee6a971 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,11 +7,26 @@ updates: directory: "/" schedule: interval: "weekly" + ignore: + - dependency-name: "tendermint*" + - dependency-name: "ibc*" + - dependency-name: "cosmwasm*" + - dependency-name: "cw*" - package-ecosystem: "cargo" directory: "ci/no-std-check" schedule: interval: "weekly" + ignore: + - dependency-name: "tendermint*" + - dependency-name: "ibc*" + - dependency-name: "cosmwasm*" + - dependency-name: "cw*" - package-ecosystem: "cargo" directory: "ci/cw-check" schedule: interval: "weekly" + ignore: + - dependency-name: "tendermint*" + - dependency-name: "ibc*" + - dependency-name: "cosmwasm*" + - dependency-name: "cw*" diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml index c9e11b972..307efeee0 100644 --- a/.github/workflows/code-quality.yaml +++ b/.github/workflows/code-quality.yaml @@ -10,7 +10,7 @@ jobs: FD_VERSION: 9.0.0 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Whitestapace lints run: bash ci/code-quality/whitespace-lints.sh @@ -19,3 +19,9 @@ jobs: uses: crate-ci/typos@v1.19.0 # NOTE: Newer versions detect false positives. Test locally before upgrading. with: config: ./.github/typos.toml + + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: baptiste0928/cargo-install@v3 + with: + crate: taplo-cli + - run: taplo fmt --check diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 8e2a0a008..e6e522820 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -136,7 +136,7 @@ jobs: timeout-minutes: 30 env: CARGO_MSRV_VERSION: 0.16.0-beta.20 - MSRV: 1.72 + MSRV: 1.71.1 strategy: matrix: param: diff --git a/Cargo.toml b/Cargo.toml index fc9a7c5ad..184204497 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,91 +2,91 @@ resolver = "2" # members sorted by publishing order to `crates.io` members = [ - "ibc-derive", - "ibc-primitives", - "ibc-core/ics24-host/types", - "ibc-core/ics26-routing/types", - "ibc-core/ics23-commitment/types", - "ibc-core/ics02-client/types", - "ibc-core/ics03-connection/types", - "ibc-core/ics04-channel/types", - "ibc-core/ics25-handler/types", - "ibc-core/ics02-client/context", - "ibc-core/ics24-host", - "ibc-core/ics26-routing", - "ibc-core/ics02-client", - "ibc-core/ics03-connection", - "ibc-core/ics04-channel", - "ibc-core/ics25-handler", - "ibc-core", - "ibc-clients/ics07-tendermint/types", - "ibc-clients/ics07-tendermint", - "ibc-clients/ics08-wasm/types", - "ibc-clients/cw-context", - "ibc-clients/ics07-tendermint/cw-contract", - "ibc-clients", - "ibc-apps/ics20-transfer/types", - "ibc-apps/ics20-transfer", - "ibc-apps/ics721-nft-transfer/types", - "ibc-apps/ics721-nft-transfer", - "ibc-apps", - "ibc-core/ics24-host/cosmos", - "ibc-data-types", - "ibc", - "ibc-query", - "ibc-testkit", + "ibc-derive", + "ibc-primitives", + "ibc-core/ics24-host/types", + "ibc-core/ics26-routing/types", + "ibc-core/ics23-commitment/types", + "ibc-core/ics02-client/types", + "ibc-core/ics03-connection/types", + "ibc-core/ics04-channel/types", + "ibc-core/ics25-handler/types", + "ibc-core/ics02-client/context", + "ibc-core/ics24-host", + "ibc-core/ics26-routing", + "ibc-core/ics02-client", + "ibc-core/ics03-connection", + "ibc-core/ics04-channel", + "ibc-core/ics25-handler", + "ibc-core", + "ibc-clients/ics07-tendermint/types", + "ibc-clients/ics07-tendermint", + "ibc-clients/ics08-wasm/types", + "ibc-clients/cw-context", + "ibc-clients/ics07-tendermint/cw-contract", + "ibc-clients", + "ibc-apps/ics20-transfer/types", + "ibc-apps/ics20-transfer", + "ibc-apps/ics721-nft-transfer/types", + "ibc-apps/ics721-nft-transfer", + "ibc-apps", + "ibc-core/ics24-host/cosmos", + "ibc-data-types", + "ibc", + "ibc-query", + "ibc-testkit", ] exclude = [ - "ci/cw-check", - "ci/no-std-check", + "ci/cw-check", + "ci/no-std-check", ] [workspace.package] version = "0.52.0" license = "Apache-2.0" edition = "2021" -rust-version = "1.72" +rust-version = "1.71.1" readme = "README.md" repository = "https://github.com/cosmos/ibc-rs" -authors = ["Informal Systems "] +authors = [ "Informal Systems " ] [workspace.dependencies] # external dependencies -base64 = { version = "0.21", default-features = false } -borsh = { version = "0.10", default-features = false } -displaydoc = { version = "0.2", default-features = false } -prost = { version = "0.12", default-features = false } -derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] } -rstest = "0.18.2" -schemars = { version = "0.8.15" } -sha2 = { version = "0.10.8", default-features = false } -serde = { version = "1.0", default-features = false } -serde_json = { package = "serde-json-wasm", version = "1.0.1", default-features = false } -subtle-encoding = { version = "0.5", default-features = false } +base64 = { version = "0.21", default-features = false } +borsh = { version = "0.10", default-features = false } +displaydoc = { version = "0.2", default-features = false } +prost = { version = "0.12", default-features = false } +derive_more = { version = "0.99.17", default-features = false, features = [ "from", "into", "display", "try_into" ] } +rstest = { version = "0.19" } +schemars = { version = "0.8.15" } +sha2 = { version = "0.10.8", default-features = false } +serde = { version = "1.0", default-features = false } +serde_json = { package = "serde-json-wasm", version = "1.0.1", default-features = false } +subtle-encoding = { version = "0.5", default-features = false } # ibc dependencies -ibc = { version = "0.52.0", path = "./ibc", default-features = false } -ibc-core = { version = "0.52.0", path = "./ibc-core", default-features = false } -ibc-clients = { version = "0.52.0", path = "./ibc-clients", default-features = false } -ibc-apps = { version = "0.52.0", path = "./ibc-apps", default-features = false } -ibc-primitives = { version = "0.52.0", path = "./ibc-primitives", default-features = false } -ibc-testkit = { version = "0.52.0", path = "./ibc-testkit", default-features = false } +ibc = { version = "0.52.0", path = "./ibc", default-features = false } +ibc-core = { version = "0.52.0", path = "./ibc-core", default-features = false } +ibc-clients = { version = "0.52.0", path = "./ibc-clients", default-features = false } +ibc-apps = { version = "0.52.0", path = "./ibc-apps", default-features = false } +ibc-primitives = { version = "0.52.0", path = "./ibc-primitives", default-features = false } +ibc-testkit = { version = "0.52.0", path = "./ibc-testkit", default-features = false } -ibc-derive = { version = "0.7.0", path = "./ibc-derive" } +ibc-derive = { version = "0.7.0", path = "./ibc-derive" } -ibc-core-client = { version = "0.52.0", path = "./ibc-core/ics02-client", default-features = false } -ibc-core-connection = { version = "0.52.0", path = "./ibc-core/ics03-connection", default-features = false } -ibc-core-channel = { version = "0.52.0", path = "./ibc-core/ics04-channel", default-features = false } -ibc-core-host = { version = "0.52.0", path = "./ibc-core/ics24-host", default-features = false } -ibc-core-handler = { version = "0.52.0", path = "./ibc-core/ics25-handler", default-features = false } -ibc-core-router = { version = "0.52.0", path = "./ibc-core/ics26-routing", default-features = false } +ibc-core-client = { version = "0.52.0", path = "./ibc-core/ics02-client", default-features = false } +ibc-core-connection = { version = "0.52.0", path = "./ibc-core/ics03-connection", default-features = false } +ibc-core-channel = { version = "0.52.0", path = "./ibc-core/ics04-channel", default-features = false } +ibc-core-host = { version = "0.52.0", path = "./ibc-core/ics24-host", default-features = false } +ibc-core-handler = { version = "0.52.0", path = "./ibc-core/ics25-handler", default-features = false } +ibc-core-router = { version = "0.52.0", path = "./ibc-core/ics26-routing", default-features = false } -ibc-client-cw = { version = "0.52.0", path = "./ibc-clients/cw-context", default-features = false } -ibc-client-tendermint = { version = "0.52.0", path = "./ibc-clients/ics07-tendermint", default-features = false } -ibc-client-tendermint-cw = { version = "0.52.0", path = "./ibc-clients/ics07-tendermint/cw-contract", default-features = false } +ibc-client-cw = { version = "0.52.0", path = "./ibc-clients/cw-context", default-features = false } +ibc-client-tendermint = { version = "0.52.0", path = "./ibc-clients/ics07-tendermint", default-features = false } +ibc-client-tendermint-cw = { version = "0.52.0", path = "./ibc-clients/ics07-tendermint/cw-contract", default-features = false } -ibc-app-transfer = { version = "0.52.0", path = "./ibc-apps/ics20-transfer", default-features = false } -ibc-app-nft-transfer = { version = "0.52.0", path = "./ibc-apps/ics721-nft-transfer", default-features = false } +ibc-app-transfer = { version = "0.52.0", path = "./ibc-apps/ics20-transfer", default-features = false } +ibc-app-nft-transfer = { version = "0.52.0", path = "./ibc-apps/ics721-nft-transfer", default-features = false } ibc-core-client-context = { version = "0.52.0", path = "./ibc-core/ics02-client/context", default-features = false } ibc-core-client-types = { version = "0.52.0", path = "./ibc-core/ics02-client/types", default-features = false } @@ -102,25 +102,25 @@ ibc-client-wasm-types = { version = "0.52.0", path = "./ibc-clients/ics08- ibc-app-transfer-types = { version = "0.52.0", path = "./ibc-apps/ics20-transfer/types", default-features = false } ibc-app-nft-transfer-types = { version = "0.52.0", path = "./ibc-apps/ics721-nft-transfer/types", default-features = false } -ibc-proto = { version = "0.43.0", default-features = false } +ibc-proto = { version = "0.44.0", default-features = false } # cosmos dependencies -tendermint = { version = "0.35.0", default-features = false } -tendermint-light-client = { version = "0.35.0", default-features = false } -tendermint-light-client-verifier = { version = "0.35.0", default-features = false } -tendermint-proto = { version = "0.35.0", default-features = false } -tendermint-rpc = { version = "0.35.0", default-features = false } -tendermint-testgen = { version = "0.35.0", default-features = false } +tendermint = { version = "0.36.0", default-features = false } +tendermint-light-client = { version = "0.36.0", default-features = false } +tendermint-light-client-verifier = { version = "0.36.0", default-features = false } +tendermint-proto = { version = "0.36.0", default-features = false } +tendermint-rpc = { version = "0.36.0", default-features = false } +tendermint-testgen = { version = "0.36.0", default-features = false } # cosmwasm dependencies ### Note: Kept at the following version to match the CosmWasm module version ### used by chains supporting the wasm-enabled version of ibc-go v7.3 ### (This is the min version of `ibc-go` that supports `08-wasm` light clients) -cosmwasm-schema = { version = "1.5.4" } -cosmwasm-std = { version = "1.5.4" } -cosmwasm-vm = { version = "1.5.4" } -cw-storage-plus = { version = "1.2.0" } +cosmwasm-schema = { version = "1.5.4" } +cosmwasm-std = { version = "1.5.4" } +cosmwasm-vm = { version = "1.5.4" } +cw-storage-plus = { version = "1.2.0" } # parity dependencies -parity-scale-codec = { version = "3.6.5", default-features = false, features = ["full"] } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } +parity-scale-codec = { version = "3.6.5", default-features = false, features = [ "full" ] } +scale-info = { version = "2.10.0", default-features = false, features = [ "derive" ] } diff --git a/Makefile b/Makefile index ee1a28e72..7947b9501 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ install-tools: ## Install development tools including nightly rustfmt, cargo-hac rustup component add rustfmt --toolchain nightly cargo install cargo-hack cargo install cargo-release - cargo install typos-cli + cargo install typos-cli taplo-cli lint: ## Lint the code using rustfmt, clippy and whitespace lints. cargo +nightly fmt --all --check @@ -16,6 +16,7 @@ lint: ## Lint the code using rustfmt, clippy and whitespace lints. cargo clippy --all-targets --no-default-features typos --config $(CURDIR)/.github/typos.toml bash ./ci/code-quality/whitespace-lints.sh + taplo fmt --check check-features: ## Check that project compiles with all combinations of features. cargo hack check --workspace --feature-powerset --exclude-features default @@ -36,10 +37,10 @@ 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 + cargo release --workspace --no-push --no-tag --no-publish --exclude ibc-derive --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 --allow-branch HEAD --execute + cargo release --workspace --no-push --no-tag --exclude ibc-derive --exclude ibc-client-tendermint-cw --allow-branch HEAD --execute 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 881f7c9b5..06d94af6b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -25,6 +25,21 @@ Our release process is as follows: 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 + ``` + 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 the documentation compiles and seems up-to-date and coherent. Fix any potential issues here and push them to the release PR. @@ -41,7 +56,9 @@ Our release process is as follows: 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]. - 2. In case the problems arise from the source files, fix them, bump a new + 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, diff --git a/ci/cw-check/Cargo.lock b/ci/cw-check/Cargo.lock index db9237c00..e8a733fce 100644 --- a/ci/cw-check/Cargo.lock +++ b/ci/cw-check/Cargo.lock @@ -577,9 +577,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hex" @@ -891,9 +891,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af781637b107aa33042426c9d17b181ced05ae97b1d88dba50f40f19ad44e36f" +checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" dependencies = [ "base64 0.22.0", "bytes", @@ -955,7 +955,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1024,17 +1024,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "num-traits" version = "0.2.18" @@ -1261,9 +1250,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +checksum = "7f55c82c700538496bdc329bb4918a81f87cc8888811bd123cf325a0f2f8d309" dependencies = [ "dyn-clone", "schemars_derive", @@ -1273,14 +1262,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +checksum = "83263746fe5e32097f06356968a077f96089739c927a61450efa069905eec108" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] @@ -1299,9 +1288,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] @@ -1335,9 +1324,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2", "quote", @@ -1346,13 +1335,13 @@ dependencies = [ [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "330f01ce65a3a5fe59a60c82f3c9a024b573b8a6e875bd233fe5f934e71d54e3" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] @@ -1476,9 +1465,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f8a10105d0a7c4af0a242e23ed5a12519afe5cc0e68419da441bb5981a6802" +checksum = "8b50aae6ec24c3429149ad59b5b8d3374d7804d4c7d6125ceb97cb53907fb68d" dependencies = [ "bytes", "digest 0.10.7", @@ -1503,14 +1492,12 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff525d5540a9fc535c38dc0d92a98da3ee36fcdfbda99cecb9f3cce5cd4d41d7" +checksum = "46f193d04afde6592c20fd70788a10b8cb3823091c07456db70d8a93f5fb99c1" dependencies = [ "bytes", "flex-error", - "num-derive", - "num-traits", "prost", "prost-types", "serde", diff --git a/ci/cw-check/Cargo.toml b/ci/cw-check/Cargo.toml index 86af97be6..fdb27f2cd 100644 --- a/ci/cw-check/Cargo.toml +++ b/ci/cw-check/Cargo.toml @@ -1,25 +1,25 @@ [package] edition = "2021" -name = "cw-check" +name = "cw-check" version = "0.1.0" [lib] -crate-type = ["cdylib", "rlib"] +crate-type = [ "cdylib", "rlib" ] [dependencies] -ibc-apps = { path = "../../ibc-apps", default_features = false, features = ["serde", "parity-scale-codec"] } -ibc-core = { path = "../../ibc-core", features = ["serde", "parity-scale-codec", "schema"] } -cosmwasm-std = { version = "1.5.4", default-features = false } +ibc-apps = { path = "../../ibc-apps", default_features = false, features = [ "serde", "parity-scale-codec" ] } +ibc-core = { path = "../../ibc-core", features = [ "serde", "parity-scale-codec", "schema" ] } +cosmwasm-std = { version = "1.5.4", default-features = false } cosmwasm-schema = { version = "1.5.4", default-features = false } -serde_json = { package = "serde-json-wasm", version = "^1.0.1", default-features = false } -thiserror = { version = "^1.0", default-features = false } +serde_json = { package = "serde-json-wasm", version = "^1.0.1", default-features = false } +thiserror = { version = "^1.0", default-features = false } [profile.release] -lto = true -codegen-units = 1 -debug = false +lto = true +codegen-units = 1 +debug = false debug-assertions = false -opt-level = "s" -overflow-checks = true -panic = "abort" -rpath = false +opt-level = "s" +overflow-checks = true +panic = "abort" +rpath = false diff --git a/ci/no-std-check/Cargo.lock b/ci/no-std-check/Cargo.lock index 8b98fa57e..381a663b8 100644 --- a/ci/no-std-check/Cargo.lock +++ b/ci/no-std-check/Cargo.lock @@ -1120,9 +1120,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hermit-abi" @@ -1551,9 +1551,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af781637b107aa33042426c9d17b181ced05ae97b1d88dba50f40f19ad44e36f" +checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" dependencies = [ "base64 0.22.0", "borsh", @@ -1624,7 +1624,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1862,17 +1862,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "num-format" version = "0.4.4" @@ -2497,9 +2486,9 @@ checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] @@ -2524,9 +2513,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2", "quote", @@ -3067,9 +3056,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tendermint" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f8a10105d0a7c4af0a242e23ed5a12519afe5cc0e68419da441bb5981a6802" +checksum = "8b50aae6ec24c3429149ad59b5b8d3374d7804d4c7d6125ceb97cb53907fb68d" dependencies = [ "bytes", "digest 0.10.7", @@ -3096,9 +3085,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35678b66e819659617c2e83f9662b8544425694441990c07137904a07872d871" +checksum = "4216e487165e5dbd7af79952eaa0d5f06c5bde861eb76c690acd7f2d2a19395c" dependencies = [ "derive_more", "flex-error", @@ -3109,14 +3098,12 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff525d5540a9fc535c38dc0d92a98da3ee36fcdfbda99cecb9f3cce5cd4d41d7" +checksum = "46f193d04afde6592c20fd70788a10b8cb3823091c07456db70d8a93f5fb99c1" dependencies = [ "bytes", "flex-error", - "num-derive", - "num-traits", "prost", "prost-types", "serde", diff --git a/ci/no-std-check/Cargo.toml b/ci/no-std-check/Cargo.toml index 07dd884ac..ce66a2e6f 100644 --- a/ci/no-std-check/Cargo.toml +++ b/ci/no-std-check/Cargo.toml @@ -1,24 +1,24 @@ [package] -name = "no-std-check" -version = "0.1.0" -edition = "2021" +name = "no-std-check" +version = "0.1.0" +edition = "2021" resolver = "2" [dependencies] -ibc = { path = "../../ibc", default-features = false, features = ["serde"] } -ibc-proto = { version = "0.43", default-features = false, features = [ +ibc = { path = "../../ibc", default-features = false, features = [ "serde" ] } +ibc-proto = { version = "0.44", default-features = false, features = [ "parity-scale-codec", "borsh", "serde", ] } -tendermint = { version = "0.35", default-features = false } -tendermint-proto = { version = "0.35", default-features = false } -tendermint-light-client-verifier = { version = "0.35", default-features = false, features = ["rust-crypto"] } +tendermint = { version = "0.36", default-features = false } +tendermint-proto = { version = "0.36", default-features = false } +tendermint-light-client-verifier = { version = "0.36", default-features = false, features = [ "rust-crypto" ] } -sp-core = { version = "32.0", default-features = false, optional = true } -sp-io = { version = "34.0", default-features = false, optional = true } +sp-core = { version = "32.0", default-features = false, optional = true } +sp-io = { version = "34.0", default-features = false, optional = true } sp-runtime = { version = "35.0", default-features = false, optional = true } -sp-std = { version = "14.0", default-features = false, optional = true } +sp-std = { version = "14.0", default-features = false, optional = true } # The indirect dependency `syn` 2.0.4 has a bug that causes # compilation errors in `tendermint`. This is fixed in 2.0.5. @@ -26,6 +26,6 @@ sp-std = { version = "14.0", default-features = false, optional = true } syn = ">=2.0.5" [features] -panic-handler = [] -use-substrate = ["sp-core", "sp-io", "sp-runtime", "sp-std"] -substrate-std = ["sp-core/std", "sp-io/std", "sp-runtime/std", "sp-std/std"] +panic-handler = [ ] +use-substrate = [ "sp-core", "sp-io", "sp-runtime", "sp-std" ] +substrate-std = [ "sp-core/std", "sp-io/std", "sp-runtime/std", "sp-std/std" ] diff --git a/clippy.toml b/clippy.toml index 24256e918..76e4dff64 100644 --- a/clippy.toml +++ b/clippy.toml @@ -7,4 +7,4 @@ disallowed-types = [ disallowed-methods = [ "std::time::Duration::as_secs_f64", ] -msrv = "1.72" +msrv = "1.71.1" diff --git a/docs/dev-deps-graph.png b/docs/dev-deps-graph.png new file mode 100644 index 000000000..7386f9cf2 Binary files /dev/null and b/docs/dev-deps-graph.png differ diff --git a/ibc-apps/Cargo.toml b/ibc-apps/Cargo.toml index a6fe583b3..6ef3c6ac6 100644 --- a/ibc-apps/Cargo.toml +++ b/ibc-apps/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "applications", "token-transfer"] +keywords = [ "blockchain", "cosmos", "ibc", "applications", "token-transfer" ] readme = "README.md" -description = """ + +description = """ Maintained by `ibc-rs`, re-exports a comprehensive set of libraries that implement various IBC applications, enabling smooth integration of IBC business logic into any blockchain system. """ @@ -21,25 +22,25 @@ ibc-app-transfer = { workspace = true } ibc-app-nft-transfer = { workspace = true, optional = true, features = [ "std", "serde", "schema", "borsh", "parity-scale-codec" ] } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-app-transfer/std", - "nft-transfer", + "ibc-app-transfer/std", + "nft-transfer", ] serde = [ - "ibc-app-transfer/serde", + "ibc-app-transfer/serde", ] schema = [ - "ibc-app-transfer/schema", - "serde", - "std", + "ibc-app-transfer/schema", + "serde", + "std", ] borsh = [ - "ibc-app-transfer/borsh", + "ibc-app-transfer/borsh", ] parity-scale-codec = [ - "ibc-app-transfer/parity-scale-codec", + "ibc-app-transfer/parity-scale-codec", ] nft-transfer = [ - "ibc-app-nft-transfer" + "ibc-app-nft-transfer", ] diff --git a/ibc-apps/ics20-transfer/Cargo.toml b/ibc-apps/ics20-transfer/Cargo.toml index 4d54f2bf6..b904e0902 100644 --- a/ibc-apps/ics20-transfer/Cargo.toml +++ b/ibc-apps/ics20-transfer/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "transfer", "ics20"] +keywords = [ "blockchain", "cosmos", "ibc", "transfer", "ics20" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains the implementation of the ICS-20 Fungible Token Transfer application logic and re-exports essential data structures and domain types from `ibc-app-transfer-types` crate. @@ -19,7 +20,7 @@ all-features = true [dependencies] # external dependencies -serde_json = { workspace = true, optional = true } +serde_json = { workspace = true, optional = true } # ibc dependencies ibc-core = { workspace = true } @@ -29,28 +30,28 @@ ibc-app-transfer-types = { workspace = true } subtle-encoding = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-app-transfer-types/std", - "ibc-core/std", - "serde_json/std", + "ibc-app-transfer-types/std", + "ibc-core/std", + "serde_json/std", ] serde = [ - "ibc-app-transfer-types/serde", - "ibc-core/serde", - "serde_json" + "ibc-app-transfer-types/serde", + "ibc-core/serde", + "serde_json", ] schema = [ - "ibc-app-transfer-types/schema", - "ibc-core/schema", - "serde", - "std", + "ibc-app-transfer-types/schema", + "ibc-core/schema", + "serde", + "std", ] borsh = [ - "ibc-app-transfer-types/borsh", - "ibc-core/borsh", + "ibc-app-transfer-types/borsh", + "ibc-core/borsh", ] parity-scale-codec = [ - "ibc-app-transfer-types/parity-scale-codec", - "ibc-core/parity-scale-codec", + "ibc-app-transfer-types/parity-scale-codec", + "ibc-core/parity-scale-codec", ] diff --git a/ibc-apps/ics20-transfer/types/Cargo.toml b/ibc-apps/ics20-transfer/types/Cargo.toml index 7afb599eb..f967ce8f7 100644 --- a/ibc-apps/ics20-transfer/types/Cargo.toml +++ b/ibc-apps/ics20-transfer/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "transfer", "ics20"] +keywords = [ "blockchain", "cosmos", "ibc", "transfer", "ics20" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-20 Fungible Token Transfer data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -22,7 +23,7 @@ all-features = true borsh = { workspace = true, optional = true } derive_more = { workspace = true } displaydoc = { workspace = true } -primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] } +primitive-types = { version = "0.12.2", default-features = false, features = [ "serde_no_std" ] } schemars = { workspace = true, optional = true } serde = { workspace = true, optional = true } uint = { version = "0.9", default-features = false } @@ -32,44 +33,44 @@ ibc-core = { workspace = true } ibc-proto = { workspace = true } ## parity dependencies -parity-scale-codec = { workspace = true , optional = true } -scale-info = { workspace = true , optional = true } +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } [dev-dependencies] -serde_json = { workspace = true } -rstest = { workspace = true } +serde_json = { workspace = true } +rstest = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "serde/std", - "serde_json/std", - "displaydoc/std", - "uint/std", - "primitive-types/std", - "ibc-core/std", - "ibc-proto/std", + "serde/std", + "serde_json/std", + "displaydoc/std", + "uint/std", + "primitive-types/std", + "ibc-core/std", + "ibc-proto/std", ] serde = [ - "dep:serde", - "ibc-core/serde", - "ibc-proto/serde", + "dep:serde", + "ibc-core/serde", + "ibc-proto/serde", ] schema = [ - "dep:schemars", - "ibc-core/schema", - "ibc-proto/json-schema", - "serde", - "std" + "dep:schemars", + "ibc-core/schema", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-core/borsh", - "ibc-proto/borsh" + "dep:borsh", + "ibc-core/borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core/parity-scale-codec", - "ibc-proto/parity-scale-codec" + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-apps/ics721-nft-transfer/Cargo.toml b/ibc-apps/ics721-nft-transfer/Cargo.toml index aaba18862..f1146b970 100644 --- a/ibc-apps/ics721-nft-transfer/Cargo.toml +++ b/ibc-apps/ics721-nft-transfer/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["cosmos", "ibc", "nft", "transfer", "ics721"] +keywords = [ "cosmos", "ibc", "nft", "transfer", "ics721" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains the implementation of the ICS-721 Non-Fungible Token Transfer application logic and re-exports essential data structures and domain types from `ibc-app-nft-transfer-types` crate. @@ -26,28 +27,28 @@ ibc-app-nft-transfer-types = { workspace = true } ibc-core = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-app-nft-transfer-types/std", - "ibc-core/std", - "serde_json/std", + "ibc-app-nft-transfer-types/std", + "ibc-core/std", + "serde_json/std", ] serde = [ - "ibc-app-nft-transfer-types/serde", - "ibc-core/serde", - "serde_json" + "ibc-app-nft-transfer-types/serde", + "ibc-core/serde", + "serde_json", ] schema = [ - "ibc-app-nft-transfer-types/schema", - "ibc-core/schema", - "serde", - "std", + "ibc-app-nft-transfer-types/schema", + "ibc-core/schema", + "serde", + "std", ] borsh = [ - "ibc-app-nft-transfer-types/borsh", - "ibc-core/borsh", + "ibc-app-nft-transfer-types/borsh", + "ibc-core/borsh", ] parity-scale-codec = [ - "ibc-app-nft-transfer-types/parity-scale-codec", - "ibc-core/parity-scale-codec", + "ibc-app-nft-transfer-types/parity-scale-codec", + "ibc-core/parity-scale-codec", ] diff --git a/ibc-apps/ics721-nft-transfer/types/Cargo.toml b/ibc-apps/ics721-nft-transfer/types/Cargo.toml index 8b7d27b91..b520aebdc 100644 --- a/ibc-apps/ics721-nft-transfer/types/Cargo.toml +++ b/ibc-apps/ics721-nft-transfer/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["cosmos", "ibc", "transfer", "nft", "ics721"] +keywords = [ "cosmos", "ibc", "transfer", "nft", "ics721" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-721 Non-Fungible Token Transfer data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -19,15 +20,15 @@ all-features = true [dependencies] # external dependencies -borsh = { workspace = true, optional = true } -base64 = { workspace = true, features = ["alloc"] } -derive_more = { workspace = true } -displaydoc = { workspace = true } -http = { version = "1.0.0" } -mime = { version = "0.3.17" } -schemars = { workspace = true, optional = true } -serde = { workspace = true, optional = true } -serde_json = { workspace = true } +borsh = { workspace = true, optional = true } +base64 = { workspace = true, features = [ "alloc" ] } +derive_more = { workspace = true } +displaydoc = { workspace = true } +http = { version = "1.0.0" } +mime = { version = "0.3.17" } +schemars = { workspace = true, optional = true } +serde = { workspace = true, optional = true } +serde_json = { workspace = true } # ibc dependencies ibc-core = { workspace = true } @@ -35,48 +36,48 @@ ibc-proto = { workspace = true } ibc-app-transfer-types = { workspace = true } ## parity dependencies -parity-scale-codec = { workspace = true , optional = true } -scale-info = { workspace = true , optional = true } +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } [dev-dependencies] -rstest = { workspace = true } +rstest = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "serde/std", - "serde_json/std", - "base64/std", - "displaydoc/std", - "http/std", - "ibc-core/std", - "ibc-proto/std", - "ibc-app-transfer-types/std", + "serde/std", + "serde_json/std", + "base64/std", + "displaydoc/std", + "http/std", + "ibc-core/std", + "ibc-proto/std", + "ibc-app-transfer-types/std", ] serde = [ - "dep:serde", - "ibc-core/serde", - "ibc-proto/serde", - "ibc-app-transfer-types/serde", + "dep:serde", + "ibc-core/serde", + "ibc-proto/serde", + "ibc-app-transfer-types/serde", ] schema = [ - "dep:schemars", - "ibc-core/schema", - "ibc-proto/json-schema", - "serde", - "std", - "ibc-app-transfer-types/schema", + "dep:schemars", + "ibc-core/schema", + "ibc-proto/json-schema", + "serde", + "std", + "ibc-app-transfer-types/schema", ] borsh = [ - "dep:borsh", - "ibc-core/borsh", - "ibc-proto/borsh", - "ibc-app-transfer-types/borsh", + "dep:borsh", + "ibc-core/borsh", + "ibc-proto/borsh", + "ibc-app-transfer-types/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core/parity-scale-codec", - "ibc-proto/parity-scale-codec", - "ibc-app-transfer-types/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core/parity-scale-codec", + "ibc-proto/parity-scale-codec", + "ibc-app-transfer-types/parity-scale-codec", ] diff --git a/ibc-clients/Cargo.toml b/ibc-clients/Cargo.toml index 1f1e35812..0ab910b3c 100644 --- a/ibc-clients/Cargo.toml +++ b/ibc-clients/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "applications", "tendermint"] +keywords = [ "blockchain", "cosmos", "ibc", "applications", "tendermint" ] readme = "README.md" -description = """ + +description = """ Maintained by `ibc-rs`, re-exports a comprehensive set of libraries that implement various IBC light clients, enabling smooth integration with IBC-enabled blockchains. """ @@ -21,24 +22,24 @@ ibc-client-tendermint = { workspace = true } ibc-client-wasm-types = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-client-tendermint/std", - "ibc-client-wasm-types/std", + "ibc-client-tendermint/std", + "ibc-client-wasm-types/std", ] serde = [ - "ibc-client-tendermint/serde", - "ibc-client-wasm-types/serde", + "ibc-client-tendermint/serde", + "ibc-client-wasm-types/serde", ] schema = [ - "ibc-client-tendermint/schema", - "ibc-client-wasm-types/schema", - "serde", - "std" + "ibc-client-tendermint/schema", + "ibc-client-wasm-types/schema", + "serde", + "std", ] borsh = [ - "ibc-client-tendermint/borsh", + "ibc-client-tendermint/borsh", ] parity-scale-codec = [ - "ibc-client-tendermint/parity-scale-codec", + "ibc-client-tendermint/parity-scale-codec", ] diff --git a/ibc-clients/cw-context/Cargo.toml b/ibc-clients/cw-context/Cargo.toml index 95132d252..7cb2ef06f 100644 --- a/ibc-clients/cw-context/Cargo.toml +++ b/ibc-clients/cw-context/Cargo.toml @@ -6,9 +6,10 @@ license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } version = { workspace = true } -keywords = ["ibc", "light-client", "CosmWasm", "ICS-08"] +keywords = [ "ibc", "light-client", "CosmWasm", "ICS-08" ] readme = "./../README.md" -description = """ + +description = """ Contains types and implementations that are needed to integrate a light client, built using ibc-rs, into CosmWasm contract. It functions as a library, allowing users to import the ready-made `Context` object that is generic across light clients, introduce their concrete client type and integrate @@ -19,22 +20,22 @@ description = """ # external dependencies derive_more = { workspace = true } prost = { workspace = true } -serde = { workspace = true, features = ["derive"] } +serde = { workspace = true, features = [ "derive" ] } # ibc dependencies ibc-core = { workspace = true } -ibc-client-wasm-types = { workspace = true, features = ["cosmwasm"] } +ibc-client-wasm-types = { workspace = true, features = [ "cosmwasm" ] } # cosmwasm dependencies -cosmwasm-schema = { workspace = true } -cosmwasm-std = { workspace = true } -cw-storage-plus = { workspace = true } +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw-storage-plus = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "prost/std", - "serde/std", - "ibc-core/std", - "ibc-client-wasm-types/std", + "prost/std", + "serde/std", + "ibc-core/std", + "ibc-client-wasm-types/std", ] diff --git a/ibc-clients/cw-context/src/api.rs b/ibc-clients/cw-context/src/api.rs index cdab7a745..dfcbe7ce9 100644 --- a/ibc-clients/cw-context/src/api.rs +++ b/ibc-clients/cw-context/src/api.rs @@ -8,7 +8,11 @@ use crate::context::Context; /// Enables users to integrate their implemented light client by introducing /// their client state and consensus state types into the generic [`Context`] /// object. -pub trait ClientType<'a>: Sized { +pub trait ClientType<'a>: Sized +where + >::Error: Into, + >::Error: Into, +{ type ClientState: ClientStateExecution> + Clone; - type ConsensusState: ConsensusStateTrait + Into + TryFrom; + type ConsensusState: ConsensusStateTrait; } diff --git a/ibc-clients/cw-context/src/context/client_ctx.rs b/ibc-clients/cw-context/src/context/client_ctx.rs index acb45c311..414217590 100644 --- a/ibc-clients/cw-context/src/context/client_ctx.rs +++ b/ibc-clients/cw-context/src/context/client_ctx.rs @@ -16,7 +16,11 @@ use crate::api::ClientType; use crate::context::CONSENSUS_STATE_HEIGHT_MAP; use crate::utils::AnyCodec; -impl<'a, C: ClientType<'a>> ClientValidationContext for Context<'a, C> { +impl<'a, C: ClientType<'a>> ClientValidationContext for Context<'a, C> +where + >::Error: Into, + >::Error: Into, +{ type ClientStateRef = C::ClientState; type ConsensusStateRef = C::ConsensusState; @@ -83,7 +87,11 @@ impl<'a, C: ClientType<'a>> ClientValidationContext for Context<'a, C> { } } -impl<'a, C: ClientType<'a>> ClientExecutionContext for Context<'a, C> { +impl<'a, C: ClientType<'a>> ClientExecutionContext for Context<'a, C> +where + >::Error: Into, + >::Error: Into, +{ type ClientStateMut = C::ClientState; fn store_client_state( diff --git a/ibc-clients/cw-context/src/context/custom_ctx.rs b/ibc-clients/cw-context/src/context/custom_ctx.rs index 36fe86393..54829d8e4 100644 --- a/ibc-clients/cw-context/src/context/custom_ctx.rs +++ b/ibc-clients/cw-context/src/context/custom_ctx.rs @@ -6,13 +6,18 @@ use ibc_core::client::types::Height; use ibc_core::handler::types::error::ContextError; use ibc_core::host::types::identifiers::ClientId; use ibc_core::host::types::path::ClientConsensusStatePath; +use ibc_core::primitives::proto::Any; use ibc_core::primitives::Timestamp; use super::Context; use crate::api::ClientType; use crate::types::HeightTravel; -impl<'a, C: ClientType<'a>> ExtClientValidationContext for Context<'a, C> { +impl<'a, C: ClientType<'a>> ExtClientValidationContext for Context<'a, C> +where + >::Error: Into, + >::Error: Into, +{ fn host_timestamp(&self) -> Result { let time = self.env().block.time; diff --git a/ibc-clients/cw-context/src/context/mod.rs b/ibc-clients/cw-context/src/context/mod.rs index 1000f837c..ea8518297 100644 --- a/ibc-clients/cw-context/src/context/mod.rs +++ b/ibc-clients/cw-context/src/context/mod.rs @@ -33,7 +33,11 @@ pub const CONSENSUS_STATE_HEIGHT_MAP: Map<'_, (u64, u64), Empty> = /// Context is a wrapper around the deps and env that gives access to the /// methods under the ibc-rs Validation and Execution traits. -pub struct Context<'a, C: ClientType<'a>> { +pub struct Context<'a, C: ClientType<'a>> +where + >::Error: Into, + >::Error: Into, +{ deps: Option>, deps_mut: Option>, env: Env, @@ -43,7 +47,11 @@ pub struct Context<'a, C: ClientType<'a>> { client_type: std::marker::PhantomData, } -impl<'a, C: ClientType<'a>> Context<'a, C> { +impl<'a, C: ClientType<'a>> Context<'a, C> +where + >::Error: Into, + >::Error: Into, +{ /// Constructs a new Context object with the given deps and env. pub fn new_ref(deps: Deps<'a>, env: Env) -> Result { let client_id = ClientId::from_str(env.contract.address.as_str())?; @@ -303,7 +311,11 @@ pub trait StorageRef { fn storage_ref(&self) -> &dyn Storage; } -impl<'a, C: ClientType<'a>> StorageRef for Context<'a, C> { +impl<'a, C: ClientType<'a>> StorageRef for Context<'a, C> +where + >::Error: Into, + >::Error: Into, +{ fn storage_ref(&self) -> &dyn Storage { match self.deps { Some(ref deps) => deps.storage, @@ -319,7 +331,11 @@ pub trait StorageMut: StorageRef { fn storage_mut(&mut self) -> &mut dyn Storage; } -impl<'a, C: ClientType<'a>> StorageMut for Context<'a, C> { +impl<'a, C: ClientType<'a>> StorageMut for Context<'a, C> +where + >::Error: Into, + >::Error: Into, +{ fn storage_mut(&mut self) -> &mut dyn Storage { match self.deps_mut { Some(ref mut deps) => deps.storage, diff --git a/ibc-clients/cw-context/src/handlers.rs b/ibc-clients/cw-context/src/handlers.rs index 024d8e08a..fdf9c3ed2 100644 --- a/ibc-clients/cw-context/src/handlers.rs +++ b/ibc-clients/cw-context/src/handlers.rs @@ -1,5 +1,6 @@ use cosmwasm_std::{to_json_binary, Binary}; use ibc_core::client::context::prelude::*; +use ibc_core::client::types::error::ClientError; use ibc_core::host::types::path::ClientConsensusStatePath; use ibc_core::primitives::proto::Any; use prost::Message; @@ -13,12 +14,16 @@ use crate::types::{ VerifyUpgradeAndUpdateStateMsg, }; -impl<'a, C: ClientType<'a>> Context<'a, C> { +impl<'a, C: ClientType<'a>> Context<'a, C> +where + >::Error: Into, + >::Error: Into, +{ /// Instantiates a new client with the given [`InstantiateMsg`] message. pub fn instantiate(&mut self, msg: InstantiateMsg) -> Result { let any = Any::decode(&mut msg.client_state.as_slice())?; - let client_state = C::ClientState::try_from(any)?; + let client_state = C::ClientState::try_from(any).map_err(Into::into)?; let any_consensus_state = Any::decode(&mut msg.consensus_state.as_slice())?; diff --git a/ibc-clients/cw-context/src/utils/codec.rs b/ibc-clients/cw-context/src/utils/codec.rs index f31d9ab2f..dc662ecff 100644 --- a/ibc-clients/cw-context/src/utils/codec.rs +++ b/ibc-clients/cw-context/src/utils/codec.rs @@ -7,13 +7,14 @@ use prost::Message; pub trait AnyCodec { fn decode_any_vec(data: Vec) -> Result where - C: TryFrom, + C: TryFrom, + >::Error: Into, { let raw = Any::decode(&mut data.as_slice()).map_err(|e| ClientError::Other { description: e.to_string(), })?; - C::try_from(raw) + C::try_from(raw).map_err(Into::into) } fn encode_to_any_vec(value: C) -> Vec @@ -24,4 +25,4 @@ pub trait AnyCodec { } } -impl AnyCodec for T where T: TryFrom + Into {} +impl AnyCodec for T where T: TryFrom + Into {} diff --git a/ibc-clients/ics07-tendermint/Cargo.toml b/ibc-clients/ics07-tendermint/Cargo.toml index f7da34cae..e9983c8ec 100644 --- a/ibc-clients/ics07-tendermint/Cargo.toml +++ b/ibc-clients/ics07-tendermint/Cargo.toml @@ -1,14 +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"] -description = """ +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. """ @@ -22,60 +22,60 @@ derive_more = { workspace = true } serde = { workspace = true, optional = true } # ibc dependencies -ibc-client-tendermint-types = { workspace = true } -ibc-core-client = { workspace = true } -ibc-core-commitment-types = { workspace = true } -ibc-core-host = { workspace = true } -ibc-core-handler-types = { workspace = true } -ibc-primitives = { workspace = true } +ibc-client-tendermint-types = { workspace = true } +ibc-core-client = { workspace = true } +ibc-core-commitment-types = { workspace = true } +ibc-core-host = { workspace = true } +ibc-core-handler-types = { workspace = true } +ibc-primitives = { workspace = true } # cosmos dependencies tendermint = { workspace = true } -tendermint-light-client-verifier = { workspace = true, features = ["rust-crypto"] } +tendermint-light-client-verifier = { workspace = true, features = [ "rust-crypto" ] } [features] -default = ["std"] +default = [ "std" ] std = [ - "serde/std", - "ibc-client-tendermint-types/std", - "ibc-core-client/std", - "ibc-core-commitment-types/std", - "ibc-core-host/std", - "ibc-core-handler-types/std", - "ibc-primitives/std", + "serde/std", + "ibc-client-tendermint-types/std", + "ibc-core-client/std", + "ibc-core-commitment-types/std", + "ibc-core-host/std", + "ibc-core-handler-types/std", + "ibc-primitives/std", ] serde = [ - "dep:serde", - "ibc-client-tendermint-types/serde", - "ibc-core-client/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host/serde", - "ibc-core-handler-types/serde", - "ibc-primitives/serde", + "dep:serde", + "ibc-client-tendermint-types/serde", + "ibc-core-client/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host/serde", + "ibc-core-handler-types/serde", + "ibc-primitives/serde", ] schema = [ - "ibc-client-tendermint-types/schema", - "ibc-core-client/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host/schema", - "ibc-core-handler-types/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-client-tendermint-types/schema", + "ibc-core-client/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host/schema", + "ibc-core-handler-types/schema", + "ibc-primitives/schema", + "serde", + "std", ] borsh = [ - "ibc-client-tendermint-types/borsh", - "ibc-core-client/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host/borsh", - "ibc-core-handler-types/borsh", - "ibc-primitives/borsh", + "ibc-client-tendermint-types/borsh", + "ibc-core-client/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host/borsh", + "ibc-core-handler-types/borsh", + "ibc-primitives/borsh", ] parity-scale-codec = [ - "ibc-client-tendermint-types/parity-scale-codec", - "ibc-core-client/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-client-tendermint-types/parity-scale-codec", + "ibc-core-client/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml b/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml index 34eb32812..8c5c35733 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml +++ b/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml @@ -6,14 +6,15 @@ license = { workspace = true } repository = { workspace = true } rust-version = { workspace = true } version = { workspace = true } -keywords = ["ibc", "light-client", "ics07", "tendermint", "CosmWasm"] +keywords = [ "ibc", "light-client", "ics07", "tendermint", "CosmWasm" ] readme = "./../../README.md" -description = """ + +description = """ The ICS-08 CosmWasm contract implementation of the ICS-07 Tendermint light client. """ [lib] -crate-type = ["cdylib", "rlib"] +crate-type = [ "cdylib", "rlib" ] [dependencies] # ibc dependencies @@ -22,21 +23,12 @@ ibc-client-cw = { workspace = true } ibc-client-tendermint = { workspace = true } # cosmwasm dependencies -cosmwasm-std = { workspace = true } - -[dev-dependencies] -cosmwasm-vm = { workspace = true } -hex = { version = "0.4.2" } -ibc-testkit = { workspace = true } -ibc-client-tendermint = { workspace = true } -tendermint = { workspace = true } -tendermint-testgen = { workspace = true } +cosmwasm-std = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-core/std", - "ibc-client-cw/std", - "ibc-client-tendermint/std", + "ibc-core/std", + "ibc-client-cw/std", + "ibc-client-tendermint/std", ] - diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs b/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs index cbed3ebe5..4a4a642f0 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs +++ b/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs @@ -13,6 +13,3 @@ pub mod client_type; pub mod entrypoint; - -#[cfg(test)] -pub mod tests; diff --git a/ibc-clients/ics07-tendermint/src/client_state/execution.rs b/ibc-clients/ics07-tendermint/src/client_state/execution.rs index 7e844b21c..5d4fadde5 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/execution.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/execution.rs @@ -15,7 +15,8 @@ impl ClientStateExecution for ClientState where E: ExtClientExecutionContext, E::ClientStateRef: From, - E::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, { fn initialise( &self, @@ -93,12 +94,12 @@ pub fn initialise( where E: ExtClientExecutionContext, E::ClientStateRef: From, - E::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, { let host_timestamp = ExtClientValidationContext::host_timestamp(ctx)?; let host_height = ExtClientValidationContext::host_height(ctx)?; - let tm_consensus_state = ConsensusStateType::try_from(consensus_state)?; + let tm_consensus_state: ConsensusStateType = consensus_state.try_into()?; ctx.store_client_state( ClientStatePath::new(client_id.clone()), @@ -138,7 +139,8 @@ pub fn update_state( where E: ExtClientExecutionContext, E::ClientStateRef: From, - E::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, { let header = TmHeader::try_from(header)?; let header_height = header.height(); @@ -237,10 +239,10 @@ pub fn update_on_upgrade( where E: ExtClientExecutionContext, E::ClientStateRef: From, - E::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, { let mut upgraded_tm_client_state = ClientState::try_from(upgraded_client_state)?; - let upgraded_tm_cons_state = ConsensusStateType::try_from(upgraded_consensus_state)?; + let upgraded_tm_cons_state: ConsensusStateType = upgraded_consensus_state.try_into()?; upgraded_tm_client_state.0.zero_custom_fields(); @@ -317,7 +319,8 @@ pub fn prune_oldest_consensus_state( where E: ClientExecutionContext + ExtClientValidationContext, E::ClientStateRef: From, - E::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, { let mut heights = ctx.consensus_state_heights(client_id)?; @@ -330,7 +333,8 @@ where height.revision_height(), ); let consensus_state = ctx.consensus_state(&client_consensus_state_path)?; - let tm_consensus_state = consensus_state.try_into()?; + let tm_consensus_state: ConsensusStateType = + consensus_state.try_into().map_err(Into::into)?; let host_timestamp = ctx.host_timestamp()? @@ -380,7 +384,7 @@ pub fn update_on_recovery( where E: ExtClientExecutionContext, E::ClientStateRef: From, - E::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, { let substitute_client_state = ClientState::try_from(substitute_client_state)? .inner() @@ -401,7 +405,7 @@ where let host_timestamp = E::host_timestamp(ctx)?; let host_height = E::host_height(ctx)?; - let tm_consensus_state = ConsensusStateType::try_from(substitute_consensus_state)?; + let tm_consensus_state: ConsensusStateType = substitute_consensus_state.try_into()?; ctx.store_consensus_state( ClientConsensusStatePath::new( diff --git a/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs b/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs index 6750a44eb..79d2b6ea9 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/misbehaviour.rs @@ -28,13 +28,14 @@ pub fn verify_misbehaviour( ) -> Result<(), ClientError> where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, H: MerkleHash + Sha256 + Default, { misbehaviour.validate_basic::()?; let header_1 = misbehaviour.header1(); - let trusted_consensus_state_1 = { + let trusted_consensus_state_1: ConsensusStateType = { let consensus_state_path = ClientConsensusStatePath::new( client_id.clone(), header_1.trusted_height.revision_number(), @@ -42,11 +43,11 @@ where ); let consensus_state = ctx.consensus_state(&consensus_state_path)?; - consensus_state.try_into()? + consensus_state.try_into().map_err(Into::into)? }; let header_2 = misbehaviour.header2(); - let trusted_consensus_state_2 = { + let trusted_consensus_state_2: ConsensusStateType = { let consensus_state_path = ClientConsensusStatePath::new( client_id.clone(), header_2.trusted_height.revision_number(), @@ -54,7 +55,7 @@ where ); let consensus_state = ctx.consensus_state(&consensus_state_path)?; - consensus_state.try_into()? + consensus_state.try_into().map_err(Into::into)? }; let current_timestamp = ctx.host_timestamp()?; diff --git a/ibc-clients/ics07-tendermint/src/client_state/update_client.rs b/ibc-clients/ics07-tendermint/src/client_state/update_client.rs index e715643fb..ec5d88c36 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/update_client.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/update_client.rs @@ -22,7 +22,8 @@ pub fn verify_header( ) -> Result<(), ClientError> where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, H: MerkleHash + Sha256 + Default, { // Checks that the header fields are valid. @@ -41,9 +42,10 @@ where header.trusted_height.revision_number(), header.trusted_height.revision_height(), ); - let trusted_consensus_state = ctx + let trusted_consensus_state: ConsensusStateType = ctx .consensus_state(&trusted_client_cons_state_path)? - .try_into()?; + .try_into() + .map_err(Into::into)?; header.check_trusted_next_validator_set::( &trusted_consensus_state.next_validators_hash, @@ -107,7 +109,8 @@ pub fn check_for_misbehaviour_on_update( ) -> Result where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, { let maybe_existing_consensus_state = { let path_at_header_height = ClientConsensusStatePath::new( @@ -120,7 +123,8 @@ where }; if let Some(existing_consensus_state) = maybe_existing_consensus_state { - let existing_consensus_state = existing_consensus_state.try_into()?; + let existing_consensus_state: ConsensusStateType = + existing_consensus_state.try_into().map_err(Into::into)?; let header_consensus_state = ConsensusStateType::from(header); @@ -138,7 +142,7 @@ where if let Some(prev_cs) = maybe_prev_cs { // New header timestamp cannot occur *before* the // previous consensus state's height - let prev_cs = prev_cs.try_into()?; + let prev_cs: ConsensusStateType = prev_cs.try_into().map_err(Into::into)?; if header.signed_header.header().time <= prev_cs.timestamp() { return Ok(true); @@ -154,7 +158,7 @@ where if let Some(next_cs) = maybe_next_cs { // New (untrusted) header timestamp cannot occur *after* next // consensus state's height - let next_cs = next_cs.try_into()?; + let next_cs: ConsensusStateType = next_cs.try_into().map_err(Into::into)?; if header.signed_header.header().time >= next_cs.timestamp() { return Ok(true); diff --git a/ibc-clients/ics07-tendermint/src/client_state/validation.rs b/ibc-clients/ics07-tendermint/src/client_state/validation.rs index 73349d1ec..aca62f5e5 100644 --- a/ibc-clients/ics07-tendermint/src/client_state/validation.rs +++ b/ibc-clients/ics07-tendermint/src/client_state/validation.rs @@ -21,7 +21,8 @@ use crate::client_state::{verify_header, verify_misbehaviour}; impl ClientStateValidation for ClientState where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, { /// The default verification logic exposed by ibc-rs simply delegates to a /// standalone `verify_client_message` function. This is to make it as @@ -93,7 +94,8 @@ pub fn verify_client_message( ) -> Result<(), ClientError> where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, H: MerkleHash + Sha256Trait + Default, { match client_message.type_url.as_str() { @@ -163,7 +165,8 @@ pub fn check_for_misbehaviour( ) -> Result where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, { match client_message.type_url.as_str() { TENDERMINT_HEADER_TYPE_URL => { @@ -190,19 +193,20 @@ pub fn status( ) -> Result where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, + >::Error: Into, { if client_state.is_frozen() { return Ok(Status::Frozen); } - let latest_consensus_state = { + let latest_consensus_state: ConsensusStateType = { match ctx.consensus_state(&ClientConsensusStatePath::new( client_id.clone(), client_state.latest_height.revision_number(), client_state.latest_height.revision_height(), )) { - Ok(cs) => cs.try_into()?, + Ok(cs) => cs.try_into().map_err(Into::into)?, // if the client state does not have an associated consensus state for its latest height // then it must be expired Err(_) => return Ok(Status::Expired), @@ -237,7 +241,7 @@ pub fn check_substitute( ) -> Result<(), ClientError> where V: ExtClientValidationContext, - V::ConsensusStateRef: Convertible, + ConsensusStateType: Convertible, { let ClientStateType { latest_height: _, diff --git a/ibc-clients/ics07-tendermint/types/Cargo.toml b/ibc-clients/ics07-tendermint/types/Cargo.toml index 2eae85a94..d52a1f260 100644 --- a/ibc-clients/ics07-tendermint/types/Cargo.toml +++ b/ibc-clients/ics07-tendermint/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "tendermint", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "tendermint", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-07 Tendermint Client data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -32,7 +33,7 @@ ibc-proto = { workspace = true } # cosmos dependencies tendermint = { workspace = true } -tendermint-light-client-verifier = { workspace = true, features = ["rust-crypto"] } +tendermint-light-client-verifier = { workspace = true, features = [ "rust-crypto" ] } tendermint-proto = { workspace = true } # parity dependencies @@ -44,49 +45,49 @@ serde_json = { workspace = true } tendermint-rpc = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "serde/std", - "serde_json/std", - "ibc-core-client-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-primitives/std", - "ibc-proto/std", - "tendermint/std", + "displaydoc/std", + "serde/std", + "serde_json/std", + "ibc-core-client-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-primitives/std", + "ibc-proto/std", + "tendermint/std", ] serde = [ - "dep:serde", - "ibc-core-client-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", + "dep:serde", + "ibc-core-client-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", ] schema = [ - "ibc-core-client-types/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "ibc-core-client-types/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-core-client-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-primitives/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-core-client-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-primitives/borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core-client-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-clients/ics08-wasm/types/Cargo.toml b/ibc-clients/ics08-wasm/types/Cargo.toml index db986dc74..57c73e78b 100644 --- a/ibc-clients/ics08-wasm/types/Cargo.toml +++ b/ibc-clients/ics08-wasm/types/Cargo.toml @@ -1,14 +1,15 @@ [package] -name = "ibc-client-wasm-types" +name = "ibc-client-wasm-types" version = { workspace = true } authors = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "wasm", "ics08"] +keywords = [ "blockchain", "cosmos", "ibc", "wasm", "ics08" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-08 Wasm Light Client data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -16,10 +17,10 @@ description = """ [dependencies] # external dependencies -base64 = { workspace = true , features = ["alloc"] } +base64 = { workspace = true, features = [ "alloc" ] } displaydoc = { workspace = true } -serde = { workspace = true , optional = true } -cosmwasm-schema = { workspace = true , optional = true } +serde = { workspace = true, optional = true } +cosmwasm-schema = { workspace = true, optional = true } # ibc dependencies ibc-core-client = { workspace = true } @@ -32,31 +33,31 @@ rstest = { workspace = true } serde_json = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-core-client/std", - "ibc-core-host-types/std", - "ibc-primitives/std", - "ibc-proto/std", - "base64/std", - "serde/std" + "ibc-core-client/std", + "ibc-core-host-types/std", + "ibc-primitives/std", + "ibc-proto/std", + "base64/std", + "serde/std", ] serde = [ - "ibc-core-client/serde", - "ibc-core-host-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", - "dep:serde" + "ibc-core-client/serde", + "ibc-core-host-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", + "dep:serde", ] schema = [ - "ibc-core-client/schema", - "ibc-core-host-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "ibc-core-client/schema", + "ibc-core-host-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] cosmwasm = [ - "cosmwasm-schema", - "schema" + "cosmwasm-schema", + "schema", ] diff --git a/ibc-core/Cargo.toml b/ibc-core/Cargo.toml index 4eed1c18e..eebb12318 100644 --- a/ibc-core/Cargo.toml +++ b/ibc-core/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "core"] +keywords = [ "blockchain", "cosmos", "ibc", "core" ] readme = "README.md" -description = """ + +description = """ Maintained by `ibc-rs`, re-exports a comprehensive set of libraries that implement IBC core (TAO) modules, facilitating seamless integration of IBC core business logic into any blockchain system. """ @@ -28,56 +29,56 @@ ibc-derive = { workspace = true } ibc-primitives = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-core-client/std", - "ibc-core-connection/std", - "ibc-core-channel/std", - "ibc-core-commitment-types/std", - "ibc-core-host/std", - "ibc-core-router/std", - "ibc-core-handler/std", - "ibc-primitives/std", + "ibc-core-client/std", + "ibc-core-connection/std", + "ibc-core-channel/std", + "ibc-core-commitment-types/std", + "ibc-core-host/std", + "ibc-core-router/std", + "ibc-core-handler/std", + "ibc-primitives/std", ] serde = [ - "ibc-core-client/serde", - "ibc-core-connection/serde", - "ibc-core-channel/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host/serde", - "ibc-core-router/serde", - "ibc-core-handler/serde", - "ibc-primitives/serde", + "ibc-core-client/serde", + "ibc-core-connection/serde", + "ibc-core-channel/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host/serde", + "ibc-core-router/serde", + "ibc-core-handler/serde", + "ibc-primitives/serde", ] borsh = [ - "ibc-core-client/borsh", - "ibc-core-connection/borsh", - "ibc-core-channel/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host/borsh", - "ibc-core-router/borsh", - "ibc-core-handler/borsh", - "ibc-primitives/borsh", + "ibc-core-client/borsh", + "ibc-core-connection/borsh", + "ibc-core-channel/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host/borsh", + "ibc-core-router/borsh", + "ibc-core-handler/borsh", + "ibc-primitives/borsh", ] schema = [ - "ibc-core-client/schema", - "ibc-core-connection/schema", - "ibc-core-channel/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host/schema", - "ibc-core-router/schema", - "ibc-core-handler/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-client/schema", + "ibc-core-connection/schema", + "ibc-core-channel/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host/schema", + "ibc-core-router/schema", + "ibc-core-handler/schema", + "ibc-primitives/schema", + "serde", + "std", ] parity-scale-codec = [ - "ibc-core-client/parity-scale-codec", - "ibc-core-connection/parity-scale-codec", - "ibc-core-channel/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host/parity-scale-codec", - "ibc-core-router/parity-scale-codec", - "ibc-core-handler/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-client/parity-scale-codec", + "ibc-core-connection/parity-scale-codec", + "ibc-core-channel/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host/parity-scale-codec", + "ibc-core-router/parity-scale-codec", + "ibc-core-handler/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics02-client/Cargo.toml b/ibc-core/ics02-client/Cargo.toml index 7c6340022..7502b6a25 100644 --- a/ibc-core/ics02-client/Cargo.toml +++ b/ibc-core/ics02-client/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "light-client"] +keywords = [ "blockchain", "cosmos", "ibc", "light-client" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains the implementation of ICS-02 Client Semantics and re-exports essential data structures and domain types from `ibc-core-client-types` crate. """ @@ -25,46 +26,46 @@ ibc-core-handler-types = { workspace = true } ibc-primitives = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-core-client-types/std", - "ibc-core-client-context/std", - "ibc-core-commitment-types/std", - "ibc-core-host/std", - "ibc-core-handler-types/std", - "ibc-primitives/std", + "ibc-core-client-types/std", + "ibc-core-client-context/std", + "ibc-core-commitment-types/std", + "ibc-core-host/std", + "ibc-core-handler-types/std", + "ibc-primitives/std", ] serde = [ - "ibc-core-client-types/serde", - "ibc-core-client-context/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host/serde", - "ibc-core-handler-types/serde", - "ibc-primitives/serde", + "ibc-core-client-types/serde", + "ibc-core-client-context/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host/serde", + "ibc-core-handler-types/serde", + "ibc-primitives/serde", ] borsh = [ - "ibc-core-client-types/borsh", - "ibc-core-client-context/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host/borsh", - "ibc-core-handler-types/borsh", - "ibc-primitives/borsh", + "ibc-core-client-types/borsh", + "ibc-core-client-context/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host/borsh", + "ibc-core-handler-types/borsh", + "ibc-primitives/borsh", ] schema = [ - "ibc-core-client-types/schema", - "ibc-core-client-context/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host/schema", - "ibc-core-handler-types/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-client-types/schema", + "ibc-core-client-context/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host/schema", + "ibc-core-handler-types/schema", + "ibc-primitives/schema", + "serde", + "std", ] parity-scale-codec = [ - "ibc-core-client-types/parity-scale-codec", - "ibc-core-client-context/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-client-context/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics02-client/context/Cargo.toml b/ibc-core/ics02-client/context/Cargo.toml index e4eb8db05..9085da29e 100644 --- a/ibc-core/ics02-client/context/Cargo.toml +++ b/ibc-core/ics02-client/context/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc"] +keywords = [ "blockchain", "cosmos", "ibc" ] readme = "./../../README.md" -description = """ + +description = """ Maintaind by `ibc-rs`, contains essential APIs to interface with the host chain's store, enabling smooth client state transitions. Additionally, provides necessary traits for implementing custom IBC light clients. @@ -34,43 +35,43 @@ ibc-primitives = { workspace = true } tendermint = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "subtle-encoding/std", - "ibc-core-client-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-core-handler-types/std", - "ibc-primitives/std", - "tendermint/std", + "displaydoc/std", + "subtle-encoding/std", + "ibc-core-client-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-core-handler-types/std", + "ibc-primitives/std", + "tendermint/std", ] serde = [ - "ibc-core-client-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host-types/serde", - "ibc-core-handler-types/serde", - "ibc-primitives/serde", + "ibc-core-client-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host-types/serde", + "ibc-core-handler-types/serde", + "ibc-primitives/serde", ] borsh = [ - "ibc-core-client-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-core-handler-types/borsh", - "ibc-primitives/borsh", + "ibc-core-client-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-core-handler-types/borsh", + "ibc-primitives/borsh", ] schema = [ - "ibc-core-client-types/schema", - "ibc-core-host-types/schema", - "ibc-core-handler-types/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-client-types/schema", + "ibc-core-host-types/schema", + "ibc-core-handler-types/schema", + "ibc-primitives/schema", + "serde", + "std", ] parity-scale-codec = [ - "ibc-core-client-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics02-client/context/src/client_state.rs b/ibc-core/ics02-client/context/src/client_state.rs index abe496e2f..e6becbf58 100644 --- a/ibc-core/ics02-client/context/src/client_state.rs +++ b/ibc-core/ics02-client/context/src/client_state.rs @@ -10,17 +10,14 @@ use ibc_core_host_types::path::Path; use ibc_primitives::prelude::*; use ibc_primitives::proto::Any; -/// Convenient trait to decode a client state from an [`Any`] type and obtain a -/// handle to the local instance of [`ClientState`]. -pub trait ClientStateDecoder: Into + TryFrom {} - -impl ClientStateDecoder for T where T: Into + TryFrom {} +use crate::context::{ClientExecutionContext, ClientValidationContext}; +use crate::Convertible; /// `ClientState` methods needed in both validation and execution. /// /// They do not require access to a client `ValidationContext` nor /// `ExecutionContext`. -pub trait ClientStateCommon: ClientStateDecoder { +pub trait ClientStateCommon: Convertible { /// Performs basic validation on the `consensus_state`. /// /// Notably, an implementation should verify that it can properly @@ -206,8 +203,6 @@ where ) -> Result<(), ClientError>; } -use crate::context::{ClientExecutionContext, ClientValidationContext}; - /// Primary client trait. Defines all the methods that clients must implement. /// /// `ClientState` is broken up in 3 separate traits to avoid needing to use diff --git a/ibc-core/ics02-client/context/src/consensus_state.rs b/ibc-core/ics02-client/context/src/consensus_state.rs index 7d1bfcb77..556486c67 100644 --- a/ibc-core/ics02-client/context/src/consensus_state.rs +++ b/ibc-core/ics02-client/context/src/consensus_state.rs @@ -1,22 +1,17 @@ //! Defines the trait to be implemented by all concrete consensus state types -use ibc_core_client_types::error::ClientError; use ibc_core_commitment_types::commitment::CommitmentRoot; use ibc_primitives::prelude::*; use ibc_primitives::proto::Any; use ibc_primitives::Timestamp; -/// Convenient trait to decode a consensus state from an [`Any`] type and obtain -/// a handle to the local instance of [`ConsensusState`]. -pub trait ConsensusStateDecoder: Into + TryFrom {} - -impl ConsensusStateDecoder for T where T: Into + TryFrom {} +use crate::Convertible; /// Defines methods that all `ConsensusState`s should provide. /// /// One can think of a "consensus state" as a pruned header, to be stored on chain. In other words, /// a consensus state only contains the header's information needed by IBC message handlers. -pub trait ConsensusState: Send + Sync + ConsensusStateDecoder { +pub trait ConsensusState: Send + Sync + Convertible { /// Commitment root of the consensus state, which is used for key-value pair verification. fn root(&self) -> &CommitmentRoot; diff --git a/ibc-core/ics02-client/context/src/context.rs b/ibc-core/ics02-client/context/src/context.rs index 8f7b4922a..972ec547e 100644 --- a/ibc-core/ics02-client/context/src/context.rs +++ b/ibc-core/ics02-client/context/src/context.rs @@ -153,11 +153,11 @@ pub trait ExtClientExecutionContext: ExtClientValidationContext + ClientExecutio impl ExtClientExecutionContext for T where T: ExtClientValidationContext + ClientExecutionContext {} -/// General-purpose helper converter enabling `TryInto` and `From` conversions +/// General-purpose helper converter enabling `TryFrom` and `Into` conversions /// primarily intended between an enum and its variants. This usually used by /// standalone functions as a trait bound allowing them to obtain the concrete /// local type from the enum containing that concrete type as its variant, like /// when enum `AnyConsensusState` contains the Tendermint `ConsensusState`. -pub trait Convertible: TryInto + From {} +pub trait Convertible: TryFrom + Into {} -impl Convertible for T where T: TryInto + From {} +impl Convertible for T where T: TryFrom + Into {} diff --git a/ibc-core/ics02-client/src/handler/create_client.rs b/ibc-core/ics02-client/src/handler/create_client.rs index 4a4148251..4cb3d34f2 100644 --- a/ibc-core/ics02-client/src/handler/create_client.rs +++ b/ibc-core/ics02-client/src/handler/create_client.rs @@ -8,10 +8,12 @@ use ibc_core_handler_types::error::ContextError; use ibc_core_handler_types::events::{IbcEvent, MessageEvent}; use ibc_core_host::{ClientStateMut, ClientStateRef, ExecutionContext, ValidationContext}; use ibc_primitives::prelude::*; +use ibc_primitives::proto::Any; pub fn validate(ctx: &Ctx, msg: MsgCreateClient) -> Result<(), ContextError> where Ctx: ValidationContext, + as TryFrom>::Error: Into, { let MsgCreateClient { client_state, @@ -26,7 +28,7 @@ where let client_val_ctx = ctx.get_client_validation_context(); - let client_state = ClientStateRef::::try_from(client_state)?; + let client_state = ClientStateRef::::try_from(client_state).map_err(Into::into)?; let client_id = client_state.client_type().build_client_id(id_counter); @@ -51,6 +53,7 @@ where pub fn execute(ctx: &mut Ctx, msg: MsgCreateClient) -> Result<(), ContextError> where Ctx: ExecutionContext, + as TryFrom>::Error: Into, { let MsgCreateClient { client_state, @@ -63,7 +66,7 @@ where let client_exec_ctx = ctx.get_client_execution_context(); - let client_state = ClientStateMut::::try_from(client_state)?; + let client_state = ClientStateMut::::try_from(client_state).map_err(Into::into)?; let client_type = client_state.client_type(); let client_id = client_type.build_client_id(id_counter); diff --git a/ibc-core/ics02-client/types/Cargo.toml b/ibc-core/ics02-client/types/Cargo.toml index de5f7b656..bc11d449c 100644 --- a/ibc-core/ics02-client/types/Cargo.toml +++ b/ibc-core/ics02-client/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "client", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "client", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-02 Client Semantics data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -36,49 +37,49 @@ ibc-proto = { workspace = true } tendermint = { workspace = true } # parity dependencies -parity-scale-codec = { workspace = true, optional = true } -scale-info = { workspace = true, optional = true } +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "serde/std", - "subtle-encoding/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-primitives/std", - "ibc-proto/std", - "tendermint/std", + "displaydoc/std", + "serde/std", + "subtle-encoding/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-primitives/std", + "ibc-proto/std", + "tendermint/std", ] serde = [ - "ibc-core-host-types/serde", - "ibc-core-commitment-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", - "dep:serde", + "ibc-core-host-types/serde", + "ibc-core-commitment-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", + "dep:serde", ] borsh = [ - "dep:borsh", - "ibc-core-host-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-primitives/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-core-host-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-primitives/borsh", + "ibc-proto/borsh", ] schema = [ - "dep:schemars", - "ibc-core-host-types/schema", - "ibc-core-commitment-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "dep:schemars", + "ibc-core-host-types/schema", + "ibc-core-commitment-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core-host-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core-host-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-core/ics03-connection/Cargo.toml b/ibc-core/ics03-connection/Cargo.toml index c43f93c8e..7cea316c2 100644 --- a/ibc-core/ics03-connection/Cargo.toml +++ b/ibc-core/ics03-connection/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "connection"] +keywords = [ "blockchain", "cosmos", "ibc", "connection" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains the implementation of the ICS-03 Connection Semantics and re-exports essential data structures and domain types from `ibc-core-connection-types` crate. """ @@ -24,41 +25,41 @@ ibc-core-handler-types = { workspace = true } ibc-primitives = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-core-client/std", - "ibc-core-connection-types/std", - "ibc-core-host/std", - "ibc-core-handler-types/std", - "ibc-primitives/std", + "ibc-core-client/std", + "ibc-core-connection-types/std", + "ibc-core-host/std", + "ibc-core-handler-types/std", + "ibc-primitives/std", ] serde = [ - "ibc-core-client/serde", - "ibc-core-connection-types/serde", - "ibc-core-host/serde", - "ibc-core-handler-types/serde", - "ibc-primitives/serde", + "ibc-core-client/serde", + "ibc-core-connection-types/serde", + "ibc-core-host/serde", + "ibc-core-handler-types/serde", + "ibc-primitives/serde", ] schema = [ - "ibc-core-client/schema", - "ibc-core-connection-types/schema", - "ibc-core-host/schema", - "ibc-core-handler-types/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-client/schema", + "ibc-core-connection-types/schema", + "ibc-core-host/schema", + "ibc-core-handler-types/schema", + "ibc-primitives/schema", + "serde", + "std", ] borsh = [ - "ibc-core-client/borsh", - "ibc-core-connection-types/borsh", - "ibc-core-host/borsh", - "ibc-core-handler-types/borsh", - "ibc-primitives/borsh", + "ibc-core-client/borsh", + "ibc-core-connection-types/borsh", + "ibc-core-host/borsh", + "ibc-core-handler-types/borsh", + "ibc-primitives/borsh", ] parity-scale-codec = [ - "ibc-core-client/parity-scale-codec", - "ibc-core-connection-types/parity-scale-codec", - "ibc-core-host/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-client/parity-scale-codec", + "ibc-core-connection-types/parity-scale-codec", + "ibc-core-host/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics03-connection/src/handler/conn_open_ack.rs b/ibc-core/ics03-connection/src/handler/conn_open_ack.rs index 4e76a493a..a0630ef33 100644 --- a/ibc-core/ics03-connection/src/handler/conn_open_ack.rs +++ b/ibc-core/ics03-connection/src/handler/conn_open_ack.rs @@ -1,6 +1,7 @@ //! Protocol logic specific to processing ICS3 messages of type `MsgConnectionOpenAck`. use ibc_core_client::context::prelude::*; +use ibc_core_client::types::error::ClientError; use ibc_core_connection_types::error::ConnectionError; use ibc_core_connection_types::events::OpenAck; use ibc_core_connection_types::msgs::MsgConnectionOpenAck; @@ -11,12 +12,13 @@ use ibc_core_host::types::identifiers::ClientId; use ibc_core_host::types::path::{ClientConsensusStatePath, ClientStatePath, ConnectionPath, Path}; use ibc_core_host::{ExecutionContext, ValidationContext}; use ibc_primitives::prelude::*; -use ibc_primitives::proto::Protobuf; +use ibc_primitives::proto::{Any, Protobuf}; use ibc_primitives::ToVec; pub fn validate(ctx_a: &Ctx, msg: MsgConnectionOpenAck) -> Result<(), ContextError> where Ctx: ValidationContext, + >::Error: Into, { let vars = LocalVars::new(ctx_a, &msg)?; validate_impl(ctx_a, &msg, &vars) @@ -29,6 +31,7 @@ fn validate_impl( ) -> Result<(), ContextError> where Ctx: ValidationContext, + >::Error: Into, { ctx_a.validate_message_signer(&msg.signer)?; @@ -46,7 +49,7 @@ where let client_val_ctx_a = ctx_a.get_client_validation_context(); let client_state_of_a_on_b = - Ctx::HostClientState::try_from(msg.client_state_of_a_on_b.clone())?; + Ctx::HostClientState::try_from(msg.client_state_of_a_on_b.clone()).map_err(Into::into)?; ctx_a.validate_self_client(client_state_of_a_on_b)?; diff --git a/ibc-core/ics03-connection/src/handler/conn_open_try.rs b/ibc-core/ics03-connection/src/handler/conn_open_try.rs index d7eb9592f..e85828e7e 100644 --- a/ibc-core/ics03-connection/src/handler/conn_open_try.rs +++ b/ibc-core/ics03-connection/src/handler/conn_open_try.rs @@ -1,5 +1,6 @@ //! Protocol logic specific to processing ICS3 messages of type `MsgConnectionOpenTry`.; use ibc_core_client::context::prelude::*; +use ibc_core_client::types::error::ClientError; use ibc_core_connection_types::error::ConnectionError; use ibc_core_connection_types::events::OpenTry; use ibc_core_connection_types::msgs::MsgConnectionOpenTry; @@ -12,12 +13,13 @@ use ibc_core_host::types::path::{ }; use ibc_core_host::{ExecutionContext, ValidationContext}; use ibc_primitives::prelude::*; -use ibc_primitives::proto::Protobuf; +use ibc_primitives::proto::{Any, Protobuf}; use ibc_primitives::ToVec; pub fn validate(ctx_b: &Ctx, msg: MsgConnectionOpenTry) -> Result<(), ContextError> where Ctx: ValidationContext, + >::Error: Into, { let vars = LocalVars::new(ctx_b, &msg)?; validate_impl(ctx_b, &msg, &vars) @@ -30,13 +32,14 @@ fn validate_impl( ) -> Result<(), ContextError> where Ctx: ValidationContext, + >::Error: Into, { ctx_b.validate_message_signer(&msg.signer)?; let client_val_ctx_b = ctx_b.get_client_validation_context(); let client_state_of_b_on_a = - Ctx::HostClientState::try_from(msg.client_state_of_b_on_a.clone())?; + Ctx::HostClientState::try_from(msg.client_state_of_b_on_a.clone()).map_err(Into::into)?; ctx_b.validate_self_client(client_state_of_b_on_a)?; diff --git a/ibc-core/ics03-connection/types/Cargo.toml b/ibc-core/ics03-connection/types/Cargo.toml index 07091d845..39ecc8485 100644 --- a/ibc-core/ics03-connection/types/Cargo.toml +++ b/ibc-core/ics03-connection/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "connection", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "connection", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-03 Connection Semantics data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -41,50 +42,50 @@ parity-scale-codec = { workspace = true, optional = true } scale-info = { workspace = true, optional = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "subtle-encoding/std", - "serde/std", - "ibc-core-client-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-primitives/std", - "ibc-proto/std", - "tendermint/std", + "displaydoc/std", + "subtle-encoding/std", + "serde/std", + "ibc-core-client-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-primitives/std", + "ibc-proto/std", + "tendermint/std", ] serde = [ - "dep:serde", - "ibc-core-client-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", + "dep:serde", + "ibc-core-client-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", ] schema = [ - "dep:schemars", - "ibc-core-client-types/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "dep:schemars", + "ibc-core-client-types/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-core-client-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-primitives/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-core-client-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-primitives/borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core-client-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-core/ics03-connection/types/src/events.rs b/ibc-core/ics03-connection/types/src/events.rs index 1c2879852..08f64d9e1 100644 --- a/ibc-core/ics03-connection/types/src/events.rs +++ b/ibc-core/ics03-connection/types/src/events.rs @@ -393,11 +393,17 @@ mod tests { assert_eq!(t.kind, t.event.kind); assert_eq!(t.expected_keys.len(), t.event.attributes.len()); for (i, e) in t.event.attributes.iter().enumerate() { - assert_eq!(e.key, t.expected_keys[i], "key mismatch for {:?}", t.kind); + assert_eq!( + e.key_str().unwrap(), + t.expected_keys[i], + "key mismatch for {:?}", + t.kind + ); } for (i, e) in t.event.attributes.iter().enumerate() { assert_eq!( - e.value, t.expected_values[i], + e.value_str().unwrap(), + t.expected_values[i], "value mismatch for {:?}", t.kind ); diff --git a/ibc-core/ics04-channel/Cargo.toml b/ibc-core/ics04-channel/Cargo.toml index 3f61d5092..1ad973cc1 100644 --- a/ibc-core/ics04-channel/Cargo.toml +++ b/ibc-core/ics04-channel/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "channel"] +keywords = [ "blockchain", "cosmos", "ibc", "channel" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains the implementation of the ICS-04 Channel & Packet Semantics and re-exports essential data structures and domain types from `ibc-core-channel-types` crate. """ @@ -27,56 +28,56 @@ ibc-core-router = { workspace = true } ibc-primitives = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-core-client/std", - "ibc-core-connection/std", - "ibc-core-channel-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host/std", - "ibc-core-handler-types/std", - "ibc-core-router/std", - "ibc-primitives/std", + "ibc-core-client/std", + "ibc-core-connection/std", + "ibc-core-channel-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host/std", + "ibc-core-handler-types/std", + "ibc-core-router/std", + "ibc-primitives/std", ] serde = [ - "ibc-core-client/serde", - "ibc-core-connection/serde", - "ibc-core-channel-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host/serde", - "ibc-core-handler-types/serde", - "ibc-core-router/serde", - "ibc-primitives/serde", + "ibc-core-client/serde", + "ibc-core-connection/serde", + "ibc-core-channel-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host/serde", + "ibc-core-handler-types/serde", + "ibc-core-router/serde", + "ibc-primitives/serde", ] schema = [ - "ibc-core-client/schema", - "ibc-core-connection/schema", - "ibc-core-channel-types/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host/schema", - "ibc-core-handler-types/schema", - "ibc-core-router/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-client/schema", + "ibc-core-connection/schema", + "ibc-core-channel-types/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host/schema", + "ibc-core-handler-types/schema", + "ibc-core-router/schema", + "ibc-primitives/schema", + "serde", + "std", ] borsh = [ - "ibc-core-client/borsh", - "ibc-core-connection/borsh", - "ibc-core-channel-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host/borsh", - "ibc-core-handler-types/borsh", - "ibc-core-router/borsh", - "ibc-primitives/borsh", + "ibc-core-client/borsh", + "ibc-core-connection/borsh", + "ibc-core-channel-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host/borsh", + "ibc-core-handler-types/borsh", + "ibc-core-router/borsh", + "ibc-primitives/borsh", ] parity-scale-codec = [ - "ibc-core-client/parity-scale-codec", - "ibc-core-connection/parity-scale-codec", - "ibc-core-channel-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-core-router/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-client/parity-scale-codec", + "ibc-core-connection/parity-scale-codec", + "ibc-core-channel-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-core-router/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics04-channel/types/Cargo.toml b/ibc-core/ics04-channel/types/Cargo.toml index 55aee47f5..0ee9080c9 100644 --- a/ibc-core/ics04-channel/types/Cargo.toml +++ b/ibc-core/ics04-channel/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "channel", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "channel", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-4 Channel Semantics data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -43,56 +44,56 @@ parity-scale-codec = { workspace = true, optional = true } scale-info = { workspace = true, optional = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "sha2/std", - "serde/std", - "subtle-encoding/std", - "ibc-core-client-types/std", - "ibc-core-connection-types/std", - "ibc-core-host-types/std", - "ibc-core-commitment-types/std", - "ibc-primitives/std", - "ibc-proto/std", - "tendermint/std", + "displaydoc/std", + "sha2/std", + "serde/std", + "subtle-encoding/std", + "ibc-core-client-types/std", + "ibc-core-connection-types/std", + "ibc-core-host-types/std", + "ibc-core-commitment-types/std", + "ibc-primitives/std", + "ibc-proto/std", + "tendermint/std", ] serde = [ - "dep:serde", - "ibc-core-client-types/serde", - "ibc-core-connection-types/serde", - "ibc-core-host-types/serde", - "ibc-core-commitment-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", + "dep:serde", + "ibc-core-client-types/serde", + "ibc-core-connection-types/serde", + "ibc-core-host-types/serde", + "ibc-core-commitment-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", ] schema = [ - "dep:schemars", - "ibc-core-client-types/schema", - "ibc-core-connection-types/schema", - "ibc-core-host-types/schema", - "ibc-core-commitment-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "dep:schemars", + "ibc-core-client-types/schema", + "ibc-core-connection-types/schema", + "ibc-core-host-types/schema", + "ibc-core-commitment-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-core-client-types/borsh", - "ibc-core-connection-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-primitives/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-core-client-types/borsh", + "ibc-core-connection-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-primitives/borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core-client-types/parity-scale-codec", - "ibc-core-connection-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-connection-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-core/ics04-channel/types/src/events/mod.rs b/ibc-core/ics04-channel/types/src/events/mod.rs index 443119b3e..ee83a4028 100644 --- a/ibc-core/ics04-channel/types/src/events/mod.rs +++ b/ibc-core/ics04-channel/types/src/events/mod.rs @@ -1246,12 +1246,18 @@ mod tests { assert_eq!(t.kind, t.event.kind); assert_eq!(t.expected_keys.len(), t.event.attributes.len()); for (i, e) in t.event.attributes.iter().enumerate() { - assert_eq!(e.key, t.expected_keys[i], "key mismatch for {:?}", t.kind); + assert_eq!( + e.key_str().unwrap(), + t.expected_keys[i], + "key mismatch for {:?}", + t.kind + ); } assert_eq!(t.expected_values.len(), t.event.attributes.len()); for (i, e) in t.event.attributes.iter().enumerate() { assert_eq!( - e.value, t.expected_values[i], + e.value_str().unwrap(), + t.expected_values[i], "value mismatch for {:?}", t.kind ); diff --git a/ibc-core/ics23-commitment/types/Cargo.toml b/ibc-core/ics23-commitment/types/Cargo.toml index 905689347..27ce743c6 100644 --- a/ibc-core/ics23-commitment/types/Cargo.toml +++ b/ibc-core/ics23-commitment/types/Cargo.toml @@ -1,14 +1,15 @@ [package] -name = "ibc-core-commitment-types" +name = "ibc-core-commitment-types" version = { workspace = true } authors = { workspace = true } edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "commitment", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "commitment", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-23 Vector Commitments data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -20,55 +21,55 @@ all-features = true [dependencies] # external dependencies borsh = { workspace = true, optional = true } -derive_more = { workspace = true, features = ["as_ref"] } +derive_more = { workspace = true, features = [ "as_ref" ] } displaydoc = { workspace = true } schemars = { workspace = true, optional = true } serde = { workspace = true, optional = true } subtle-encoding = { workspace = true } # ibc dependencies -ibc-proto = { workspace = true } -ibc-primitives = { workspace = true } -ics23 = { version = "0.11", default-features = false, features = ["host-functions"] } +ibc-proto = { workspace = true } +ibc-primitives = { workspace = true } +ics23 = { version = "0.11", default-features = false, features = [ "host-functions" ] } # parity dependencies -parity-scale-codec = { workspace = true, optional = true } -scale-info = { workspace = true, optional = true } +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } [dev-dependencies] rstest = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "serde/std", - "subtle-encoding/std", - "ibc-primitives/std", - "ibc-proto/std", - "ics23/std", + "displaydoc/std", + "serde/std", + "subtle-encoding/std", + "ibc-primitives/std", + "ibc-proto/std", + "ics23/std", ] serde = [ - "dep:serde", - "ibc-primitives/serde", - "ibc-proto/serde", - "ics23/serde", + "dep:serde", + "ibc-primitives/serde", + "ibc-proto/serde", + "ics23/serde", ] schema = [ - "dep:schemars", - "ibc-proto/json-schema", - "ibc-primitives/schema", - "serde", - "std" + "dep:schemars", + "ibc-proto/json-schema", + "ibc-primitives/schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-proto/borsh", - "ibc-primitives/borsh", + "dep:borsh", + "ibc-proto/borsh", + "ibc-primitives/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-core/ics24-host/Cargo.toml b/ibc-core/ics24-host/Cargo.toml index c3e56f554..c97fb7324 100644 --- a/ibc-core/ics24-host/Cargo.toml +++ b/ibc-core/ics24-host/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "host"] +keywords = [ "blockchain", "cosmos", "ibc", "host" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains essential top-level traits designed for the seamless integration of host chains, facilitating access to the host's storage, the efficient retrieval of states and metadata crucial for the execution of any IBC datagrams. @@ -19,9 +20,9 @@ all-features = true [dependencies] # external dependencies -derive_more = { workspace = true } -displaydoc = { workspace = true } -subtle-encoding = { workspace = true } +derive_more = { workspace = true } +displaydoc = { workspace = true } +subtle-encoding = { workspace = true } # ibc dependencies ibc-core-client-types = { workspace = true } @@ -37,57 +38,57 @@ ibc-primitives = { workspace = true } rstest = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "subtle-encoding/std", - "ibc-core-client-types/std", - "ibc-core-client-context/std", - "ibc-core-connection-types/std", - "ibc-core-channel-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-core-handler-types/std", - "ibc-primitives/std", + "displaydoc/std", + "subtle-encoding/std", + "ibc-core-client-types/std", + "ibc-core-client-context/std", + "ibc-core-connection-types/std", + "ibc-core-channel-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-core-handler-types/std", + "ibc-primitives/std", ] serde = [ - "ibc-core-client-types/serde", - "ibc-core-client-context/serde", - "ibc-core-connection-types/serde", - "ibc-core-channel-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host-types/serde", - "ibc-core-handler-types/serde", - "ibc-primitives/serde", + "ibc-core-client-types/serde", + "ibc-core-client-context/serde", + "ibc-core-connection-types/serde", + "ibc-core-channel-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host-types/serde", + "ibc-core-handler-types/serde", + "ibc-primitives/serde", ] schema = [ - "ibc-core-client-types/schema", - "ibc-core-client-context/schema", - "ibc-core-connection-types/schema", - "ibc-core-channel-types/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host-types/schema", - "ibc-core-handler-types/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-client-types/schema", + "ibc-core-client-context/schema", + "ibc-core-connection-types/schema", + "ibc-core-channel-types/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host-types/schema", + "ibc-core-handler-types/schema", + "ibc-primitives/schema", + "serde", + "std", ] borsh = [ - "ibc-core-client-types/borsh", - "ibc-core-client-context/borsh", - "ibc-core-connection-types/borsh", - "ibc-core-channel-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-core-handler-types/borsh", - "ibc-primitives/borsh", + "ibc-core-client-types/borsh", + "ibc-core-client-context/borsh", + "ibc-core-connection-types/borsh", + "ibc-core-channel-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-core-handler-types/borsh", + "ibc-primitives/borsh", ] parity-scale-codec = [ - "ibc-core-client-types/parity-scale-codec", - "ibc-core-connection-types/parity-scale-codec", - "ibc-core-channel-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-connection-types/parity-scale-codec", + "ibc-core-channel-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics24-host/cosmos/Cargo.toml b/ibc-core/ics24-host/cosmos/Cargo.toml index e9c2e73e6..50e06f273 100644 --- a/ibc-core/ics24-host/cosmos/Cargo.toml +++ b/ibc-core/ics24-host/cosmos/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "tendermint"] +keywords = [ "blockchain", "cosmos", "ibc", "tendermint" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains Cosmos-specific helper traits and implementations to facilitate IBC integration, ensuring proper interaction with modules/components beyond the IBC modules on host chains. @@ -19,7 +20,7 @@ all-features = true [dependencies] # external dependencies -borsh = { workspace = true, optional = true} +borsh = { workspace = true, optional = true } derive_more = { workspace = true } displaydoc = { workspace = true } serde = { workspace = true, optional = true } @@ -46,66 +47,66 @@ parity-scale-codec = { workspace = true, optional = true } scale-info = { workspace = true, optional = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "serde/std", - "sha2/std", - "subtle-encoding/std", - "ibc-core-client-types/std", - "ibc-core-client-context/std", - "ibc-core-connection-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-core-handler-types/std", - "ibc-primitives/std", - "ibc-proto/std", + "displaydoc/std", + "serde/std", + "sha2/std", + "subtle-encoding/std", + "ibc-core-client-types/std", + "ibc-core-client-context/std", + "ibc-core-connection-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-core-handler-types/std", + "ibc-primitives/std", + "ibc-proto/std", ] serde = [ - "dep:serde", - "ibc-client-tendermint/serde", - "ibc-core-client-types/serde", - "ibc-core-client-context/serde", - "ibc-core-connection-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host-types/serde", - "ibc-core-handler-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", + "dep:serde", + "ibc-client-tendermint/serde", + "ibc-core-client-types/serde", + "ibc-core-client-context/serde", + "ibc-core-connection-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host-types/serde", + "ibc-core-handler-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", ] schema = [ - "ibc-client-tendermint/schema", - "ibc-core-client-types/schema", - "ibc-core-client-context/schema", - "ibc-core-connection-types/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host-types/schema", - "ibc-core-handler-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "ibc-client-tendermint/schema", + "ibc-core-client-types/schema", + "ibc-core-client-context/schema", + "ibc-core-connection-types/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host-types/schema", + "ibc-core-handler-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-client-tendermint/borsh", - "ibc-core-client-types/borsh", - "ibc-core-client-context/borsh", - "ibc-core-connection-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-primitives/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-client-tendermint/borsh", + "ibc-core-client-types/borsh", + "ibc-core-client-context/borsh", + "ibc-core-connection-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-primitives/borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-client-tendermint/parity-scale-codec", - "ibc-core-client-types/parity-scale-codec", - "ibc-core-connection-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-client-tendermint/parity-scale-codec", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-connection-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-core/ics24-host/types/Cargo.toml b/ibc-core/ics24-host/types/Cargo.toml index ec2d6ed1f..80c1efb2b 100644 --- a/ibc-core/ics24-host/types/Cargo.toml +++ b/ibc-core/ics24-host/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "host", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "host", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-24 Host Requirements data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -29,35 +30,35 @@ serde = { workspace = true, optional = true } ibc-primitives = { workspace = true } # parity dependencies -parity-scale-codec = { workspace = true, optional = true } -scale-info = { workspace = true, optional = true } +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } [dev-dependencies] rstest = { workspace = true } serde_json = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "ibc-primitives/std", + "displaydoc/std", + "ibc-primitives/std", ] serde = [ - "dep:serde", - "ibc-primitives/serde", + "dep:serde", + "ibc-primitives/serde", ] schema = [ - "dep:schemars", - "ibc-primitives/schema", - "serde", - "std" + "dep:schemars", + "ibc-primitives/schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-primitives/borsh", + "dep:borsh", + "ibc-primitives/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-primitives/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics25-handler/Cargo.toml b/ibc-core/ics25-handler/Cargo.toml index af7589735..43dcf44ed 100644 --- a/ibc-core/ics25-handler/Cargo.toml +++ b/ibc-core/ics25-handler/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "handler"] +keywords = [ "blockchain", "cosmos", "ibc", "handler" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, exposes IBC handler entry points for an integrated IBC core modules. These entry points are responsible for processing incoming IBC messages, performing validation, and execution logic by invoking the appropriate module handler. @@ -28,55 +29,55 @@ ibc-core-host = { workspace = true } ibc-primitives = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-core-client/std", - "ibc-core-connection/std", - "ibc-core-channel/std", - "ibc-core-commitment-types/std", - "ibc-core-host/std", - "ibc-core-router/std", - "ibc-core-handler-types/std", - "ibc-primitives/std", + "ibc-core-client/std", + "ibc-core-connection/std", + "ibc-core-channel/std", + "ibc-core-commitment-types/std", + "ibc-core-host/std", + "ibc-core-router/std", + "ibc-core-handler-types/std", + "ibc-primitives/std", ] serde = [ - "ibc-core-client/serde", - "ibc-core-connection/serde", - "ibc-core-channel/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host/serde", - "ibc-core-router/serde", - "ibc-core-handler-types/serde", - "ibc-primitives/serde", + "ibc-core-client/serde", + "ibc-core-connection/serde", + "ibc-core-channel/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host/serde", + "ibc-core-router/serde", + "ibc-core-handler-types/serde", + "ibc-primitives/serde", ] borsh = [ - "ibc-core-client/borsh", - "ibc-core-connection/borsh", - "ibc-core-channel/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host/borsh", - "ibc-core-router/borsh", - "ibc-core-handler-types/borsh", - "ibc-primitives/borsh", + "ibc-core-client/borsh", + "ibc-core-connection/borsh", + "ibc-core-channel/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host/borsh", + "ibc-core-router/borsh", + "ibc-core-handler-types/borsh", + "ibc-primitives/borsh", ] schema = [ - "ibc-core-client/schema", - "ibc-core-connection/schema", - "ibc-core-channel/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host/schema", - "ibc-core-router/schema", - "ibc-core-handler-types/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-client/schema", + "ibc-core-connection/schema", + "ibc-core-channel/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host/schema", + "ibc-core-router/schema", + "ibc-core-handler-types/schema", + "ibc-primitives/schema", + "serde", + "std", ] parity-scale-codec = [ - "ibc-core-client/parity-scale-codec", - "ibc-core-connection/parity-scale-codec", - "ibc-core-channel/parity-scale-codec", - "ibc-core-host/parity-scale-codec", - "ibc-core-router/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-client/parity-scale-codec", + "ibc-core-connection/parity-scale-codec", + "ibc-core-channel/parity-scale-codec", + "ibc-core-host/parity-scale-codec", + "ibc-core-router/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics25-handler/src/entrypoint.rs b/ibc-core/ics25-handler/src/entrypoint.rs index 1de98b062..3c271a9bb 100644 --- a/ibc-core/ics25-handler/src/entrypoint.rs +++ b/ibc-core/ics25-handler/src/entrypoint.rs @@ -9,7 +9,9 @@ use ibc_core_channel::handler::{ use ibc_core_channel::types::msgs::{ channel_msg_to_port_id, packet_msg_to_port_id, ChannelMsg, PacketMsg, }; +use ibc_core_client::context::{ClientExecutionContext, ClientValidationContext}; use ibc_core_client::handler::{create_client, update_client, upgrade_client}; +use ibc_core_client::types::error::ClientError; use ibc_core_client::types::msgs::{ClientMsg, MsgUpdateOrMisbehaviour}; use ibc_core_connection::handler::{ conn_open_ack, conn_open_confirm, conn_open_init, conn_open_try, @@ -20,6 +22,7 @@ use ibc_core_handler_types::msgs::MsgEnvelope; use ibc_core_host::{ExecutionContext, ValidationContext}; use ibc_core_router::router::Router; use ibc_core_router::types::error::RouterError; +use ibc_primitives::proto::Any; /// Entrypoint which performs both validation and message execution pub fn dispatch( @@ -29,6 +32,9 @@ pub fn dispatch( ) -> Result<(), ContextError> where Ctx: ExecutionContext, + <::ClientStateRef as TryFrom>::Error: Into, + <::ClientStateMut as TryFrom>::Error: Into, + >::Error: Into, { validate(ctx, router, msg.clone())?; execute(ctx, router, msg) @@ -45,6 +51,8 @@ where pub fn validate(ctx: &Ctx, router: &impl Router, msg: MsgEnvelope) -> Result<(), ContextError> where Ctx: ValidationContext, + <::ClientStateRef as TryFrom>::Error: Into, + >::Error: Into, { match msg { MsgEnvelope::Client(msg) => match msg { @@ -121,6 +129,7 @@ pub fn execute( ) -> Result<(), ContextError> where Ctx: ExecutionContext, + <::ClientStateMut as TryFrom>::Error: Into, { match msg { MsgEnvelope::Client(msg) => match msg { diff --git a/ibc-core/ics25-handler/types/Cargo.toml b/ibc-core/ics25-handler/types/Cargo.toml index 853e43c39..8e5154493 100644 --- a/ibc-core/ics25-handler/types/Cargo.toml +++ b/ibc-core/ics25-handler/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "handler", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "handler", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-25 Handler Interface data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -44,65 +45,65 @@ parity-scale-codec = { workspace = true, optional = true } scale-info = { workspace = true, optional = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "serde/std", - "subtle-encoding/std", - "ibc-core-client-types/std", - "ibc-core-connection-types/std", - "ibc-core-channel-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-core-router-types/std", - "ibc-primitives/std", - "ibc-proto/std", - "tendermint/std", + "displaydoc/std", + "serde/std", + "subtle-encoding/std", + "ibc-core-client-types/std", + "ibc-core-connection-types/std", + "ibc-core-channel-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-core-router-types/std", + "ibc-primitives/std", + "ibc-proto/std", + "tendermint/std", ] serde = [ - "dep:serde", - "ibc-core-client-types/serde", - "ibc-core-connection-types/serde", - "ibc-core-channel-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host-types/serde", - "ibc-core-router-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", + "dep:serde", + "ibc-core-client-types/serde", + "ibc-core-connection-types/serde", + "ibc-core-channel-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host-types/serde", + "ibc-core-router-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", ] schema = [ - "dep:schemars", - "ibc-core-client-types/schema", - "ibc-core-connection-types/schema", - "ibc-core-channel-types/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host-types/schema", - "ibc-core-router-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "dep:schemars", + "ibc-core-client-types/schema", + "ibc-core-connection-types/schema", + "ibc-core-channel-types/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host-types/schema", + "ibc-core-router-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-core-client-types/borsh", - "ibc-core-connection-types/borsh", - "ibc-core-channel-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-core-router-types/borsh", - "ibc-primitives/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-core-client-types/borsh", + "ibc-core-connection-types/borsh", + "ibc-core-channel-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-core-router-types/borsh", + "ibc-primitives/borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core-client-types/parity-scale-codec", - "ibc-core-connection-types/parity-scale-codec", - "ibc-core-channel-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-core-router-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-connection-types/parity-scale-codec", + "ibc-core-channel-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-core-router-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-core/ics26-routing/Cargo.toml b/ibc-core/ics26-routing/Cargo.toml index 482bf719d..cf809acf1 100644 --- a/ibc-core/ics26-routing/Cargo.toml +++ b/ibc-core/ics26-routing/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "routing"] +keywords = [ "blockchain", "cosmos", "ibc", "routing" ] readme = "./../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, contains necessary traits to implement the routing and callback functionality (IBC router module) used for connecting the application layer to the transport layer of an IBC enabled chain. """ @@ -29,38 +30,38 @@ ibc-core-host-types = { workspace = true } ibc-core-router-types = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "subtle-encoding/std", - "ibc-primitives/std", - "ibc-core-channel-types/std", - "ibc-core-host-types/std", - "ibc-core-router-types/std", + "displaydoc/std", + "subtle-encoding/std", + "ibc-primitives/std", + "ibc-core-channel-types/std", + "ibc-core-host-types/std", + "ibc-core-router-types/std", ] serde = [ - "ibc-primitives/serde", - "ibc-core-channel-types/serde", - "ibc-core-host-types/serde", - "ibc-core-router-types/serde", + "ibc-primitives/serde", + "ibc-core-channel-types/serde", + "ibc-core-host-types/serde", + "ibc-core-router-types/serde", ] borsh = [ - "ibc-primitives/borsh", - "ibc-core-channel-types/borsh", - "ibc-core-host-types/borsh", - "ibc-core-router-types/borsh", + "ibc-primitives/borsh", + "ibc-core-channel-types/borsh", + "ibc-core-host-types/borsh", + "ibc-core-router-types/borsh", ] schema = [ - "ibc-core-channel-types/schema", - "ibc-core-host-types/schema", - "ibc-core-router-types/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-core-channel-types/schema", + "ibc-core-host-types/schema", + "ibc-core-router-types/schema", + "ibc-primitives/schema", + "serde", + "std", ] parity-scale-codec = [ - "ibc-core-channel-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-core-router-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-core-channel-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-core-router-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/ibc-core/ics26-routing/types/Cargo.toml b/ibc-core/ics26-routing/types/Cargo.toml index e9691d43a..71acf4bee 100644 --- a/ibc-core/ics26-routing/types/Cargo.toml +++ b/ibc-core/ics26-routing/types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc", "routing", "types"] +keywords = [ "blockchain", "cosmos", "ibc", "routing", "types" ] readme = "./../../README.md" -description = """ + +description = """ Maintained by `ibc-rs`, encapsulates essential ICS-26 Routing Module data structures and domain types, as specified in the Inter-Blockchain Communication (IBC) protocol. Designed for universal applicability to facilitate development and integration across diverse IBC-enabled projects. @@ -27,9 +28,9 @@ serde = { workspace = true, optional = true } subtle-encoding = { workspace = true } # ibc dependencies -ibc-core-host-types = { workspace = true } -ibc-primitives = { workspace = true } -ibc-proto = {workspace = true } +ibc-core-host-types = { workspace = true } +ibc-primitives = { workspace = true } +ibc-proto = { workspace = true } # cosmos dependencies tendermint = { workspace = true } @@ -39,41 +40,41 @@ parity-scale-codec = { workspace = true, optional = true } scale-info = { workspace = true, optional = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "serde/std", - "subtle-encoding/std", - "ibc-primitives/std", - "ibc-core-host-types/std", - "ibc-proto/std", - "tendermint/std", + "displaydoc/std", + "serde/std", + "subtle-encoding/std", + "ibc-primitives/std", + "ibc-core-host-types/std", + "ibc-proto/std", + "tendermint/std", ] serde = [ - "dep:serde", - "ibc-primitives/serde", - "ibc-core-host-types/serde", - "ibc-primitives/serde", - "ibc-proto/serde", + "dep:serde", + "ibc-primitives/serde", + "ibc-core-host-types/serde", + "ibc-primitives/serde", + "ibc-proto/serde", ] borsh = [ - "dep:borsh", - "ibc-core-host-types/borsh", - "ibc-primitives/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-core-host-types/borsh", + "ibc-primitives/borsh", + "ibc-proto/borsh", ] schema = [ - "dep:schemars", - "ibc-core-host-types/schema", - "ibc-primitives/schema", - "ibc-proto/json-schema", - "serde", - "std" + "dep:schemars", + "ibc-core-host-types/schema", + "ibc-primitives/schema", + "ibc-proto/json-schema", + "serde", + "std", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-core-host-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-core-host-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-data-types/Cargo.toml b/ibc-data-types/Cargo.toml index 30bc92a2c..da618570d 100644 --- a/ibc-data-types/Cargo.toml +++ b/ibc-data-types/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc"] +keywords = [ "blockchain", "cosmos", "ibc" ] readme = "README.md" -description = """ + +description = """ Maintained by `ibc-rs`, delineates standard data structures and domain types of the Inter-Blockchain Communication (IBC) protocol. Designed for universal application, enabling diverse projects across IBC ecosystem to build using a shared language. """ @@ -30,70 +31,70 @@ ibc-client-wasm-types = { workspace = true } ibc-primitives = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-app-transfer-types/std", - "ibc-core-client-types/std", - "ibc-core-connection-types/std", - "ibc-core-channel-types/std", - "ibc-core-commitment-types/std", - "ibc-core-host-types/std", - "ibc-core-router-types/std", - "ibc-core-handler-types/std", - "ibc-client-tendermint-types/std", - "ibc-client-wasm-types/std", - "ibc-primitives/std", + "ibc-app-transfer-types/std", + "ibc-core-client-types/std", + "ibc-core-connection-types/std", + "ibc-core-channel-types/std", + "ibc-core-commitment-types/std", + "ibc-core-host-types/std", + "ibc-core-router-types/std", + "ibc-core-handler-types/std", + "ibc-client-tendermint-types/std", + "ibc-client-wasm-types/std", + "ibc-primitives/std", ] serde = [ - "ibc-app-transfer-types/serde", - "ibc-core-client-types/serde", - "ibc-core-connection-types/serde", - "ibc-core-channel-types/serde", - "ibc-core-commitment-types/serde", - "ibc-core-host-types/serde", - "ibc-core-router-types/serde", - "ibc-core-handler-types/serde", - "ibc-client-tendermint-types/serde", - "ibc-client-wasm-types/serde", - "ibc-primitives/serde", + "ibc-app-transfer-types/serde", + "ibc-core-client-types/serde", + "ibc-core-connection-types/serde", + "ibc-core-channel-types/serde", + "ibc-core-commitment-types/serde", + "ibc-core-host-types/serde", + "ibc-core-router-types/serde", + "ibc-core-handler-types/serde", + "ibc-client-tendermint-types/serde", + "ibc-client-wasm-types/serde", + "ibc-primitives/serde", ] borsh = [ - "ibc-app-transfer-types/borsh", - "ibc-core-client-types/borsh", - "ibc-core-connection-types/borsh", - "ibc-core-channel-types/borsh", - "ibc-core-commitment-types/borsh", - "ibc-core-host-types/borsh", - "ibc-core-router-types/borsh", - "ibc-core-handler-types/borsh", - "ibc-client-tendermint-types/borsh", - "ibc-primitives/borsh", + "ibc-app-transfer-types/borsh", + "ibc-core-client-types/borsh", + "ibc-core-connection-types/borsh", + "ibc-core-channel-types/borsh", + "ibc-core-commitment-types/borsh", + "ibc-core-host-types/borsh", + "ibc-core-router-types/borsh", + "ibc-core-handler-types/borsh", + "ibc-client-tendermint-types/borsh", + "ibc-primitives/borsh", ] schema = [ - "ibc-app-transfer-types/schema", - "ibc-core-client-types/schema", - "ibc-core-connection-types/schema", - "ibc-core-channel-types/schema", - "ibc-core-commitment-types/schema", - "ibc-core-host-types/schema", - "ibc-core-router-types/schema", - "ibc-core-handler-types/schema", - "ibc-client-tendermint-types/schema", - "ibc-client-wasm-types/schema", - "ibc-primitives/schema", + "ibc-app-transfer-types/schema", + "ibc-core-client-types/schema", + "ibc-core-connection-types/schema", + "ibc-core-channel-types/schema", + "ibc-core-commitment-types/schema", + "ibc-core-host-types/schema", + "ibc-core-router-types/schema", + "ibc-core-handler-types/schema", + "ibc-client-tendermint-types/schema", + "ibc-client-wasm-types/schema", + "ibc-primitives/schema", ] parity-scale-codec = [ - "ibc-app-transfer-types/parity-scale-codec", - "ibc-core-client-types/parity-scale-codec", - "ibc-core-connection-types/parity-scale-codec", - "ibc-core-channel-types/parity-scale-codec", - "ibc-core-commitment-types/parity-scale-codec", - "ibc-core-host-types/parity-scale-codec", - "ibc-core-router-types/parity-scale-codec", - "ibc-core-handler-types/parity-scale-codec", - "ibc-client-tendermint-types/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-app-transfer-types/parity-scale-codec", + "ibc-core-client-types/parity-scale-codec", + "ibc-core-connection-types/parity-scale-codec", + "ibc-core-channel-types/parity-scale-codec", + "ibc-core-commitment-types/parity-scale-codec", + "ibc-core-host-types/parity-scale-codec", + "ibc-core-router-types/parity-scale-codec", + "ibc-core-handler-types/parity-scale-codec", + "ibc-client-tendermint-types/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] cosmwasm = [ - "ibc-client-wasm-types/cosmwasm", + "ibc-client-wasm-types/cosmwasm", ] diff --git a/ibc-derive/Cargo.toml b/ibc-derive/Cargo.toml index 90abcab43..cf7ce7cbf 100644 --- a/ibc-derive/Cargo.toml +++ b/ibc-derive/Cargo.toml @@ -11,6 +11,6 @@ description = "Maintained by `ibc-rs`, macros implementations of #[derive(Client proc-macro = true [dependencies] -syn = "2" -proc-macro2 = "1" -quote = "1" +syn = { version = "2" } +proc-macro2 = { version = "1" } +quote = { version = "1" } diff --git a/ibc-primitives/Cargo.toml b/ibc-primitives/Cargo.toml index c00344252..0afd83407 100644 --- a/ibc-primitives/Cargo.toml +++ b/ibc-primitives/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "cosmos", "ibc"] +keywords = [ "blockchain", "cosmos", "ibc" ] readme = "README.md" -description = """ + +description = """ Maintained by `ibc-rs`, furnishes essential types and traits universally utilized in the implementation of diverse IBC modules, encompassing core functionalities, clients, and applications. @@ -25,7 +26,7 @@ displaydoc = { workspace = true } prost = { workspace = true } schemars = { workspace = true, optional = true } serde = { workspace = true, optional = true } -time = { version = ">=0.3.0, <0.3.35", default-features = false } +time = { version = ">=0.3.0, <0.3.37", default-features = false } # ibc dependencies ibc-proto = { workspace = true } @@ -34,35 +35,35 @@ ibc-proto = { workspace = true } tendermint = { workspace = true } # parity dependencies -parity-scale-codec = { workspace = true, optional = true } -scale-info = { workspace = true, optional = true } +parity-scale-codec = { workspace = true, optional = true } +scale-info = { workspace = true, optional = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "displaydoc/std", - "prost/std", - "serde/std", - "ibc-proto/std", - "tendermint/std", - "time/std", + "displaydoc/std", + "prost/std", + "serde/std", + "ibc-proto/std", + "tendermint/std", + "time/std", ] serde = [ - "dep:serde", - "ibc-proto/serde", + "dep:serde", + "ibc-proto/serde", ] schema = [ - "dep:schemars", - "ibc-proto/json-schema", - "serde", - "std" + "dep:schemars", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "dep:parity-scale-codec", - "dep:scale-info", - "ibc-proto/parity-scale-codec", + "dep:parity-scale-codec", + "dep:scale-info", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-query/Cargo.toml b/ibc-query/Cargo.toml index 7d71d7424..531629343 100644 --- a/ibc-query/Cargo.toml +++ b/ibc-query/Cargo.toml @@ -1,14 +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"] -description = """ +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. """ @@ -16,30 +16,29 @@ description = """ [dependencies] # external dependencies displaydoc = { version = "0.2", default-features = false } -schemars = { workspace = true , optional = true } +schemars = { workspace = true, optional = true } serde = { workspace = true, optional = true } tonic = { version = "0.11" } # ibc dependencies ibc = { workspace = true } -ibc-proto = { workspace = true, features = ["server"] } +ibc-proto = { workspace = true, features = [ "server" ] } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc/std", - "ibc-proto/std", + "ibc/std", + "ibc-proto/std", ] serde = [ - "dep:serde", - "ibc/serde", - "ibc-proto/serde", + "dep:serde", + "ibc/serde", + "ibc-proto/serde", ] schema = [ - "dep:schemars", - "ibc/schema", - "ibc-proto/json-schema", - "serde", - "std", + "dep:schemars", + "ibc/schema", + "ibc-proto/json-schema", + "serde", + "std", ] - diff --git a/ibc-testkit/Cargo.toml b/ibc-testkit/Cargo.toml index 6c3d64805..0ab0ed09e 100644 --- a/ibc-testkit/Cargo.toml +++ b/ibc-testkit/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "ibc-testkit" -version = { workspace = true } -authors = { workspace = true } -edition = { workspace = true } +name = "ibc-testkit" +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"] -description = """ +license = { workspace = true } +repository = { workspace = true } +readme = "README.md" +keywords = [ "blockchain", "consensus", "cosmos", "ibc", "tendermint" ] +description = """ Maintained by `ibc-rs`, serves as a versatile library that provides essential abstractions and implementations, fulfilling a dual role of enabling rigorous integration testing for the `ibc-rs` implementation while also aiding host chains in addressing a broad spectrum @@ -17,63 +17,70 @@ description = """ [dependencies] # external dependencies -borsh = { workspace = true, optional = true } -derive_more = { workspace = true } -displaydoc = { workspace = true } -parking_lot = { version = "0.12.1", default-features = false } -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" } +borsh = { workspace = true, optional = true } +derive_more = { workspace = true } +displaydoc = { workspace = true } +parking_lot = { version = "0.12.1", default-features = false } +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-query = { version = "0.52.0", path = "../ibc-query" } -basecoin-store = { git = "https://github.com/informalsystems/basecoin-rs", rev = "ce0d6c7" } +ibc = { workspace = true, features = [ "std" ] } +ibc-proto = { workspace = true } +ibc-client-cw = { workspace = true } +ibc-client-tendermint-cw = { workspace = true } +ibc-query = { workspace = true } + +# basecoin dependencies +basecoin-store = { git = "https://github.com/informalsystems/basecoin-rs", rev = "8496b3f" } # cosmos dependencies tendermint = { workspace = true } tendermint-testgen = { workspace = true } [dev-dependencies] -env_logger = "0.11.0" +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 } -tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"] } -test-log = { version = "0.2.13", features = ["trace"] } +cosmwasm-vm = { workspace = true } +cosmwasm-std = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "serde/std", - "tracing/std", - "tracing-subscriber/std", - "serde_json/std", - "ibc/std", - "ibc-proto/std", - "tendermint/std", + "serde/std", + "tracing/std", + "tracing-subscriber/std", + "serde_json/std", + "ibc/std", + "ibc-proto/std", + "tendermint/std", ] serde = [ - "dep:serde", - "ibc/serde", - "ibc-proto/serde", - "serde_json", + "dep:serde", + "ibc/serde", + "ibc-proto/serde", + "serde_json", ] schema = [ - "dep:schemars", - "ibc/schema", - "ibc-proto/json-schema", - "serde", - "std", + "dep:schemars", + "ibc/schema", + "ibc-proto/json-schema", + "serde", + "std", ] borsh = [ - "dep:borsh", - "ibc/borsh", - "ibc-proto/borsh", + "dep:borsh", + "ibc/borsh", + "ibc-proto/borsh", ] parity-scale-codec = [ - "ibc/parity-scale-codec", - "ibc-proto/parity-scale-codec", + "ibc/parity-scale-codec", + "ibc-proto/parity-scale-codec", ] diff --git a/ibc-testkit/src/fixtures/core/client/mod.rs b/ibc-testkit/src/fixtures/core/client/mod.rs index 442bed21d..508fe0e3b 100644 --- a/ibc-testkit/src/fixtures/core/client/mod.rs +++ b/ibc-testkit/src/fixtures/core/client/mod.rs @@ -96,14 +96,16 @@ mod tests { assert_eq!(t.expected_keys.len(), t.event.attributes.len()); for (i, e) in t.event.attributes.iter().enumerate() { assert_eq!( - e.key, t.expected_keys[i], + e.key_str().unwrap(), + t.expected_keys[i], "key mismatch for {:?}", t.event_kind ); } for (i, e) in t.event.attributes.iter().enumerate() { assert_eq!( - e.value, t.expected_values[i], + e.value_str().unwrap(), + t.expected_values[i], "value mismatch for {:?}", t.event_kind ); diff --git a/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs b/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs index 46564fa75..a72f1c87e 100644 --- a/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs +++ b/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs @@ -482,3 +482,22 @@ impl From for MockClientState { Self::new(cs.header) } } + +#[cfg(test)] +mod test { + #[cfg(feature = "serde")] + #[test] + fn test_any_client_state_to_json() { + use ibc::primitives::proto::Any; + + use super::{MockClientState, MockHeader}; + + let client_state = MockClientState::new(MockHeader::default()); + let expected = r#"{"typeUrl":"/ibc.mock.ClientState","value":"CgQKAhABEIDIr6Al"}"#; + let json = serde_json::to_string(&Any::from(client_state)).unwrap(); + assert_eq!(json, expected); + + let proto_any = serde_json::from_str::(expected).unwrap(); + assert_eq!(proto_any, Any::from(client_state)); + } +} diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/tests/fixture.rs b/ibc-testkit/tests/cosmwasm/fixture.rs similarity index 94% rename from ibc-clients/ics07-tendermint/cw-contract/src/tests/fixture.rs rename to ibc-testkit/tests/cosmwasm/fixture.rs index b9b646eec..8e8403342 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/tests/fixture.rs +++ b/ibc-testkit/tests/cosmwasm/fixture.rs @@ -1,24 +1,24 @@ use std::time::Duration; use cosmwasm_std::{from_json, Deps, DepsMut, Empty, Response, StdError, StdResult}; +use ibc::clients::tendermint::client_state::ClientState as TmClientState; +use ibc::clients::tendermint::consensus_state::ConsensusState as TmConsensusState; +use ibc::clients::tendermint::types::Header; +use ibc::core::client::types::{Height, Status}; +use ibc::core::host::types::identifiers::ChainId; +use ibc::core::primitives::Timestamp; use ibc_client_cw::types::{ CheckForMisbehaviourMsgRaw, ContractError, ExportMetadataMsg, GenesisMetadata, InstantiateMsg, MigrationPrefix, QueryMsg, QueryResponse, StatusMsg, UpdateStateMsgRaw, UpdateStateOnMisbehaviourMsgRaw, VerifyClientMessageRaw, }; use ibc_client_cw::utils::AnyCodec; -use ibc_client_tendermint::client_state::ClientState as TmClientState; -use ibc_client_tendermint::consensus_state::ConsensusState as TmConsensusState; -use ibc_client_tendermint::types::Header; -use ibc_core::client::types::{Height, Status}; -use ibc_core::host::types::identifiers::ChainId; -use ibc_core::primitives::Timestamp; +use ibc_client_tendermint_cw::entrypoint::TendermintContext; use ibc_testkit::fixtures::clients::tendermint::ClientStateConfig; use tendermint::Time; use tendermint_testgen::{Generator, Validator}; use super::helper::{dummy_checksum, dummy_sov_consensus_state, mock_env_with_timestamp_now}; -use crate::entrypoint::TendermintContext; /// Test fixture #[derive(Clone, Debug)] diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/tests/helper.rs b/ibc-testkit/tests/cosmwasm/helper.rs similarity index 91% rename from ibc-clients/ics07-tendermint/cw-contract/src/tests/helper.rs rename to ibc-testkit/tests/cosmwasm/helper.rs index 45b5137b0..666a7e83f 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/tests/helper.rs +++ b/ibc-testkit/tests/cosmwasm/helper.rs @@ -2,8 +2,8 @@ use std::str::FromStr; use cosmwasm_std::testing::{mock_env, mock_info}; use cosmwasm_std::{coins, Env, MessageInfo, Timestamp as CwTimestamp}; -use ibc_client_tendermint::types::ConsensusState; -use ibc_core::primitives::Timestamp as IbcTimestamp; +use ibc::clients::tendermint::types::ConsensusState; +use ibc::core::primitives::Timestamp as IbcTimestamp; use tendermint::Hash; pub fn dummy_msg_info() -> MessageInfo { diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/tests/mod.rs b/ibc-testkit/tests/cosmwasm/mod.rs similarity index 96% rename from ibc-clients/ics07-tendermint/cw-contract/src/tests/mod.rs rename to ibc-testkit/tests/cosmwasm/mod.rs index 9c302f1f2..413981236 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/tests/mod.rs +++ b/ibc-testkit/tests/cosmwasm/mod.rs @@ -5,13 +5,12 @@ use std::time::Duration; use cosmwasm_std::from_json; use cosmwasm_std::testing::{mock_dependencies, mock_env}; +use fixture::Fixture; +use ibc::core::client::types::{Height, Status}; use ibc_client_cw::types::{ ContractResult, MigrateClientStoreMsg, MigrationPrefix, VerifyClientMessageRaw, }; -use ibc_core::client::types::{Height, Status}; - -use crate::entrypoint::sudo; -use crate::tests::fixture::Fixture; +use ibc_client_tendermint_cw::entrypoint::sudo; #[test] fn test_cw_create_client_ok() { diff --git a/ibc-testkit/tests/mod.rs b/ibc-testkit/tests/mod.rs index 1f32c1d98..8b6f6bf3e 100644 --- a/ibc-testkit/tests/mod.rs +++ b/ibc-testkit/tests/mod.rs @@ -8,3 +8,4 @@ )] pub mod applications; pub mod core; +pub mod cosmwasm; diff --git a/ibc/Cargo.toml b/ibc/Cargo.toml index bc7d9c2ba..1005db2a0 100644 --- a/ibc/Cargo.toml +++ b/ibc/Cargo.toml @@ -6,9 +6,10 @@ edition = { workspace = true } rust-version = { workspace = true } license = { workspace = true } repository = { workspace = true } -keywords = ["blockchain", "consensus", "cosmos", "ibc"] +keywords = [ "blockchain", "consensus", "cosmos", "ibc" ] readme = "README.md" -description = """ + +description = """ Maintained by `ibc-rs`, serves as a top-level library that contain a comprehensive set of Inter-Blockchain Communication (IBC) implementations, re-exporting data structures and implementations of various IBC core, clients and applications from the `ibc-core`, @@ -20,49 +21,49 @@ all-features = true [dependencies] # ibc dependencies -ibc-apps = { workspace = true } -ibc-clients = { workspace = true } -ibc-core = { workspace = true } -ibc-core-host-cosmos = { workspace = true } -ibc-derive = { workspace = true } -ibc-primitives = { workspace = true } +ibc-apps = { workspace = true } +ibc-clients = { workspace = true } +ibc-core = { workspace = true } +ibc-core-host-cosmos = { workspace = true } +ibc-derive = { workspace = true } +ibc-primitives = { workspace = true } [features] -default = ["std"] +default = [ "std" ] std = [ - "ibc-apps/std", - "ibc-clients/std", - "ibc-core/std", - "ibc-core-host-cosmos/std", - "ibc-primitives/std", + "ibc-apps/std", + "ibc-clients/std", + "ibc-core/std", + "ibc-core-host-cosmos/std", + "ibc-primitives/std", ] borsh = [ - "ibc-apps/borsh", - "ibc-clients/borsh", - "ibc-core/borsh", - "ibc-core-host-cosmos/borsh", - "ibc-primitives/borsh", + "ibc-apps/borsh", + "ibc-clients/borsh", + "ibc-core/borsh", + "ibc-core-host-cosmos/borsh", + "ibc-primitives/borsh", ] serde = [ - "ibc-apps/serde", - "ibc-clients/serde", - "ibc-core/serde", - "ibc-core-host-cosmos/serde", - "ibc-primitives/serde", + "ibc-apps/serde", + "ibc-clients/serde", + "ibc-core/serde", + "ibc-core-host-cosmos/serde", + "ibc-primitives/serde", ] schema = [ - "ibc-apps/schema", - "ibc-clients/schema", - "ibc-core/schema", - "ibc-core-host-cosmos/schema", - "ibc-primitives/schema", - "serde", - "std" + "ibc-apps/schema", + "ibc-clients/schema", + "ibc-core/schema", + "ibc-core-host-cosmos/schema", + "ibc-primitives/schema", + "serde", + "std", ] parity-scale-codec = [ - "ibc-apps/parity-scale-codec", - "ibc-clients/parity-scale-codec", - "ibc-core/parity-scale-codec", - "ibc-core-host-cosmos/parity-scale-codec", - "ibc-primitives/parity-scale-codec", + "ibc-apps/parity-scale-codec", + "ibc-clients/parity-scale-codec", + "ibc-core/parity-scale-codec", + "ibc-core-host-cosmos/parity-scale-codec", + "ibc-primitives/parity-scale-codec", ] diff --git a/taplo.toml b/taplo.toml new file mode 100644 index 000000000..edaa7882b --- /dev/null +++ b/taplo.toml @@ -0,0 +1,7 @@ +include = [ "taplo.toml", "**/Cargo.toml" ] + +[formatting] +align_entries = true +compact_arrays = false +array_auto_expand = false +array_auto_collapse = false