diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8439ca1a32c..034631aeae1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,8 +1,8 @@ # CODEOWNERS: https://help.github.com/articles/about-codeowners/ -* @colin-axner @AdityaSripal @crodriguezvega @charleenfei @damiannolan @chatton @DimitrisJim +* @colin-axner @AdityaSripal @crodriguezvega @damiannolan @chatton @DimitrisJim @gjermundgaraba -# Our appreciation and gratitude to past code owners: @fedekunze @seantking @tmsdkeys +# Our appreciation and gratitude to past code owners: @fedekunze @seantking @tmsdkeys @charleenfei # Order is important; the last matching pattern takes the most # precedence. When someone opens a pull request that only @@ -25,7 +25,7 @@ # CODEOWNERS for 08-wasm light client module -/modules/light-clients/08-wasm/ @colin-axner @AdityaSripal @damiannolan @charleenfei @chatton @DimitrisJim @srdtrk @crodriguezvega +/modules/light-clients/08-wasm/ @colin-axner @AdityaSripal @damiannolan @chatton @DimitrisJim @srdtrk @crodriguezvega # CODEOWNERS for ICS 20 @@ -39,8 +39,8 @@ # CODEOWNERS for fee module -/modules/apps/29-fee/ @AdityaSripal @charleenfei @colin-axner @damiannolan @chatton -/proto/ibc/applications/fee/ @AdityaSripal @charleenfei @colin-axner @damiannolan @chatton +/modules/apps/29-fee/ @AdityaSripal @colin-axner @damiannolan @chatton +/proto/ibc/applications/fee/ @AdityaSripal @colin-axner @damiannolan @chatton # CODEOWNERS for callbacks middleware @@ -48,5 +48,5 @@ # CODEOWNERS for docs -/docs/ @colin-axner @AdityaSripal @crodriguezvega @charleenfei @damiannolan @chatton @DimitrisJim @srdtrk +/docs/ @colin-axner @AdityaSripal @crodriguezvega @damiannolan @chatton @DimitrisJim @srdtrk diff --git a/.github/workflows/callbacks.yml b/.github/workflows/callbacks.yml index 574adf6e095..284ebf81fe5 100644 --- a/.github/workflows/callbacks.yml +++ b/.github/workflows/callbacks.yml @@ -1,12 +1,15 @@ name: Callbacks Module # This workflow runs when a PR is opened that targets code that is part of the callbacks module. on: + merge_group: pull_request: push: branches: - main + permissions: contents: read + pull-requests: read jobs: lint: @@ -16,9 +19,12 @@ jobs: with: go-version: '1.22' - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: golangci/golangci-lint-action@v6.0.1 with: version: v1.57.2 + only-new-issues: true args: --timeout 5m working-directory: modules/apps/callbacks diff --git a/.github/workflows/capability.yml b/.github/workflows/capability.yml index 73e9d2e146c..d240264a77a 100644 --- a/.github/workflows/capability.yml +++ b/.github/workflows/capability.yml @@ -1,6 +1,7 @@ name: Capability Module # This workflow runs when a PR is opened that targets code that is part of the capability module. on: + merge_group: pull_request: paths: - '.github/workflows/capability.yml' @@ -47,4 +48,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: - projectBaseDir: modules/capability/ \ No newline at end of file + projectBaseDir: modules/capability/ diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml index e44b61f06d5..73786c85d50 100644 --- a/.github/workflows/check-docs.yml +++ b/.github/workflows/check-docs.yml @@ -4,6 +4,7 @@ name: Check docs build # This workflow runs when a PR is labeled with `docs` # This will check if the docs build successfully by running `npm run build` on: + merge_group: pull_request: branches: - main diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 076d0aa1d80..9cc8efad240 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,7 +28,7 @@ jobs: images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} - name: Build Docker image - uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 + uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 with: context: . tags: ${{ steps.meta.outputs.tags }} @@ -46,7 +46,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Push Docker image - uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 + uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 with: context: . push: true diff --git a/.github/workflows/e2e-compatibility-workflow-call.yaml b/.github/workflows/e2e-compatibility-workflow-call.yaml index e2d77461515..9554a7daac1 100644 --- a/.github/workflows/e2e-compatibility-workflow-call.yaml +++ b/.github/workflows/e2e-compatibility-workflow-call.yaml @@ -44,6 +44,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: '1.22' + cache-dependency-path: 'e2e/go.sum' - name: Run e2e Test run: | cd e2e diff --git a/.github/workflows/e2e-fork.yml b/.github/workflows/e2e-fork.yml index 795a3b72838..58ff2d2a759 100644 --- a/.github/workflows/e2e-fork.yml +++ b/.github/workflows/e2e-fork.yml @@ -69,6 +69,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.22' + cache-dependency-path: 'e2e/go.sum' - name: Run e2e Test run: | cd e2e @@ -104,6 +105,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: '1.22' + cache-dependency-path: 'e2e/go.sum' - name: Run e2e Test run: | cd e2e diff --git a/.github/workflows/e2e-test-workflow-call.yml b/.github/workflows/e2e-test-workflow-call.yml index 0e88c673e31..116790a72c7 100644 --- a/.github/workflows/e2e-test-workflow-call.yml +++ b/.github/workflows/e2e-test-workflow-call.yml @@ -127,7 +127,7 @@ jobs: - name: Build and push Docker image if: ${{ inputs.build-and-push-docker-image }} - uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 + uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 with: context: . push: true @@ -174,7 +174,7 @@ jobs: - name: Build and push Docker image if: ${{ inputs.build-and-push-docker-image-wasm }} - uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 + uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 with: context: . push: true @@ -239,6 +239,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: '1.22' + cache-dependency-path: 'e2e/go.sum' - name: Run e2e Test id: e2e_test run: | diff --git a/.github/workflows/e2emodule.yml b/.github/workflows/e2emodule.yml index a99a9d62df1..8c996a9cbe9 100644 --- a/.github/workflows/e2emodule.yml +++ b/.github/workflows/e2emodule.yml @@ -1,11 +1,16 @@ name: E2E Unit tests/Lint. # This workflow runs when a PR is opened that targets code that is part of the e2e module. on: + merge_group: pull_request: paths: - '.github/workflows/e2emodule.yml' - 'e2e/**' +permissions: + contents: read + pull-requests: read + jobs: lint: runs-on: ubuntu-latest @@ -13,10 +18,14 @@ jobs: - uses: actions/setup-go@v5 with: go-version: '1.22' + cache-dependency-path: 'e2e/go.sum' - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: golangci/golangci-lint-action@v6.0.1 with: version: v1.57.2 + only-new-issues: true args: --timeout 5m working-directory: e2e/ @@ -27,6 +36,7 @@ jobs: - uses: actions/setup-go@v5 with: go-version: '1.22' + cache-dependency-path: 'e2e/go.sum' - name: Go Test run: | cd e2e diff --git a/.github/workflows/golangci-feature.yml b/.github/workflows/golangci-feature.yml index 18cf00f1761..39b33404b91 100644 --- a/.github/workflows/golangci-feature.yml +++ b/.github/workflows/golangci-feature.yml @@ -13,7 +13,7 @@ on: permissions: contents: read # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read + pull-requests: read jobs: golangci: @@ -24,8 +24,11 @@ jobs: with: go-version: '1.22' - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: golangci-lint uses: golangci/golangci-lint-action@v6.0.1 with: version: v1.57.2 + only-new-issues: true args: --timeout 10m diff --git a/.github/workflows/golangci.yml b/.github/workflows/golangci.yml index 367dba78283..1f2485ca988 100644 --- a/.github/workflows/golangci.yml +++ b/.github/workflows/golangci.yml @@ -9,7 +9,8 @@ on: permissions: contents: read # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read + pull-requests: read + jobs: golangci: name: lint @@ -19,8 +20,11 @@ jobs: with: go-version: '1.22' - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: golangci-lint uses: golangci/golangci-lint-action@v6.0.1 with: version: v1.57.2 + only-new-issues: true args: --timeout 10m diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 262057c189a..0859d7e8cfc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: images: ${{ env.REGISTRY }}/cosmos/${{ env.IMAGE_NAME }} - name: Build and push Docker image - uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 + uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 with: context: . push: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6015722f2f0..a14c2a6565c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,7 @@ name: Tests / Code Coverage # Tests / Code Coverage workflow runs unit tests and uploads a code coverage report # This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed on: + merge_group: pull_request: push: branches: diff --git a/.github/workflows/wasm-client.yml b/.github/workflows/wasm-client.yml index 70f52643dde..15c9e316ba2 100644 --- a/.github/workflows/wasm-client.yml +++ b/.github/workflows/wasm-client.yml @@ -1,12 +1,14 @@ name: Wasm Light-Client # This workflow runs when a PR is opened that targets code that is part of the wasm light-client. on: + merge_group: pull_request: push: branches: - main permissions: contents: read + pull-requests: read jobs: lint: @@ -16,9 +18,12 @@ jobs: with: go-version: '1.22' - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: golangci/golangci-lint-action@v6.0.1 with: version: v1.57.2 + only-new-issues: true args: --timeout 10m working-directory: modules/light-clients/08-wasm diff --git a/CHANGELOG.md b/CHANGELOG.md index e0dac6413e8..ec0ff639f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (apps/27-interchain-accounts) [\#6377](https://github.com/cosmos/ibc-go/pull/6377) Generate ICA simtest proposals only for provided keepers. + ## [v8.3.0](https://github.com/cosmos/ibc-go/releases/tag/v8.3.0) - 2024-05-16 ### Dependencies diff --git a/docs/docs/01-ibc/10-roadmap.md b/docs/docs/01-ibc/10-roadmap.md index c60d4e7d3ee..88651908455 100644 --- a/docs/docs/01-ibc/10-roadmap.md +++ b/docs/docs/01-ibc/10-roadmap.md @@ -7,27 +7,33 @@ slug: /ibc/roadmap # Roadmap ibc-go -*Latest update: April 05st, 2024* +*Latest update: June 7th, 2024* This document endeavours to inform the wider IBC community about plans and priorities for work on ibc-go by the team at Interchain GmbH. It is intended to broadly inform all users of ibc-go, including developers and operators of IBC, relayer, chain and wallet applications. This roadmap should be read as a high-level guide, rather than a commitment to schedules and deliverables. The degree of specificity is inversely proportional to the timeline. We will update this document periodically to reflect the status and plans. For the latest expected release timelines, please check [here](https://github.com/cosmos/ibc-go/wiki/Release-timeline). -## v8.3.0 - -### Conditional clients - -Conditional clients are light clients which are dependent on another client in order to verify or update state. Conditional clients are essential for integration with modular blockchains which break up consensus and state management, such as rollups. Currently, light clients receive a single provable store they maintain. There is an unidirectional communication channel with 02-client: the 02-client module will call into the light client, without allowing for the light client to call into the 02-client module. But modular blockchains break up a logical blockchain into many constituent parts, so in order to accurately represent these chains and also to account for various types of shared security primitives that are coming up, we need to introduce dependencies between clients. In the case of optimistic rollups, for example, in order to prove execution (allowing for fraud proofs), you must prove data availability and sequencing. A potential solution to this problem is that a light client may optionally specify a list of dependencies and the 02-client module would lookup read-only provable stores for each dependency and provide this to the conditional client to perform verification. Please see [this issue](https://github.com/cosmos/ibc-go/issues/5112) for more details. - ## v9.0.0 ### ICS20 v2 -The transfer application will be updated to add support for [transferring multiple tokens in the same packet](https://github.com/cosmos/ibc/pull/1020) and support for [atomically route tokens series of paths with a single packet](https://github.com/cosmos/ibc/pull/1090) +The transfer application will be updated to add support for [transferring multiple tokens in the same packet](https://github.com/cosmos/ibc/pull/1020) and support for [atomically route tokens series of paths with a single packet](https://github.com/cosmos/ibc/pull/1090). ## v10.0.0 -### Multihop channels +### ICA v2 + +This new version of ICS27 will address many of [the pain points with the current design](https://github.com/cosmos/ibc-go/pull/6281), including multiplexing all communication between controller and host through a single channel (instead of each interchain account on the host being associated to a different channel, as it is now). + +### Multipacket atomicity + +We will refactor the 05-port router to enable atomic sending of multiple packets belonging to different applications. + +--- + +And potentially later on... + +#### Multihop channels Multihop channels specify a way to route messages across a path of IBC enabled blockchains utilizing multiple pre-existing IBC connections. The current IBC protocol defines messaging in a point-to-point paradigm which allows message passing between two directly connected IBC chains, but as more IBC enabled chains come into existence there becomes a need to relay IBC packets across chains because IBC connections may not exist between the two chains wishing to exchange messages. IBC connections may not exist for a variety of reasons which could include economic inviability since connections require client state to be continuously exchanged between connection ends which carries a cost. Please see the [ICS 33 spec](https://github.com/cosmos/ibc/blob/main/spec/core/ics-033-multi-hop/README.md) for more information. diff --git a/docs/docs/02-apps/01-transfer/05-events.md b/docs/docs/02-apps/01-transfer/05-events.md index bd1f6c16085..ebd936d1615 100644 --- a/docs/docs/02-apps/01-transfer/05-events.md +++ b/docs/docs/02-apps/01-transfer/05-events.md @@ -21,12 +21,12 @@ slug: /apps/transfer/events | Type | Attribute Key | Attribute Value | |-----------------------|---------------|------------------| -| fungible_token_packet | sender | \{sender\} | -| fungible_token_packet | receiver | \{receiver\} | +| fungible_token_packet | sender | \{sender\} | +| fungible_token_packet | receiver | \{receiver\} | | fungible_token_packet | tokens | \{jsonTokens\} | +| fungible_token_packet | memo | \{memo\} | | fungible_token_packet | success | \{ackSuccess\} | | fungible_token_packet | error | \{ackError\} | -| fungible_token_packet | memo | \{memo\} | | denomination | trace_hash | \{hex_hash\} | | denomination | denom | \{jsonDenom\} | | message | module | transfer | diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index e95b8e2b262..39c64fd7b74 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -24,7 +24,7 @@ const config = { organizationName: "cosmos", // Usually your GitHub org/user name. projectName: "ibc-go", // Usually your repo name. deploymentBranch: "gh-pages", - trailingSlash: false, + trailingSlash: true, onBrokenLinks: "log", onBrokenMarkdownLinks: "log", @@ -103,7 +103,7 @@ const config = { alt: "IBC Logo", src: "img/black-ibc-logo.svg", srcDark: "img/white-ibc-logo.svg", - href: "/main/", + href: "/", }, items: [ { @@ -240,17 +240,17 @@ const config = { { className: 'theme-code-block-highlighted-line', line: 'highlight-next-line', - block: {start: 'highlight-start', end: 'highlight-end'}, + block: { start: 'highlight-start', end: 'highlight-end' }, }, { className: 'code-block-minus-diff-line', line: 'minus-diff-line', - block: {start: 'minus-diff-start', end: 'minus-diff-end'}, + block: { start: 'minus-diff-start', end: 'minus-diff-end' }, }, { className: 'code-block-plus-diff-line', line: 'plus-diff-line', - block: {start: 'plus-diff-start', end: 'plus-diff-end'}, + block: { start: 'plus-diff-start', end: 'plus-diff-end' }, }, ], }, @@ -258,7 +258,7 @@ const config = { themes: ["docusaurus-theme-github-codeblock"], plugins: [ [ - 'docusaurus-pushfeedback',{ + 'docusaurus-pushfeedback', { project: '3mpmaho4fa', buttonPosition: 'center-right', modalPosition: 'sidebar-right', @@ -311,9 +311,13 @@ const config = { // makes the default page next in production redirects: [ { - from: ["/", "/master", "/next", "/docs"], + from: ["/master", "/next"], to: "/main/", }, + { + from: ["/", "/docs"], + to: "/v8/", + } ], }, ], @@ -344,22 +348,22 @@ const config = { ], scripts: [ { - src: "https://widget.kapa.ai/kapa-widget.bundle.js", - "data-website-id": "806aa1dc-0d46-4563-a8b8-880eecac59f1", - "data-project-name": "Interchain", - "data-user-analytics-fingerprint-enabled": "true", - "data-project-color": "#1878FF", - "data-modal-title": "IBC Docs AI", - "data-modal-disclaimer": "This is a custom LLM for the Inter-Blockchain Communication Protocol in Golang (ibc-go). It is trained on the IBC developer documentation, code base, and resources. Answers are AI-generated. Please use your best judgment before implementing. The bot is not trained on documentation, code, or resources for the Cosmos SDK, CometBFT, CosmJS, CosmWasm, or interchain ecosystem blockchains. Please refer to those specific documentation sites for answers to those questions.", - "data-modal-ask-ai-input-placeholder": "Ask me a question about IBC...", - "data-modal-disclaimer-text-color": "#000000", - "data-modal-disclaimer-font-size": "14px", - "data-modal-image": - "img/black-ibc-logo-400x400.svg", - "data-project-logo": - "img/white-ibc-logo-400x400.svg", - async: true, - }, + src: "https://widget.kapa.ai/kapa-widget.bundle.js", + "data-website-id": "806aa1dc-0d46-4563-a8b8-880eecac59f1", + "data-project-name": "Interchain", + "data-user-analytics-fingerprint-enabled": "true", + "data-project-color": "#1878FF", + "data-modal-title": "IBC Docs AI", + "data-modal-disclaimer": "This is a custom LLM for the Inter-Blockchain Communication Protocol in Golang (ibc-go). It is trained on the IBC developer documentation, code base, and resources. Answers are AI-generated. Please use your best judgment before implementing. The bot is not trained on documentation, code, or resources for the Cosmos SDK, CometBFT, CosmJS, CosmWasm, or interchain ecosystem blockchains. Please refer to those specific documentation sites for answers to those questions.", + "data-modal-ask-ai-input-placeholder": "Ask me a question about IBC...", + "data-modal-disclaimer-text-color": "#000000", + "data-modal-disclaimer-font-size": "14px", + "data-modal-image": + "/img/black-ibc-logo-400x400.svg", + "data-project-logo": + "/img/white-ibc-logo-400x400.svg", + async: true, + }, ], }; diff --git a/docs/package-lock.json b/docs/package-lock.json index 8449a973072..1db551d1423 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -8,12 +8,12 @@ "name": "docs", "version": "0.0.0", "dependencies": { - "@docusaurus/core": "^3.3.2", - "@docusaurus/plugin-client-redirects": "^3.3.2", - "@docusaurus/plugin-content-docs": "^3.3.2", - "@docusaurus/plugin-google-gtag": "^3.3.2", - "@docusaurus/plugin-sitemap": "^3.3.2", - "@docusaurus/preset-classic": "^3.3.2", + "@docusaurus/core": "^3.4.0", + "@docusaurus/plugin-client-redirects": "^3.4.0", + "@docusaurus/plugin-content-docs": "^3.4.0", + "@docusaurus/plugin-google-gtag": "^3.4.0", + "@docusaurus/plugin-sitemap": "^3.4.0", + "@docusaurus/preset-classic": "^3.4.0", "@easyops-cn/docusaurus-search-local": "^0.40.1", "@gracefullight/docusaurus-plugin-microsoft-clarity": "^1.0.0", "@mdx-js/react": "^3.0.0", @@ -39,6 +39,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz", "integrity": "sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==", + "license": "MIT", "dependencies": { "@algolia/autocomplete-plugin-algolia-insights": "1.9.3", "@algolia/autocomplete-shared": "1.9.3" @@ -48,6 +49,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-plugin-algolia-insights/-/autocomplete-plugin-algolia-insights-1.9.3.tgz", "integrity": "sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==", + "license": "MIT", "dependencies": { "@algolia/autocomplete-shared": "1.9.3" }, @@ -59,6 +61,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.9.3.tgz", "integrity": "sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==", + "license": "MIT", "dependencies": { "@algolia/autocomplete-shared": "1.9.3" }, @@ -71,6 +74,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-shared/-/autocomplete-shared-1.9.3.tgz", "integrity": "sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==", + "license": "MIT", "peerDependencies": { "@algolia/client-search": ">= 4.9.1 < 6", "algoliasearch": ">= 4.9.1 < 6" @@ -80,6 +84,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.23.3.tgz", "integrity": "sha512-vRHXYCpPlTDE7i6UOy2xE03zHF2C8MEFjPN2v7fRbqVpcOvAUQK81x3Kc21xyb5aSIpYCjWCZbYZuz8Glyzyyg==", + "license": "MIT", "dependencies": { "@algolia/cache-common": "4.23.3" } @@ -87,12 +92,14 @@ "node_modules/@algolia/cache-common": { "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/cache-common/-/cache-common-4.23.3.tgz", - "integrity": "sha512-h9XcNI6lxYStaw32pHpB1TMm0RuxphF+Ik4o7tcQiodEdpKK+wKufY6QXtba7t3k8eseirEMVB83uFFF3Nu54A==" + "integrity": "sha512-h9XcNI6lxYStaw32pHpB1TMm0RuxphF+Ik4o7tcQiodEdpKK+wKufY6QXtba7t3k8eseirEMVB83uFFF3Nu54A==", + "license": "MIT" }, "node_modules/@algolia/cache-in-memory": { "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/cache-in-memory/-/cache-in-memory-4.23.3.tgz", "integrity": "sha512-yvpbuUXg/+0rbcagxNT7un0eo3czx2Uf0y4eiR4z4SD7SiptwYTpbuS0IHxcLHG3lq22ukx1T6Kjtk/rT+mqNg==", + "license": "MIT", "dependencies": { "@algolia/cache-common": "4.23.3" } @@ -101,6 +108,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/client-account/-/client-account-4.23.3.tgz", "integrity": "sha512-hpa6S5d7iQmretHHF40QGq6hz0anWEHGlULcTIT9tbUssWUriN9AUXIFQ8Ei4w9azD0hc1rUok9/DeQQobhQMA==", + "license": "MIT", "dependencies": { "@algolia/client-common": "4.23.3", "@algolia/client-search": "4.23.3", @@ -111,6 +119,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/client-analytics/-/client-analytics-4.23.3.tgz", "integrity": "sha512-LBsEARGS9cj8VkTAVEZphjxTjMVCci+zIIiRhpFun9jGDUlS1XmhCW7CTrnaWeIuCQS/2iPyRqSy1nXPjcBLRA==", + "license": "MIT", "dependencies": { "@algolia/client-common": "4.23.3", "@algolia/client-search": "4.23.3", @@ -122,6 +131,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/client-common/-/client-common-4.23.3.tgz", "integrity": "sha512-l6EiPxdAlg8CYhroqS5ybfIczsGUIAC47slLPOMDeKSVXYG1n0qGiz4RjAHLw2aD0xzh2EXZ7aRguPfz7UKDKw==", + "license": "MIT", "dependencies": { "@algolia/requester-common": "4.23.3", "@algolia/transporter": "4.23.3" @@ -131,6 +141,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/client-personalization/-/client-personalization-4.23.3.tgz", "integrity": "sha512-3E3yF3Ocr1tB/xOZiuC3doHQBQ2zu2MPTYZ0d4lpfWads2WTKG7ZzmGnsHmm63RflvDeLK/UVx7j2b3QuwKQ2g==", + "license": "MIT", "dependencies": { "@algolia/client-common": "4.23.3", "@algolia/requester-common": "4.23.3", @@ -141,6 +152,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-4.23.3.tgz", "integrity": "sha512-P4VAKFHqU0wx9O+q29Q8YVuaowaZ5EM77rxfmGnkHUJggh28useXQdopokgwMeYw2XUht49WX5RcTQ40rZIabw==", + "license": "MIT", "dependencies": { "@algolia/client-common": "4.23.3", "@algolia/requester-common": "4.23.3", @@ -150,17 +162,20 @@ "node_modules/@algolia/events": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@algolia/events/-/events-4.0.1.tgz", - "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==" + "integrity": "sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==", + "license": "MIT" }, "node_modules/@algolia/logger-common": { "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/logger-common/-/logger-common-4.23.3.tgz", - "integrity": "sha512-y9kBtmJwiZ9ZZ+1Ek66P0M68mHQzKRxkW5kAAXYN/rdzgDN0d2COsViEFufxJ0pb45K4FRcfC7+33YB4BLrZ+g==" + "integrity": "sha512-y9kBtmJwiZ9ZZ+1Ek66P0M68mHQzKRxkW5kAAXYN/rdzgDN0d2COsViEFufxJ0pb45K4FRcfC7+33YB4BLrZ+g==", + "license": "MIT" }, "node_modules/@algolia/logger-console": { "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/logger-console/-/logger-console-4.23.3.tgz", "integrity": "sha512-8xoiseoWDKuCVnWP8jHthgaeobDLolh00KJAdMe9XPrWPuf1by732jSpgy2BlsLTaT9m32pHI8CRfrOqQzHv3A==", + "license": "MIT", "dependencies": { "@algolia/logger-common": "4.23.3" } @@ -169,6 +184,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/recommend/-/recommend-4.23.3.tgz", "integrity": "sha512-9fK4nXZF0bFkdcLBRDexsnGzVmu4TSYZqxdpgBW2tEyfuSSY54D4qSRkLmNkrrz4YFvdh2GM1gA8vSsnZPR73w==", + "license": "MIT", "dependencies": { "@algolia/cache-browser-local-storage": "4.23.3", "@algolia/cache-common": "4.23.3", @@ -187,6 +203,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.23.3.tgz", "integrity": "sha512-jDWGIQ96BhXbmONAQsasIpTYWslyjkiGu0Quydjlowe+ciqySpiDUrJHERIRfELE5+wFc7hc1Q5hqjGoV7yghw==", + "license": "MIT", "dependencies": { "@algolia/requester-common": "4.23.3" } @@ -194,12 +211,14 @@ "node_modules/@algolia/requester-common": { "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/requester-common/-/requester-common-4.23.3.tgz", - "integrity": "sha512-xloIdr/bedtYEGcXCiF2muajyvRhwop4cMZo+K2qzNht0CMzlRkm8YsDdj5IaBhshqfgmBb3rTg4sL4/PpvLYw==" + "integrity": "sha512-xloIdr/bedtYEGcXCiF2muajyvRhwop4cMZo+K2qzNht0CMzlRkm8YsDdj5IaBhshqfgmBb3rTg4sL4/PpvLYw==", + "license": "MIT" }, "node_modules/@algolia/requester-node-http": { "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/requester-node-http/-/requester-node-http-4.23.3.tgz", "integrity": "sha512-zgu++8Uj03IWDEJM3fuNl34s746JnZOWn1Uz5taV1dFyJhVM/kTNw9Ik7YJWiUNHJQXcaD8IXD1eCb0nq/aByA==", + "license": "MIT", "dependencies": { "@algolia/requester-common": "4.23.3" } @@ -208,6 +227,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/@algolia/transporter/-/transporter-4.23.3.tgz", "integrity": "sha512-Wjl5gttqnf/gQKJA+dafnD0Y6Yw97yvfY8R9h0dQltX1GXTgNs1zWgvtWW0tHl1EgMdhAyw189uWiZMnL3QebQ==", + "license": "MIT", "dependencies": { "@algolia/cache-common": "4.23.3", "@algolia/logger-common": "4.23.3", @@ -2169,12 +2189,14 @@ "node_modules/@docsearch/css": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.6.0.tgz", - "integrity": "sha512-+sbxb71sWre+PwDK7X2T8+bhS6clcVMLwBPznX45Qu6opJcgRjAp7gYSDzVFp187J+feSj5dNBN1mJoi6ckkUQ==" + "integrity": "sha512-+sbxb71sWre+PwDK7X2T8+bhS6clcVMLwBPznX45Qu6opJcgRjAp7gYSDzVFp187J+feSj5dNBN1mJoi6ckkUQ==", + "license": "MIT" }, "node_modules/@docsearch/react": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/@docsearch/react/-/react-3.6.0.tgz", "integrity": "sha512-HUFut4ztcVNmqy9gp/wxNbC7pTOHhgVVkHVGCACTuLhUKUhKAF9KYHJtMiLUJxEqiFLQiuri1fWF8zqwM/cu1w==", + "license": "MIT", "dependencies": { "@algolia/autocomplete-core": "1.9.3", "@algolia/autocomplete-preset-algolia": "1.9.3", @@ -2203,9 +2225,10 @@ } }, "node_modules/@docusaurus/core": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.3.2.tgz", - "integrity": "sha512-PzKMydKI3IU1LmeZQDi+ut5RSuilbXnA8QdowGeJEgU8EJjmx3rBHNT1LxQxOVqNEwpWi/csLwd9bn7rUjggPA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-3.4.0.tgz", + "integrity": "sha512-g+0wwmN2UJsBqy2fQRQ6fhXruoEa62JDeEa5d8IdTJlMoaDaEDfHh7WjwGRn4opuTQWpjAwP/fbcgyHKlE+64w==", + "license": "MIT", "dependencies": { "@babel/core": "^7.23.3", "@babel/generator": "^7.23.3", @@ -2217,12 +2240,12 @@ "@babel/runtime": "^7.22.6", "@babel/runtime-corejs3": "^7.22.6", "@babel/traverse": "^7.22.8", - "@docusaurus/cssnano-preset": "3.3.2", - "@docusaurus/logger": "3.3.2", - "@docusaurus/mdx-loader": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "@docusaurus/cssnano-preset": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "autoprefixer": "^10.4.14", "babel-loader": "^9.1.3", "babel-plugin-dynamic-import-node": "^2.3.3", @@ -2288,9 +2311,10 @@ } }, "node_modules/@docusaurus/cssnano-preset": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.3.2.tgz", - "integrity": "sha512-+5+epLk/Rp4vFML4zmyTATNc3Is+buMAL6dNjrMWahdJCJlMWMPd/8YfU+2PA57t8mlSbhLJ7vAZVy54cd1vRQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-3.4.0.tgz", + "integrity": "sha512-qwLFSz6v/pZHy/UP32IrprmH5ORce86BGtN0eBtG75PpzQJAzp9gefspox+s8IEOr0oZKuQ/nhzZ3xwyc3jYJQ==", + "license": "MIT", "dependencies": { "cssnano-preset-advanced": "^6.1.2", "postcss": "^8.4.38", @@ -2302,9 +2326,10 @@ } }, "node_modules/@docusaurus/logger": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.3.2.tgz", - "integrity": "sha512-Ldu38GJ4P8g4guN7d7pyCOJ7qQugG7RVyaxrK8OnxuTlaImvQw33aDRwaX2eNmX8YK6v+//Z502F4sOZbHHCHQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-3.4.0.tgz", + "integrity": "sha512-bZwkX+9SJ8lB9kVRkXw+xvHYSMGG4bpYHKGXeXFvyVc79NMeeBSGgzd4TQLHH+DYeOJoCdl8flrFJVxlZ0wo/Q==", + "license": "MIT", "dependencies": { "chalk": "^4.1.2", "tslib": "^2.6.0" @@ -2314,13 +2339,14 @@ } }, "node_modules/@docusaurus/mdx-loader": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.3.2.tgz", - "integrity": "sha512-AFRxj/aOk3/mfYDPxE3wTbrjeayVRvNSZP7mgMuUlrb2UlPRbSVAFX1k2RbgAJrnTSwMgb92m2BhJgYRfptN3g==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-3.4.0.tgz", + "integrity": "sha512-kSSbrrk4nTjf4d+wtBA9H+FGauf2gCax89kV8SUSJu3qaTdSIKdWERlngsiHaCFgZ7laTJ8a67UFf+xlFPtuTw==", + "license": "MIT", "dependencies": { - "@docusaurus/logger": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "@docusaurus/logger": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@mdx-js/mdx": "^3.0.0", "@slorber/remark-comment": "^1.0.0", "escape-html": "^1.0.3", @@ -2352,11 +2378,12 @@ } }, "node_modules/@docusaurus/module-type-aliases": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.3.2.tgz", - "integrity": "sha512-b/XB0TBJah5yKb4LYuJT4buFvL0MGAb0+vJDrJtlYMguRtsEBkf2nWl5xP7h4Dlw6ol0hsHrCYzJ50kNIOEclw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-3.4.0.tgz", + "integrity": "sha512-A1AyS8WF5Bkjnb8s+guTDuYmUiwJzNrtchebBHpc0gz0PyHJNMaybUlSrmJjHVcGrya0LKI4YcR3lBDQfXRYLw==", + "license": "MIT", "dependencies": { - "@docusaurus/types": "3.3.2", + "@docusaurus/types": "3.4.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -2370,15 +2397,16 @@ } }, "node_modules/@docusaurus/plugin-client-redirects": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.3.2.tgz", - "integrity": "sha512-W8ueb5PaQ06oanatL+CzE3GjqeRBTzv3MSFqEQlBa8BqLyOomc1uHsWgieE3glHsckU4mUZ6sHnOfesAtYnnew==", - "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/logger": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-3.4.0.tgz", + "integrity": "sha512-Pr8kyh/+OsmYCvdZhc60jy/FnrY6flD2TEAhl4rJxeVFxnvvRgEhoaIVX8q9MuJmaQoh6frPk94pjs7/6YgBDQ==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "eta": "^2.2.0", "fs-extra": "^11.1.1", "lodash": "^4.17.21", @@ -2393,17 +2421,18 @@ } }, "node_modules/@docusaurus/plugin-content-blog": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.3.2.tgz", - "integrity": "sha512-fJU+dmqp231LnwDJv+BHVWft8pcUS2xVPZdeYH6/ibH1s2wQ/sLcmUrGWyIv/Gq9Ptj8XWjRPMghlxghuPPoxg==", - "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/logger": "3.3.2", - "@docusaurus/mdx-loader": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-3.4.0.tgz", + "integrity": "sha512-vv6ZAj78ibR5Jh7XBUT4ndIjmlAxkijM3Sx5MAAzC1gyv0vupDQNhzuFg1USQmQVj3P5I6bquk12etPV3LJ+Xw==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "cheerio": "^1.0.0-rc.12", "feed": "^4.2.2", "fs-extra": "^11.1.1", @@ -2424,18 +2453,19 @@ } }, "node_modules/@docusaurus/plugin-content-docs": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.3.2.tgz", - "integrity": "sha512-Dm1ri2VlGATTN3VGk1ZRqdRXWa1UlFubjaEL6JaxaK7IIFqN/Esjpl+Xw10R33loHcRww/H76VdEeYayaL76eg==", - "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/logger": "3.3.2", - "@docusaurus/mdx-loader": "3.3.2", - "@docusaurus/module-type-aliases": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-3.4.0.tgz", + "integrity": "sha512-HkUCZffhBo7ocYheD9oZvMcDloRnGhBMOZRyVcAQRFmZPmNqSyISlXA1tQCIxW+r478fty97XXAGjNYzBjpCsg==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/module-type-aliases": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@types/react-router-config": "^5.0.7", "combine-promises": "^1.1.0", "fs-extra": "^11.1.1", @@ -2454,15 +2484,16 @@ } }, "node_modules/@docusaurus/plugin-content-pages": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.3.2.tgz", - "integrity": "sha512-EKc9fQn5H2+OcGER8x1aR+7URtAGWySUgULfqE/M14+rIisdrBstuEZ4lUPDRrSIexOVClML82h2fDS+GSb8Ew==", - "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/mdx-loader": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-pages/-/plugin-content-pages-3.4.0.tgz", + "integrity": "sha512-h2+VN/0JjpR8fIkDEAoadNjfR3oLzB+v1qSXbIAKjQ46JAHx3X22n9nqS+BWSQnTnp1AjkjSvZyJMekmcwxzxg==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "fs-extra": "^11.1.1", "tslib": "^2.6.0", "webpack": "^5.88.1" @@ -2476,13 +2507,14 @@ } }, "node_modules/@docusaurus/plugin-debug": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.3.2.tgz", - "integrity": "sha512-oBIBmwtaB+YS0XlmZ3gCO+cMbsGvIYuAKkAopoCh0arVjtlyPbejzPrHuCoRHB9G7abjNZw7zoONOR8+8LM5+Q==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-debug/-/plugin-debug-3.4.0.tgz", + "integrity": "sha512-uV7FDUNXGyDSD3PwUaf5YijX91T5/H9SX4ErEcshzwgzWwBtK37nUWPU3ZLJfeTavX3fycTOqk9TglpOLaWkCg==", + "license": "MIT", "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils": "3.3.2", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", "fs-extra": "^11.1.1", "react-json-view-lite": "^1.2.0", "tslib": "^2.6.0" @@ -2496,13 +2528,14 @@ } }, "node_modules/@docusaurus/plugin-google-analytics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.3.2.tgz", - "integrity": "sha512-jXhrEIhYPSClMBK6/IA8qf1/FBoxqGXZvg7EuBax9HaK9+kL3L0TJIlatd8jQJOMtds8mKw806TOCc3rtEad1A==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-3.4.0.tgz", + "integrity": "sha512-mCArluxEGi3cmYHqsgpGGt3IyLCrFBxPsxNZ56Mpur0xSlInnIHoeLDH7FvVVcPJRPSQ9/MfRqLsainRw+BojA==", + "license": "MIT", "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "tslib": "^2.6.0" }, "engines": { @@ -2514,13 +2547,14 @@ } }, "node_modules/@docusaurus/plugin-google-gtag": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.3.2.tgz", - "integrity": "sha512-vcrKOHGbIDjVnNMrfbNpRQR1x6Jvcrb48kVzpBAOsKbj9rXZm/idjVAXRaewwobHdOrJkfWS/UJoxzK8wyLRBQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-3.4.0.tgz", + "integrity": "sha512-Dsgg6PLAqzZw5wZ4QjUYc8Z2KqJqXxHxq3vIoyoBWiLEEfigIs7wHR+oiWUQy3Zk9MIk6JTYj7tMoQU0Jm3nqA==", + "license": "MIT", "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@types/gtag.js": "^0.0.12", "tslib": "^2.6.0" }, @@ -2533,13 +2567,14 @@ } }, "node_modules/@docusaurus/plugin-google-tag-manager": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.3.2.tgz", - "integrity": "sha512-ldkR58Fdeks0vC+HQ+L+bGFSJsotQsipXD+iKXQFvkOfmPIV6QbHRd7IIcm5b6UtwOiK33PylNS++gjyLUmaGw==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-google-tag-manager/-/plugin-google-tag-manager-3.4.0.tgz", + "integrity": "sha512-O9tX1BTwxIhgXpOLpFDueYA9DWk69WCbDRrjYoMQtFHSkTyE7RhNgyjSPREUWJb9i+YUg3OrsvrBYRl64FCPCQ==", + "license": "MIT", "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "@docusaurus/core": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "tslib": "^2.6.0" }, "engines": { @@ -2551,16 +2586,17 @@ } }, "node_modules/@docusaurus/plugin-sitemap": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.3.2.tgz", - "integrity": "sha512-/ZI1+bwZBhAgC30inBsHe3qY9LOZS+79fRGkNdTcGHRMcdAp6Vw2pCd1gzlxd/xU+HXsNP6cLmTOrggmRp3Ujg==", - "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/logger": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-sitemap/-/plugin-sitemap-3.4.0.tgz", + "integrity": "sha512-+0VDvx9SmNrFNgwPoeoCha+tRoAjopwT0+pYO1xAbyLcewXSemq+eLxEa46Q1/aoOaJQ0qqHELuQM7iS2gp33Q==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "fs-extra": "^11.1.1", "sitemap": "^7.1.1", "tslib": "^2.6.0" @@ -2574,23 +2610,24 @@ } }, "node_modules/@docusaurus/preset-classic": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.3.2.tgz", - "integrity": "sha512-1SDS7YIUN1Pg3BmD6TOTjhB7RSBHJRpgIRKx9TpxqyDrJ92sqtZhomDc6UYoMMLQNF2wHFZZVGFjxJhw2VpL+Q==", - "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/plugin-content-blog": "3.3.2", - "@docusaurus/plugin-content-docs": "3.3.2", - "@docusaurus/plugin-content-pages": "3.3.2", - "@docusaurus/plugin-debug": "3.3.2", - "@docusaurus/plugin-google-analytics": "3.3.2", - "@docusaurus/plugin-google-gtag": "3.3.2", - "@docusaurus/plugin-google-tag-manager": "3.3.2", - "@docusaurus/plugin-sitemap": "3.3.2", - "@docusaurus/theme-classic": "3.3.2", - "@docusaurus/theme-common": "3.3.2", - "@docusaurus/theme-search-algolia": "3.3.2", - "@docusaurus/types": "3.3.2" + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/preset-classic/-/preset-classic-3.4.0.tgz", + "integrity": "sha512-Ohj6KB7siKqZaQhNJVMBBUzT3Nnp6eTKqO+FXO3qu/n1hJl3YLwVKTWBg28LF7MWrKu46UuYavwMRxud0VyqHg==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.4.0", + "@docusaurus/plugin-content-blog": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/plugin-content-pages": "3.4.0", + "@docusaurus/plugin-debug": "3.4.0", + "@docusaurus/plugin-google-analytics": "3.4.0", + "@docusaurus/plugin-google-gtag": "3.4.0", + "@docusaurus/plugin-google-tag-manager": "3.4.0", + "@docusaurus/plugin-sitemap": "3.4.0", + "@docusaurus/theme-classic": "3.4.0", + "@docusaurus/theme-common": "3.4.0", + "@docusaurus/theme-search-algolia": "3.4.0", + "@docusaurus/types": "3.4.0" }, "engines": { "node": ">=18.0" @@ -2601,22 +2638,23 @@ } }, "node_modules/@docusaurus/theme-classic": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.3.2.tgz", - "integrity": "sha512-gepHFcsluIkPb4Im9ukkiO4lXrai671wzS3cKQkY9BXQgdVwsdPf/KS0Vs4Xlb0F10fTz+T3gNjkxNEgSN9M0A==", - "dependencies": { - "@docusaurus/core": "3.3.2", - "@docusaurus/mdx-loader": "3.3.2", - "@docusaurus/module-type-aliases": "3.3.2", - "@docusaurus/plugin-content-blog": "3.3.2", - "@docusaurus/plugin-content-docs": "3.3.2", - "@docusaurus/plugin-content-pages": "3.3.2", - "@docusaurus/theme-common": "3.3.2", - "@docusaurus/theme-translations": "3.3.2", - "@docusaurus/types": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-classic/-/theme-classic-3.4.0.tgz", + "integrity": "sha512-0IPtmxsBYv2adr1GnZRdMkEQt1YW6tpzrUPj02YxNpvJ5+ju4E13J5tB4nfdaen/tfR1hmpSPlTFPvTf4kwy8Q==", + "license": "MIT", + "dependencies": { + "@docusaurus/core": "3.4.0", + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/module-type-aliases": "3.4.0", + "@docusaurus/plugin-content-blog": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/plugin-content-pages": "3.4.0", + "@docusaurus/theme-common": "3.4.0", + "@docusaurus/theme-translations": "3.4.0", + "@docusaurus/types": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "@mdx-js/react": "^3.0.0", "clsx": "^2.0.0", "copy-text-to-clipboard": "^3.2.0", @@ -2640,17 +2678,18 @@ } }, "node_modules/@docusaurus/theme-common": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.3.2.tgz", - "integrity": "sha512-kXqSaL/sQqo4uAMQ4fHnvRZrH45Xz2OdJ3ABXDS7YVGPSDTBC8cLebFrRR4YF9EowUHto1UC/EIklJZQMG/usA==", - "dependencies": { - "@docusaurus/mdx-loader": "3.3.2", - "@docusaurus/module-type-aliases": "3.3.2", - "@docusaurus/plugin-content-blog": "3.3.2", - "@docusaurus/plugin-content-docs": "3.3.2", - "@docusaurus/plugin-content-pages": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-common/-/theme-common-3.4.0.tgz", + "integrity": "sha512-0A27alXuv7ZdCg28oPE8nH/Iz73/IUejVaCazqu9elS4ypjiLhK3KfzdSQBnL/g7YfHSlymZKdiOHEo8fJ0qMA==", + "license": "MIT", + "dependencies": { + "@docusaurus/mdx-loader": "3.4.0", + "@docusaurus/module-type-aliases": "3.4.0", + "@docusaurus/plugin-content-blog": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/plugin-content-pages": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", "@types/history": "^4.7.11", "@types/react": "*", "@types/react-router-config": "*", @@ -2669,18 +2708,19 @@ } }, "node_modules/@docusaurus/theme-search-algolia": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.3.2.tgz", - "integrity": "sha512-qLkfCl29VNBnF1MWiL9IyOQaHxUvicZp69hISyq/xMsNvFKHFOaOfk9xezYod2Q9xx3xxUh9t/QPigIei2tX4w==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.4.0.tgz", + "integrity": "sha512-aiHFx7OCw4Wck1z6IoShVdUWIjntC8FHCw9c5dR8r3q4Ynh+zkS8y2eFFunN/DL6RXPzpnvKCg3vhLQYJDmT9Q==", + "license": "MIT", "dependencies": { "@docsearch/react": "^3.5.2", - "@docusaurus/core": "3.3.2", - "@docusaurus/logger": "3.3.2", - "@docusaurus/plugin-content-docs": "3.3.2", - "@docusaurus/theme-common": "3.3.2", - "@docusaurus/theme-translations": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-validation": "3.3.2", + "@docusaurus/core": "3.4.0", + "@docusaurus/logger": "3.4.0", + "@docusaurus/plugin-content-docs": "3.4.0", + "@docusaurus/theme-common": "3.4.0", + "@docusaurus/theme-translations": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-validation": "3.4.0", "algoliasearch": "^4.18.0", "algoliasearch-helper": "^3.13.3", "clsx": "^2.0.0", @@ -2699,9 +2739,10 @@ } }, "node_modules/@docusaurus/theme-translations": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.3.2.tgz", - "integrity": "sha512-bPuiUG7Z8sNpGuTdGnmKl/oIPeTwKr0AXLGu9KaP6+UFfRZiyWbWE87ti97RrevB2ffojEdvchNujparR3jEZQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-3.4.0.tgz", + "integrity": "sha512-zSxCSpmQCCdQU5Q4CnX/ID8CSUUI3fvmq4hU/GNP/XoAWtXo9SAVnM3TzpU8Gb//H3WCsT8mJcTfyOk3d9ftNg==", + "license": "MIT", "dependencies": { "fs-extra": "^11.1.1", "tslib": "^2.6.0" @@ -2711,9 +2752,10 @@ } }, "node_modules/@docusaurus/types": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.3.2.tgz", - "integrity": "sha512-5p201S7AZhliRxTU7uMKtSsoC8mgPA9bs9b5NQg1IRdRxJfflursXNVsgc3PcMqiUTul/v1s3k3rXXFlRE890w==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-3.4.0.tgz", + "integrity": "sha512-4jcDO8kXi5Cf9TcyikB/yKmz14f2RZ2qTRerbHAsS+5InE9ZgSLBNLsewtFTcTOXSVcbU3FoGOzcNWAmU1TR0A==", + "license": "MIT", "dependencies": { "@mdx-js/mdx": "^3.0.0", "@types/history": "^4.7.11", @@ -2731,12 +2773,13 @@ } }, "node_modules/@docusaurus/utils": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.3.2.tgz", - "integrity": "sha512-f4YMnBVymtkSxONv4Y8js3Gez9IgHX+Lcg6YRMOjVbq8sgCcdYK1lf6SObAuz5qB/mxiSK7tW0M9aaiIaUSUJg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-3.4.0.tgz", + "integrity": "sha512-fRwnu3L3nnWaXOgs88BVBmG1yGjcQqZNHG+vInhEa2Sz2oQB+ZjbEMO5Rh9ePFpZ0YDiDUhpaVjwmS+AU2F14g==", + "license": "MIT", "dependencies": { - "@docusaurus/logger": "3.3.2", - "@docusaurus/utils-common": "3.3.2", + "@docusaurus/logger": "3.4.0", + "@docusaurus/utils-common": "3.4.0", "@svgr/webpack": "^8.1.0", "escape-string-regexp": "^4.0.0", "file-loader": "^6.2.0", @@ -2753,6 +2796,7 @@ "shelljs": "^0.8.5", "tslib": "^2.6.0", "url-loader": "^4.1.1", + "utility-types": "^3.10.0", "webpack": "^5.88.1" }, "engines": { @@ -2768,9 +2812,10 @@ } }, "node_modules/@docusaurus/utils-common": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.3.2.tgz", - "integrity": "sha512-QWFTLEkPYsejJsLStgtmetMFIA3pM8EPexcZ4WZ7b++gO5jGVH7zsipREnCHzk6+eDgeaXfkR6UPaTt86bp8Og==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-3.4.0.tgz", + "integrity": "sha512-NVx54Wr4rCEKsjOH5QEVvxIqVvm+9kh7q8aYTU5WzUU9/Hctd6aTrcZ3G0Id4zYJ+AeaG5K5qHA4CY5Kcm2iyQ==", + "license": "MIT", "dependencies": { "tslib": "^2.6.0" }, @@ -2787,15 +2832,18 @@ } }, "node_modules/@docusaurus/utils-validation": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.3.2.tgz", - "integrity": "sha512-itDgFs5+cbW9REuC7NdXals4V6++KifgVMzoGOOOSIifBQw+8ULhy86u5e1lnptVL0sv8oAjq2alO7I40GR7pA==", - "dependencies": { - "@docusaurus/logger": "3.3.2", - "@docusaurus/utils": "3.3.2", - "@docusaurus/utils-common": "3.3.2", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-3.4.0.tgz", + "integrity": "sha512-hYQ9fM+AXYVTWxJOT1EuNaRnrR2WGpRdLDQG07O8UOpsvCPWUVOeo26Rbm0JWY2sGLfzAb+tvJ62yF+8F+TV0g==", + "license": "MIT", + "dependencies": { + "@docusaurus/logger": "3.4.0", + "@docusaurus/utils": "3.4.0", + "@docusaurus/utils-common": "3.4.0", + "fs-extra": "^11.2.0", "joi": "^17.9.2", "js-yaml": "^4.1.0", + "lodash": "^4.17.21", "tslib": "^2.6.0" }, "engines": { @@ -4335,6 +4383,7 @@ "version": "4.23.3", "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-4.23.3.tgz", "integrity": "sha512-Le/3YgNvjW9zxIQMRhUHuhiUjAlKY/zsdZpfq4dlLqg6mEm0nL6yk+7f2hDOtLpxsgE4jSzDmvHL7nXdBp5feg==", + "license": "MIT", "dependencies": { "@algolia/cache-browser-local-storage": "4.23.3", "@algolia/cache-common": "4.23.3", @@ -4354,9 +4403,10 @@ } }, "node_modules/algoliasearch-helper": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.19.0.tgz", - "integrity": "sha512-AaSb5DZDMZmDQyIy6lf4aL0OZGgyIdqvLIIvSuVQOIOqfhrYSY7TvotIFI2x0Q3cP3xUpTd7lI1astUC4aXBJw==", + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/algoliasearch-helper/-/algoliasearch-helper-3.21.0.tgz", + "integrity": "sha512-hjVOrL15I3Y3K8xG0icwG1/tWE+MocqBrhW6uVBWpU+/kVEMK0BnM2xdssj6mZM61eJ4iRxHR0djEI3ENOpR8w==", + "license": "MIT", "dependencies": { "@algolia/events": "^4.0.1" }, @@ -5334,6 +5384,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz", "integrity": "sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -5655,6 +5706,7 @@ "version": "6.1.2", "resolved": "https://registry.npmjs.org/cssnano-preset-advanced/-/cssnano-preset-advanced-6.1.2.tgz", "integrity": "sha512-Nhao7eD8ph2DoHolEzQs5CfRpiEP0xa1HBdnFZ82kvqdmbwVBUr2r1QuQ4t1pi+D1ZpqpcO4T+wy/7RxzJ/WPQ==", + "license": "MIT", "dependencies": { "autoprefixer": "^10.4.19", "browserslist": "^4.23.0", @@ -7975,6 +8027,7 @@ "version": "0.2.0-alpha.43", "resolved": "https://registry.npmjs.org/infima/-/infima-0.2.0-alpha.43.tgz", "integrity": "sha512-2uw57LvUqW0rK/SWYnd/2rRfxNA5DDNOh33jxF7fy46VWoNhGxiUQyVZHbBMjQ33mQem0cjdDVwgWVAmlRfgyQ==", + "license": "MIT", "engines": { "node": ">=12" } @@ -11006,7 +11059,8 @@ "node_modules/nprogress": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz", - "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==" + "integrity": "sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==", + "license": "MIT" }, "node_modules/nth-check": { "version": "2.1.1", @@ -11649,6 +11703,7 @@ "version": "6.0.5", "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-6.0.5.tgz", "integrity": "sha512-wHalBlRHkaNnNwfC8z+ppX57VhvS+HWgjW508esjdaEYr3Mx7Gnn2xA4R/CKf5+Z9S5qsqC+Uzh4ueENWwCVUA==", + "license": "MIT", "dependencies": { "postcss-selector-parser": "^6.0.16" }, @@ -11768,6 +11823,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-6.0.3.tgz", "integrity": "sha512-1oIoAsODUs6IHQZkLQGO15uGEbK3EAl5wi9SS8hs45VgsxQfMnxvt+L+zIr7ifZFIH14cfAeVe2uCTa+SPRa3g==", + "license": "MIT", "dependencies": { "cssnano-utils": "^4.0.2", "postcss-value-parser": "^4.2.0" @@ -12087,6 +12143,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-6.0.3.tgz", "integrity": "sha512-G3yCqZDpsNPoQgbDUy3T0E6hqOQ5xigUtBQyrmq3tn2GxlyiL0yyl7H+T8ulQR6kOcHJ9t7/9H4/R2tv8tJbMA==", + "license": "MIT", "dependencies": { "postcss-value-parser": "^4.2.0" }, @@ -12142,6 +12199,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/postcss-sort-media-queries/-/postcss-sort-media-queries-5.2.0.tgz", "integrity": "sha512-AZ5fDMLD8SldlAYlvi8NIqo0+Z8xnXU2ia0jxmuhxAU+Lqt9K+AlmLNJ/zWEnE9x+Zx3qL3+1K20ATgNOr3fAA==", + "license": "MIT", "dependencies": { "sort-css-media-queries": "2.2.0" }, @@ -12190,6 +12248,7 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-6.0.2.tgz", "integrity": "sha512-5BxW9l1evPB/4ZIc+2GobEBoKC+h8gPGCMi+jxsYvd2x0mjq7wazk6DrP71pStqxE9Foxh5TVnonbWpFZzXaYg==", + "license": "MIT", "engines": { "node": "^14 || ^16 || >=18.0" }, @@ -12230,6 +12289,7 @@ "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==", + "license": "MIT", "engines": { "node": ">=6" } @@ -12602,6 +12662,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-1.4.0.tgz", "integrity": "sha512-wh6F6uJyYAmQ4fK0e8dSQMEWuvTs2Wr3el3sLD9bambX1+pSWUVXIz1RFaoy3TI1mZ0FqdpKq9YgbgTTgyrmXA==", + "license": "MIT", "engines": { "node": ">=14" }, @@ -13176,6 +13237,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/rtlcss/-/rtlcss-4.1.1.tgz", "integrity": "sha512-/oVHgBtnPNcggP2aVXQjSy6N1mMAfHg4GSag0QtZBlD5bdDgAHwr4pydqJGd+SUCu9260+Pjqbjwtvu7EMH1KQ==", + "license": "MIT", "dependencies": { "escalade": "^3.1.1", "picocolors": "^1.0.0", @@ -13267,9 +13329,10 @@ } }, "node_modules/search-insights": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.13.0.tgz", - "integrity": "sha512-Orrsjf9trHHxFRuo9/rzm0KIWmgzE8RMlZMzuhZOJ01Rnz3D0YBAe+V6473t6/H6c7irs6Lt48brULAiRWb3Vw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/search-insights/-/search-insights-2.14.0.tgz", + "integrity": "sha512-OLN6MsPMCghDOqlCtsIsYgtsC0pnwVTyT9Mu6A3ewOj1DxvzZF6COrn2g86E/c05xbktB0XN04m/t1Z+n+fTGw==", + "license": "MIT", "peer": true }, "node_modules/section-matter": { @@ -13685,6 +13748,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/sort-css-media-queries/-/sort-css-media-queries-2.2.0.tgz", "integrity": "sha512-0xtkGhWCC9MGt/EzgnvbbbKhqWjl1+/rncmhTh5qCpbYguXh6S/qwePfv/JQ8jePXXmqingylxoC49pCkSPIbA==", + "license": "MIT", "engines": { "node": ">= 6.3.0" } @@ -13925,6 +13989,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "license": "MIT", "engines": { "node": ">=8" }, diff --git a/docs/package.json b/docs/package.json index 05165ae4b7e..d74dafda30e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -15,12 +15,12 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@docusaurus/core": "^3.3.2", - "@docusaurus/plugin-client-redirects": "^3.3.2", - "@docusaurus/plugin-content-docs": "^3.3.2", - "@docusaurus/plugin-google-gtag": "^3.3.2", - "@docusaurus/plugin-sitemap": "^3.3.2", - "@docusaurus/preset-classic": "^3.3.2", + "@docusaurus/core": "^3.4.0", + "@docusaurus/plugin-client-redirects": "^3.4.0", + "@docusaurus/plugin-content-docs": "^3.4.0", + "@docusaurus/plugin-google-gtag": "^3.4.0", + "@docusaurus/plugin-sitemap": "^3.4.0", + "@docusaurus/preset-classic": "^3.4.0", "@easyops-cn/docusaurus-search-local": "^0.40.1", "@gracefullight/docusaurus-plugin-microsoft-clarity": "^1.0.0", "@mdx-js/react": "^3.0.0", diff --git a/docs/src/css/custom.css b/docs/src/css/custom.css index cafce22a321..55f7cbb8e6d 100644 --- a/docs/src/css/custom.css +++ b/docs/src/css/custom.css @@ -228,6 +228,12 @@ html { @apply bg-none; } } + .breadcrumbs__link { + color: black !important; + } + &[data-theme="dark"] .breadcrumbs__link { + color: white !important; + } .theme-doc-breadcrumbs { @media (min-width: 997px) { @apply pt-[calc(theme(spacing.7)-1rem)]; diff --git a/docs/versioned_docs/version-v4.6.x/02-apps/01-transfer/05-events.md b/docs/versioned_docs/version-v4.6.x/02-apps/01-transfer/05-events.md index cdadc5753c8..eaf85b626c3 100644 --- a/docs/versioned_docs/version-v4.6.x/02-apps/01-transfer/05-events.md +++ b/docs/versioned_docs/version-v4.6.x/02-apps/01-transfer/05-events.md @@ -14,7 +14,6 @@ slug: /apps/transfer/events |--------------|---------------|-----------------| | ibc_transfer | sender | \{sender\} | | ibc_transfer | receiver | \{receiver\} | -| message | action | transfer | | message | module | transfer | ## `OnRecvPacket` callback @@ -26,22 +25,24 @@ slug: /apps/transfer/events | fungible_token_packet | receiver | \{receiver\} | | fungible_token_packet | denom | \{denom\} | | fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | success | \{ackSuccess\} | | fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | success | \{ackSuccess\} | +| fungible_token_packet | error | \{ackError\} | | denomination_trace | trace_hash | \{hex_hash\} | +| denomination_trace | denom | \{voucherDenom\}| ## `OnAcknowledgePacket` callback -| Type | Attribute Key | Attribute Value | -|-----------------------|-----------------|-------------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | sender | \{sender\} | -| fungible_token_packet | receiver | \{receiver\} | -| fungible_token_packet | denom | \{denom\} | -| fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | memo | \{memo\} | -| fungible_token_packet | acknowledgement | \{ack.String()\} | -| fungible_token_packet | success / error | \{ack.Response\} | +| Type | Attribute Key | Attribute Value | +|-----------------------|-----------------|------------------| +| fungible_token_packet | module | transfer | +| fungible_token_packet | sender | \{sender\} | +| fungible_token_packet | receiver | \{receiver\} | +| fungible_token_packet | denom | \{denom\} | +| fungible_token_packet | amount | \{amount\} | +| fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | acknowledgement | \{ack.String()\} | +| fungible_token_packet | success / error | \{ack.Response\} | ## `OnTimeoutPacket` callback diff --git a/docs/versioned_docs/version-v5.4.x/02-apps/01-transfer/05-events.md b/docs/versioned_docs/version-v5.4.x/02-apps/01-transfer/05-events.md index cdadc5753c8..eaf85b626c3 100644 --- a/docs/versioned_docs/version-v5.4.x/02-apps/01-transfer/05-events.md +++ b/docs/versioned_docs/version-v5.4.x/02-apps/01-transfer/05-events.md @@ -14,7 +14,6 @@ slug: /apps/transfer/events |--------------|---------------|-----------------| | ibc_transfer | sender | \{sender\} | | ibc_transfer | receiver | \{receiver\} | -| message | action | transfer | | message | module | transfer | ## `OnRecvPacket` callback @@ -26,22 +25,24 @@ slug: /apps/transfer/events | fungible_token_packet | receiver | \{receiver\} | | fungible_token_packet | denom | \{denom\} | | fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | success | \{ackSuccess\} | | fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | success | \{ackSuccess\} | +| fungible_token_packet | error | \{ackError\} | | denomination_trace | trace_hash | \{hex_hash\} | +| denomination_trace | denom | \{voucherDenom\}| ## `OnAcknowledgePacket` callback -| Type | Attribute Key | Attribute Value | -|-----------------------|-----------------|-------------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | sender | \{sender\} | -| fungible_token_packet | receiver | \{receiver\} | -| fungible_token_packet | denom | \{denom\} | -| fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | memo | \{memo\} | -| fungible_token_packet | acknowledgement | \{ack.String()\} | -| fungible_token_packet | success / error | \{ack.Response\} | +| Type | Attribute Key | Attribute Value | +|-----------------------|-----------------|------------------| +| fungible_token_packet | module | transfer | +| fungible_token_packet | sender | \{sender\} | +| fungible_token_packet | receiver | \{receiver\} | +| fungible_token_packet | denom | \{denom\} | +| fungible_token_packet | amount | \{amount\} | +| fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | acknowledgement | \{ack.String()\} | +| fungible_token_packet | success / error | \{ack.Response\} | ## `OnTimeoutPacket` callback diff --git a/docs/versioned_docs/version-v6.3.x/02-apps/01-transfer/05-events.md b/docs/versioned_docs/version-v6.3.x/02-apps/01-transfer/05-events.md index cdadc5753c8..eaf85b626c3 100644 --- a/docs/versioned_docs/version-v6.3.x/02-apps/01-transfer/05-events.md +++ b/docs/versioned_docs/version-v6.3.x/02-apps/01-transfer/05-events.md @@ -14,7 +14,6 @@ slug: /apps/transfer/events |--------------|---------------|-----------------| | ibc_transfer | sender | \{sender\} | | ibc_transfer | receiver | \{receiver\} | -| message | action | transfer | | message | module | transfer | ## `OnRecvPacket` callback @@ -26,22 +25,24 @@ slug: /apps/transfer/events | fungible_token_packet | receiver | \{receiver\} | | fungible_token_packet | denom | \{denom\} | | fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | success | \{ackSuccess\} | | fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | success | \{ackSuccess\} | +| fungible_token_packet | error | \{ackError\} | | denomination_trace | trace_hash | \{hex_hash\} | +| denomination_trace | denom | \{voucherDenom\}| ## `OnAcknowledgePacket` callback -| Type | Attribute Key | Attribute Value | -|-----------------------|-----------------|-------------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | sender | \{sender\} | -| fungible_token_packet | receiver | \{receiver\} | -| fungible_token_packet | denom | \{denom\} | -| fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | memo | \{memo\} | -| fungible_token_packet | acknowledgement | \{ack.String()\} | -| fungible_token_packet | success / error | \{ack.Response\} | +| Type | Attribute Key | Attribute Value | +|-----------------------|-----------------|------------------| +| fungible_token_packet | module | transfer | +| fungible_token_packet | sender | \{sender\} | +| fungible_token_packet | receiver | \{receiver\} | +| fungible_token_packet | denom | \{denom\} | +| fungible_token_packet | amount | \{amount\} | +| fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | acknowledgement | \{ack.String()\} | +| fungible_token_packet | success / error | \{ack.Response\} | ## `OnTimeoutPacket` callback diff --git a/docs/versioned_docs/version-v7.5.x/02-apps/01-transfer/05-events.md b/docs/versioned_docs/version-v7.5.x/02-apps/01-transfer/05-events.md index cdadc5753c8..67d002b14a7 100644 --- a/docs/versioned_docs/version-v7.5.x/02-apps/01-transfer/05-events.md +++ b/docs/versioned_docs/version-v7.5.x/02-apps/01-transfer/05-events.md @@ -14,7 +14,9 @@ slug: /apps/transfer/events |--------------|---------------|-----------------| | ibc_transfer | sender | \{sender\} | | ibc_transfer | receiver | \{receiver\} | -| message | action | transfer | +| ibc_transfer | amount | \{amount\} | +| ibc_transfer | denom | \{denom\} | +| ibc_transfer | memo | \{memo\} | | message | module | transfer | ## `OnRecvPacket` callback @@ -26,22 +28,24 @@ slug: /apps/transfer/events | fungible_token_packet | receiver | \{receiver\} | | fungible_token_packet | denom | \{denom\} | | fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | success | \{ackSuccess\} | | fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | success | \{ackSuccess\} | +| fungible_token_packet | error | \{ackError\} | | denomination_trace | trace_hash | \{hex_hash\} | +| denomination_trace | denom | \{voucherDenom\}| ## `OnAcknowledgePacket` callback -| Type | Attribute Key | Attribute Value | -|-----------------------|-----------------|-------------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | sender | \{sender\} | -| fungible_token_packet | receiver | \{receiver\} | -| fungible_token_packet | denom | \{denom\} | -| fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | memo | \{memo\} | -| fungible_token_packet | acknowledgement | \{ack.String()\} | -| fungible_token_packet | success / error | \{ack.Response\} | +| Type | Attribute Key | Attribute Value | +|-----------------------|-----------------|------------------| +| fungible_token_packet | module | transfer | +| fungible_token_packet | sender | \{sender\} | +| fungible_token_packet | receiver | \{receiver\} | +| fungible_token_packet | denom | \{denom\} | +| fungible_token_packet | amount | \{amount\} | +| fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | acknowledgement | \{ack.String()\} | +| fungible_token_packet | success / error | \{ack.Response\} | ## `OnTimeoutPacket` callback diff --git a/docs/versioned_docs/version-v8.3.x/02-apps/01-transfer/05-events.md b/docs/versioned_docs/version-v8.3.x/02-apps/01-transfer/05-events.md index 9b222ba3820..194c78c7506 100644 --- a/docs/versioned_docs/version-v8.3.x/02-apps/01-transfer/05-events.md +++ b/docs/versioned_docs/version-v8.3.x/02-apps/01-transfer/05-events.md @@ -5,7 +5,6 @@ sidebar_position: 5 slug: /apps/transfer/events --- - # Events ## `MsgTransfer` @@ -14,7 +13,9 @@ slug: /apps/transfer/events |--------------|---------------|-----------------| | ibc_transfer | sender | \{sender\} | | ibc_transfer | receiver | \{receiver\} | -| message | action | transfer | +| ibc_transfer | amount | \{amount\} | +| ibc_transfer | denom | \{denom\} | +| ibc_transfer | memo | \{memo\} | | message | module | transfer | ## `OnRecvPacket` callback @@ -22,26 +23,28 @@ slug: /apps/transfer/events | Type | Attribute Key | Attribute Value | |-----------------------|---------------|-----------------| | fungible_token_packet | module | transfer | -| fungible_token_packet | sender | \{sender\} | -| fungible_token_packet | receiver | \{receiver\} | -| fungible_token_packet | denom | \{denom\} | -| fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | success | \{ackSuccess\} | -| fungible_token_packet | memo | \{memo\} | -| denomination_trace | trace_hash | \{hex_hash\} | +| fungible_token_packet | sender | \{sender\} | +| fungible_token_packet | receiver | \{receiver\} | +| fungible_token_packet | denom | \{denom\} | +| fungible_token_packet | amount | \{amount\} | +| fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | success | \{ackSuccess\} | +| fungible_token_packet | error | \{ackError\} | +| denomination_trace | trace_hash | \{hex_hash\} | +| denomination_trace | denom | \{voucherDenom\}| ## `OnAcknowledgePacket` callback -| Type | Attribute Key | Attribute Value | -|-----------------------|-----------------|-------------------| -| fungible_token_packet | module | transfer | -| fungible_token_packet | sender | \{sender\} | -| fungible_token_packet | receiver | \{receiver\} | -| fungible_token_packet | denom | \{denom\} | -| fungible_token_packet | amount | \{amount\} | -| fungible_token_packet | memo | \{memo\} | -| fungible_token_packet | acknowledgement | \{ack.String()\} | -| fungible_token_packet | success / error | \{ack.Response\} | +| Type | Attribute Key | Attribute Value | +|-----------------------|-----------------|------------------| +| fungible_token_packet | module | transfer | +| fungible_token_packet | sender | \{sender\} | +| fungible_token_packet | receiver | \{receiver\} | +| fungible_token_packet | denom | \{denom\} | +| fungible_token_packet | amount | \{amount\} | +| fungible_token_packet | memo | \{memo\} | +| fungible_token_packet | acknowledgement | \{ack.String()\} | +| fungible_token_packet | success / error | \{ack.Response\} | ## `OnTimeoutPacket` callback diff --git a/e2e/go.mod b/e2e/go.mod index 787bdd1a019..0e117437a60 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -12,7 +12,7 @@ require ( cosmossdk.io/x/upgrade v0.1.3 github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/modules/light-clients/08-wasm v0.0.0-00010101000000-000000000000 github.com/cosmos/ibc-go/v8 v8.1.0 github.com/docker/docker v24.0.7+incompatible @@ -244,7 +244,7 @@ require ( google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index 53cb6a3a4b7..18e160fed05 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -384,8 +384,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= @@ -1745,8 +1745,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/e2e/tests/core/02-client/client_test.go b/e2e/tests/core/02-client/client_test.go index 8075139f3d4..34980045530 100644 --- a/e2e/tests/core/02-client/client_test.go +++ b/e2e/tests/core/02-client/client_test.go @@ -438,9 +438,9 @@ func (s *ClientTestSuite) TestAllowedClientsParam() { ctx := context.TODO() _, _ = s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) + chainA, chainB := s.GetChains() chainAVersion := chainA.Config().Images[0].Version - chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") diff --git a/e2e/tests/core/03-connection/connection_test.go b/e2e/tests/core/03-connection/connection_test.go index e9a8cab12ad..c9283be5abb 100644 --- a/e2e/tests/core/03-connection/connection_test.go +++ b/e2e/tests/core/03-connection/connection_test.go @@ -62,6 +62,7 @@ func (s *ConnectionTestSuite) TestMaxExpectedTimePerBlockParam() { ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) + chainA, chainB := s.GetChains() chainAVersion := chainA.Config().Images[0].Version @@ -108,7 +109,7 @@ func (s *ConnectionTestSuite) TestMaxExpectedTimePerBlockParam() { t.Run("ensure packets can be received, send from chainB to chainA", func(t *testing.T) { t.Run("send tokens from chainB to chainA", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") + transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferCoins(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") s.AssertTxSuccess(transferTxResp) }) diff --git a/e2e/tests/transfer/authz_test.go b/e2e/tests/transfer/authz_test.go index c2f803ae4ae..f527ee0663c 100644 --- a/e2e/tests/transfer/authz_test.go +++ b/e2e/tests/transfer/authz_test.go @@ -50,7 +50,6 @@ func (suite *AuthzTransferTestSuite) TestAuthz_MsgTransfer_Succeeds() { relayer, channelA := suite.SetupChainsRelayerAndChannel(ctx, suite.TransferChannelOptions()) chainA, chainB := suite.GetChains() - chainADenom := chainA.Config().Denom granterWallet := suite.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) @@ -118,9 +117,10 @@ func (suite *AuthzTransferTestSuite) TestAuthz_MsgTransfer_Succeeds() { t.Run("broadcast MsgGrant", createMsgGrantFn) t.Run("broadcast MsgExec for ibc MsgTransfer", func(t *testing.T) { - transferMsg := transfertypes.NewMsgTransfer( + transferMsg := testsuite.GetMsgTransfer( channelA.PortID, channelA.ChannelID, + channelA.Version, testvalues.DefaultTransferCoins(chainADenom), granterAddress, receiverWalletAddress, @@ -177,9 +177,10 @@ func (suite *AuthzTransferTestSuite) TestAuthz_MsgTransfer_Succeeds() { }) t.Run("exec unauthorized MsgTransfer", func(t *testing.T) { - transferMsg := transfertypes.NewMsgTransfer( + transferMsg := testsuite.GetMsgTransfer( channelA.PortID, channelA.ChannelID, + channelA.Version, testvalues.DefaultTransferCoins(chainADenom), granterAddress, receiverWalletAddress, @@ -207,9 +208,8 @@ func (suite *AuthzTransferTestSuite) TestAuthz_InvalidTransferAuthorizations() { relayer, channelA := suite.SetupChainsRelayerAndChannel(ctx, suite.TransferChannelOptions()) chainA, chainB := suite.GetChains() - - chainAVersion := chainA.Config().Images[0].Version chainADenom := chainA.Config().Denom + chainAVersion := chainA.Config().Images[0].Version granterWallet := suite.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) granterAddress := granterWallet.FormattedAddress() @@ -259,9 +259,10 @@ func (suite *AuthzTransferTestSuite) TestAuthz_InvalidTransferAuthorizations() { const invalidSpendAmount = spendLimit + 1 t.Run("broadcast MsgExec for ibc MsgTransfer", func(t *testing.T) { - transferMsg := transfertypes.NewMsgTransfer( + transferMsg := testsuite.GetMsgTransfer( channelA.PortID, channelA.ChannelID, + channelA.Version, sdk.NewCoins(sdk.Coin{Denom: chainADenom, Amount: sdkmath.NewInt(invalidSpendAmount)}), granterAddress, receiverWalletAddress, @@ -318,9 +319,10 @@ func (suite *AuthzTransferTestSuite) TestAuthz_InvalidTransferAuthorizations() { invalidWalletAddress := invalidWallet.FormattedAddress() t.Run("broadcast MsgExec for ibc MsgTransfer", func(t *testing.T) { - transferMsg := transfertypes.NewMsgTransfer( + transferMsg := testsuite.GetMsgTransfer( channelA.PortID, channelA.ChannelID, + channelA.Version, sdk.NewCoins(sdk.Coin{Denom: chainADenom, Amount: sdkmath.NewInt(spendLimit)}), granterAddress, invalidWalletAddress, diff --git a/e2e/tests/transfer/base_test.go b/e2e/tests/transfer/base_test.go index 751ad6eecf5..fffe14d9228 100644 --- a/e2e/tests/transfer/base_test.go +++ b/e2e/tests/transfer/base_test.go @@ -48,8 +48,10 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) - chainA, chainB := s.GetChains() + chainA, chainB := s.GetChains() + chainAVersion := chainA.Config().Images[0].Version + chainBVersion := chainB.Config().Images[0].Version chainADenom := chainA.Config().Denom chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) @@ -66,11 +68,8 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA), "failed to wait for blocks") }) - chainAVersion := chainA.Config().Images[0].Version - chainBVersion := chainB.Config().Images[0].Version - t.Run("native IBC token transfer from chainA to chainB, sender is source of tokens", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -113,7 +112,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() { } t.Run("non-native IBC token transfer from chainB to chainA, receiver is source of tokens", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") + transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferCoins(chainBIBCToken.IBCDenom()), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -158,8 +157,8 @@ func (s *TransferTestSuite) TestMsgTransfer_Fails_InvalidAddress() { ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) - chainA, chainB := s.GetChains() + chainA, chainB := s.GetChains() chainADenom := chainA.Config().Denom chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) @@ -168,7 +167,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Fails_InvalidAddress() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("native IBC token transfer from chainA to invalid address", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, testvalues.InvalidAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, testvalues.InvalidAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -203,6 +202,7 @@ func (s *TransferTestSuite) TestMsgTransfer_Timeout_Nonincentivized() { relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) chainA, _ := s.GetChains() + chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) @@ -250,8 +250,9 @@ func (s *TransferTestSuite) TestSendEnabledParam() { ctx := context.TODO() _, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) - chainA, chainB := s.GetChains() + chainA, chainB := s.GetChains() + chainAVersion := chainA.Config().Images[0].Version chainADenom := chainA.Config().Denom chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) @@ -260,7 +261,6 @@ func (s *TransferTestSuite) TestSendEnabledParam() { chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) chainBAddress := chainBWallet.FormattedAddress() - chainAVersion := chainA.Config().Images[0].Version isSelfManagingParams := testvalues.SelfParamsFeatureReleases.IsSupported(chainAVersion) govModuleAddress, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, chainA) @@ -275,7 +275,7 @@ func (s *TransferTestSuite) TestSendEnabledParam() { }) t.Run("ensure packets can be sent", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -299,7 +299,7 @@ func (s *TransferTestSuite) TestSendEnabledParam() { }) t.Run("ensure ics20 transfer fails", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxFailure(transferTxResp, transfertypes.ErrSendDisabled) }) } @@ -310,7 +310,9 @@ func (s *TransferTestSuite) TestReceiveEnabledParam() { ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) + chainA, chainB := s.GetChains() + chainAVersion := chainA.Config().Images[0].Version chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) @@ -323,7 +325,6 @@ func (s *TransferTestSuite) TestReceiveEnabledParam() { chainBAddress = chainBWallet.FormattedAddress() ) - chainAVersion := chainA.Config().Images[0].Version isSelfManagingParams := testvalues.SelfParamsFeatureReleases.IsSupported(chainAVersion) govModuleAddress, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, chainA) @@ -339,7 +340,7 @@ func (s *TransferTestSuite) TestReceiveEnabledParam() { t.Run("ensure packets can be received, send from chainB to chainA", func(t *testing.T) { t.Run("send from chainB to chainA", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") + transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferCoins(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -391,7 +392,7 @@ func (s *TransferTestSuite) TestReceiveEnabledParam() { t.Run("ensure ics20 transfer fails", func(t *testing.T) { t.Run("send from chainB to chainA", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") + transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferCoins(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -429,8 +430,8 @@ func (s *TransferTestSuite) TestMsgTransfer_WithMemo() { ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) - chainA, chainB := s.GetChains() + chainA, chainB := s.GetChains() chainADenom := chainA.Config().Denom chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) @@ -442,7 +443,7 @@ func (s *TransferTestSuite) TestMsgTransfer_WithMemo() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("IBC token transfer with memo from chainA to chainB", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "memo") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "memo") s.AssertTxSuccess(transferTxResp) }) diff --git a/e2e/tests/transfer/forwarding_test.go b/e2e/tests/transfer/forwarding_test.go new file mode 100644 index 00000000000..dbebfab1e9c --- /dev/null +++ b/e2e/tests/transfer/forwarding_test.go @@ -0,0 +1,93 @@ +//go:build !test_e2e + +package transfer + +import ( + "context" + "testing" + + testifysuite "github.com/stretchr/testify/suite" + + "github.com/cosmos/ibc-go/e2e/testsuite" + "github.com/cosmos/ibc-go/e2e/testsuite/query" + "github.com/cosmos/ibc-go/e2e/testvalues" +) + +func TestTransferForwardingTestSuite(t *testing.T) { + testifysuite.Run(t, new(TransferForwardingTestSuite)) +} + +type TransferForwardingTestSuite struct { + testsuite.E2ETestSuite +} + +// TODO: replace this with actual tests https://github.com/cosmos/ibc-go/issues/6578 +// this test verifies that three chains can be set up, and the relayer will relay +// packets between them as configured in the newInterchain function. +func (s *TransferForwardingTestSuite) TestThreeChainSetup() { + ctx := context.TODO() + t := s.T() + + // TODO: note the ThreeChainSetup fn needs to be passed to TransferChannelOptions since it calls + // GetChains which will requires those settings. We should be able to update the function to accept + // the chain version rather than calling GetChains. + // https://github.com/cosmos/ibc-go/issues/6577 + relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions(testsuite.ThreeChainSetup()), testsuite.ThreeChainSetup()) + chains := s.GetAllChains() + + chainA, chainB, chainC := chains[0], chains[1], chains[2] + + chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + chainAAddress := chainAWallet.FormattedAddress() + chainADenom := chainA.Config().Denom + + chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) + chainBAddress := chainBWallet.FormattedAddress() + chainBDenom := chainB.Config().Denom + + chainCWallet := s.CreateUserOnChainC(ctx, testvalues.StartingTokenAmount) + chainCAddress := chainCWallet.FormattedAddress() + + t.Run("IBC transfer from A to B", func(t *testing.T) { + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + s.AssertTxSuccess(transferTxResp) + }) + + chainBChannels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainB.Config().ChainID) + s.Require().NoError(err) + // channel between A and B and channel between B and C + s.Require().Len(chainBChannels, 2) + + chainBtoCChannel := chainBChannels[0] + + t.Run("IBC transfer from B to C", func(t *testing.T) { + transferTxResp := s.Transfer(ctx, chainB, chainBWallet, chainBtoCChannel.PortID, chainBtoCChannel.ChannelID, testvalues.DefaultTransferCoins(chainBDenom), chainBAddress, chainCAddress, s.GetTimeoutHeight(ctx, chainC), 0, "") + s.AssertTxSuccess(transferTxResp) + }) + + t.Run("start relayer", func(t *testing.T) { + s.StartRelayer(relayer) + }) + + chainBIBCToken := testsuite.GetIBCToken(chainADenom, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID) + t.Run("packets are relayed from A to B", func(t *testing.T) { + s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1) + + actualBalance, err := query.Balance(ctx, chainB, chainBAddress, chainBIBCToken.IBCDenom()) + s.Require().NoError(err) + + expected := testvalues.IBCTransferAmount + s.Require().Equal(expected, actualBalance.Int64()) + }) + + chainCIBCToken := testsuite.GetIBCToken(chainBDenom, chainBtoCChannel.Counterparty.PortID, chainBtoCChannel.Counterparty.ChannelID) + t.Run("packets are relayed from B to C", func(t *testing.T) { + s.AssertPacketRelayed(ctx, chainB, chainBtoCChannel.PortID, chainBtoCChannel.ChannelID, 1) + + actualBalance, err := query.Balance(ctx, chainC, chainCAddress, chainCIBCToken.IBCDenom()) + s.Require().NoError(err) + + expected := testvalues.IBCTransferAmount + s.Require().Equal(expected, actualBalance.Int64()) + }) +} diff --git a/e2e/tests/transfer/incentivized_test.go b/e2e/tests/transfer/incentivized_test.go index cbf9ac79c99..6b54c31b961 100644 --- a/e2e/tests/transfer/incentivized_test.go +++ b/e2e/tests/transfer/incentivized_test.go @@ -16,10 +16,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/ibc-go/e2e/testsuite" "github.com/cosmos/ibc-go/e2e/testsuite/query" "github.com/cosmos/ibc-go/e2e/testvalues" feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" - transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) @@ -198,7 +198,20 @@ func (s *IncentivizedTransferTestSuite) TestMsgPayPacketFee_InvalidReceiverAccou transferAmount := testvalues.DefaultTransferAmount(chainADenom) t.Run("send IBC transfer", func(t *testing.T) { - msgTransfer := transfertypes.NewMsgTransfer(channelA.PortID, channelA.ChannelID, sdk.NewCoins(transferAmount), chainAWallet.FormattedAddress(), testvalues.InvalidAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + version, err := feetypes.MetadataFromVersion(channelA.Version) + s.Require().NoError(err) + + msgTransfer := testsuite.GetMsgTransfer( + channelA.PortID, + channelA.ChannelID, + version.AppVersion, + sdk.NewCoins(transferAmount), + chainAWallet.FormattedAddress(), + testvalues.InvalidAddress, + s.GetTimeoutHeight(ctx, chainB), + 0, + "", + ) txResp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgTransfer) // this message should be successful, as receiver account is not validated on the sending chain. s.AssertTxSuccess(txResp) @@ -322,8 +335,21 @@ func (s *IncentivizedTransferTestSuite) TestMultiMsg_MsgPayPacketFeeSingleSender s.Require().Empty(packets) }) + version, err := feetypes.MetadataFromVersion(channelA.Version) + s.Require().NoError(err) + msgPayPacketFee := feetypes.NewMsgPayPacketFee(testFee, channelA.PortID, channelA.ChannelID, chainAWallet.FormattedAddress(), nil) - msgTransfer := transfertypes.NewMsgTransfer(channelA.PortID, channelA.ChannelID, sdk.NewCoins(transferAmount), chainAWallet.FormattedAddress(), chainBWallet.FormattedAddress(), s.GetTimeoutHeight(ctx, chainB), 0, "") + msgTransfer := testsuite.GetMsgTransfer( + channelA.PortID, + channelA.ChannelID, + version.AppVersion, + sdk.NewCoins(transferAmount), + chainAWallet.FormattedAddress(), + chainBWallet.FormattedAddress(), + s.GetTimeoutHeight(ctx, chainB), + 0, + "", + ) resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgPayPacketFee, msgTransfer) s.AssertTxSuccess(resp) diff --git a/e2e/tests/transfer/localhost_test.go b/e2e/tests/transfer/localhost_test.go index fac88272018..8d3de8e2808 100644 --- a/e2e/tests/transfer/localhost_test.go +++ b/e2e/tests/transfer/localhost_test.go @@ -35,9 +35,9 @@ func (s *LocalhostTransferTestSuite) TestMsgTransfer_Localhost() { t := s.T() ctx := context.TODO() - _, _ = s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) - chainA, _ := s.GetChains() + _, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) + chainA, _ := s.GetChains() chainADenom := chainA.Config().Denom rlyWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) @@ -70,7 +70,7 @@ func (s *LocalhostTransferTestSuite) TestMsgTransfer_Localhost() { t.Run("channel open init localhost", func(t *testing.T) { msgChanOpenInit := channeltypes.NewMsgChannelOpenInit( - transfertypes.PortID, transfertypes.V2, + transfertypes.PortID, channelA.Version, channeltypes.UNORDERED, []string{exported.LocalhostConnectionID}, transfertypes.PortID, rlyWallet.FormattedAddress(), ) @@ -85,10 +85,10 @@ func (s *LocalhostTransferTestSuite) TestMsgTransfer_Localhost() { t.Run("channel open try localhost", func(t *testing.T) { msgChanOpenTry := channeltypes.NewMsgChannelOpenTry( - transfertypes.PortID, transfertypes.V2, + transfertypes.PortID, channelA.Version, channeltypes.UNORDERED, []string{exported.LocalhostConnectionID}, transfertypes.PortID, msgChanOpenInitRes.ChannelId, - transfertypes.V2, localhost.SentinelProof, clienttypes.ZeroHeight(), rlyWallet.FormattedAddress(), + channelA.Version, localhost.SentinelProof, clienttypes.ZeroHeight(), rlyWallet.FormattedAddress(), ) txResp := s.BroadcastMessages(ctx, chainA, rlyWallet, msgChanOpenTry) @@ -100,7 +100,7 @@ func (s *LocalhostTransferTestSuite) TestMsgTransfer_Localhost() { t.Run("channel open ack localhost", func(t *testing.T) { msgChanOpenAck := channeltypes.NewMsgChannelOpenAck( transfertypes.PortID, msgChanOpenInitRes.ChannelId, - msgChanOpenTryRes.ChannelId, transfertypes.V2, + msgChanOpenTryRes.ChannelId, channelA.Version, localhost.SentinelProof, clienttypes.ZeroHeight(), rlyWallet.FormattedAddress(), ) @@ -132,7 +132,7 @@ func (s *LocalhostTransferTestSuite) TestMsgTransfer_Localhost() { t.Run("send packet localhost ibc transfer", func(t *testing.T) { var err error - txResp := s.Transfer(ctx, chainA, userAWallet, transfertypes.PortID, msgChanOpenInitRes.ChannelId, testvalues.DefaultTransferAmount(chainADenom), userAWallet.FormattedAddress(), userBWallet.FormattedAddress(), clienttypes.NewHeight(1, 100), 0, "") + txResp := s.Transfer(ctx, chainA, userAWallet, transfertypes.PortID, msgChanOpenInitRes.ChannelId, testvalues.DefaultTransferCoins(chainADenom), userAWallet.FormattedAddress(), userBWallet.FormattedAddress(), clienttypes.NewHeight(1, 100), 0, "") s.AssertTxSuccess(txResp) packet, err = ibctesting.ParsePacketFromEvents(txResp.Events) diff --git a/e2e/tests/transfer/upgrades_test.go b/e2e/tests/transfer/upgrades_test.go index c32b324fdca..10ea8b3c839 100644 --- a/e2e/tests/transfer/upgrades_test.go +++ b/e2e/tests/transfer/upgrades_test.go @@ -19,7 +19,6 @@ import ( "github.com/cosmos/ibc-go/e2e/testsuite/query" "github.com/cosmos/ibc-go/e2e/testvalues" feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" - transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) @@ -37,9 +36,10 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) + channelB := channelA.Counterparty - chainA, chainB := s.GetChains() + chainA, chainB := s.GetChains() chainADenom := chainA.Config().Denom chainBDenom := chainB.Config().Denom chainAIBCToken := testsuite.GetIBCToken(chainBDenom, channelA.PortID, channelA.ChannelID) @@ -198,7 +198,17 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ transferAmount := testvalues.DefaultTransferAmount(chainA.Config().Denom) msgPayPacketFee := feetypes.NewMsgPayPacketFee(testFee, channelA.PortID, channelA.ChannelID, chainAWallet.FormattedAddress(), nil) - msgTransfer := transfertypes.NewMsgTransfer(channelA.PortID, channelA.ChannelID, sdk.NewCoins(transferAmount), chainAWallet.FormattedAddress(), chainBWallet.FormattedAddress(), s.GetTimeoutHeight(ctx, chainB), 0, "") + msgTransfer := testsuite.GetMsgTransfer( + channelA.PortID, + channelA.ChannelID, + channelA.Version, // upgrade adds fee middleware, but keeps transfer version + sdk.NewCoins(transferAmount), + chainAWallet.FormattedAddress(), + chainBWallet.FormattedAddress(), + s.GetTimeoutHeight(ctx, chainB), + 0, + "", + ) resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgPayPacketFee, msgTransfer) s.AssertTxSuccess(resp) }) @@ -243,9 +253,10 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) + channelB := channelA.Counterparty - chainA, chainB := s.GetChains() + chainA, chainB := s.GetChains() chainADenom := chainA.Config().Denom chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) @@ -258,7 +269,7 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ // trying to create some inflight packets, although they might get relayed before the upgrade starts t.Run("create inflight transfer packets between chain A and chain B", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -332,9 +343,10 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ ctx := context.TODO() relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) - channelB := channelA.Counterparty chainA, chainB := s.GetChains() + channelB := channelA.Counterparty + chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) @@ -362,7 +374,7 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ s.Require().NoError(err) s.Require().Equal(channeltypes.OPEN, channel.State, "the channel state is not OPEN") - s.Require().Equal(transfertypes.V2, channel.Version, "the channel version is not ics20-2") + s.Require().Equal(channelA.Version, channel.Version, "the channel version is not "+channelA.Version) errorReceipt, err := query.UpgradeError(ctx, chainA, channelA.PortID, channelA.ChannelID) s.Require().NoError(err) @@ -375,7 +387,7 @@ func (s *TransferChannelUpgradesTestSuite) TestChannelUpgrade_WithFeeMiddleware_ s.Require().NoError(err) s.Require().Equal(channeltypes.OPEN, channel.State, "the channel state is not OPEN") - s.Require().Equal(transfertypes.V2, channel.Version, "the channel version is not ics20-2") + s.Require().Equal(channelA.Version, channel.Version, "the channel version is not "+channelA.Version) errorReceipt, err := query.UpgradeError(ctx, chainB, channelB.PortID, channelB.ChannelID) s.Require().NoError(err) diff --git a/e2e/tests/upgrades/genesis_test.go b/e2e/tests/upgrades/genesis_test.go index 77affeaba94..e8f606df85f 100644 --- a/e2e/tests/upgrades/genesis_test.go +++ b/e2e/tests/upgrades/genesis_test.go @@ -46,7 +46,7 @@ func (s *GenesisTestSuite) TestIBCGenesis() { appTomlOverrides["halt-height"] = haltHeight configFileOverrides["config/app.toml"] = appTomlOverrides chainOpts := func(options *testsuite.ChainOptions) { - options.ChainASpec.ConfigFileOverrides = configFileOverrides + options.ChainSpecs[0].ConfigFileOverrides = configFileOverrides } // create chains with specified chain configuration options @@ -69,7 +69,7 @@ func (s *GenesisTestSuite) TestIBCGenesis() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("ics20: native IBC token transfer from chainA to chainB, sender is source of tokens", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -135,7 +135,7 @@ func (s *GenesisTestSuite) TestIBCGenesis() { }) t.Run("ics20: native IBC token transfer from chainA to chainB, sender is source of tokens", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index ff536fa24f6..942a11d18ca 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -28,7 +28,6 @@ import ( "github.com/cosmos/ibc-go/e2e/testsuite/query" "github.com/cosmos/ibc-go/e2e/testvalues" feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" - transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" v7migrations "github.com/cosmos/ibc-go/v8/modules/core/02-client/migrations/v7" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" connectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types" @@ -144,7 +143,7 @@ func (s *UpgradeTestSuite) TestIBCChainUpgrade() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("native IBC token transfer from chainA to chainB, sender is source of tokens", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -183,7 +182,7 @@ func (s *UpgradeTestSuite) TestIBCChainUpgrade() { }) t.Run("native IBC token transfer from chainA to chainB, sender is source of tokens", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -201,7 +200,7 @@ func (s *UpgradeTestSuite) TestIBCChainUpgrade() { t.Run("ensure packets can be received, send from chainB to chainA", func(t *testing.T) { t.Run("send from chainB to chainA", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferAmount(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") + transferTxResp := s.Transfer(ctx, chainB, chainBWallet, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID, testvalues.DefaultTransferCoins(chainBDenom), chainBAddress, chainAAddress, s.GetTimeoutHeight(ctx, chainA), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -358,7 +357,7 @@ func (s *UpgradeTestSuite) TestV6ToV7ChainUpgrade() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("IBC token transfer from chainA to chainB, sender is source of tokens", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -411,7 +410,7 @@ func (s *UpgradeTestSuite) TestV6ToV7ChainUpgrade() { }) t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB.(*cosmos.CosmosChain)), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB.(*cosmos.CosmosChain)), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -451,7 +450,7 @@ func (s *UpgradeTestSuite) TestV7ToV7_1ChainUpgrade() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("transfer native tokens from chainA to chainB", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB.(*cosmos.CosmosChain)), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB.(*cosmos.CosmosChain)), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -508,7 +507,7 @@ func (s *UpgradeTestSuite) TestV7ToV7_1ChainUpgrade() { }) t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -542,7 +541,7 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("transfer native tokens from chainA to chainB", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -602,7 +601,7 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { }) t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -619,8 +618,8 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { func (s *UpgradeTestSuite) TestV8ToV8_1ChainUpgrade() { t := s.T() - ctx := context.Background() + relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.FeeMiddlewareChannelOptions()) chainA, chainB := s.GetChains() @@ -635,7 +634,7 @@ func (s *UpgradeTestSuite) TestV8ToV8_1ChainUpgrade() { s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") t.Run("transfer native tokens from chainA to chainB", func(t *testing.T) { - txResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + txResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(txResp) }) @@ -728,7 +727,7 @@ func (s *UpgradeTestSuite) TestV8ToV8_1ChainUpgrade() { s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA), "failed to wait for blocks") t.Run("IBC token transfer from chainA to chainB, to make sure the upgrade did not break the packet flow", func(t *testing.T) { - transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferCoins(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") s.AssertTxSuccess(transferTxResp) }) @@ -750,8 +749,8 @@ func (s *UpgradeTestSuite) TestV8ToV8_1ChainUpgrade_ChannelUpgrades() { relayer, channelA := s.SetupChainsRelayerAndChannel(ctx, s.TransferChannelOptions()) channelB := channelA.Counterparty - chainA, chainB := s.GetChains() + chainA, chainB := s.GetChains() chainADenom := chainA.Config().Denom chainBDenom := chainB.Config().Denom chainAIBCToken := testsuite.GetIBCToken(chainBDenom, channelA.PortID, channelA.ChannelID) @@ -957,7 +956,17 @@ func (s *UpgradeTestSuite) TestV8ToV8_1ChainUpgrade_ChannelUpgrades() { transferAmount := testvalues.DefaultTransferAmount(chainA.Config().Denom) msgPayPacketFee := feetypes.NewMsgPayPacketFee(testFee, channelA.PortID, channelA.ChannelID, chainAWallet.FormattedAddress(), nil) - msgTransfer := transfertypes.NewMsgTransfer(channelA.PortID, channelA.ChannelID, sdk.NewCoins(transferAmount), chainAWallet.FormattedAddress(), chainBWallet.FormattedAddress(), s.GetTimeoutHeight(ctx, chainB), 0, "") + msgTransfer := testsuite.GetMsgTransfer( + channelA.PortID, + channelA.ChannelID, + channelA.Version, // upgrade adds fee middleware, but keeps transfer version + sdk.NewCoins(transferAmount), + chainAWallet.FormattedAddress(), + chainBWallet.FormattedAddress(), + s.GetTimeoutHeight(ctx, chainB), + 0, + "", + ) resp := s.BroadcastMessages(ctx, chainA, chainAWallet, msgPayPacketFee, msgTransfer) s.AssertTxSuccess(resp) }) diff --git a/e2e/tests/wasm/grandpa_test.go b/e2e/tests/wasm/grandpa_test.go index 227529e95a3..63488f79d79 100644 --- a/e2e/tests/wasm/grandpa_test.go +++ b/e2e/tests/wasm/grandpa_test.go @@ -710,11 +710,11 @@ func getConfigOverrides() map[string]any { func (s *GrandpaTestSuite) GetGrandpaTestChains() (ibc.Chain, ibc.Chain) { return s.GetChains(func(options *testsuite.ChainOptions) { // configure chain A (polkadot) - options.ChainASpec.ChainName = composable - options.ChainASpec.Type = "polkadot" - options.ChainASpec.ChainID = "rococo-local" - options.ChainASpec.Name = "composable" - options.ChainASpec.Images = []ibc.DockerImage{ + options.ChainSpecs[0].ChainName = composable + options.ChainSpecs[0].Type = "polkadot" + options.ChainSpecs[0].ChainID = "rococo-local" + options.ChainSpecs[0].Name = "composable" + options.ChainSpecs[0].Images = []ibc.DockerImage{ // TODO: https://github.com/cosmos/ibc-go/issues/4965 { Repository: "ghcr.io/misko9/polkadot-node", @@ -727,37 +727,37 @@ func (s *GrandpaTestSuite) GetGrandpaTestChains() (ibc.Chain, ibc.Chain) { UidGid: "1000:1000", }, } - options.ChainASpec.Bin = "polkadot" - options.ChainASpec.Bech32Prefix = composable - options.ChainASpec.Denom = "uDOT" - options.ChainASpec.GasPrices = "" - options.ChainASpec.GasAdjustment = 0 - options.ChainASpec.TrustingPeriod = "" - options.ChainASpec.CoinType = "354" + options.ChainSpecs[0].Bin = "polkadot" + options.ChainSpecs[0].Bech32Prefix = composable + options.ChainSpecs[0].Denom = "uDOT" + options.ChainSpecs[0].GasPrices = "" + options.ChainSpecs[0].GasAdjustment = 0 + options.ChainSpecs[0].TrustingPeriod = "" + options.ChainSpecs[0].CoinType = "354" // these values are set by default for our cosmos chains, we need to explicitly remove them here. - options.ChainASpec.ModifyGenesis = nil - options.ChainASpec.ConfigFileOverrides = nil - options.ChainASpec.EncodingConfig = nil + options.ChainSpecs[0].ModifyGenesis = nil + options.ChainSpecs[0].ConfigFileOverrides = nil + options.ChainSpecs[0].EncodingConfig = nil // configure chain B (cosmos) - options.ChainBSpec.ChainName = simd // Set chain name so that a suffix with a "dash" is not appended (required for hyperspace) - options.ChainBSpec.Type = "cosmos" - options.ChainBSpec.Name = "simd" - options.ChainBSpec.ChainID = simd - options.ChainBSpec.Bin = simd - options.ChainBSpec.Bech32Prefix = "cosmos" + options.ChainSpecs[1].ChainName = simd // Set chain name so that a suffix with a "dash" is not appended (required for hyperspace) + options.ChainSpecs[1].Type = "cosmos" + options.ChainSpecs[1].Name = "simd" + options.ChainSpecs[1].ChainID = simd + options.ChainSpecs[1].Bin = simd + options.ChainSpecs[1].Bech32Prefix = "cosmos" // TODO: hyperspace relayer assumes a denom of "stake", hard code this here right now. // https://github.com/cosmos/ibc-go/issues/4964 - options.ChainBSpec.Denom = "stake" - options.ChainBSpec.GasPrices = "0.00stake" - options.ChainBSpec.GasAdjustment = 1 - options.ChainBSpec.TrustingPeriod = "504h" - options.ChainBSpec.CoinType = "118" - - options.ChainBSpec.ChainConfig.NoHostMount = false - options.ChainBSpec.ConfigFileOverrides = getConfigOverrides() - options.ChainBSpec.EncodingConfig = testsuite.SDKEncodingConfig() + options.ChainSpecs[1].Denom = "stake" + options.ChainSpecs[1].GasPrices = "0.00stake" + options.ChainSpecs[1].GasAdjustment = 1 + options.ChainSpecs[1].TrustingPeriod = "504h" + options.ChainSpecs[1].CoinType = "118" + + options.ChainSpecs[1].ChainConfig.NoHostMount = false + options.ChainSpecs[1].ConfigFileOverrides = getConfigOverrides() + options.ChainSpecs[1].EncodingConfig = testsuite.SDKEncodingConfig() }) } diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index b1050388e77..0aec930be62 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -71,7 +71,7 @@ const ( ) // defaultChainNames contains the default name for chainA and chainB. -var defaultChainNames = []string{"simapp-a", "simapp-b"} +var defaultChainNames = []string{"simapp-a", "simapp-b", "simapp-c"} func getChainImage(binary string) string { if binary == "" { @@ -525,8 +525,7 @@ func IsFork() bool { // created for the tests. They can be modified by passing ChainOptionConfiguration // to E2ETestSuite.GetChains. type ChainOptions struct { - ChainASpec *interchaintest.ChainSpec - ChainBSpec *interchaintest.ChainSpec + ChainSpecs []*interchaintest.ChainSpec SkipPathCreation bool } @@ -544,17 +543,20 @@ func DefaultChainOptions() ChainOptions { chainAVal, chainAFn := getValidatorsAndFullNodes(0) chainBVal, chainBFn := getValidatorsAndFullNodes(1) + chainASpec := &interchaintest.ChainSpec{ + ChainConfig: chainACfg, + NumFullNodes: &chainAFn, + NumValidators: &chainAVal, + } + + chainBSpec := &interchaintest.ChainSpec{ + ChainConfig: chainBCfg, + NumFullNodes: &chainBFn, + NumValidators: &chainBVal, + } + return ChainOptions{ - ChainASpec: &interchaintest.ChainSpec{ - ChainConfig: chainACfg, - NumFullNodes: &chainAFn, - NumValidators: &chainAVal, - }, - ChainBSpec: &interchaintest.ChainSpec{ - ChainConfig: chainBCfg, - NumFullNodes: &chainBFn, - NumValidators: &chainBVal, - }, + ChainSpecs: []*interchaintest.ChainSpec{chainASpec, chainBSpec}, } } diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 5ccefbb64ad..0924ce0f4b2 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -19,6 +19,7 @@ import ( sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -26,6 +27,7 @@ import ( "github.com/cosmos/ibc-go/e2e/relayer" "github.com/cosmos/ibc-go/e2e/testsuite/diagnostics" "github.com/cosmos/ibc-go/e2e/testsuite/query" + "github.com/cosmos/ibc-go/e2e/testvalues" feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" @@ -47,7 +49,7 @@ type E2ETestSuite struct { // proposalIDs keeps track of the active proposal ID for each chain. proposalIDs map[string]uint64 - paths map[string]pathPair + paths map[string][]ibc.Chain relayers relayer.Map logger *zap.Logger DockerClient *dockerclient.Client @@ -58,19 +60,6 @@ type E2ETestSuite struct { pathNameIndex int64 } -// pathPair is a pairing of two chains which will be used in a test. -type pathPair struct { - chainA, chainB ibc.Chain -} - -// newPath returns a path built from the given chains. -func newPath(chainA, chainB ibc.Chain) pathPair { - return pathPair{ - chainA: chainA, - chainB: chainB, - } -} - func (s *E2ETestSuite) SetupTest() { s.configureGenesisDebugExport() } @@ -117,7 +106,8 @@ func (s *E2ETestSuite) configureGenesisDebugExport() { // GetRelayerUsers returns two ibc.Wallet instances which can be used for the relayer users // on the two chains. func (s *E2ETestSuite) GetRelayerUsers(ctx context.Context, chainOpts ...ChainOptionConfiguration) (ibc.Wallet, ibc.Wallet) { - chainA, chainB := s.GetChains(chainOpts...) + chains := s.GetAllChains(chainOpts...) + chainA, chainB := chains[0], chains[1] chainAAccountBytes, err := chainA.GetAddress(ctx, ChainARelayerName) s.Require().NoError(err) @@ -141,23 +131,78 @@ func (s *E2ETestSuite) GetRelayerUsers(ctx context.Context, chainOpts ...ChainOp // with E2ETestSuite.StartRelayer if needed. // This should be called at the start of every test, unless fine grained control is required. func (s *E2ETestSuite) SetupChainsRelayerAndChannel(ctx context.Context, channelOpts func(*ibc.CreateChannelOptions), chainSpecOpts ...ChainOptionConfiguration) (ibc.Relayer, ibc.ChannelOutput) { - chainA, chainB := s.GetChains(chainSpecOpts...) - r := s.ConfigureRelayer(ctx, chainA, chainB, channelOpts) - chainAChannels, err := r.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID) + chains := s.GetAllChains(chainSpecOpts...) + + r := relayer.New(s.T(), *LoadConfig().GetActiveRelayerConfig(), s.logger, s.DockerClient, s.network) + + ic := s.newInterchain(ctx, r, chains, channelOpts) + + buildOpts := interchaintest.InterchainBuildOptions{ + TestName: s.T().Name(), + Client: s.DockerClient, + NetworkID: s.network, + } + + s.Require().NoError(ic.Build(ctx, s.GetRelayerExecReporter(), buildOpts)) + + chainAChannels, err := r.GetChannels(ctx, s.GetRelayerExecReporter(), chains[0].Config().ChainID) s.Require().NoError(err) return r, chainAChannels[len(chainAChannels)-1] } +// newInterchain constructs a new interchain instance that creates channels between the chains. +func (s *E2ETestSuite) newInterchain(ctx context.Context, r ibc.Relayer, chains []ibc.Chain, channelOpts func(*ibc.CreateChannelOptions)) *interchaintest.Interchain { + channelOptions := defaultChannelOpts(chains) + if channelOpts != nil { + channelOpts(&channelOptions) + } + + ic := interchaintest.NewInterchain() + for _, chain := range chains { + ic.AddChain(chain) + } + ic.AddRelayer(r, "r") + + var pathNames []string + + // iterate through all chains, and create links such that there is a channel between + // - chainA and chainB + // - chainB and chainC + // - chainC and chainD etc + for i := 0; i < len(chains)-1; i++ { + pathName := s.generatePathName() + pathNames = append(pathNames, pathName) + ic.AddLink(interchaintest.InterchainLink{ + Chain1: chains[i], + Chain2: chains[i+1], + Relayer: r, + Path: pathName, + CreateChannelOpts: channelOptions, + }) + } + + s.startRelayerFn = func(relayer ibc.Relayer) { + err := relayer.StartRelayer(ctx, s.GetRelayerExecReporter(), pathNames...) + s.Require().NoError(err, fmt.Sprintf("failed to start relayer: %s", err)) + + var chainHeighters []test.ChainHeighter + for _, c := range chains { + chainHeighters = append(chainHeighters, c) + } + + // wait for every chain to produce some blocks before using the relayer. + s.Require().NoError(test.WaitForBlocks(ctx, 10, chainHeighters...), "failed to wait for blocks") + } + + return ic +} + func (s *E2ETestSuite) ConfigureRelayer(ctx context.Context, chainA, chainB ibc.Chain, channelOpts func(*ibc.CreateChannelOptions), buildOptions ...func(options *interchaintest.InterchainBuildOptions)) ibc.Relayer { r := relayer.New(s.T(), *LoadConfig().GetActiveRelayerConfig(), s.logger, s.DockerClient, s.network) pathName := s.generatePathName() - channelOptions := ibc.DefaultChannelOpts() - // For now, set the version to the latest transfer module version - // DefaultChannelOpts uses V1 at the moment - channelOptions.Version = transfertypes.V2 - + channelOptions := defaultChannelOpts([]ibc.Chain{chainA, chainB}) if channelOpts != nil { channelOpts(&channelOptions) } @@ -202,7 +247,8 @@ func (s *E2ETestSuite) ConfigureRelayer(ctx context.Context, chainA, chainB ibc. // TODO: Actually setup a single chain. Seeing panic: runtime error: index out of range [0] with length 0 when using a single chain. // issue: https://github.com/strangelove-ventures/interchaintest/issues/401 func (s *E2ETestSuite) SetupSingleChain(ctx context.Context) ibc.Chain { - chainA, chainB := s.GetChains() + chains := s.GetAllChains() + chainA, chainB := chains[0], chains[1] ic := interchaintest.NewInterchain().AddChain(chainA).AddChain(chainB) @@ -231,9 +277,12 @@ func (s *E2ETestSuite) GetPathName(idx int64) string { return strings.ReplaceAll(pathName, "/", "-") } -// generatePath generates the path name using the test suites name -func (s *E2ETestSuite) generatePath(ctx context.Context, ibcrelayer ibc.Relayer) string { - chainA, chainB := s.GetChains() +// generatePath generates the path name using the test suites name. The indices provided specify which chains should be +// used. E.g. to generate a path between chain A and B, you would use 0 and 1, to specify between A and C, you would +// use 0 and 2 etc. +func (s *E2ETestSuite) generatePath(ctx context.Context, ibcrelayer ibc.Relayer, chainAIdx, chainBIdx int) string { + chains := s.GetAllChains() + chainA, chainB := chains[chainAIdx], chains[chainBIdx] chainAID := chainA.Config().ChainID chainBID := chainB.Config().ChainID @@ -247,7 +296,7 @@ func (s *E2ETestSuite) generatePath(ctx context.Context, ibcrelayer ibc.Relayer) // SetupClients creates clients on chainA and chainB using the provided create client options func (s *E2ETestSuite) SetupClients(ctx context.Context, ibcrelayer ibc.Relayer, opts ibc.CreateClientOptions) { - pathName := s.generatePath(ctx, ibcrelayer) + pathName := s.generatePath(ctx, ibcrelayer, 0, 1) err := ibcrelayer.CreateClients(ctx, s.GetRelayerExecReporter(), pathName, opts) s.Require().NoError(err) } @@ -261,13 +310,19 @@ func (s *E2ETestSuite) UpdateClients(ctx context.Context, ibcrelayer ibc.Relayer // GetChains returns two chains that can be used in a test. The pair returned // is unique to the current test being run. Note: this function does not create containers. func (s *E2ETestSuite) GetChains(chainOpts ...ChainOptionConfiguration) (ibc.Chain, ibc.Chain) { + chains := s.GetAllChains(chainOpts...) + return chains[0], chains[1] +} + +// GetAllChains returns all chains that can be used in a test. The chains returned +// are unique to the current test being run. Note: this function does not create containers. +func (s *E2ETestSuite) GetAllChains(chainOpts ...ChainOptionConfiguration) []ibc.Chain { if s.paths == nil { - s.paths = map[string]pathPair{} + s.paths = map[string][]ibc.Chain{} } - suitePath, ok := s.paths[s.T().Name()] - if ok { - return suitePath.chainA, suitePath.chainB + if chains, ok := s.paths[s.T().Name()]; ok { + return chains } chainOptions := DefaultChainOptions() @@ -275,23 +330,25 @@ func (s *E2ETestSuite) GetChains(chainOpts ...ChainOptionConfiguration) (ibc.Cha opt(&chainOptions) } - chainA, chainB := s.createChains(chainOptions) - suitePath = newPath(chainA, chainB) - s.paths[s.T().Name()] = suitePath + chains := s.createChains(chainOptions) + s.paths[s.T().Name()] = chains if s.proposalIDs == nil { s.proposalIDs = map[string]uint64{} } - s.proposalIDs[chainA.Config().ChainID] = 1 - s.proposalIDs[chainB.Config().ChainID] = 1 + // initialise proposal ids for all chains. + for _, chain := range chains { + s.proposalIDs[chain.Config().ChainID] = 1 + } - return suitePath.chainA, suitePath.chainB + return chains } // GetRelayerWallets returns the ibcrelayer wallets associated with the chains. func (s *E2ETestSuite) GetRelayerWallets(ibcrelayer ibc.Relayer) (ibc.Wallet, ibc.Wallet, error) { - chainA, chainB := s.GetChains() + chains := s.GetAllChains() + chainA, chainB := chains[0], chains[1] chainARelayerWallet, ok := ibcrelayer.GetWallet(chainA.Config().ChainID) if !ok { return nil, nil, fmt.Errorf("unable to find chain A relayer wallet") @@ -312,7 +369,8 @@ func (s *E2ETestSuite) RecoverRelayerWallets(ctx context.Context, ibcrelayer ibc return err } - chainA, chainB := s.GetChains() + chains := s.GetAllChains() + chainA, chainB := chains[0], chains[1] if err := chainA.RecoverKey(ctx, ChainARelayerName, chainARelayerWallet.Mnemonic()); err != nil { return fmt.Errorf("could not recover relayer wallet on chain A: %s", err) @@ -346,19 +404,28 @@ func (s *E2ETestSuite) RestartRelayer(ctx context.Context, ibcrelayer ibc.Relaye // CreateUserOnChainA creates a user with the given amount of funds on chain A. func (s *E2ETestSuite) CreateUserOnChainA(ctx context.Context, amount int64) ibc.Wallet { - chainA, _ := s.GetChains() - return interchaintest.GetAndFundTestUsers(s.T(), ctx, strings.ReplaceAll(s.T().Name(), " ", "-"), sdkmath.NewInt(amount), chainA)[0] + return s.createWalletOnChainIndex(ctx, amount, 0) } // CreateUserOnChainB creates a user with the given amount of funds on chain B. func (s *E2ETestSuite) CreateUserOnChainB(ctx context.Context, amount int64) ibc.Wallet { - _, chainB := s.GetChains() - return interchaintest.GetAndFundTestUsers(s.T(), ctx, strings.ReplaceAll(s.T().Name(), " ", "-"), sdkmath.NewInt(amount), chainB)[0] + return s.createWalletOnChainIndex(ctx, amount, 1) +} + +// CreateUserOnChainC creates a user with the given amount of funds on chain C. +func (s *E2ETestSuite) CreateUserOnChainC(ctx context.Context, amount int64) ibc.Wallet { + return s.createWalletOnChainIndex(ctx, amount, 2) +} + +// createWalletOnChainIndex creates a wallet with the given amount of funds on the chain of the given index. +func (s *E2ETestSuite) createWalletOnChainIndex(ctx context.Context, amount, chainIndex int64) ibc.Wallet { + chain := s.GetAllChains()[chainIndex] + return interchaintest.GetAndFundTestUsers(s.T(), ctx, strings.ReplaceAll(s.T().Name(), " ", "-"), sdkmath.NewInt(amount), chain)[0] } // GetChainANativeBalance gets the balance of a given user on chain A. func (s *E2ETestSuite) GetChainANativeBalance(ctx context.Context, user ibc.Wallet) (int64, error) { - chainA, _ := s.GetChains() + chainA := s.GetAllChains()[0] balanceResp, err := query.GRPCQuery[banktypes.QueryBalanceResponse](ctx, chainA, &banktypes.QueryBalanceRequest{ Address: user.FormattedAddress(), @@ -373,7 +440,7 @@ func (s *E2ETestSuite) GetChainANativeBalance(ctx context.Context, user ibc.Wall // GetChainBNativeBalance gets the balance of a given user on chain B. func (s *E2ETestSuite) GetChainBNativeBalance(ctx context.Context, user ibc.Wallet) (int64, error) { - _, chainB := s.GetChains() + chainB := s.GetAllChains()[1] balanceResp, err := query.GRPCQuery[banktypes.QueryBalanceResponse](ctx, chainB, &banktypes.QueryBalanceRequest{ Address: user.FormattedAddress(), @@ -418,7 +485,7 @@ func (s *E2ETestSuite) AssertHumanReadableDenom(ctx context.Context, chain ibc.C // createChains creates two separate chains in docker containers. // test and can be retrieved with GetChains. -func (s *E2ETestSuite) createChains(chainOptions ChainOptions) (ibc.Chain, ibc.Chain) { +func (s *E2ETestSuite) createChains(chainOptions ChainOptions) []ibc.Chain { client, network := interchaintest.DockerSetup(s.T()) t := s.T() @@ -426,21 +493,24 @@ func (s *E2ETestSuite) createChains(chainOptions ChainOptions) (ibc.Chain, ibc.C s.DockerClient = client s.network = network - cf := interchaintest.NewBuiltinChainFactory(s.logger, []*interchaintest.ChainSpec{chainOptions.ChainASpec, chainOptions.ChainBSpec}) + cf := interchaintest.NewBuiltinChainFactory(s.logger, chainOptions.ChainSpecs) // this is intentionally called after the interchaintest.DockerSetup function. The above function registers a // cleanup task which deletes all containers. By registering a cleanup function afterwards, it is executed first // this allows us to process the logs before the containers are removed. t.Cleanup(func() { dumpLogs := LoadConfig().DebugConfig.DumpLogs - chains := []string{chainOptions.ChainASpec.ChainConfig.Name, chainOptions.ChainBSpec.ChainConfig.Name} - diagnostics.Collect(t, s.DockerClient, dumpLogs, chains...) + var chainNames []string + for _, chain := range chainOptions.ChainSpecs { + chainNames = append(chainNames, chain.Name) + } + diagnostics.Collect(t, s.DockerClient, dumpLogs, chainNames...) }) chains, err := cf.Chains(t.Name()) s.Require().NoError(err) - return chains[0], chains[1] + return chains } // GetRelayerExecReporter returns a testreporter.RelayerExecReporter instances @@ -451,9 +521,19 @@ func (s *E2ETestSuite) GetRelayerExecReporter() *testreporter.RelayerExecReporte } // TransferChannelOptions configures both of the chains to have non-incentivized transfer channels. -func (*E2ETestSuite) TransferChannelOptions() func(options *ibc.CreateChannelOptions) { +func (s *E2ETestSuite) TransferChannelOptions(chainOpts ...ChainOptionConfiguration) func(options *ibc.CreateChannelOptions) { + chainA, chainB := s.GetChains(chainOpts...) + chainAVersion := chainA.Config().Images[0].Version + chainBVersion := chainB.Config().Images[0].Version + + // select the transfer version based on the chain versions + transferVersion := transfertypes.V1 + if testvalues.ICS20v2FeatureReleases.IsSupported(chainAVersion) && testvalues.ICS20v2FeatureReleases.IsSupported(chainBVersion) { + transferVersion = transfertypes.V2 + } + return func(opts *ibc.CreateChannelOptions) { - opts.Version = transfertypes.V2 + opts.Version = transferVersion opts.SourcePortName = transfertypes.PortID opts.DestPortName = transfertypes.PortID } @@ -461,9 +541,19 @@ func (*E2ETestSuite) TransferChannelOptions() func(options *ibc.CreateChannelOpt // FeeMiddlewareChannelOptions configures both of the chains to have fee middleware enabled. func (s *E2ETestSuite) FeeMiddlewareChannelOptions() func(options *ibc.CreateChannelOptions) { + chainA, chainB := s.GetChains() + chainAVersion := chainA.Config().Images[0].Version + chainBVersion := chainB.Config().Images[0].Version + + // select the transfer version based on the chain versions + transferVersion := transfertypes.V1 + if testvalues.ICS20v2FeatureReleases.IsSupported(chainAVersion) && testvalues.ICS20v2FeatureReleases.IsSupported(chainBVersion) { + transferVersion = transfertypes.V2 + } + versionMetadata := feetypes.Metadata{ FeeVersion: feetypes.Version, - AppVersion: transfertypes.V2, + AppVersion: transferVersion, } versionBytes, err := feetypes.ModuleCdc.MarshalJSON(&versionMetadata) s.Require().NoError(err) @@ -533,3 +623,64 @@ func getValidatorsAndFullNodes(chainIdx int) (int, int) { tc := LoadConfig() return tc.GetChainNumValidators(chainIdx), tc.GetChainNumFullNodes(chainIdx) } + +// GetMsgTransfer returns a MsgTransfer that is constructed based on the channel version +func GetMsgTransfer(portID, channelID, version string, tokens sdk.Coins, sender, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, memo string) *transfertypes.MsgTransfer { + if len(tokens) == 0 { + panic(errors.New("tokens cannot be empty")) + } + + var msg *transfertypes.MsgTransfer + switch version { + case transfertypes.V1: + msg = &transfertypes.MsgTransfer{ + SourcePort: portID, + SourceChannel: channelID, + Token: tokens[0], + Sender: sender, + Receiver: receiver, + TimeoutHeight: timeoutHeight, + TimeoutTimestamp: timeoutTimestamp, + Memo: memo, + Tokens: sdk.NewCoins(), + } + case transfertypes.V2: + msg = transfertypes.NewMsgTransfer(portID, channelID, tokens, sender, receiver, timeoutHeight, timeoutTimestamp, memo) + default: + panic(fmt.Errorf("unsupported transfer version: %s", version)) + } + + return msg +} + +// ThreeChainSetup provides the default behaviour to wire up 3 chains in the tests. +func ThreeChainSetup() ChainOptionConfiguration { + // copy all values of existing chains and tweak to make unique to new chain. + return func(options *ChainOptions) { + chainCSpec := *options.ChainSpecs[0] // nolint + + chainCSpec.ChainID = "chainC-1" + chainCSpec.Name = "simapp-c" + + options.ChainSpecs = append(options.ChainSpecs, &chainCSpec) + } +} + +// DefaultChainOptions returns the default chain options for the test suite based on the provided chains. +func defaultChannelOpts(chains []ibc.Chain) ibc.CreateChannelOptions { + channelOptions := ibc.DefaultChannelOpts() + channelOptions.Version = determineDefaultTransferVersion(chains) + return channelOptions +} + +// determineDefaultTransferVersion determines the version of transfer that should be used with an arbitrary number of chains. +// the default is V2, but if any chain does not support V2, then V1 is used. +func determineDefaultTransferVersion(chains []ibc.Chain) string { + for _, chain := range chains { + chainVersion := chain.Config().Images[0].Version + if !testvalues.ICS20v2FeatureReleases.IsSupported(chainVersion) { + return transfertypes.V1 + } + } + return transfertypes.V2 +} diff --git a/e2e/testsuite/tx.go b/e2e/testsuite/tx.go index 6ad082e2635..f54887a3773 100644 --- a/e2e/testsuite/tx.go +++ b/e2e/testsuite/tx.go @@ -30,7 +30,6 @@ import ( "github.com/cosmos/ibc-go/e2e/testsuite/sanitize" "github.com/cosmos/ibc-go/e2e/testvalues" feetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types" - transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types" clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" ) @@ -278,9 +277,28 @@ func (s *E2ETestSuite) ExecuteGovV1Beta1Proposal(ctx context.Context, chain ibc. // Transfer broadcasts a MsgTransfer message. func (s *E2ETestSuite) Transfer(ctx context.Context, chain ibc.Chain, user ibc.Wallet, - portID, channelID string, token sdk.Coin, sender, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, memo string, + portID, channelID string, tokens sdk.Coins, sender, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, memo string, ) sdk.TxResponse { - msg := transfertypes.NewMsgTransfer(portID, channelID, sdk.NewCoins(token), sender, receiver, timeoutHeight, timeoutTimestamp, memo) + channel, err := query.Channel(ctx, chain, portID, channelID) + s.Require().NoError(err) + s.Require().NotNil(channel) + + feeEnabled := false + if testvalues.FeeMiddlewareFeatureReleases.IsSupported(chain.Config().Images[0].Version) { + feeEnabled, err = query.FeeEnabledChannel(ctx, chain, portID, channelID) + s.Require().NoError(err) + } + + transferVersion := channel.Version + if feeEnabled { + version, err := feetypes.MetadataFromVersion(channel.Version) + s.Require().NoError(err) + + transferVersion = version.AppVersion + } + + msg := GetMsgTransfer(portID, channelID, transferVersion, tokens, sender, receiver, timeoutHeight, timeoutTimestamp, memo) + return s.BroadcastMessages(ctx, chain, user, msg) } diff --git a/e2e/testvalues/values.go b/e2e/testvalues/values.go index d5cd8a9c968..7d0e7e18b56 100644 --- a/e2e/testvalues/values.go +++ b/e2e/testvalues/values.go @@ -59,6 +59,11 @@ func SolomachineClientID(id int) string { return fmt.Sprintf("06-solomachine-%d", id) } +// FeeMiddlewareFeatureReleases represents the releases the support for fee middleware was released in. +var FeeMiddlewareFeatureReleases = semverutil.FeatureReleases{ + MajorVersion: "v4", +} + // TokenMetadataFeatureReleases represents the releases the token metadata was released in. var TokenMetadataFeatureReleases = semverutil.FeatureReleases{ MajorVersion: "v8", @@ -130,3 +135,8 @@ var CapitalEfficientFeeEscrowFeatureReleases = semverutil.FeatureReleases{ var TransactionEventQueryFeatureReleases = semverutil.FeatureReleases{ MajorVersion: "v8", } + +// ICS20v2FeatureReleases represents the releases the support for ICS20 v2 was released in. +var ICS20v2FeatureReleases = semverutil.FeatureReleases{ + MajorVersion: "v9", +} diff --git a/go.mod b/go.mod index a80f0970f5d..068d5bf8f39 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ics23/go v0.10.0 github.com/golang/protobuf v1.5.4 @@ -34,7 +34,7 @@ require ( github.com/stretchr/testify v1.9.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index c5a4fd09172..6a4499dfba1 100644 --- a/go.sum +++ b/go.sum @@ -358,8 +358,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= @@ -1661,8 +1661,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index 62e2c3e0333..d3b7d00d1e1 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -195,8 +195,8 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { } // ProposalMsgs returns msgs used for governance proposals for simulations. -func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { - return simulation.ProposalMsgs() +func (am AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return simulation.ProposalMsgs(am.controllerKeeper, am.hostKeeper) } // WeightedOperations is unimplemented. diff --git a/modules/apps/27-interchain-accounts/simulation/proposals.go b/modules/apps/27-interchain-accounts/simulation/proposals.go index cc12948ef27..7437a2a1825 100644 --- a/modules/apps/27-interchain-accounts/simulation/proposals.go +++ b/modules/apps/27-interchain-accounts/simulation/proposals.go @@ -8,7 +8,9 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + controllerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" controllertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" + hostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" ) @@ -20,19 +22,23 @@ const ( ) // ProposalMsgs defines the module weighted proposals' contents -func ProposalMsgs() []simtypes.WeightedProposalMsg { - return []simtypes.WeightedProposalMsg{ - simulation.NewWeightedProposalMsg( +func ProposalMsgs(controllerKeeper *controllerkeeper.Keeper, hostKeeper *hostkeeper.Keeper) []simtypes.WeightedProposalMsg { + msgs := make([]simtypes.WeightedProposalMsg, 0, 2) + if hostKeeper != nil { + msgs = append(msgs, simulation.NewWeightedProposalMsg( OpWeightMsgUpdateParams, DefaultWeightMsgUpdateParams, SimulateHostMsgUpdateParams, - ), - simulation.NewWeightedProposalMsg( + )) + } + if controllerKeeper != nil { + msgs = append(msgs, simulation.NewWeightedProposalMsg( OpWeightMsgUpdateParams, DefaultWeightMsgUpdateParams, SimulateControllerMsgUpdateParams, - ), + )) } + return msgs } // SimulateHostMsgUpdateParams returns a MsgUpdateParams for the host module diff --git a/modules/apps/27-interchain-accounts/simulation/proposals_test.go b/modules/apps/27-interchain-accounts/simulation/proposals_test.go index 29d8eae0ebf..c001a919765 100644 --- a/modules/apps/27-interchain-accounts/simulation/proposals_test.go +++ b/modules/apps/27-interchain-accounts/simulation/proposals_test.go @@ -12,8 +12,10 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + controllerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" controllertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" - "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" + hostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper" + hosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types" "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/simulation" ) @@ -25,32 +27,75 @@ func TestProposalMsgs(t *testing.T) { ctx := sdk.NewContext(nil, cmtproto.Header{}, true, nil) accounts := simtypes.RandomAccounts(r, 3) - // execute ProposalMsgs function - weightedProposalMsgs := simulation.ProposalMsgs() - require.Equal(t, 2, len(weightedProposalMsgs)) - w0 := weightedProposalMsgs[0] + tests := []struct { + name string + controller *controllerkeeper.Keeper + host *hostkeeper.Keeper + expMsgs []sdk.Msg + }{ + { + name: "host and controller keepers are both enabled", + controller: &controllerkeeper.Keeper{}, + host: &hostkeeper.Keeper{}, + expMsgs: []sdk.Msg{ + hosttypes.NewMsgUpdateParams( + sdk.AccAddress(address.Module("gov")).String(), + hosttypes.NewParams(false, []string{hosttypes.AllowAllHostMsgs}), + ), + controllertypes.NewMsgUpdateParams( + sdk.AccAddress(address.Module("gov")).String(), + controllertypes.NewParams(false), + ), + }, + }, + { + name: "host and controller keepers are not enabled", + controller: nil, + host: nil, + }, + { + name: "only controller keeper is enabled", + controller: &controllerkeeper.Keeper{}, + expMsgs: []sdk.Msg{ + controllertypes.NewMsgUpdateParams( + sdk.AccAddress(address.Module("gov")).String(), + controllertypes.NewParams(false), + ), + }, + }, + { + name: "only host keeper is enabled", + host: &hostkeeper.Keeper{}, + expMsgs: []sdk.Msg{ + hosttypes.NewMsgUpdateParams( + sdk.AccAddress(address.Module("gov")).String(), + hosttypes.NewParams(false, []string{hosttypes.AllowAllHostMsgs}), + ), + }, + }, + } - // tests w0 interface: - require.Equal(t, simulation.OpWeightMsgUpdateParams, w0.AppParamsKey()) - require.Equal(t, simulation.DefaultWeightMsgUpdateParams, w0.DefaultWeight()) + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + // execute ProposalMsgs function + weightedProposalMsgs := simulation.ProposalMsgs(tc.controller, tc.host) + require.Equal(t, len(tc.expMsgs), len(weightedProposalMsgs)) - msg := w0.MsgSimulatorFn()(r, ctx, accounts) - msgUpdateHostParams, ok := msg.(*types.MsgUpdateParams) - require.True(t, ok) + for idx, weightedMsg := range weightedProposalMsgs { + // tests weighted interface: + require.Equal(t, simulation.OpWeightMsgUpdateParams, weightedMsg.AppParamsKey()) + require.Equal(t, simulation.DefaultWeightMsgUpdateParams, weightedMsg.DefaultWeight()) - require.Equal(t, sdk.AccAddress(address.Module("gov")).String(), msgUpdateHostParams.Signer) - require.Equal(t, msgUpdateHostParams.Params.HostEnabled, false) + msg := weightedMsg.MsgSimulatorFn()(r, ctx, accounts) - w1 := weightedProposalMsgs[1] - - // tests w1 interface: - require.Equal(t, simulation.OpWeightMsgUpdateParams, w1.AppParamsKey()) - require.Equal(t, simulation.DefaultWeightMsgUpdateParams, w1.DefaultWeight()) - - msg1 := w1.MsgSimulatorFn()(r, ctx, accounts) - msgUpdateControllerParams, ok := msg1.(*controllertypes.MsgUpdateParams) - require.True(t, ok) - - require.Equal(t, sdk.AccAddress(address.Module("gov")).String(), msgUpdateControllerParams.Signer) - require.Equal(t, msgUpdateControllerParams.Params.ControllerEnabled, false) + if msgUpdateHostParams, ok := msg.(*hosttypes.MsgUpdateParams); ok { + require.Equal(t, tc.expMsgs[idx], msgUpdateHostParams) + } else { + msgUpdateControllerParams, ok := msg.(*controllertypes.MsgUpdateParams) + require.True(t, ok) + require.Equal(t, tc.expMsgs[idx], msgUpdateControllerParams) + } + } + }) + } } diff --git a/modules/apps/29-fee/ibc_middleware.go b/modules/apps/29-fee/ibc_middleware.go index 671206eab8f..32b95ad431e 100644 --- a/modules/apps/29-fee/ibc_middleware.go +++ b/modules/apps/29-fee/ibc_middleware.go @@ -29,7 +29,7 @@ type IBCMiddleware struct { keeper keeper.Keeper } -// NewIBCMiddleware creates a new IBCMiddlware given the keeper and underlying application +// NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application func NewIBCMiddleware(app porttypes.IBCModule, k keeper.Keeper) IBCMiddleware { return IBCMiddleware{ app: app, diff --git a/modules/apps/29-fee/transfer_test.go b/modules/apps/29-fee/transfer_test.go index f78b56e25a9..c9c83d8211b 100644 --- a/modules/apps/29-fee/transfer_test.go +++ b/modules/apps/29-fee/transfer_test.go @@ -11,62 +11,81 @@ import ( // Integration test to ensure ics29 works with ics20 func (suite *FeeTestSuite) TestFeeTransfer() { - path := ibctesting.NewPath(suite.chainA, suite.chainB) - feeTransferVersion := string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: transfertypes.V2})) - path.EndpointA.ChannelConfig.Version = feeTransferVersion - path.EndpointB.ChannelConfig.Version = feeTransferVersion - path.EndpointA.ChannelConfig.PortID = transfertypes.PortID - path.EndpointB.ChannelConfig.PortID = transfertypes.PortID + testCases := []struct { + name string + coinsToTransfer sdk.Coins + }{ + { + "transfer single denom", + sdk.NewCoins(ibctesting.TestCoin), + }, + { + "transfer multiple denoms", + sdk.NewCoins(ibctesting.TestCoin, ibctesting.SecondaryTestCoin), + }, + } - path.Setup() + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset - // set up coin & ics20 packet - coin := ibctesting.TestCoin - fee := types.Fee{ - RecvFee: defaultRecvFee, - AckFee: defaultAckFee, - TimeoutFee: defaultTimeoutFee, - } + path := ibctesting.NewPath(suite.chainA, suite.chainB) + feeTransferVersion := string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: transfertypes.V2})) + path.EndpointA.ChannelConfig.Version = feeTransferVersion + path.EndpointB.ChannelConfig.Version = feeTransferVersion + path.EndpointA.ChannelConfig.PortID = transfertypes.PortID + path.EndpointB.ChannelConfig.PortID = transfertypes.PortID - msgs := []sdk.Msg{ - types.NewMsgPayPacketFee(fee, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, suite.chainA.SenderAccount.GetAddress().String(), nil), - transfertypes.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, sdk.NewCoins(coin), suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), clienttypes.NewHeight(1, 100), 0, ""), - } - res, err := suite.chainA.SendMsgs(msgs...) - suite.Require().NoError(err) // message committed + path.Setup() - // after incentivizing the packets - originalChainASenderAccountBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)) + fee := types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + } - packet, err := ibctesting.ParsePacketFromEvents(res.Events) - suite.Require().NoError(err) + msgs := []sdk.Msg{ + types.NewMsgPayPacketFee(fee, path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, suite.chainA.SenderAccount.GetAddress().String(), nil), + transfertypes.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, tc.coinsToTransfer, suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), clienttypes.NewHeight(1, 100), 0, ""), + } - // register counterparty address on chainB - // relayerAddress is address of sender account on chainB, but we will use it on chainA - // to differentiate from the chainA.SenderAccount for checking successful relay payouts - relayerAddress := suite.chainB.SenderAccount.GetAddress() + res, err := suite.chainA.SendMsgs(msgs...) + suite.Require().NoError(err) // message committed - msgRegister := types.NewMsgRegisterCounterpartyPayee(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, suite.chainB.SenderAccount.GetAddress().String(), relayerAddress.String()) - _, err = suite.chainB.SendMsgs(msgRegister) - suite.Require().NoError(err) // message committed + // after incentivizing the packets + originalChainASenderAccountBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)) - // relay packet - err = path.RelayPacket(packet) - suite.Require().NoError(err) // relay committed + packet, err := ibctesting.ParsePacketFromEvents(res.Events) + suite.Require().NoError(err) + + // register counterparty address on chainB + // relayerAddress is address of sender account on chainB, but we will use it on chainA + // to differentiate from the chainA.SenderAccount for checking successful relay payouts + relayerAddress := suite.chainB.SenderAccount.GetAddress() + + msgRegister := types.NewMsgRegisterCounterpartyPayee(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, suite.chainB.SenderAccount.GetAddress().String(), relayerAddress.String()) + _, err = suite.chainB.SendMsgs(msgRegister) + suite.Require().NoError(err) // message committed - // ensure relayers got paid - // relayer for forward relay: chainB.SenderAccount - // relayer for reverse relay: chainA.SenderAccount + // relay packet + err = path.RelayPacket(packet) + suite.Require().NoError(err) // relay committed - // check forward relay balance - suite.Require().Equal( - fee.RecvFee, - sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainB.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)), - ) + // ensure relayers got paid + // relayer for forward relay: chainB.SenderAccount + // relayer for reverse relay: chainA.SenderAccount - suite.Require().Equal( - fee.AckFee, // ack fee paid, no refund needed since timeout_fee = recv_fee + ack_fee - sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)).Sub(originalChainASenderAccountBalance[0])) + // check forward relay balance + suite.Require().Equal( + fee.RecvFee, + sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainB.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)), + ) + + suite.Require().Equal( + fee.AckFee, // ack fee paid, no refund needed since timeout_fee = recv_fee + ack_fee + sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)).Sub(originalChainASenderAccountBalance[0])) + }) + } } func (suite *FeeTestSuite) TestTransferFeeUpgrade() { diff --git a/modules/apps/callbacks/go.mod b/modules/apps/callbacks/go.mod index 3d5aca987c8..f76d8ccd41d 100644 --- a/modules/apps/callbacks/go.mod +++ b/modules/apps/callbacks/go.mod @@ -25,7 +25,7 @@ require ( github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.0.0 github.com/spf13/cast v1.6.0 @@ -196,7 +196,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/grpc v1.64.0 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/modules/apps/callbacks/go.sum b/modules/apps/callbacks/go.sum index c5a4fd09172..6a4499dfba1 100644 --- a/modules/apps/callbacks/go.sum +++ b/modules/apps/callbacks/go.sum @@ -358,8 +358,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= @@ -1661,8 +1661,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/modules/apps/callbacks/ibc_middleware.go b/modules/apps/callbacks/ibc_middleware.go index 7e52f73d1ca..74e6e83a408 100644 --- a/modules/apps/callbacks/ibc_middleware.go +++ b/modules/apps/callbacks/ibc_middleware.go @@ -38,7 +38,7 @@ type IBCMiddleware struct { maxCallbackGas uint64 } -// NewIBCMiddleware creates a new IBCMiddlware given the keeper and underlying application. +// NewIBCMiddleware creates a new IBCMiddleware given the keeper and underlying application. // The underlying application must implement the required callback interfaces. func NewIBCMiddleware( app porttypes.IBCModule, ics4Wrapper porttypes.ICS4Wrapper, diff --git a/modules/apps/callbacks/ibc_middleware_test.go b/modules/apps/callbacks/ibc_middleware_test.go index 53687fed3c7..a818116e01c 100644 --- a/modules/apps/callbacks/ibc_middleware_test.go +++ b/modules/apps/callbacks/ibc_middleware_test.go @@ -109,6 +109,18 @@ func (s *CallbacksTestSuite) TestSendPacket() { false, nil, }, + { + "success: multiple denoms", + func() { + packetData.Tokens = append(packetData.Tokens, transfertypes.Token{ + Denom: transfertypes.NewDenom(ibctesting.SecondaryDenom), + Amount: ibctesting.SecondaryTestCoin.Amount.String(), + }) + }, + types.CallbackTypeSendPacket, + false, + nil, + }, { "success: no-op on callback data is not valid", func() { @@ -167,10 +179,7 @@ func (s *CallbacksTestSuite) TestSendPacket() { packetData = transfertypes.NewFungibleTokenPacketDataV2( []transfertypes.Token{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.GetDenom(), - Trace: []transfertypes.Trace{}, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -311,10 +320,7 @@ func (s *CallbacksTestSuite) TestOnAcknowledgementPacket() { packetData = transfertypes.NewFungibleTokenPacketDataV2( []transfertypes.Token{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.GetDenom(), - Trace: []transfertypes.Trace{}, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -646,10 +652,7 @@ func (s *CallbacksTestSuite) TestOnRecvPacket() { packetData = transfertypes.NewFungibleTokenPacketDataV2( []transfertypes.Token{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.GetDenom(), - Trace: []transfertypes.Trace{}, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -780,10 +783,7 @@ func (s *CallbacksTestSuite) TestWriteAcknowledgement() { packetData = transfertypes.NewFungibleTokenPacketDataV2( []transfertypes.Token{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.GetDenom(), - Trace: []transfertypes.Trace{}, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -1006,10 +1006,7 @@ func (s *CallbacksTestSuite) TestUnmarshalPacketDataV1() { expPacketDataICS20V2 := transfertypes.FungibleTokenPacketDataV2{ Tokens: []transfertypes.Token{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.GetDenom(), - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -1042,10 +1039,7 @@ func (s *CallbacksTestSuite) TestUnmarshalPacketDataV2() { expPacketDataICS20V2 := transfertypes.FungibleTokenPacketDataV2{ Tokens: []transfertypes.Token{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.GetDenom(), - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, diff --git a/modules/apps/callbacks/types/callbacks_test.go b/modules/apps/callbacks/types/callbacks_test.go index be01f892189..79b3437faf9 100644 --- a/modules/apps/callbacks/types/callbacks_test.go +++ b/modules/apps/callbacks/types/callbacks_test.go @@ -303,10 +303,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -329,10 +326,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.GetDenom()), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -358,10 +352,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -385,10 +376,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -414,10 +402,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -441,10 +426,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -475,10 +457,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -496,10 +475,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -517,10 +493,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackData() { packetData = transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -601,10 +574,7 @@ func (s *CallbacksTypesTestSuite) TestGetSourceCallbackDataTransfer() { transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -691,10 +661,7 @@ func (s *CallbacksTypesTestSuite) TestGetDestCallbackDataTransfer() { transfertypes.FungibleTokenPacketDataV2{ Tokens: transfertypes.Tokens{ { - Denom: transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: transfertypes.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -745,7 +712,7 @@ func (s *CallbacksTypesTestSuite) TestGetDestCallbackDataTransfer() { } func (s *CallbacksTypesTestSuite) TestGetCallbackAddress() { - denom := transfertypes.Denom{Base: ibctesting.TestCoin.Denom} + denom := transfertypes.NewDenom(ibctesting.TestCoin.Denom) amount := ibctesting.TestCoin.Amount.String() sender := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() receiver := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() @@ -976,10 +943,7 @@ func (s *CallbacksTypesTestSuite) TestGetCallbackAddress() { } func (s *CallbacksTypesTestSuite) TestUserDefinedGasLimit() { - denom := transfertypes.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - } + denom := transfertypes.NewDenom(ibctesting.TestCoin.Denom) amount := ibctesting.TestCoin.Amount.String() sender := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() receiver := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() diff --git a/modules/apps/transfer/ibc_module_test.go b/modules/apps/transfer/ibc_module_test.go index 9ec0430be5f..2abcbafbfb9 100644 --- a/modules/apps/transfer/ibc_module_test.go +++ b/modules/apps/transfer/ibc_module_test.go @@ -278,17 +278,26 @@ func (suite *TransferTestSuite) TestOnTimeoutPacket() { var packet channeltypes.Packet testCases := []struct { - name string - malleate func() - expError error + name string + coinsToSendToB sdk.Coins + malleate func() + expError error }{ { "success", + sdk.NewCoins(ibctesting.TestCoin), + func() {}, + nil, + }, + { + "success with multiple coins", + sdk.NewCoins(ibctesting.TestCoin, ibctesting.SecondaryTestCoin), func() {}, nil, }, { "non-existent channel", + sdk.NewCoins(ibctesting.TestCoin), func() { packet.SourceChannel = "channel-100" }, @@ -296,6 +305,7 @@ func (suite *TransferTestSuite) TestOnTimeoutPacket() { }, { "invalid packet data", + sdk.NewCoins(ibctesting.TestCoin), func() { packet.Data = []byte("invalid data") }, @@ -303,6 +313,7 @@ func (suite *TransferTestSuite) TestOnTimeoutPacket() { }, { "already timed-out packet", + sdk.NewCoins(ibctesting.TestCoin), func() { module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.TransferPort) suite.Require().NoError(err) @@ -324,12 +335,11 @@ func (suite *TransferTestSuite) TestOnTimeoutPacket() { path = ibctesting.NewTransferPath(suite.chainA, suite.chainB) path.Setup() - coinToSendToB := sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(42)) timeoutHeight := suite.chainA.GetTimeoutHeight() msg := types.NewMsgTransfer( path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, - sdk.NewCoins(coinToSendToB), + tc.coinsToSendToB, suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), timeoutHeight, @@ -653,12 +663,7 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() { initialPacketData = types.FungibleTokenPacketDataV2{ Tokens: []types.Token{ { - Denom: types.Denom{ - Base: "atom", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - }, - }, + Denom: types.NewDenom("atom", types.NewTrace("transfer", "channel-0")), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -678,10 +683,7 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() { initialPacketData = types.FungibleTokenPacketDataV2{ Tokens: []types.Token{ { - Denom: types.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: nil, - }, + Denom: types.NewDenom(ibctesting.TestCoin.Denom), Amount: ibctesting.TestCoin.Amount.String(), }, }, @@ -701,10 +703,7 @@ func (suite *TransferTestSuite) TestPacketDataUnmarshalerInterface() { initialPacketData = types.FungibleTokenPacketDataV2{ Tokens: []types.Token{ { - Denom: types.Denom{ - Base: ibctesting.TestCoin.Denom, - Trace: []types.Trace{{}}, - }, + Denom: types.NewDenom(ibctesting.TestCoin.Denom, []types.Trace{{}}...), Amount: ibctesting.TestCoin.Amount.String(), }, }, diff --git a/modules/apps/transfer/internal/packet_test.go b/modules/apps/transfer/internal/packet_test.go index 17194e916cf..72d57476fc2 100644 --- a/modules/apps/transfer/internal/packet_test.go +++ b/modules/apps/transfer/internal/packet_test.go @@ -32,12 +32,7 @@ func TestUnmarshalPacketData(t *testing.T) { packetData := types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - }, - }, + Denom: types.NewDenom("atom", types.NewTrace("transfer", "channel-0")), Amount: "1000", }, }, "sender", "receiver", "") @@ -94,12 +89,7 @@ func TestPacketV1ToPacketV2(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - }, - }, + Denom: types.NewDenom("atom", types.NewTrace("transfer", "channel-0")), Amount: "1000", }, }, sender, receiver, ""), @@ -111,10 +101,7 @@ func TestPacketV1ToPacketV2(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom", - Trace: nil, - }, + Denom: types.NewDenom("atom"), Amount: "1000", }, }, sender, receiver, ""), @@ -126,12 +113,7 @@ func TestPacketV1ToPacketV2(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom/withslash", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - }, - }, + Denom: types.NewDenom("atom/withslash", types.NewTrace("transfer", "channel-0")), Amount: "1000", }, }, sender, receiver, ""), @@ -143,12 +125,7 @@ func TestPacketV1ToPacketV2(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom/", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - }, - }, + Denom: types.NewDenom("atom/", types.NewTrace("transfer", "channel-0")), Amount: "1000", }, }, sender, receiver, ""), @@ -160,13 +137,7 @@ func TestPacketV1ToPacketV2(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom/pool", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - types.NewTrace("transfer", "channel-1"), - }, - }, + Denom: types.NewDenom("atom/pool", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: "1000", }, }, sender, receiver, ""), @@ -178,14 +149,7 @@ func TestPacketV1ToPacketV2(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - types.NewTrace("transfer", "channel-1"), - types.NewTrace("transfer-custom", "channel-2"), - }, - }, + Denom: types.NewDenom("atom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer-custom", "channel-2")), Amount: "1000", }, }, sender, receiver, ""), @@ -197,14 +161,7 @@ func TestPacketV1ToPacketV2(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "atom/pool", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - types.NewTrace("transfer", "channel-1"), - types.NewTrace("transfer-custom", "channel-2"), - }, - }, + Denom: types.NewDenom("atom/pool", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer-custom", "channel-2")), Amount: "1000", }, }, sender, receiver, ""), diff --git a/modules/apps/transfer/keeper/genesis_test.go b/modules/apps/transfer/keeper/genesis_test.go index f358dbdbc7a..253c3c6e56d 100644 --- a/modules/apps/transfer/keeper/genesis_test.go +++ b/modules/apps/transfer/keeper/genesis_test.go @@ -31,10 +31,7 @@ func (suite *KeeperTestSuite) TestGenesis() { ) for _, traceAndEscrowAmount := range traceAndEscrowAmounts { - denom := types.Denom{ - Base: "uatom", - Trace: traceAndEscrowAmount.trace, - } + denom := types.NewDenom("uatom", traceAndEscrowAmount.trace...) denoms = append(denoms, denom) suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), denom) diff --git a/modules/apps/transfer/keeper/grpc_query_test.go b/modules/apps/transfer/keeper/grpc_query_test.go index 5dc7cdfeea2..9c52cc9ed69 100644 --- a/modules/apps/transfer/keeper/grpc_query_test.go +++ b/modules/apps/transfer/keeper/grpc_query_test.go @@ -26,13 +26,11 @@ func (suite *KeeperTestSuite) TestQueryDenom() { { "success: correct ibc denom", func() { - expDenom = types.Denom{ - Base: "uatom", //nolint:goconst - Trace: []types.Trace{ - types.NewTrace("transfer", "channelToA"), //nolint:goconst - types.NewTrace("transfer", "channelToB"), //nolint:goconst - }, - } + expDenom = types.NewDenom( + "uatom", //nolint:goconst + types.NewTrace("transfer", "channelToA"), //nolint:goconst + types.NewTrace("transfer", "channelToB"), //nolint:goconst + ) suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), expDenom) req = &types.QueryDenomRequest{ @@ -44,13 +42,11 @@ func (suite *KeeperTestSuite) TestQueryDenom() { { "success: correct hex hash", func() { - expDenom = types.Denom{ - Base: "uatom", //nolint:goconst - Trace: []types.Trace{ - types.NewTrace("transfer", "channelToA"), //nolint:goconst - types.NewTrace("transfer", "channelToB"), //nolint:goconst - }, - } + expDenom = types.NewDenom( + "uatom", //nolint:goconst + types.NewTrace("transfer", "channelToA"), //nolint:goconst + types.NewTrace("transfer", "channelToB"), //nolint:goconst + ) suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), expDenom) req = &types.QueryDenomRequest{ @@ -71,13 +67,11 @@ func (suite *KeeperTestSuite) TestQueryDenom() { { "failure: not found denom trace", func() { - expDenom = types.Denom{ - Base: "uatom", //nolint:goconst - Trace: []types.Trace{ - types.NewTrace("transfer", "channelToA"), //nolint:goconst - types.NewTrace("transfer", "channelToB"), //nolint:goconst - }, - } + expDenom = types.NewDenom( + "uatom", //nolint:goconst + types.NewTrace("transfer", "channelToA"), //nolint:goconst + types.NewTrace("transfer", "channelToB"), //nolint:goconst + ) req = &types.QueryDenomRequest{ Hash: expDenom.IBCDenom(), @@ -129,9 +123,9 @@ func (suite *KeeperTestSuite) TestQueryDenoms() { { "success", func() { - expDenoms = append(expDenoms, types.Denom{Base: "uatom"}) - expDenoms = append(expDenoms, types.Denom{Base: "uatom", Trace: []types.Trace{types.NewTrace("transfer", "channelToB")}}) - expDenoms = append(expDenoms, types.Denom{Base: "uatom", Trace: []types.Trace{types.NewTrace("transfer", "channelToA"), types.NewTrace("transfer", "channelToB")}}) + expDenoms = append(expDenoms, types.NewDenom("uatom")) + expDenoms = append(expDenoms, types.NewDenom("uatom", types.NewTrace("transfer", "channelToB"))) + expDenoms = append(expDenoms, types.NewDenom("uatom", types.NewTrace("transfer", "channelToA"), types.NewTrace("transfer", "channelToB"))) for _, trace := range expDenoms { suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), trace) @@ -177,13 +171,7 @@ func (suite *KeeperTestSuite) TestQueryParams() { } func (suite *KeeperTestSuite) TestQueryDenomHash() { - reqDenom := types.Denom{ - Base: "uatom", - Trace: []types.Trace{ - types.NewTrace("transfer", "channelToA"), - types.NewTrace("transfer", "channelToB"), - }, - } + reqDenom := types.NewDenom("uatom", types.NewTrace("transfer", "channelToA"), types.NewTrace("transfer", "channelToB")) var ( req *types.QueryDenomHashRequest @@ -345,18 +333,15 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { { "valid ibc denom with escrow amount > 2^63", func() { - denomTrace := types.Denom{ - Base: sdk.DefaultBondDenom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - } + denom := types.NewDenom(sdk.DefaultBondDenom, types.NewTrace("transfer", "channel-0")) - suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), denomTrace) + suite.chainA.GetSimApp().TransferKeeper.SetDenom(suite.chainA.GetContext(), denom) expEscrowAmount, ok := sdkmath.NewIntFromString("100000000000000000000") suite.Require().True(ok) suite.chainA.GetSimApp().TransferKeeper.SetTotalEscrowForDenom(suite.chainA.GetContext(), sdk.NewCoin(sdk.DefaultBondDenom, expEscrowAmount)) req = &types.QueryTotalEscrowForDenomRequest{ - Denom: denomTrace.IBCDenom(), + Denom: denom.IBCDenom(), } }, true, @@ -364,13 +349,10 @@ func (suite *KeeperTestSuite) TestTotalEscrowForDenom() { { "valid ibc denom treated as native denom", func() { - denomTrace := types.Denom{ - Base: sdk.DefaultBondDenom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - } + denom := types.NewDenom(sdk.DefaultBondDenom, types.NewTrace("transfer", "channel-0")) req = &types.QueryTotalEscrowForDenomRequest{ - Denom: denomTrace.IBCDenom(), + Denom: denom.IBCDenom(), } }, true, // denom trace is not found, thus the denom is considered a native token diff --git a/modules/apps/transfer/keeper/invariants_test.go b/modules/apps/transfer/keeper/invariants_test.go index e150f9ef7c9..668d5c17c59 100644 --- a/modules/apps/transfer/keeper/invariants_test.go +++ b/modules/apps/transfer/keeper/invariants_test.go @@ -12,20 +12,29 @@ import ( func (suite *KeeperTestSuite) TestTotalEscrowPerDenomInvariant() { testCases := []struct { - name string - malleate func() - expPass bool + name string + coinsToTransfer sdk.Coins + malleate func() + expPass bool }{ { "success", + sdk.NewCoins(ibctesting.TestCoin, ibctesting.SecondaryTestCoin), + func() {}, + true, + }, + { + "success with single denom", + sdk.NewCoins(ibctesting.TestCoin), func() {}, true, }, { "fails with broken invariant", + sdk.NewCoins(ibctesting.TestCoin), func() { // set amount for denom higher than actual value in escrow - amount := sdkmath.NewInt(200) + amount := ibctesting.TestCoin.Amount.Add(sdkmath.NewInt(100)) suite.chainA.GetSimApp().TransferKeeper.SetTotalEscrowForDenom(suite.chainA.GetContext(), sdk.NewCoin(sdk.DefaultBondDenom, amount)) }, false, @@ -40,14 +49,10 @@ func (suite *KeeperTestSuite) TestTotalEscrowPerDenomInvariant() { path := ibctesting.NewTransferPath(suite.chainA, suite.chainB) path.Setup() - amount := sdkmath.NewInt(100) - - // send coins from chain A to chain B so that we have them in escrow - coin := sdk.NewCoin(sdk.DefaultBondDenom, amount) msg := types.NewMsgTransfer( path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, - sdk.NewCoins(coin), + tc.coinsToTransfer, suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), suite.chainA.GetTimeoutHeight(), 0, "", diff --git a/modules/apps/transfer/keeper/msg_server_test.go b/modules/apps/transfer/keeper/msg_server_test.go index 2c67c9c01e1..02242c703a8 100644 --- a/modules/apps/transfer/keeper/msg_server_test.go +++ b/modules/apps/transfer/keeper/msg_server_test.go @@ -22,56 +22,41 @@ import ( func (suite *KeeperTestSuite) TestMsgTransfer() { var msg *types.MsgTransfer var path *ibctesting.Path - var coin1 sdk.Coin - var coin2 sdk.Coin + + coin2 := sdk.NewCoin("bond", sdkmath.NewInt(100)) + testCoins := append(ibctesting.TestCoins, coin2) //nolint:gocritic testCases := []struct { - name string - malleate func() - expError error - multiDenom bool + name string + malleate func() + expError error }{ { - "success: single denom", + "success: multiple coins", func() {}, nil, - false, }, { - "success: multidenom", + "success: single coin", func() { - coin2 = sdk.NewCoin("bond", sdkmath.NewInt(100)) - coins := []sdk.Coin{coin1, coin2} - - // send some coins of the second denom from bank module to the sender account as well - suite.Require().NoError(suite.chainA.GetSimApp().BankKeeper.MintCoins(suite.chainA.GetContext(), types.ModuleName, sdk.NewCoins(coin2))) - suite.Require().NoError(suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(coin2))) - - msg = types.NewMsgTransfer( - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - coins, - suite.chainA.SenderAccount.GetAddress().String(), - suite.chainB.SenderAccount.GetAddress().String(), - suite.chainB.GetTimeoutHeight(), 0, // only use timeout height - "memo", - ) + msg.Tokens = []sdk.Coin{ibctesting.TestCoin} }, nil, - true, }, { - "bank send enabled for denom", + "bank send enabled for denoms", func() { err := suite.chainA.GetSimApp().BankKeeper.SetParams(suite.chainA.GetContext(), banktypes.Params{ - SendEnabled: []*banktypes.SendEnabled{{Denom: sdk.DefaultBondDenom, Enabled: true}}, + SendEnabled: []*banktypes.SendEnabled{ + {Denom: sdk.DefaultBondDenom, Enabled: true}, + {Denom: "bond", Enabled: true}, + }, }, ) suite.Require().NoError(err) }, nil, - false, }, { "failure: send transfers disabled", @@ -83,7 +68,6 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { ) }, types.ErrSendDisabled, - false, }, { "failure: invalid sender", @@ -91,7 +75,6 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { msg.Sender = "address" }, errors.New("decoding bech32 failed"), - false, }, { "failure: sender is a blocked address", @@ -99,10 +82,9 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { msg.Sender = suite.chainA.GetSimApp().AccountKeeper.GetModuleAddress(types.ModuleName).String() }, ibcerrors.ErrUnauthorized, - false, }, { - "failure: bank send disabled for denom", + "failure: bank send disabled for one of the denoms", func() { err := suite.chainA.GetSimApp().BankKeeper.SetParams(suite.chainA.GetContext(), banktypes.Params{ @@ -112,37 +94,6 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { suite.Require().NoError(err) }, types.ErrSendDisabled, - false, - }, - { - "failure: bank send disabled for coin in multi coin transfer", - func() { - coin2 = sdk.NewCoin("bond", sdkmath.NewInt(100)) - coins := sdk.NewCoins(coin1, coin2) - - // send some coins of the second denom from bank module to the sender account as well - suite.Require().NoError(suite.chainA.GetSimApp().BankKeeper.MintCoins(suite.chainA.GetContext(), types.ModuleName, sdk.NewCoins(coin2))) - suite.Require().NoError(suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(coin2))) - - msg = types.NewMsgTransfer( - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - coins, - suite.chainA.SenderAccount.GetAddress().String(), - suite.chainB.SenderAccount.GetAddress().String(), - suite.chainB.GetTimeoutHeight(), 0, // only use timeout height - "memo", - ) - - err := suite.chainA.GetSimApp().BankKeeper.SetParams(suite.chainA.GetContext(), - banktypes.Params{ - SendEnabled: []*banktypes.SendEnabled{{Denom: coin2.Denom, Enabled: false}}, - }, - ) - suite.Require().NoError(err) - }, - types.ErrSendDisabled, - true, }, { "failure: channel does not exist", @@ -150,35 +101,14 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { msg.SourceChannel = "channel-100" }, channeltypes.ErrChannelNotFound, - false, }, { "failure: multidenom with ics20-1", func() { - coin2 = sdk.NewCoin("bond", sdkmath.NewInt(100)) - coins := sdk.NewCoins(coin1, coin2) - - // send some coins of the second denom from bank module to the sender account as well - suite.Require().NoError(suite.chainA.GetSimApp().BankKeeper.MintCoins(suite.chainA.GetContext(), types.ModuleName, sdk.NewCoins(coin2))) - suite.Require().NoError(suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(coin2))) - - msg = types.NewMsgTransfer( - path.EndpointA.ChannelConfig.PortID, - path.EndpointA.ChannelID, - coins, - suite.chainA.SenderAccount.GetAddress().String(), - suite.chainB.SenderAccount.GetAddress().String(), - suite.chainB.GetTimeoutHeight(), 0, // only use timeout height - "memo", - ) - // explicitly set to ics20-1 which does not support multi-denom - path.EndpointA.UpdateChannel(func(channel *channeltypes.Channel) { - channel.Version = types.V1 - }) + path.EndpointA.UpdateChannel(func(channel *channeltypes.Channel) { channel.Version = types.V1 }) }, ibcerrors.ErrInvalidRequest, - true, }, } @@ -191,31 +121,31 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { path = ibctesting.NewTransferPath(suite.chainA, suite.chainB) path.Setup() - coin1 = sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100)) msg = types.NewMsgTransfer( path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, - sdk.NewCoins(coin1), + testCoins, suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), suite.chainB.GetTimeoutHeight(), 0, // only use timeout height "memo", ) + // send some coins of the second denom from bank module to the sender account as well + err := suite.chainA.GetSimApp().BankKeeper.MintCoins(suite.chainA.GetContext(), types.ModuleName, sdk.NewCoins(coin2)) + suite.Require().NoError(err) + err = suite.chainA.GetSimApp().BankKeeper.SendCoinsFromModuleToAccount(suite.chainA.GetContext(), types.ModuleName, suite.chainA.SenderAccount.GetAddress(), sdk.NewCoins(coin2)) + suite.Require().NoError(err) + tc.malleate() ctx := suite.chainA.GetContext() var tokens []types.Token - token1, err := suite.chainA.GetSimApp().TransferKeeper.TokenFromCoin(ctx, coin1) - suite.Require().NoError(err) - tokens = append(tokens, token1) - - var expEvents []abci.Event - if tc.multiDenom { - token2, err := suite.chainA.GetSimApp().TransferKeeper.TokenFromCoin(ctx, coin2) + for _, coin := range msg.GetCoins() { + token, err := suite.chainA.GetSimApp().TransferKeeper.TokenFromCoin(ctx, coin) suite.Require().NoError(err) - tokens = append(tokens, token2) + tokens = append(tokens, token) } jsonTokens, err := json.Marshal(types.Tokens(tokens)) @@ -224,6 +154,7 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { res, err := suite.chainA.GetSimApp().TransferKeeper.Transfer(ctx, msg) // Verify events + var expEvents []abci.Event events := ctx.EventManager().Events().ToABCIEvents() expEvents = sdk.Events{ @@ -247,7 +178,6 @@ func (suite *KeeperTestSuite) TestMsgTransfer() { ibctesting.AssertEvents(&suite.Suite, expEvents, events) } else { suite.Require().Nil(res) - suite.Require().Error(err) suite.Require().True(errors.Is(err, tc.expError) || strings.Contains(err.Error(), tc.expError.Error()), err.Error()) suite.Require().Len(events, 0) } diff --git a/modules/apps/transfer/keeper/relay.go b/modules/apps/transfer/keeper/relay.go index 3b3d3fca1aa..60c01a836b1 100644 --- a/modules/apps/transfer/keeper/relay.go +++ b/modules/apps/transfer/keeper/relay.go @@ -368,9 +368,7 @@ func (k Keeper) tokenFromCoin(ctx sdk.Context, coin sdk.Coin) (types.Token, erro // if the coin does not have an IBC denom, return as is if !strings.HasPrefix(coin.Denom, "ibc/") { return types.Token{ - Denom: types.Denom{ - Base: coin.Denom, - }, + Denom: types.NewDenom(coin.Denom), Amount: coin.Amount.String(), }, nil } diff --git a/modules/apps/transfer/keeper/relay_test.go b/modules/apps/transfer/keeper/relay_test.go index bb3b2094852..5fcd6c59c13 100644 --- a/modules/apps/transfer/keeper/relay_test.go +++ b/modules/apps/transfer/keeper/relay_test.go @@ -57,12 +57,7 @@ func (suite *KeeperTestSuite) TestSendTransfer() { "successful transfer of IBC token", func() { // send IBC token back to chainB - denom := types.Denom{ - Base: coin.Denom, - Trace: []types.Trace{ - types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID), - }, - } + denom := types.NewDenom(coin.Denom, types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)) coin = sdk.NewCoin(denom.IBCDenom(), coin.Amount) }, nil, @@ -83,12 +78,7 @@ func (suite *KeeperTestSuite) TestSendTransfer() { "successful transfer of IBC token with memo", func() { // send IBC token back to chainB - denom := types.Denom{ - Base: coin.Denom, - Trace: []types.Trace{ - types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID), - }, - } + denom := types.NewDenom(coin.Denom, types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)) coin = sdk.NewCoin(denom.IBCDenom(), coin.Amount) memo = "memo" }, @@ -119,12 +109,7 @@ func (suite *KeeperTestSuite) TestSendTransfer() { { "failure: denom trace not found", func() { - denom := types.Denom{ - Base: "randomdenom", - Trace: []types.Trace{ - types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID), - }, - } + denom := types.NewDenom("randomdenom", types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)) coin = sdk.NewCoin(denom.IBCDenom(), coin.Amount) }, types.ErrDenomNotFound, @@ -132,12 +117,7 @@ func (suite *KeeperTestSuite) TestSendTransfer() { { "failure: bank send from module account failed, insufficient balance", func() { - denom := types.Denom{ - Base: coin.Denom, - Trace: []types.Trace{ - types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID), - }, - } + denom := types.NewDenom(coin.Denom, types.NewTrace(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)) coin = sdk.NewCoin(denom.IBCDenom(), coin.Amount.Add(sdkmath.NewInt(1))) }, sdkerrors.ErrInsufficientFunds, @@ -394,10 +374,7 @@ func (suite *KeeperTestSuite) TestOnRecvPacket_ReceiverIsNotSource() { data := types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: sdk.DefaultBondDenom, - Trace: []types.Trace{}, - }, + Denom: types.NewDenom(sdk.DefaultBondDenom, []types.Trace{}...), Amount: amount.String(), }, }, suite.chainA.SenderAccount.GetAddress().String(), receiver, memo) diff --git a/modules/apps/transfer/transfer_test.go b/modules/apps/transfer/transfer_test.go index f2777e293cf..63145ae77a9 100644 --- a/modules/apps/transfer/transfer_test.go +++ b/modules/apps/transfer/transfer_test.go @@ -37,106 +37,160 @@ func (suite *TransferTestSuite) SetupTest() { // 2 - from chainB to chainC // 3 - from chainC to chainB func (suite *TransferTestSuite) TestHandleMsgTransfer() { - // setup between chainA and chainB - // NOTE: - // pathAtoB.EndpointA = endpoint on chainA - // pathAtoB.EndpointB = endpoint on chainB - pathAtoB := ibctesting.NewTransferPath(suite.chainA, suite.chainB) - pathAtoB.Setup() - - originalBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), sdk.DefaultBondDenom) - timeoutHeight := clienttypes.NewHeight(1, 110) - - amount, ok := sdkmath.NewIntFromString("9223372036854775808") // 2^63 (one above int64) - suite.Require().True(ok) - coinToSendToB := sdk.NewCoin(sdk.DefaultBondDenom, amount) - - // send from chainA to chainB - msg := types.NewMsgTransfer(pathAtoB.EndpointA.ChannelConfig.PortID, pathAtoB.EndpointA.ChannelID, sdk.NewCoins(coinToSendToB), suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), timeoutHeight, 0, "") - res, err := suite.chainA.SendMsgs(msg) - suite.Require().NoError(err) // message committed - - packet, err := ibctesting.ParsePacketFromEvents(res.Events) - suite.Require().NoError(err) - - // relay send - err = pathAtoB.RelayPacket(packet) - suite.Require().NoError(err) // relay committed - - // check that module account escrow address has locked the tokens - escrowAddress := types.GetEscrowAddress(packet.GetSourcePort(), packet.GetSourceChannel()) - balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), escrowAddress, sdk.DefaultBondDenom) - suite.Require().Equal(coinToSendToB, balance) - - // check that voucher exists on chain B - denom := types.Denom{ - Base: sdk.DefaultBondDenom, - Trace: []types.Trace{ - types.NewTrace(packet.DestinationPort, packet.DestinationChannel), + testCases := []struct { + name string + sourceDenomsToTransfer []string + }{ + { + "transfer single denom", + []string{sdk.DefaultBondDenom}, }, + { + "transfer multiple denoms", + []string{sdk.DefaultBondDenom, ibctesting.SecondaryDenom}, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + // setup between chainA and chainB + // NOTE: + // pathAToB.EndpointA = endpoint on chainA + // pathAToB.EndpointB = endpoint on chainB + pathAToB := ibctesting.NewTransferPath(suite.chainA, suite.chainB) + pathAToB.Setup() + traceAToB := types.NewTrace(pathAToB.EndpointB.ChannelConfig.PortID, pathAToB.EndpointB.ChannelID) + + originalBalances := sdk.NewCoins() + for _, denom := range tc.sourceDenomsToTransfer { + originalBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), denom) + originalBalances = originalBalances.Add(originalBalance) + } + + timeoutHeight := clienttypes.NewHeight(1, 110) + + amount, ok := sdkmath.NewIntFromString("9223372036854775808") // 2^63 (one above int64) + suite.Require().True(ok) + originalCoins := sdk.NewCoins() + for _, denom := range tc.sourceDenomsToTransfer { + coinToSendToB := sdk.NewCoin(denom, amount) + originalCoins = originalCoins.Add(coinToSendToB) + } + + // send from chainA to chainB + msg := types.NewMsgTransfer(pathAToB.EndpointA.ChannelConfig.PortID, pathAToB.EndpointA.ChannelID, originalCoins, suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), timeoutHeight, 0, "") + res, err := suite.chainA.SendMsgs(msg) + suite.Require().NoError(err) // message committed + + packet, err := ibctesting.ParsePacketFromEvents(res.Events) + suite.Require().NoError(err) + + // relay send + err = pathAToB.RelayPacket(packet) + suite.Require().NoError(err) // relay committed + + escrowAddress := types.GetEscrowAddress(packet.GetSourcePort(), packet.GetSourceChannel()) + coinsSentFromAToB := sdk.NewCoins() + for _, coin := range originalCoins { + // check that the balance for chainA is updated + chainABalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), coin.Denom) + suite.Require().Equal(originalBalances.AmountOf(coin.Denom).Sub(amount).Int64(), chainABalance.Amount.Int64()) + + // check that module account escrow address has locked the tokens + chainAEscrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), escrowAddress, coin.Denom) + suite.Require().Equal(coin, chainAEscrowBalance) + + // check that voucher exists on chain B + chainBDenom := types.NewDenom(coin.Denom, traceAToB) + chainBBalance := suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), chainBDenom.IBCDenom()) + coinSentFromAToB := sdk.NewCoin(chainBDenom.IBCDenom(), amount) + suite.Require().Equal(coinSentFromAToB, chainBBalance) + + coinsSentFromAToB = coinsSentFromAToB.Add(coinSentFromAToB) + } + + // setup between chainB to chainC + // NOTE: + // pathBToC.EndpointA = endpoint on chainB + // pathBToC.EndpointB = endpoint on chainC + pathBToC := ibctesting.NewTransferPath(suite.chainB, suite.chainC) + pathBToC.Setup() + traceBToC := types.NewTrace(pathBToC.EndpointB.ChannelConfig.PortID, pathBToC.EndpointB.ChannelID) + + // send from chainB to chainC + msg = types.NewMsgTransfer(pathBToC.EndpointA.ChannelConfig.PortID, pathBToC.EndpointA.ChannelID, coinsSentFromAToB, suite.chainB.SenderAccount.GetAddress().String(), suite.chainC.SenderAccount.GetAddress().String(), timeoutHeight, 0, "") + res, err = suite.chainB.SendMsgs(msg) + suite.Require().NoError(err) // message committed + + packet, err = ibctesting.ParsePacketFromEvents(res.Events) + suite.Require().NoError(err) + + err = pathBToC.RelayPacket(packet) + suite.Require().NoError(err) // relay committed + + coinsSentFromBToC := sdk.NewCoins() + // check balances for chainB and chainC after transfer from chainB to chainC + for _, coin := range originalCoins { + // NOTE: fungible token is prefixed with the full trace in order to verify the packet commitment + chainCDenom := types.NewDenom(coin.Denom, traceBToC, traceAToB) + + // check that the balance is updated on chainC + coinSentFromBToC := sdk.NewCoin(chainCDenom.IBCDenom(), amount) + chainCBalance := suite.chainC.GetSimApp().BankKeeper.GetBalance(suite.chainC.GetContext(), suite.chainC.SenderAccount.GetAddress(), coinSentFromBToC.Denom) + suite.Require().Equal(coinSentFromBToC, chainCBalance) + + // check that balance on chain B is empty + chainBBalance := suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), coinSentFromBToC.Denom) + suite.Require().Zero(chainBBalance.Amount.Int64()) + + coinsSentFromBToC = coinsSentFromBToC.Add(coinSentFromBToC) + } + + // send from chainC back to chainB + msg = types.NewMsgTransfer(pathBToC.EndpointB.ChannelConfig.PortID, pathBToC.EndpointB.ChannelID, coinsSentFromBToC, suite.chainC.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), timeoutHeight, 0, "") + res, err = suite.chainC.SendMsgs(msg) + suite.Require().NoError(err) // message committed + + packet, err = ibctesting.ParsePacketFromEvents(res.Events) + suite.Require().NoError(err) + + err = pathBToC.RelayPacket(packet) + suite.Require().NoError(err) // relay committed + + // check balances for chainC are empty after transfer from chainC to chainB + for _, coin := range coinsSentFromBToC { + // check that balance on chain C is empty + chainCBalance := suite.chainC.GetSimApp().BankKeeper.GetBalance(suite.chainC.GetContext(), suite.chainC.SenderAccount.GetAddress(), coin.Denom) + suite.Require().Zero(chainCBalance.Amount.Int64()) + } + + // check balances for chainB after transfer from chainC to chainB + for _, coin := range coinsSentFromAToB { + // check that balance on chain B has the transferred amount + chainBBalance := suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), coin.Denom) + suite.Require().Equal(coin, chainBBalance) + + // check that module account escrow address is empty + escrowAddress = types.GetEscrowAddress(traceBToC.PortId, traceBToC.ChannelId) + chainBEscrowBalance := suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), escrowAddress, coin.Denom) + suite.Require().Zero(chainBEscrowBalance.Amount.Int64()) + } + + // check balances for chainA after transfer from chainC to chainB + for _, coin := range originalCoins { + // check that the balance is unchanged + chainABalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), coin.Denom) + suite.Require().Equal(originalBalances.AmountOf(coin.Denom).Sub(amount).Int64(), chainABalance.Amount.Int64()) + + // check that module account escrow address is unchanged + escrowAddress = types.GetEscrowAddress(traceAToB.PortId, traceAToB.ChannelId) + chainAEscrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), escrowAddress, coin.Denom) + suite.Require().Equal(coin, chainAEscrowBalance) + } + }) } - balance = suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), denom.IBCDenom()) - coinSentFromAToB := sdk.NewCoin(denom.IBCDenom(), amount) - suite.Require().Equal(coinSentFromAToB, balance) - - // setup between chainB to chainC - // NOTE: - // pathBtoC.EndpointA = endpoint on chainB - // pathBtoC.EndpointB = endpoint on chainC - pathBtoC := ibctesting.NewTransferPath(suite.chainB, suite.chainC) - pathBtoC.Setup() - - // send from chainB to chainC - msg = types.NewMsgTransfer(pathBtoC.EndpointA.ChannelConfig.PortID, pathBtoC.EndpointA.ChannelID, sdk.NewCoins(coinSentFromAToB), suite.chainB.SenderAccount.GetAddress().String(), suite.chainC.SenderAccount.GetAddress().String(), timeoutHeight, 0, "") - res, err = suite.chainB.SendMsgs(msg) - suite.Require().NoError(err) // message committed - - packet, err = ibctesting.ParsePacketFromEvents(res.Events) - suite.Require().NoError(err) - - err = pathBtoC.RelayPacket(packet) - suite.Require().NoError(err) // relay committed - - // NOTE: fungible token is prefixed with the full trace in order to verify the packet commitment - trace := []types.Trace{types.NewTrace(pathBtoC.EndpointB.ChannelConfig.PortID, pathBtoC.EndpointB.ChannelID)} - denom.Trace = append(trace, denom.Trace...) - - // check that the balance is updated on chainC - coinSentFromBToC := sdk.NewCoin(denom.IBCDenom(), amount) - balance = suite.chainC.GetSimApp().BankKeeper.GetBalance(suite.chainC.GetContext(), suite.chainC.SenderAccount.GetAddress(), coinSentFromBToC.Denom) - suite.Require().Equal(coinSentFromBToC, balance) - - // check that balance on chain B is empty - balance = suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), coinSentFromBToC.Denom) - suite.Require().Zero(balance.Amount.Int64()) - - // send from chainC back to chainB - msg = types.NewMsgTransfer(pathBtoC.EndpointB.ChannelConfig.PortID, pathBtoC.EndpointB.ChannelID, sdk.NewCoins(coinSentFromBToC), suite.chainC.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), timeoutHeight, 0, "") - res, err = suite.chainC.SendMsgs(msg) - suite.Require().NoError(err) // message committed - - packet, err = ibctesting.ParsePacketFromEvents(res.Events) - suite.Require().NoError(err) - - err = pathBtoC.RelayPacket(packet) - suite.Require().NoError(err) // relay committed - - // check that balance on chain A is updated - balance = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), sdk.DefaultBondDenom) - suite.Require().Equal(originalBalance.SubAmount(amount).Amount.Int64(), balance.Amount.Int64()) - - // check that balance on chain B has the transferred amount - balance = suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), suite.chainB.SenderAccount.GetAddress(), coinSentFromAToB.Denom) - suite.Require().Equal(coinSentFromAToB, balance) - - // check that module account escrow address is empty - escrowAddress = types.GetEscrowAddress(packet.GetDestPort(), packet.GetDestChannel()) - balance = suite.chainB.GetSimApp().BankKeeper.GetBalance(suite.chainB.GetContext(), escrowAddress, coinSentFromAToB.Denom) - suite.Require().Zero(balance.Amount.Int64()) - - // check that balance on chain C is empty - balance = suite.chainC.GetSimApp().BankKeeper.GetBalance(suite.chainC.GetContext(), suite.chainC.SenderAccount.GetAddress(), denom.IBCDenom()) - suite.Require().Zero(balance.Amount.Int64()) } func TestTransferTestSuite(t *testing.T) { diff --git a/modules/apps/transfer/types/denom_test.go b/modules/apps/transfer/types/denom_test.go index 659f31d7607..70dcd94dfed 100644 --- a/modules/apps/transfer/types/denom_test.go +++ b/modules/apps/transfer/types/denom_test.go @@ -19,22 +19,20 @@ func (suite *TypesTestSuite) TestDenomsValidate() { }, { "valid multiple trace info", - types.Denoms{ - {Base: "uatom", Trace: []types.Trace{types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2")}}, - }, + types.Denoms{types.NewDenom("uatom", types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2"))}, nil, }, { "valid multiple trace info", types.Denoms{ - {Base: "uatom", Trace: []types.Trace{types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2")}}, - {Base: "uatom", Trace: []types.Trace{types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2")}}, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2")), }, fmt.Errorf("duplicated denomination with hash"), }, { "empty base denom with trace", - types.Denoms{{Base: "", Trace: []types.Trace{types.NewTrace("transfer", "channel-1")}}}, + types.Denoms{types.NewDenom("", types.NewTrace("transfer", "channel-1"))}, fmt.Errorf("base denomination cannot be blank"), }, } @@ -65,48 +63,32 @@ func (suite *TypesTestSuite) TestPath() { }, { "only base denom", - types.Denom{ - Base: "uatom", - }, + types.NewDenom("uatom"), "uatom", }, { "base with slashes", - types.Denom{ - Base: "gamm/pool/osmo", - }, + types.NewDenom("gamm/pool/osmo"), "gamm/pool/osmo", }, { "1 hop denom", - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), "transfer/channel-0/uatom", }, { "2 hop denom", - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")), "transfer/channel-0/transfer/channel-52/uatom", }, { "3 hop denom", - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")}, - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")), "transfer/channel-0/transfer/channel-52/transfer/channel-52/uatom", }, { "4 hop denom with base denom slashes", - types.Denom{ - Base: "other-denom/", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-49")}, - }, + types.NewDenom("other-denom/", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-49")), "transfer/channel-0/transfer/channel-52/transfer/channel-52/transfer/channel-49/other-denom/", }, } @@ -127,136 +109,56 @@ func (suite *TypesTestSuite) TestSort() { }{ { "only base denom", - types.Denoms{types.Denom{Base: "uosmo"}, types.Denom{Base: "gamm"}, types.Denom{Base: "uatom"}}, - types.Denoms{types.Denom{Base: "gamm"}, types.Denom{Base: "uatom"}, types.Denom{Base: "uosmo"}}, + types.Denoms{types.NewDenom("uosmo"), types.NewDenom("gamm"), types.NewDenom("uatom")}, + types.Denoms{types.NewDenom("gamm"), types.NewDenom("uatom"), types.NewDenom("uosmo")}, }, { "different base denom and same traces", types.Denoms{ - types.Denom{ - Base: "uosmo", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, + types.NewDenom("uosmo", types.NewTrace("transfer", "channel-0")), + types.NewDenom("gamm", types.NewTrace("transfer", "channel-0")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), }, types.Denoms{ - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "uosmo", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, + types.NewDenom("gamm", types.NewTrace("transfer", "channel-0")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), + types.NewDenom("uosmo", types.NewTrace("transfer", "channel-0")), }, }, { "same base denom and different traces", types.Denoms{ - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("mountain", "channel-0")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "uatom", - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), + types.NewDenom("uatom", types.NewTrace("mountain", "channel-0")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("uatom"), }, types.Denoms{ - types.Denom{ - Base: "uatom", - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("mountain", "channel-0")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")}, - }, + types.NewDenom("uatom"), + types.NewDenom("uatom", types.NewTrace("mountain", "channel-0")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")), }, }, { "different base denoms and different traces", types.Denoms{ - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("pool", "channel-0")}, - }, - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("pool", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "utia", - }, - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), + types.NewDenom("gamm", types.NewTrace("pool", "channel-0")), + types.NewDenom("gamm", types.NewTrace("pool", "channel-0"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("utia"), + types.NewDenom("gamm", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")), }, types.Denoms{ - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("pool", "channel-0")}, - }, - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("pool", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "gamm", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")}, - }, - types.Denom{ - Base: "utia", - }, + types.NewDenom("gamm", types.NewTrace("pool", "channel-0")), + types.NewDenom("gamm", types.NewTrace("pool", "channel-0"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("gamm", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52"), types.NewTrace("transfer", "channel-52")), + types.NewDenom("utia"), }, }, } @@ -278,73 +180,52 @@ func (suite *TypesTestSuite) TestDenomChainSource() { }{ { "sender chain is source: empty trace", - types.Denom{ - Base: "uatom", - Trace: []types.Trace{}, - }, + types.NewDenom("uatom", []types.Trace{}...), "transfer", "channel-0", false, }, { "sender chain is source: nil trace", - types.Denom{ - Base: "uatom", - Trace: nil, - }, + types.NewDenom("uatom"), "transfer", "channel-0", false, }, { "sender chain is source: single trace", - types.Denom{ - Base: "ubtc", - Trace: []types.Trace{types.NewTrace("transfer", "channel-1")}, - }, + types.NewDenom("ubtc", types.NewTrace("transfer", "channel-1")), "transfer", "channel-0", false, }, { "sender chain is source: swapped portID and channelID", - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0")), "channel-0", "transfer", false, }, { "sender chain is source: multi-trace", - types.Denom{ - Base: "uatom", - Trace: []types.Trace{ - types.NewTrace("transfer", "channel-0"), - types.NewTrace("transfer", "channel-52"), - }, - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")), "transfer", "channel-1", false, }, { "receiver chain is source: single trace", - types.Denom{ - Base: "factory/stars16da2uus9zrsy83h23ur42v3lglg5rmyrpqnju4/dust", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}, - }, + types.NewDenom( + "factory/stars16da2uus9zrsy83h23ur42v3lglg5rmyrpqnju4/dust", + types.NewTrace("transfer", "channel-0"), + ), "transfer", "channel-0", true, }, { "receiver chain is source: multi-trace", - types.Denom{ - Base: "uatom", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")}, - }, + types.NewDenom("uatom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-52")), "transfer", "channel-0", true, diff --git a/modules/apps/transfer/types/packet_test.go b/modules/apps/transfer/types/packet_test.go index 1178d821863..d16461aaad8 100644 --- a/modules/apps/transfer/types/packet_test.go +++ b/modules/apps/transfer/types/packet_test.go @@ -175,10 +175,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -193,10 +190,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -211,10 +205,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: largeAmount, }, }, @@ -229,10 +220,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: "", - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom("", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -247,10 +235,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: "", }, }, @@ -275,10 +260,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: "0", }, }, @@ -293,10 +275,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: "-100", }, }, @@ -311,10 +290,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: invalidLargeAmount, }, }, @@ -329,10 +305,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -347,10 +320,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -365,10 +335,7 @@ func TestFungibleTokenPacketDataV2ValidateBasic(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: largeAmount, }, }, @@ -405,10 +372,7 @@ func TestGetPacketSender(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -423,10 +387,7 @@ func TestGetPacketSender(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -456,10 +417,7 @@ func TestPacketDataProvider(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -476,10 +434,7 @@ func TestPacketDataProvider(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -496,10 +451,7 @@ func TestPacketDataProvider(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -513,10 +465,7 @@ func TestPacketDataProvider(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -530,10 +479,7 @@ func TestPacketDataProvider(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -547,10 +493,7 @@ func TestPacketDataProvider(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -580,10 +523,7 @@ func TestFungibleTokenPacketDataOmitEmpty(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, @@ -598,10 +538,7 @@ func TestFungibleTokenPacketDataOmitEmpty(t *testing.T) { types.NewFungibleTokenPacketDataV2( []types.Token{ { - Denom: types.Denom{ - Base: denom, - Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")}, - }, + Denom: types.NewDenom(denom, types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-1")), Amount: amount, }, }, diff --git a/modules/apps/transfer/types/trace_test.go b/modules/apps/transfer/types/trace_test.go index 7d9ca914b6a..453fc4e0a55 100644 --- a/modules/apps/transfer/types/trace_test.go +++ b/modules/apps/transfer/types/trace_test.go @@ -45,24 +45,24 @@ func TestExtractDenomFromPath(t *testing.T) { expDenom types.Denom }{ {"empty denom", "", types.Denom{}}, - {"base denom no slashes", "atom", types.Denom{Base: "atom"}}, - {"base denom with trailing slash", "atom/", types.Denom{Base: "atom/"}}, - {"base denom multiple trailing slash", "foo///bar//baz/atom/", types.Denom{Base: "foo///bar//baz/atom/"}}, - {"ibc denom one hop", "transfer/channel-0/atom", types.Denom{Base: "atom", Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}}}, - {"ibc denom one hop trailing slash", "transfer/channel-0/atom/", types.Denom{Base: "atom/", Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}}}, - {"ibc denom one hop multiple slashes", "transfer/channel-0//at/om/", types.Denom{Base: "/at/om/", Trace: []types.Trace{types.NewTrace("transfer", "channel-0")}}}, - {"ibc denom two hops", "transfer/channel-0/transfer/channel-60/atom", types.Denom{Base: "atom", Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-60")}}}, - {"ibc denom two hops trailing slash", "transfer/channel-0/transfer/channel-60/atom/", types.Denom{Base: "atom/", Trace: []types.Trace{types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-60")}}}, - {"empty prefix", "/uatom", types.Denom{Base: "/uatom"}}, - {"empty identifiers", "//uatom", types.Denom{Base: "//uatom"}}, - {"base denom with single '/'", "erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA", types.Denom{Base: "erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA"}}, - {"trace info and base denom with single '/'", "transfer/channel-1/erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA", types.Denom{Base: "erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA", Trace: []types.Trace{types.NewTrace("transfer", "channel-1")}}}, - {"single trace identifier", "transfer/", types.Denom{Base: "transfer/"}}, - {"trace info with custom port", "customtransfer/channel-1/uatom", types.Denom{Base: "uatom", Trace: []types.Trace{types.NewTrace("customtransfer", "channel-1")}}}, - {"invalid path (1)", "channel-1/transfer/uatom", types.Denom{Base: "channel-1/transfer/uatom"}}, - {"invalid path (2)", "transfer/channel-1", types.Denom{Base: "transfer/channel-1"}}, - {"invalid path (3)", "transfer/channel-1/transfer/channel-2", types.Denom{Trace: []types.Trace{types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2")}}}, - {"invalid path (4)", "transfer/channelToA/uatom", types.Denom{Base: "transfer/channelToA/uatom"}}, + {"base denom no slashes", "atom", types.NewDenom("atom")}, + {"base denom with trailing slash", "atom/", types.NewDenom("atom/")}, + {"base denom multiple trailing slash", "foo///bar//baz/atom/", types.NewDenom("foo///bar//baz/atom/")}, + {"ibc denom one hop", "transfer/channel-0/atom", types.NewDenom("atom", types.NewTrace("transfer", "channel-0"))}, + {"ibc denom one hop trailing slash", "transfer/channel-0/atom/", types.NewDenom("atom/", types.NewTrace("transfer", "channel-0"))}, + {"ibc denom one hop multiple slashes", "transfer/channel-0//at/om/", types.NewDenom("/at/om/", types.NewTrace("transfer", "channel-0"))}, + {"ibc denom two hops", "transfer/channel-0/transfer/channel-60/atom", types.NewDenom("atom", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-60"))}, + {"ibc denom two hops trailing slash", "transfer/channel-0/transfer/channel-60/atom/", types.NewDenom("atom/", types.NewTrace("transfer", "channel-0"), types.NewTrace("transfer", "channel-60"))}, + {"empty prefix", "/uatom", types.NewDenom("/uatom")}, + {"empty identifiers", "//uatom", types.NewDenom("//uatom")}, + {"base denom with single '/'", "erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA", types.NewDenom("erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA")}, + {"trace info and base denom with single '/'", "transfer/channel-1/erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA", types.NewDenom("erc20/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA", types.NewTrace("transfer", "channel-1"))}, + {"single trace identifier", "transfer/", types.NewDenom("transfer/")}, + {"trace info with custom port", "customtransfer/channel-1/uatom", types.NewDenom("uatom", types.NewTrace("customtransfer", "channel-1"))}, + {"invalid path (1)", "channel-1/transfer/uatom", types.NewDenom("channel-1/transfer/uatom")}, + {"invalid path (2)", "transfer/channel-1", types.NewDenom("transfer/channel-1")}, + {"invalid path (3)", "transfer/channel-1/transfer/channel-2", types.NewDenom("", types.NewTrace("transfer", "channel-1"), types.NewTrace("transfer", "channel-2"))}, + {"invalid path (4)", "transfer/channelToA/uatom", types.NewDenom("transfer/channelToA/uatom")}, } for _, tc := range testCases { diff --git a/modules/capability/go.mod b/modules/capability/go.mod index 2b4abd4b921..7d6667fa0af 100644 --- a/modules/capability/go.mod +++ b/modules/capability/go.mod @@ -15,7 +15,7 @@ require ( github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/gogoproto v1.5.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 sigs.k8s.io/yaml v1.4.0 diff --git a/modules/capability/go.sum b/modules/capability/go.sum index 028d8d89f38..25fae62960b 100644 --- a/modules/capability/go.sum +++ b/modules/capability/go.sum @@ -134,8 +134,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= diff --git a/modules/core/03-connection/keeper/handshake.go b/modules/core/03-connection/keeper/handshake.go index 8fd698ac91a..f9e96160d5e 100644 --- a/modules/core/03-connection/keeper/handshake.go +++ b/modules/core/03-connection/keeper/handshake.go @@ -47,7 +47,7 @@ func (k *Keeper) ConnOpenInit( connection := types.NewConnectionEnd(types.INIT, clientID, counterparty, versions, delayPeriod) k.SetConnection(ctx, connectionID, connection) - k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.UNINITIALIZED.String(), "new-state", types.INIT.String()) + k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.UNINITIALIZED, "new-state", types.INIT) defer telemetry.IncrCounter(1, "ibc", "connection", "open-init") @@ -142,7 +142,7 @@ func (k *Keeper) ConnOpenTry( } k.SetConnection(ctx, connectionID, connection) - k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.UNINITIALIZED.String(), "new-state", types.TRYOPEN.String()) + k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.UNINITIALIZED, "new-state", types.TRYOPEN) defer telemetry.IncrCounter(1, "ibc", "connection", "open-try") @@ -187,7 +187,7 @@ func (k *Keeper) ConnOpenAck( if connection.State != types.INIT { return errorsmod.Wrapf( types.ErrInvalidConnectionState, - "connection state is not INIT (got %s)", connection.State.String(), + "connection state is not INIT (got %s)", connection.State, ) } @@ -234,7 +234,7 @@ func (k *Keeper) ConnOpenAck( return err } - k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.INIT.String(), "new-state", types.OPEN.String()) + k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.INIT, "new-state", types.OPEN) defer telemetry.IncrCounter(1, "ibc", "connection", "open-ack") @@ -269,7 +269,7 @@ func (k *Keeper) ConnOpenConfirm( if connection.State != types.TRYOPEN { return errorsmod.Wrapf( types.ErrInvalidConnectionState, - "connection state is not TRYOPEN (got %s)", connection.State.String(), + "connection state is not TRYOPEN (got %s)", connection.State, ) } @@ -288,7 +288,7 @@ func (k *Keeper) ConnOpenConfirm( // Update ChainB's connection to Open connection.State = types.OPEN k.SetConnection(ctx, connectionID, connection) - k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.TRYOPEN.String(), "new-state", types.OPEN.String()) + k.Logger(ctx).Info("connection state updated", "connection-id", connectionID, "previous-state", types.TRYOPEN, "new-state", types.OPEN) defer telemetry.IncrCounter(1, "ibc", "connection", "open-confirm") diff --git a/modules/core/04-channel/keeper/grpc_query.go b/modules/core/04-channel/keeper/grpc_query.go index f15a232d911..215c02a8da7 100644 --- a/modules/core/04-channel/keeper/grpc_query.go +++ b/modules/core/04-channel/keeper/grpc_query.go @@ -480,7 +480,7 @@ func (k *Keeper) UnreceivedPackets(c context.Context, req *types.QueryUnreceived default: return nil, status.Error( codes.InvalidArgument, - errorsmod.Wrapf(types.ErrInvalidChannelOrdering, "channel order %s is not supported", channel.Ordering.String()).Error()) + errorsmod.Wrapf(types.ErrInvalidChannelOrdering, "channel order %s is not supported", channel.Ordering).Error()) } selfHeight := clienttypes.GetSelfHeight(ctx) diff --git a/modules/core/04-channel/keeper/handshake.go b/modules/core/04-channel/keeper/handshake.go index 3ea7b36587e..362ab534f2e 100644 --- a/modules/core/04-channel/keeper/handshake.go +++ b/modules/core/04-channel/keeper/handshake.go @@ -89,7 +89,7 @@ func (k *Keeper) WriteOpenInitChannel( k.SetNextSequenceRecv(ctx, portID, channelID, 1) k.SetNextSequenceAck(ctx, portID, channelID, 1) - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.UNINITIALIZED.String(), "new-state", types.INIT.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.UNINITIALIZED, "new-state", types.INIT) defer telemetry.IncrCounter(1, "ibc", "channel", "open-init") @@ -197,7 +197,7 @@ func (k *Keeper) WriteOpenTryChannel( k.SetChannel(ctx, portID, channelID, channel) - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.UNINITIALIZED.String(), "new-state", types.TRYOPEN.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.UNINITIALIZED, "new-state", types.TRYOPEN) defer telemetry.IncrCounter(1, "ibc", "channel", "open-try") @@ -222,7 +222,7 @@ func (k *Keeper) ChanOpenAck( } if channel.State != types.INIT { - return errorsmod.Wrapf(types.ErrInvalidChannelState, "channel state should be INIT (got %s)", channel.State.String()) + return errorsmod.Wrapf(types.ErrInvalidChannelState, "channel state should be INIT (got %s)", channel.State) } if !k.scopedKeeper.AuthenticateCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)) { @@ -272,7 +272,7 @@ func (k *Keeper) WriteOpenAckChannel( channel.Counterparty.ChannelId = counterpartyChannelID k.SetChannel(ctx, portID, channelID, channel) - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.INIT.String(), "new-state", types.OPEN.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.INIT, "new-state", types.OPEN) defer telemetry.IncrCounter(1, "ibc", "channel", "open-ack") @@ -297,7 +297,7 @@ func (k *Keeper) ChanOpenConfirm( if channel.State != types.TRYOPEN { return errorsmod.Wrapf( types.ErrInvalidChannelState, - "channel state is not TRYOPEN (got %s)", channel.State.String(), + "channel state is not TRYOPEN (got %s)", channel.State, ) } @@ -344,7 +344,7 @@ func (k *Keeper) WriteOpenConfirmChannel( channel.State = types.OPEN k.SetChannel(ctx, portID, channelID, channel) - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.TRYOPEN.String(), "new-state", types.OPEN.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.TRYOPEN, "new-state", types.OPEN) defer telemetry.IncrCounter(1, "ibc", "channel", "open-confirm") @@ -390,7 +390,7 @@ func (k *Keeper) ChanCloseInit( return errorsmod.Wrapf(connectiontypes.ErrInvalidConnectionState, "connection state is not OPEN (got %s)", connectionEnd.State) } - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", channel.State.String(), "new-state", types.CLOSED.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", channel.State, "new-state", types.CLOSED) defer telemetry.IncrCounter(1, "ibc", "channel", "close-init") @@ -466,7 +466,7 @@ func (k *Keeper) ChanCloseConfirm( ) } - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", channel.State.String(), "new-state", types.CLOSED.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", channel.State, "new-state", types.CLOSED) defer telemetry.IncrCounter(1, "ibc", "channel", "close-confirm") diff --git a/modules/core/04-channel/keeper/timeout.go b/modules/core/04-channel/keeper/timeout.go index 8d7fdf892ff..e01092960e9 100644 --- a/modules/core/04-channel/keeper/timeout.go +++ b/modules/core/04-channel/keeper/timeout.go @@ -112,7 +112,7 @@ func (k *Keeper) TimeoutPacket( packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence(), ) default: - panic(errorsmod.Wrapf(types.ErrInvalidChannelOrdering, channel.Ordering.String())) + panic(errorsmod.Wrap(types.ErrInvalidChannelOrdering, channel.Ordering.String())) } if err != nil { @@ -308,7 +308,7 @@ func (k *Keeper) TimeoutOnClose( packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence(), ) default: - panic(errorsmod.Wrapf(types.ErrInvalidChannelOrdering, channel.Ordering.String())) + panic(errorsmod.Wrap(types.ErrInvalidChannelOrdering, channel.Ordering.String())) } if err != nil { diff --git a/modules/core/04-channel/keeper/upgrade.go b/modules/core/04-channel/keeper/upgrade.go index 955eed7f2d3..2e7a86b0eb2 100644 --- a/modules/core/04-channel/keeper/upgrade.go +++ b/modules/core/04-channel/keeper/upgrade.go @@ -629,7 +629,7 @@ func (k *Keeper) WriteUpgradeOpenChannel(ctx sdk.Context, portID, channelID stri // delete state associated with upgrade which is no longer required. k.deleteUpgradeInfo(ctx, portID, channelID) - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", previousState.String(), "new-state", types.OPEN.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", previousState, "new-state", types.OPEN) return channel } @@ -707,7 +707,7 @@ func (k *Keeper) WriteUpgradeCancelChannel(ctx sdk.Context, portID, channelID st channel = k.restoreChannel(ctx, portID, channelID, sequence, channel) k.WriteErrorReceipt(ctx, portID, channelID, types.NewUpgradeError(sequence, types.ErrInvalidUpgrade)) - k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", previousState, "new-state", types.OPEN.String()) + k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", previousState, "new-state", types.OPEN) } // ChanUpgradeTimeout times out an outstanding upgrade. diff --git a/modules/light-clients/08-wasm/go.mod b/modules/light-clients/08-wasm/go.mod index ef26ba2dfd0..8efb8cd8e81 100644 --- a/modules/light-clients/08-wasm/go.mod +++ b/modules/light-clients/08-wasm/go.mod @@ -27,7 +27,7 @@ require ( github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-sdk v0.50.7 - github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.0.0 github.com/golang/protobuf v1.5.4 @@ -197,7 +197,7 @@ require ( google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect - google.golang.org/protobuf v1.34.1 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/modules/light-clients/08-wasm/go.sum b/modules/light-clients/08-wasm/go.sum index b3b3cd21701..e1fe879de32 100644 --- a/modules/light-clients/08-wasm/go.sum +++ b/modules/light-clients/08-wasm/go.sum @@ -360,8 +360,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= @@ -1663,8 +1663,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/modules/light-clients/08-wasm/types/gas_register.go b/modules/light-clients/08-wasm/types/gas_register.go index 7119c8f274f..a58453d2b2c 100644 --- a/modules/light-clients/08-wasm/types/gas_register.go +++ b/modules/light-clients/08-wasm/types/gas_register.go @@ -178,7 +178,7 @@ func (g WasmGasRegister) UncompressCosts(byteLength int) storetypes.Gas { // SetupContractCost costs when interacting with a wasm contract. // Set discount to true in cases where you can reasonably assume the contract -// is loaded from an in-memory cache (e.g. pinned contracts or replys). +// is loaded from an in-memory cache (e.g. pinned contracts or replies). func (g WasmGasRegister) SetupContractCost(discount bool, msgLen int) storetypes.Gas { if msgLen < 0 { panic(errorsmod.Wrap(ErrInvalid, "negative length")) @@ -192,7 +192,7 @@ func (g WasmGasRegister) SetupContractCost(discount bool, msgLen int) storetypes // ReplyCosts costs to handle a message reply. // Set discount to true in cases where you can reasonably assume the contract -// is loaded from an in-memory cache (e.g. pinned contracts or replys). +// is loaded from an in-memory cache (e.g. pinned contracts or replies). func (g WasmGasRegister) ReplyCosts(discount bool, reply wasmvmtypes.Reply) storetypes.Gas { var eventGas storetypes.Gas msgLen := len(reply.Result.Err) diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000000..e4e64b8c62e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "ibc-go", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/testing/chain.go b/testing/chain.go index dba7cc23ac6..663e4fe853a 100644 --- a/testing/chain.go +++ b/testing/chain.go @@ -115,7 +115,10 @@ func NewTestChainWithValSet(tb testing.TB, coord *Coordinator, chainID string, v // add sender account balance := banktypes.Balance{ Address: acc.GetAddress().String(), - Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, amount)), + Coins: sdk.NewCoins( + sdk.NewCoin(sdk.DefaultBondDenom, amount), + sdk.NewCoin(SecondaryDenom, amount), + ), } genAccs = append(genAccs, acc) diff --git a/testing/values.go b/testing/values.go index 0f14f41a081..e8e6dd006e7 100644 --- a/testing/values.go +++ b/testing/values.go @@ -55,9 +55,11 @@ var ( // DefaultTrustLevel sets params variables used to create a TM client DefaultTrustLevel = ibctm.DefaultTrustLevel - TestAccAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs" - TestCoin = sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100)) - TestCoins = sdk.NewCoins(TestCoin) + TestAccAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs" + TestCoin = sdk.NewCoin(sdk.DefaultBondDenom, sdkmath.NewInt(100)) + TestCoins = sdk.NewCoins(TestCoin) + SecondaryDenom = "ufoo" + SecondaryTestCoin = sdk.NewCoin(SecondaryDenom, sdkmath.NewInt(100)) UpgradePath = []string{"upgrade", "upgradedIBCState"}