diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffffe3a4dae..06b91b20c75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,8 @@ name: Release on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+-?[a-z0-9]*' # Push events to matching v*, i.e. v1.0.0, v20.15.10, v3.0.0-alpha1 + - 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0.0, v20.15.10 + - 'v[0-9]+.[0-9]+.[0-9]+-?[a-z0-9]+' # Push events to matching v*-[alpha/beta/rc], i.e. v3.0.0-alpha1, v3.0.0-beta1, v3.0.0-rc0 jobs: goreleaser: @@ -14,7 +15,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: go-version: '1.17' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fdcc086ae4f..31ef80c80f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: install-tparse: runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v2.1.5 + - uses: actions/setup-go@v3 with: go-version: 1.17 - name: Display go version @@ -26,7 +26,7 @@ jobs: - name: install tparse run: | export GO111MODULE="on" && go get github.com/mfridman/tparse@v0.8.3 - - uses: actions/cache@v2.1.7 + - uses: actions/cache@v3 with: path: ~/go/bin key: ${{ runner.os }}-go-tparse-binary @@ -38,7 +38,7 @@ jobs: go-arch: ["amd64", "arm", "arm64"] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2.1.5 + - uses: actions/setup-go@v3 with: go-version: 1.17 - uses: technote-space/get-diff-action@v6.0.1 @@ -60,19 +60,19 @@ jobs: - name: Split pkgs into 4 files run: split -d -n l/4 pkgs.txt pkgs.txt.part. # cache multiple - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: "${{ github.sha }}-00" path: ./pkgs.txt.part.00 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: "${{ github.sha }}-01" path: ./pkgs.txt.part.01 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: "${{ github.sha }}-02" path: ./pkgs.txt.part.02 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: "${{ github.sha }}-03" path: ./pkgs.txt.part.03 @@ -86,7 +86,7 @@ jobs: part: ["00", "01", "02", "03"] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v2.1.5 + - uses: actions/setup-go@v3 with: go-version: 1.17 - uses: technote-space/get-diff-action@v6.0.1 @@ -95,7 +95,7 @@ jobs: **/**.go go.mod go.sum - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-${{ matrix.part }}" if: env.GIT_DIFF @@ -103,7 +103,7 @@ jobs: run: | cat pkgs.txt.part.${{ matrix.part }} | xargs go test -race -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock' if: env.GIT_DIFF - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: "${{ github.sha }}-${{ matrix.part }}-coverage" path: ./${{ matrix.part }}profile.out @@ -119,19 +119,19 @@ jobs: **/**.go go.mod go.sum - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-00-coverage" if: env.GIT_DIFF - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-01-coverage" if: env.GIT_DIFF - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-02-coverage" if: env.GIT_DIFF - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: "${{ github.sha }}-03-coverage" if: env.GIT_DIFF @@ -150,7 +150,7 @@ jobs: sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt done if: env.GIT_DIFF - - uses: codecov/codecov-action@v2.1.0 + - uses: codecov/codecov-action@v3 with: file: ./coverage.txt if: env.GIT_DIFF diff --git a/.goreleaser.yml b/.goreleaser.yml index a1df128c661..63ecd8822e7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -24,6 +24,7 @@ checksum: release: mode: keep-existing + prerelease: auto archives: - name_template: "{{ .ProjectName }}_simd_v{{ .Version }}_{{ .Os }}_{{ .Arch }}" @@ -32,4 +33,4 @@ archives: - README.md - RELEASES.md - SECURITY.md - - CHANGELOG.md \ No newline at end of file + - CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c2190232888..d243bcb0286 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,11 +38,20 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Dependencies +* [\#1247](https://github.com/cosmos/ibc-go/pull/1247) Bump SDK version to v0.45.3 and Tendermint to version 0.34.19 + ### API Breaking +* (transfer) [\#1250](https://github.com/cosmos/ibc-go/pull/1250) Deprecate `GetTransferAccount` since the `transfer` module account is never used. + ### State Machine Breaking ### Improvements + +* (middleware) [\#1022](https://github.com/cosmos/ibc-go/pull/1022) Add `GetAppVersion` to the ICS4Wrapper interface. This function should be used by IBC applications to obtain their own version since the version set in the channel structure may be wrapped many times by middleware. +* (modules/core/04-channel) [\#1160](https://github.com/cosmos/ibc-go/pull/1160) Improve `uint64 -> string` performance in `Logger`. +* (modules/core/04-channel) [\#1232](https://github.com/cosmos/ibc-go/pull/1232) Updating params on `NewPacketId` and moving to bottom of file. +* (modules/core/04-channel) [\#1279](https://github.com/cosmos/ibc-go/pull/1279) Add selected channel version to MsgChanOpenInitResponse and MsgChanOpenTryResponse. Emit channel version during OpenInit/OpenTry * (modules/light-clients/07-tendermint) [\#1118](https://github.com/cosmos/ibc-go/pull/1118) Deprecating `AllowUpdateAfterExpiry and AllowUpdateAfterMisbehaviour`. See ADR-026 for context. * (modules/core/02-client) [\#1188](https://github.com/cosmos/ibc-go/pull/1188/files) Routing `MsgSubmitMisbehaviour` to `UpdateClient` keeper function. Deprecating `SubmitMisbehaviour` endpoint. * (modules/core/02-client) [\#1208](https://github.com/cosmos/ibc-go/pull/1208) Replace `CheckHeaderAndUpdateState` usage in 02-client with calls to `VerifyClientMessage`, `CheckForMisbehaviour`, `UpdateStateOnMisbehaviour` and `UpdateState`. @@ -58,9 +67,16 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* [\#276](https://github.com/cosmos/ibc-go/pull/276) Adding the Fee Middleware module v1 +* (apps/29-fee) [\#1229](https://github.com/cosmos/ibc-go/pull/1229) Adding CLI commands for getting all unrelayed incentivized packets and packet by packet-id. +* (apps/29-fee) [\#1224](https://github.com/cosmos/ibc-go/pull/1224) Adding Query/CounterpartyAddress and CLI to ICS29 fee middleware +* (apps/29-fee) [\#1225](https://github.com/cosmos/ibc-go/pull/1225) Adding Query/FeeEnabledChannel and Query/FeeEnabledChannels with CLIs to ICS29 fee middleware. +* (modules/apps/29-fee) [\#1230](https://github.com/cosmos/ibc-go/pull/1230) Adding CLI command for getting incentivized packets for a specific channel-id. + ### Bug Fixes * (modules/core/04-channel) [\#1130](https://github.com/cosmos/ibc-go/pull/1130) Call `packet.GetSequence()` rather than passing func in `WriteAcknowledgement` log output +* (apps/29-fee) [\#1278](https://github.com/cosmos/ibc-go/pull/1278) The URI path for the query to get all incentivized packets for a specifc channel did not follow the same format as the rest of queries. ## [v3.0.0](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0) - 2022-03-15 diff --git a/README.md b/README.md index 61e1ab0c139..ff3e074b04f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# ibc-go +
+

ibc-go

+
+ +![banner](docs/ibc-go-image.png) +
Version diff --git a/RELEASES.md b/RELEASES.md index 27f0874c650..c92cc13aed0 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -21,6 +21,38 @@ To summarize: **All our ibc-go releases allow chains to communicate successfully We ensure all major releases are supported by relayers ([hermes](https://github.com/informalsystems/ibc-rs), [rly](https://github.com/strangelove-ventures/relayer) and [ts-relayer](https://github.com/confio/ts-relayer) at the moment) which can relay between the new major release and older releases. We have no plans of upgrading to an IBC protocol specification v2.0, as this would be very disruptive to the ecosystem. +## Release cycle + +IBC-Go follows a traditional release cycle involving an alpha, beta, and rc (release candidate) releases before finalizing a new version. As ibc-go works in a non-traditional area, we apply our own interpretation to each release type. We reserve the right to make both go API breaking changes and state machine breaking changes throughout the entire release cycle. The stable release guarentees do not go into affect until a final release is performed. + +It is never advisable to use a non-final release in production. + +### Alpha + +Alpha releases are intended to make available new features as soon as they are functional. No correctness guarentees are made and alpha releases **may** contain serious security vulnerabilities, bugs, and lack of user tooling, so long as they don't affect the core functionality. + +Initial users of alpha releases are expected to be advanced, patient, and capable of handling unusual errors. Very basic integration testing will be performed by the ibc-go development team before alpha releases. + +An internal audit is typically performed before the alpha release allowing the development team to guage the maturity and stability of changes included in the next release. + +### Beta + +Beta releases are intended to signal design stability. While the go API is still subject to change, the core design of the new features should not be. Developers integrating the new features should expect to handle breaking changes when upgrading to RC's. + +Beta releases should not be made with known bugs or security vulnerabilities. Beta releases should focus on ironing out remaining bugs and filling out the UX functionality required by a final release. Beta releases should have a clearly defined scope of the features that will be included in the release. Only highly requested feature additions should be acted upon in this phase. + +When the development team has determined a release is ready to enter the RC phase, a final security audit should be performed. The security audit should be limited to looking for bugs and security vulnerabilities. Code improvements may be noted, but they should not be acted upon unless highly desirable. + +### RC + +RC's are release candidates. Final releases should contain little to no changes in comparison to the latest RC. Changes included in between RC releases should be limited to: +- Improved testing +- UX additions +- Bug fixes +- Highly requested changes by the community + +A release should not be finalized until the development team and the external community have done sufficient integration tests on the targeted release. + ## Stable Release Policy The beginning of a new major release series is marked by the release of a new major version. A major release series is comprised of all minor and patch releases made under the same major version number. The series continues to receive bug fixes (released as minor or patch releases) until it reaches end of life. The date when a major release series reaches end of life is determined by one of the two following methods: @@ -33,9 +65,11 @@ Only the following major release series have a stable release status: |Release|End of Life Date| |-------|-------| -|`v1.1.x`|July 01, 2022| -|`v1.2.x`|July 01, 2022| -|`v2.0.x`|February 01, 2023| +|`v1.3.x`|July 01, 2022| +|`v1.4.x`|July 01, 2022| +|`v2.1.x`|February 01, 2023| +|`v2.2.x`|February 01, 2023| +|`v3.0.x`|March 15, 2023| **Note**: The v1 major release series will reach end of life 6 months after merging this policy. v2 will reach end of life one year after merging this policy. diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 8e83c7c7cd3..bdd58cd8d72 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -42,10 +42,30 @@ module.exports = { "label": "v1.2.0", "key": "v1.2.0" }, + { + "label": "v1.3.0", + "key": "v1.3.0" + }, + { + "label": "v1.4.0", + "key": "v1.4.0" + }, { "label": "v2.0.0", "key": "v2.0.0" - } + } , + { + "label": "v2.1.0", + "key": "v2.1.0" + }, + { + "label": "v2.2.0", + "key": "v2.2.0" + }, + { + "label": "v3.0.0", + "key": "v3.0.0" + } ], topbar: { banner: true diff --git a/docs/apps/interchain-accounts/requirements.md b/docs/apps/interchain-accounts/requirements.md new file mode 100644 index 00000000000..fff919f8088 --- /dev/null +++ b/docs/apps/interchain-accounts/requirements.md @@ -0,0 +1,119 @@ +# Business requirements + +> **TL;DR**: Rather than creating an IBC application to expose cross-chain access to every module's features, the Interchain Accounts feature would allow to leverage the capabilities of an account to access a blockchain's application-specific features. + +## Problem + +Without Interchain Accounts, cross-chain access to chain-specific features (such as staking, sending, voting, etc) has to be built as separate applications on top of the IBC TAO (Transport, Authentication, Ordering) layer. Creating new IBC application standards and implementations for each application-specific feature requires considerable time and resources. Interchain Accounts will allow new chain-specific features to be immediately available over IBC. + +## Objectives + +Provide a way to programmatically create accounts on a destination blockchain (called the host) and control them via transactions over IBC. An IBC packet will take a message from the controller blockchain to the host blockchain where it will be executed. This will allow new features on a blockchain to be immediately supported as IBC transactions, since the (destination blockchain) native messages are encapsulated in an IBC packet in an agnostic way. This will allow all of the modules on a chain to take advantage of the network effects created by the IBC ecosystem. + +## Scope + +| Features | Release | +| --------- | ------- | +| Deterministically create a new interchain account over IBC on the host chain. | v1 | +| Send over IBC a packet that contains the message to be executed by the interchain account on the host. | v1 | + +# User requirements + +## Use cases + +### Injective <> Band Chain + +Currently, Injective sends an IBC transaction to Band Chain via their custom IBC oracle module, which is a data request. When this IBC packet is executed on Band Chain, validators on Band Chain fetch prices for 10 different markets. A random selection of validators will post this selection on-chain. Once a minimum quorum has been reached, an IBC packet is sent to Injective with the prices of markets. The roundtrip latency of this flow is around 30 seconds when things go well (no packet timeouts or delays in validation). + +However, Injective wants to minimise as much as possible the latency between real world price updates and price updates on Injective. They can simplify this two-transaction flow to a single transaction using Interchain Accounts: Injective opens an interchain account on Band Chain, which would be able to pay for a continuous set of update transactions and maintain a standing request for the prices of marke. This would simplify the transaction flow to a single transaction, and introduce a simple flow to update the standing request if necessary. + +### Umee <> Cosmos Hub + +Users on the Hub would send their ATOM to Umee. In return, the user gets equivalent amount of meTokens (this token would be a form of a liquid staking token), which could then be staked on the Hub, in some other liquidity pool, etc, in addition to other business logic which Umee could perform on behalf of the users in return for the ATOM. + +Umee then stakes these ATOM tokens on the Hub on behalf of Umee (ATOMs get inflation rewards, etc). Without Interchain Accounts, Umee would have to use validator controlled multisig, because for this flow Umee needs an account on the Hub which can be controlled externally in a decentralised way. With Interchain Accounts, Umee can register an interchain account on the Hub and then receive the staking rewards for the ATOM, figure out distribution back to Umee chain, and send back to the corresponding existing account on Umee. + +### Hub custodial services + +The problem the Cosmos ecosystem faces is fragmentation of services. When a new chain goes live, they need to talk to custodial solutions and exchanges to integrate. Many exchanges and custodial solutions don't want to integrate tens of chains unless paid in advance. + +An alternative is offering the custodial service through the Hub. When a new chain goes live, the tokens of the chain are transferred through IBC to the Hub. This means that the custodial service would just have to integrate with one chain (the Hub), rather with an arbitrary number of them. + +Using Interchain Accounts, a service could be built in which a user sends tokens to an interchain account address on chain `X`, which corresponds to the registered interchain account of chain `X` on the Hub. This account would handle the token transfer to the Hub and then further on to the custodial wallet. + +# Functional requirements + +## Assumptions + +1. Interchain account packets will rarely timeout with application-set values. +2. Cosmos-SDK modules deployed on a chain are not malicious. +3. Authentication modules may implement their own permissioning scheme. + +## Features + +### 1 - Configuration + +| ID | Description | Verification | Status | +| --- | ----------- | ------------ | ------ | +| 1.01 | A chain shall have the ability to enable or disable Interchain Accounts controller functionality in the genesis state. | The controller parameters have a [flag](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/types/host.pb.go#L30) to enable/disable the controller submodule, and this flag [is stored during genesis initialization](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/params.go#L24). | `Implemented` | +| 1.02 | A chain shall have the ability to export the Interchain Accounts controller genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go#L47) | `Implemented` | +| 1.03 | A chain shall have the ability to initialize the Interchain Accounts controller genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go#L10) | `Implemented` | +| 1.04 | A chain shall have the ability to set the Interchain Accounts controller parameters when upgrading or via proposal. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/module_test.go#L33) | `Implemented` | +| 1.05 | A chain shall have the ability to enable or disable Interchain Accounts host functionality in the genesis state. | The host parameters have a [flag](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/types/host.pb.go#L30) to enable/disable the host submodule, and this flag [is stored during genesis initialization](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/params.go#L31) | `Implemented` | +| 1.06 | A chain shall have the ability to export the Interchain Accounts host genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go#L46) | `Implemented` | +| 1.07 | A chain shall have the ability to initialize the Interchain Accounts host genesis state. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go#L10) | `Implemented` | +| 1.08 | A chain shall have the ability to set the Interchain Accounts host parameters when upgrading or via proposal. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/module_test.go#L33) | `Implemented` | +| 1.09 | The host chain shall have the ability to whitelist what types of messages or transactions that it chooses to facilitate (e.g. it can decide that registered interchain accounts cannot execute staking messages). | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/params_test.go#L5) | `Implemented` | + +### 2 - Registration + +| ID | Description | Verification | Status | +| --- | ----------- | ------------ | ------ | +| 2.01 | The controller chain can programmatically create interchain accounts on the host chain that shall be controlled only by the owner account on the controller chain. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/account_test.go#L10) | `Implemented` | +| 2.02 | An interchain account shall be created by any actor without the approval of a third party (e.g. chain governance). | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/account_test.go#L10) | `Implemented` | + +### 3 - Control + +| ID | Description | Verification | Status | +| --- | ----------- | ------------ | ------ | +| 3.01 | The controller chain can programmatically control the interchain account by submitting transactions to be executed on the host chain on the behalf of the interchain account. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/relay_test.go#L29) | `Implemented` | +| 3.02 | Under no circumstances shall the owner account on the controller chain irretrievably lose control over the registered interchain account on the host chain. | If the channel between controller and host closes, then [a relayer can open a new channel on the existing controller port](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account.go#L16-L17). | `Implemented` | + +### 4 - Host execution + +| ID | Description | Verification | Status | +| --- | ----------- | ------------ | ------ | +| 4.01 | Transactions shall be executed by an interchain account on the host chain in exactly the same order in which they are submitted by the controller chain. | IBC packets with SDK messages will be sent from the controller to the host over an [ordered channel](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account.go#L60). | `Implemented` | +| 4.02 | The host shall execute only messages in the allow list. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay_test.go#L340) | `Implemented` | +| 4.03 | The controller chain shall know how the host chain will handle the transaction bytes in advance. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go#L109-L133) | `Implemented` | +| 4.04 | Each transaction submitted by the controller chain shall be executed only once by the interchain account on the host chain. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay_test.go#L248) | `Implemented` | + +# Non-functional requirements + +## 5 - Security + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 5.01 | There shall be no means for the interchain account to execute transactions that have not been submitted first by the respective owner account on the controller chain. |[Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay_test.go#L361) | `Implemented` | +| 5.02 | Every interchain account on the host chain shall have one and only one respective owner account on the controller chain. | The interchain account on the host [is generated using the host connection ID and the address of the owner on the controller](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/handshake.go#L73-L76). | `Implemented` | +| 5.03 | The owner account on a controller chain shall not be able to control interchain accounts registered by other owner accounts on the same controller chain. | Before the host logic executes the received messages, it [retrieves the interchain account associated with the port ID](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/keeper/relay.go#L94) over which it received the message. For owner address B to be able to execute a message with the interchain account registered with owner address A, it would need to send the messages over a channel that binds to a port ID that contains the owner address A, and since we have assumption number 3, this should not be allowed by applications. | `Implemented` | +| 5.04 | A controller chain shall not be able to control interchain accounts registered by owner accounts on different controller chains. | Same as 5.03. | `Implemented` | | +| 5.05 | Each interchain account on the host chain is owned by a single owner account on the controller chain. It shall not be possible to register a second interchain account with the same owner account on the controller chain. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account_test.go#L42) | `Implemented` | + +# External interface requirements + +## 6 - CLI + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 6.01 | There shall be a CLI command available to query the host parameters. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/client/cli/query.go#L22) | `Implemented` | +| 6.02 | There shall be a CLI command available to query the receive packet events on the host chain to check the result of the execution of the message on the host. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/host/client/cli/query.go#L51) | `Implemented` | +| 6.03 | There shall be a CLI command available to query the controller parameters. | [Acceptance tests](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/client/cli/query.go#L15) | `Implemented` | + + +## 7 - Application developers + +| ID | Description | Verification | Status | +| -- | ----------- | ------------ | ------ | +| 7.01 | An IBC application developer shall be able to develop an Interchain Accounts authentication module that can register interchain accounts. | The [`RegisterInterchainAccount` function](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/account.go#L18) is the entry point to registering an interchain account. | `Implemented` | +| 7.02 | An IBC application developer shall be able to develop an Interchain Accounts authentication module that can send messages from the controller to the host. | The [`SendTx` function](https://github.com/cosmos/ibc-go/blob/v3.0.0/modules/apps/27-interchain-accounts/controller/keeper/relay.go#L18) takes pre-built packet data containing messages to be executed on the host chain from an authentication module and attempts to send the packet. | `Implemented` | \ No newline at end of file diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 091ba899dc6..edfbea4f0c8 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -30,6 +30,7 @@ To suggest an ADR, please make use of the [ADR template](./adr-template.md) prov | [001](./adr-001-coin-source-tracing.md) | ICS-20 coin denomination format | Accepted, Implemented | | [002](./adr-002-go-module-versioning.md) | Go module versioning | Accepted | | [003](./adr-003-ics27-acknowledgement.md) | ICS27 acknowledgement format | Accepted | +| [004](./adr-004-ics29-lock-fee-module.md) | ICS29 module locking upon escrow out of balance | Accepted | | [015](./adr-015-ibc-packet-receiver.md) | IBC Packet Routing | Accepted | | [025](./adr-025-ibc-passive-channels.md) | IBC passive channels | Deprecated | | [026](./adr-026-ibc-client-recovery-mechanisms.md) | IBC client recovery mechansisms | Accepted | diff --git a/docs/architecture/adr-004-ics29-lock-fee-module.md b/docs/architecture/adr-004-ics29-lock-fee-module.md new file mode 100644 index 00000000000..5b17717e669 --- /dev/null +++ b/docs/architecture/adr-004-ics29-lock-fee-module.md @@ -0,0 +1,55 @@ +# ADR 004: Lock fee module upon escrow out of balance + +## Changelog +* 03/03/2022: initial draft + +## Status + +Accepted + +## Context + +The fee module maintains an escrow account for all fees escrowed to incentivize packet relays. +It also tracks each packet fee escrowed separately from the escrow account. This is because the escrow account only maintains a total balance. It has no reference for which coins belonged to which packet fee. +In the presence of a severe bug, it is possible the escrow balance will become out of sync with the packet fees marked as escrowed. +The ICS29 module should be capable of elegantly handling such a scenario. + +## Decision + +We will allow for the ICS29 module to become "locked" if the escrow balance is determined to be out of sync with the packet fees marked as escrowed. +A "locked" fee module will not allow for packet escrows to occur nor will it distribute fees. All IBC callbacks will skip performing fee logic, similar to fee disabled channels. + +Manual intervention will be needed to unlock the fee module. + +### Sending side + +Special behaviour will have to be accounted for in `OnAcknowledgementPacket`. Since the counterparty will continue to send incentivized acknowledgements for fee enabled channels, the acknowledgement will still need to be unmarshalled into an incentivized acknowledgement before calling the underlying application `OnAcknowledgePacket` callback. + +When distributing fees, a cached context should be used. If the escrow account balance would become negative, the current state changes should be discarded and the fee module should be locked using the uncached context. This prevents fees from being partially distributed for a given packetID. + +### Receiving side + +`OnRecvPacket` should remain unaffected by the fee module becoming locked since escrow accounts only affect the sending side. + +## Consequences + +### Positive + +The fee module can be elegantly disabled in the presence of severe bugs. + +### Negative + +Extra logic is added to account for edge cases which are only possible in the presence of bugs. + +### Neutral + +## References + +Issues: +- [#821](https://github.com/cosmos/ibc-go/issues/821) +- [#860](https://github.com/cosmos/ibc-go/issues/860) + +PR's: +- [#1031](https://github.com/cosmos/ibc-go/pull/1031) +- [#1029](https://github.com/cosmos/ibc-go/pull/1029) +- [#1056](https://github.com/cosmos/ibc-go/pull/1056) diff --git a/docs/ibc-go-image.png b/docs/ibc-go-image.png new file mode 100644 index 00000000000..649c879bad9 Binary files /dev/null and b/docs/ibc-go-image.png differ diff --git a/docs/ibc/apps.md b/docs/ibc/apps.md index bb2716fa0b1..f729d7dfd71 100644 --- a/docs/ibc/apps.md +++ b/docs/ibc/apps.md @@ -464,13 +464,13 @@ which implements everything discussed above. Here are the useful parts of the module to look at: [Binding to transfer -port](https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/types/genesis.go) +port](https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/keeper/genesis.go) [Sending transfer packets](https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/keeper/relay.go) [Implementing IBC -callbacks](https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/module.go) +callbacks](https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/ibc_module.go) ## Next {hide} diff --git a/docs/ibc/middleware/develop.md b/docs/ibc/middleware/develop.md index 1d75e3965a8..705040b1db7 100644 --- a/docs/ibc/middleware/develop.md +++ b/docs/ibc/middleware/develop.md @@ -49,6 +49,7 @@ type Middleware interface { type ICS4Wrapper interface { SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.Packet) error WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet exported.Packet, ack []byte) error + GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) } ``` @@ -239,4 +240,24 @@ func SendPacket(appPacket channeltypes.Packet) { return ics4Keeper.SendPacket(packet) } + +// middleware must return the underlying application version +func GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + version, found := ics4Keeper.GetAppVersion(ctx, portID, channelID) + if !found { + return "", false + } + + if !MiddlewareEnabled { + return version, true + } + + // unwrap channel version + metadata, err := Unmarshal(version) + if err != nil { + panic(fmt.Errof("unable to unmarshal version: %w", err)) + } + + return metadata.AppVersion, true +} ``` diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 32b500639a3..30722206dc7 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -4,6 +4,95 @@ ## Table of Contents +- [ibc/applications/fee/v1/ack.proto](#ibc/applications/fee/v1/ack.proto) + - [IncentivizedAcknowledgement](#ibc.applications.fee.v1.IncentivizedAcknowledgement) + +- [ibc/core/client/v1/client.proto](#ibc/core/client/v1/client.proto) + - [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) + - [ClientUpdateProposal](#ibc.core.client.v1.ClientUpdateProposal) + - [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) + - [Height](#ibc.core.client.v1.Height) + - [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) + - [Params](#ibc.core.client.v1.Params) + - [UpgradeProposal](#ibc.core.client.v1.UpgradeProposal) + +- [ibc/core/channel/v1/channel.proto](#ibc/core/channel/v1/channel.proto) + - [Acknowledgement](#ibc.core.channel.v1.Acknowledgement) + - [Channel](#ibc.core.channel.v1.Channel) + - [Counterparty](#ibc.core.channel.v1.Counterparty) + - [IdentifiedChannel](#ibc.core.channel.v1.IdentifiedChannel) + - [Packet](#ibc.core.channel.v1.Packet) + - [PacketId](#ibc.core.channel.v1.PacketId) + - [PacketState](#ibc.core.channel.v1.PacketState) + + - [Order](#ibc.core.channel.v1.Order) + - [State](#ibc.core.channel.v1.State) + +- [ibc/applications/fee/v1/fee.proto](#ibc/applications/fee/v1/fee.proto) + - [Fee](#ibc.applications.fee.v1.Fee) + - [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) + - [PacketFee](#ibc.applications.fee.v1.PacketFee) + - [PacketFees](#ibc.applications.fee.v1.PacketFees) + +- [ibc/applications/fee/v1/genesis.proto](#ibc/applications/fee/v1/genesis.proto) + - [FeeEnabledChannel](#ibc.applications.fee.v1.FeeEnabledChannel) + - [ForwardRelayerAddress](#ibc.applications.fee.v1.ForwardRelayerAddress) + - [GenesisState](#ibc.applications.fee.v1.GenesisState) + - [RegisteredRelayerAddress](#ibc.applications.fee.v1.RegisteredRelayerAddress) + +- [ibc/applications/fee/v1/metadata.proto](#ibc/applications/fee/v1/metadata.proto) + - [Metadata](#ibc.applications.fee.v1.Metadata) + +- [ibc/applications/fee/v1/query.proto](#ibc/applications/fee/v1/query.proto) + - [QueryCounterpartyAddressRequest](#ibc.applications.fee.v1.QueryCounterpartyAddressRequest) + - [QueryCounterpartyAddressResponse](#ibc.applications.fee.v1.QueryCounterpartyAddressResponse) + - [QueryFeeEnabledChannelRequest](#ibc.applications.fee.v1.QueryFeeEnabledChannelRequest) + - [QueryFeeEnabledChannelResponse](#ibc.applications.fee.v1.QueryFeeEnabledChannelResponse) + - [QueryFeeEnabledChannelsRequest](#ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest) + - [QueryFeeEnabledChannelsResponse](#ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse) + - [QueryIncentivizedPacketRequest](#ibc.applications.fee.v1.QueryIncentivizedPacketRequest) + - [QueryIncentivizedPacketResponse](#ibc.applications.fee.v1.QueryIncentivizedPacketResponse) + - [QueryIncentivizedPacketsForChannelRequest](#ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest) + - [QueryIncentivizedPacketsForChannelResponse](#ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse) + - [QueryIncentivizedPacketsRequest](#ibc.applications.fee.v1.QueryIncentivizedPacketsRequest) + - [QueryIncentivizedPacketsResponse](#ibc.applications.fee.v1.QueryIncentivizedPacketsResponse) + - [QueryTotalAckFeesRequest](#ibc.applications.fee.v1.QueryTotalAckFeesRequest) + - [QueryTotalAckFeesResponse](#ibc.applications.fee.v1.QueryTotalAckFeesResponse) + - [QueryTotalRecvFeesRequest](#ibc.applications.fee.v1.QueryTotalRecvFeesRequest) + - [QueryTotalRecvFeesResponse](#ibc.applications.fee.v1.QueryTotalRecvFeesResponse) + - [QueryTotalTimeoutFeesRequest](#ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest) + - [QueryTotalTimeoutFeesResponse](#ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse) + + - [Query](#ibc.applications.fee.v1.Query) + +- [ibc/applications/fee/v1/tx.proto](#ibc/applications/fee/v1/tx.proto) + - [MsgPayPacketFee](#ibc.applications.fee.v1.MsgPayPacketFee) + - [MsgPayPacketFeeAsync](#ibc.applications.fee.v1.MsgPayPacketFeeAsync) + - [MsgPayPacketFeeAsyncResponse](#ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse) + - [MsgPayPacketFeeResponse](#ibc.applications.fee.v1.MsgPayPacketFeeResponse) + - [MsgRegisterCounterpartyAddress](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddress) + - [MsgRegisterCounterpartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse) + + - [Msg](#ibc.applications.fee.v1.Msg) + +- [ibc/applications/interchain_accounts/controller/v1/controller.proto](#ibc/applications/interchain_accounts/controller/v1/controller.proto) + - [Params](#ibc.applications.interchain_accounts.controller.v1.Params) + +- [ibc/applications/interchain_accounts/controller/v1/query.proto](#ibc/applications/interchain_accounts/controller/v1/query.proto) + - [QueryParamsRequest](#ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest) + - [QueryParamsResponse](#ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse) + + - [Query](#ibc.applications.interchain_accounts.controller.v1.Query) + +- [ibc/applications/interchain_accounts/host/v1/host.proto](#ibc/applications/interchain_accounts/host/v1/host.proto) + - [Params](#ibc.applications.interchain_accounts.host.v1.Params) + +- [ibc/applications/interchain_accounts/host/v1/query.proto](#ibc/applications/interchain_accounts/host/v1/query.proto) + - [QueryParamsRequest](#ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) + - [QueryParamsResponse](#ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) + + - [Query](#ibc.applications.interchain_accounts.host.v1.Query) + - [ibc/applications/interchain_accounts/v1/account.proto](#ibc/applications/interchain_accounts/v1/account.proto) - [InterchainAccount](#ibc.applications.interchain_accounts.v1.InterchainAccount) @@ -42,15 +131,6 @@ - [Query](#ibc.applications.transfer.v1.Query) -- [ibc/core/client/v1/client.proto](#ibc/core/client/v1/client.proto) - - [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) - - [ClientUpdateProposal](#ibc.core.client.v1.ClientUpdateProposal) - - [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) - - [Height](#ibc.core.client.v1.Height) - - [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) - - [Params](#ibc.core.client.v1.Params) - - [UpgradeProposal](#ibc.core.client.v1.UpgradeProposal) - - [ibc/applications/transfer/v1/tx.proto](#ibc/applications/transfer/v1/tx.proto) - [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) - [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) @@ -60,17 +140,6 @@ - [ibc/applications/transfer/v2/packet.proto](#ibc/applications/transfer/v2/packet.proto) - [FungibleTokenPacketData](#ibc.applications.transfer.v2.FungibleTokenPacketData) -- [ibc/core/channel/v1/channel.proto](#ibc/core/channel/v1/channel.proto) - - [Acknowledgement](#ibc.core.channel.v1.Acknowledgement) - - [Channel](#ibc.core.channel.v1.Channel) - - [Counterparty](#ibc.core.channel.v1.Counterparty) - - [IdentifiedChannel](#ibc.core.channel.v1.IdentifiedChannel) - - [Packet](#ibc.core.channel.v1.Packet) - - [PacketState](#ibc.core.channel.v1.PacketState) - - - [Order](#ibc.core.channel.v1.Order) - - [State](#ibc.core.channel.v1.State) - - [ibc/core/channel/v1/genesis.proto](#ibc/core/channel/v1/genesis.proto) - [GenesisState](#ibc.core.channel.v1.GenesisState) - [PacketSequence](#ibc.core.channel.v1.PacketSequence) @@ -268,23 +337,24 @@ - +

Top

-## ibc/applications/interchain_accounts/v1/account.proto +## ibc/applications/fee/v1/ack.proto - + -### InterchainAccount -An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +### IncentivizedAcknowledgement +IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | -| `account_owner` | [string](#string) | | | +| `result` | [bytes](#bytes) | | the underlying app acknowledgement result bytes | +| `forward_relayer_address` | [string](#string) | | the relayer address which submits the recv packet message | +| `underlying_app_success` | [bool](#bool) | | success flag of the base application callback | @@ -300,130 +370,138 @@ An InterchainAccount is defined as a BaseAccount & the address of the account ow - +

Top

-## ibc/applications/interchain_accounts/v1/genesis.proto +## ibc/core/client/v1/client.proto - + -### ActiveChannel -ActiveChannel contains a connection ID, port ID and associated active channel ID +### ClientConsensusStates +ClientConsensusStates defines all the stored consensus states for a given +client. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `connection_id` | [string](#string) | | | -| `port_id` | [string](#string) | | | -| `channel_id` | [string](#string) | | | +| `client_id` | [string](#string) | | client identifier | +| `consensus_states` | [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) | repeated | consensus states and their heights associated with the client | - + -### ControllerGenesisState -ControllerGenesisState defines the interchain accounts controller genesis state +### ClientUpdateProposal +ClientUpdateProposal is a governance proposal. If it passes, the substitute +client's latest consensus state is copied over to the subject client. The proposal +handler may fail if the subject and the substitute do not match in client and +chain parameters (with exception to latest height, frozen height, and chain-id). | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | | -| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | | -| `ports` | [string](#string) | repeated | | -| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | | +| `title` | [string](#string) | | the title of the update proposal | +| `description` | [string](#string) | | the description of the proposal | +| `subject_client_id` | [string](#string) | | the client identifier for the client to be updated if the proposal passes | +| `substitute_client_id` | [string](#string) | | the substitute client identifier for the client standing in for the subject client | - + -### GenesisState -GenesisState defines the interchain accounts genesis state +### ConsensusStateWithHeight +ConsensusStateWithHeight defines a consensus state with an additional height +field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `controller_genesis_state` | [ControllerGenesisState](#ibc.applications.interchain_accounts.v1.ControllerGenesisState) | | | -| `host_genesis_state` | [HostGenesisState](#ibc.applications.interchain_accounts.v1.HostGenesisState) | | | +| `height` | [Height](#ibc.core.client.v1.Height) | | consensus state height | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state | - + -### HostGenesisState -HostGenesisState defines the interchain accounts host genesis state +### Height +Height is a monotonically increasing data type +that can be compared against another Height for the purposes of updating and +freezing clients + +Normally the RevisionHeight is incremented at each height while keeping +RevisionNumber the same. However some consensus algorithms may choose to +reset the height in certain conditions e.g. hard forks, state-machine +breaking changes In these cases, the RevisionNumber is incremented so that +height continues to be monitonically increasing even as the RevisionHeight +gets reset | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | | -| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | | -| `port` | [string](#string) | | | -| `params` | [ibc.applications.interchain_accounts.host.v1.Params](#ibc.applications.interchain_accounts.host.v1.Params) | | | +| `revision_number` | [uint64](#uint64) | | the revision that the client is currently on | +| `revision_height` | [uint64](#uint64) | | the height within the given revision | - + -### RegisteredInterchainAccount -RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address +### IdentifiedClientState +IdentifiedClientState defines a client state with an additional client +identifier field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `connection_id` | [string](#string) | | | -| `port_id` | [string](#string) | | | -| `account_address` | [string](#string) | | | +| `client_id` | [string](#string) | | client identifier | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | client state | - - + - +### Params +Params defines the set of IBC light client parameters. - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `allowed_clients` | [string](#string) | repeated | allowed_clients defines the list of allowed client state types. | - -

Top

-## ibc/applications/interchain_accounts/v1/metadata.proto - + -### Metadata -Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring -See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning +### UpgradeProposal +UpgradeProposal is a gov Content type for initiating an IBC breaking +upgrade. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `version` | [string](#string) | | version defines the ICS27 protocol version | -| `controller_connection_id` | [string](#string) | | controller_connection_id is the connection identifier associated with the controller chain | -| `host_connection_id` | [string](#string) | | host_connection_id is the connection identifier associated with the host chain | -| `address` | [string](#string) | | address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step NOTE: the address field is empty on the OnChanOpenInit handshake step | -| `encoding` | [string](#string) | | encoding defines the supported codec format | -| `tx_type` | [string](#string) | | tx_type defines the type of transactions the interchain account can execute | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `plan` | [cosmos.upgrade.v1beta1.Plan](#cosmos.upgrade.v1beta1.Plan) | | | +| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | An UpgradedClientState must be provided to perform an IBC breaking upgrade. This will make the chain commit to the correct upgraded (self) client state before the upgrade occurs, so that connecting chains can verify that the new upgraded client is valid by verifying a proof on the previous version of the chain. This will allow IBC connections to persist smoothly across planned chain upgrades | @@ -439,137 +517,150 @@ See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel- - +

Top

-## ibc/applications/interchain_accounts/v1/packet.proto +## ibc/core/channel/v1/channel.proto - + -### CosmosTx -CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. +### Acknowledgement +Acknowledgement is the recommended acknowledgement format to be used by +app-specific protocols. +NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental +conflicts with other protobuf message formats used for acknowledgements. +The first byte of any message with this format will be the non-ASCII values +`0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: +https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `result` | [bytes](#bytes) | | | +| `error` | [string](#string) | | | - + -### InterchainAccountPacketData -InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. +### Channel +Channel defines pipeline for exactly-once packet delivery between specific +modules on separate blockchains, which has at least one end capable of +sending packets and one end capable of receiving packets. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `type` | [Type](#ibc.applications.interchain_accounts.v1.Type) | | | -| `data` | [bytes](#bytes) | | | -| `memo` | [string](#string) | | | - - - - - - +| `state` | [State](#ibc.core.channel.v1.State) | | current state of the channel end | +| `ordering` | [Order](#ibc.core.channel.v1.Order) | | whether the channel is ordered or unordered | +| `counterparty` | [Counterparty](#ibc.core.channel.v1.Counterparty) | | counterparty channel end | +| `connection_hops` | [string](#string) | repeated | list of connection identifiers, in order, along which packets sent on this channel will travel | +| `version` | [string](#string) | | opaque channel version, which is agreed upon during the handshake | - -### Type -Type defines a classification of message issued from a controller chain to its associated interchain accounts -host -| Name | Number | Description | -| ---- | ------ | ----------- | -| TYPE_UNSPECIFIED | 0 | Default zero value enumeration | -| TYPE_EXECUTE_TX | 1 | Execute a transaction on an interchain accounts host chain | - + - +### Counterparty +Counterparty defines a channel end counterparty - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `port_id` | [string](#string) | | port on the counterparty chain which owns the other end of the channel. | +| `channel_id` | [string](#string) | | channel end on the counterparty chain | - -

Top

-## ibc/applications/transfer/v1/transfer.proto - + -### DenomTrace -DenomTrace contains the base denomination for ICS20 fungible tokens and the -source tracing information path. +### IdentifiedChannel +IdentifiedChannel defines a channel with additional port and channel +identifier fields. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `path` | [string](#string) | | path defines the chain of port/channel identifiers used for tracing the source of the fungible token. | -| `base_denom` | [string](#string) | | base denomination of the relayed fungible token. | - +| `state` | [State](#ibc.core.channel.v1.State) | | current state of the channel end | +| `ordering` | [Order](#ibc.core.channel.v1.Order) | | whether the channel is ordered or unordered | +| `counterparty` | [Counterparty](#ibc.core.channel.v1.Counterparty) | | counterparty channel end | +| `connection_hops` | [string](#string) | repeated | list of connection identifiers, in order, along which packets sent on this channel will travel | +| `version` | [string](#string) | | opaque channel version, which is agreed upon during the handshake | +| `port_id` | [string](#string) | | port identifier | +| `channel_id` | [string](#string) | | channel identifier | - -### Params -Params defines the set of IBC transfer parameters. -NOTE: To prevent a single token from being transferred, set the -TransfersEnabled parameter to true and then set the bank module's SendEnabled -parameter for the denomination to false. + + +### Packet +Packet defines a type that carries data across different chains through IBC | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `send_enabled` | [bool](#bool) | | send_enabled enables or disables all cross-chain token transfers from this chain. | -| `receive_enabled` | [bool](#bool) | | receive_enabled enables or disables all cross-chain token transfers to this chain. | +| `sequence` | [uint64](#uint64) | | number corresponds to the order of sends and receives, where a Packet with an earlier sequence number must be sent and received before a Packet with a later sequence number. | +| `source_port` | [string](#string) | | identifies the port on the sending chain. | +| `source_channel` | [string](#string) | | identifies the channel end on the sending chain. | +| `destination_port` | [string](#string) | | identifies the port on the receiving chain. | +| `destination_channel` | [string](#string) | | identifies the channel end on the receiving chain. | +| `data` | [bytes](#bytes) | | actual opaque bytes transferred directly to the application module | +| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | block height after which the packet times out | +| `timeout_timestamp` | [uint64](#uint64) | | block timestamp (in nanoseconds) after which the packet times out | - - + - +### PacketId +PacketId is an identifer for a unique Packet +Source chains refer to packets by source port/channel +Destination chains refer to packets by destination port/channel - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `port_id` | [string](#string) | | channel port identifier | +| `channel_id` | [string](#string) | | channel unique identifier | +| `sequence` | [uint64](#uint64) | | packet sequence | - -

Top

-## ibc/applications/transfer/v1/genesis.proto - + -### GenesisState -GenesisState defines the ibc-transfer genesis state +### PacketState +PacketState defines the generic type necessary to retrieve and store +packet commitments, acknowledgements, and receipts. +Caller is responsible for knowing the context necessary to interpret this +state as a commitment, acknowledgement, or a receipt. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `port_id` | [string](#string) | | | -| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | | -| `params` | [Params](#ibc.applications.transfer.v1.Params) | | | +| `port_id` | [string](#string) | | channel port identifier. | +| `channel_id` | [string](#string) | | channel unique identifier. | +| `sequence` | [uint64](#uint64) | | packet sequence. | +| `data` | [bytes](#bytes) | | embedded data that represents packet state. | @@ -577,6 +668,35 @@ GenesisState defines the ibc-transfer genesis state + + + +### Order +Order defines if a channel is ORDERED or UNORDERED + +| Name | Number | Description | +| ---- | ------ | ----------- | +| ORDER_NONE_UNSPECIFIED | 0 | zero-value for channel ordering | +| ORDER_UNORDERED | 1 | packets can be delivered in any order, which may differ from the order in which they were sent. | +| ORDER_ORDERED | 2 | packets are delivered exactly in the order which they were sent | + + + + + +### State +State defines if a channel is in one of the following states: +CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| STATE_UNINITIALIZED_UNSPECIFIED | 0 | Default State | +| STATE_INIT | 1 | A channel has just started the opening handshake. | +| STATE_TRYOPEN | 2 | A channel has acknowledged the handshake step on the counterparty chain. | +| STATE_OPEN | 3 | A channel has completed the handshake. Open channels are ready to send and receive packets. | +| STATE_CLOSED | 4 | A channel has been closed and can no longer be used to send or receive packets. | + + @@ -585,129 +705,155 @@ GenesisState defines the ibc-transfer genesis state - +

Top

-## ibc/applications/transfer/v1/query.proto +## ibc/applications/fee/v1/fee.proto - + -### QueryDenomHashRequest -QueryDenomHashRequest is the request type for the Query/DenomHash RPC -method +### Fee +Fee defines the ICS29 receive, acknowledgement and timeout fees | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `trace` | [string](#string) | | The denomination trace ([port_id]/[channel_id])+/[denom] | +| `recv_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | the packet receive fee | +| `ack_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | the packet acknowledgement fee | +| `timeout_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | the packet timeout fee | - + -### QueryDenomHashResponse -QueryDenomHashResponse is the response type for the Query/DenomHash RPC -method. +### IdentifiedPacketFees +IdentifiedPacketFees contains a list of type PacketFee and associated PacketId | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `hash` | [string](#string) | | hash (in hex format) of the denomination trace information. | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | unique packet identifier comprised of the channel ID, port ID and sequence | +| `packet_fees` | [PacketFee](#ibc.applications.fee.v1.PacketFee) | repeated | list of packet fees | - + -### QueryDenomTraceRequest -QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC -method +### PacketFee +PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `hash` | [string](#string) | | hash (in hex format) of the denomination trace information. | +| `fee` | [Fee](#ibc.applications.fee.v1.Fee) | | fee encapsulates the recv, ack and timeout fees associated with an IBC packet | +| `refund_address` | [string](#string) | | the refund address for unspent fees | +| `relayers` | [string](#string) | repeated | optional list of relayers permitted to receive fees | - + -### QueryDenomTraceResponse -QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC -method. +### PacketFees +PacketFees contains a list of type PacketFee | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `denom_trace` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | | denom_trace returns the requested denomination trace information. | +| `packet_fees` | [PacketFee](#ibc.applications.fee.v1.PacketFee) | repeated | list of packet fees | + - + -### QueryDenomTracesRequest -QueryConnectionsRequest is the request type for the Query/DenomTraces RPC -method + + + + + + + +

Top

+ +## ibc/applications/fee/v1/genesis.proto + + + + + +### FeeEnabledChannel +FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| `port_id` | [string](#string) | | unique port identifier | +| `channel_id` | [string](#string) | | unique channel identifier | - + -### QueryDenomTracesResponse -QueryConnectionsResponse is the response type for the Query/DenomTraces RPC -method. +### ForwardRelayerAddress +ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | denom_traces returns all denominations trace information. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | +| `address` | [string](#string) | | the forward relayer address | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | unique packet identifer comprised of the channel ID, port ID and sequence | - + -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. +### GenesisState +GenesisState defines the ICS29 fee middleware genesis state +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `identified_fees` | [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) | repeated | list of identified packet fees | +| `fee_enabled_channels` | [FeeEnabledChannel](#ibc.applications.fee.v1.FeeEnabledChannel) | repeated | list of fee enabled channels | +| `registered_relayers` | [RegisteredRelayerAddress](#ibc.applications.fee.v1.RegisteredRelayerAddress) | repeated | list of registered relayer addresses | +| `forward_relayers` | [ForwardRelayerAddress](#ibc.applications.fee.v1.ForwardRelayerAddress) | repeated | list of forward relayer addresses | - -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. + + + +### RegisteredRelayerAddress +RegisteredRelayerAddress contains the address and counterparty address for a specific relayer (for distributing fees) | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#ibc.applications.transfer.v1.Params) | | params defines the parameters of the module. | +| `address` | [string](#string) | | the relayer address | +| `counterparty_address` | [string](#string) | | the counterparty relayer address | +| `channel_id` | [string](#string) | | unique channel identifier | @@ -719,155 +865,1076 @@ QueryParamsResponse is the response type for the Query/Params RPC method. + - -### Query -Query provides defines the gRPC querier service. -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `DenomTrace` | [QueryDenomTraceRequest](#ibc.applications.transfer.v1.QueryDenomTraceRequest) | [QueryDenomTraceResponse](#ibc.applications.transfer.v1.QueryDenomTraceResponse) | DenomTrace queries a denomination trace information. | GET|/ibc/apps/transfer/v1/denom_traces/{hash}| -| `DenomTraces` | [QueryDenomTracesRequest](#ibc.applications.transfer.v1.QueryDenomTracesRequest) | [QueryDenomTracesResponse](#ibc.applications.transfer.v1.QueryDenomTracesResponse) | DenomTraces queries all denomination traces. | GET|/ibc/apps/transfer/v1/denom_traces| -| `Params` | [QueryParamsRequest](#ibc.applications.transfer.v1.QueryParamsRequest) | [QueryParamsResponse](#ibc.applications.transfer.v1.QueryParamsResponse) | Params queries all parameters of the ibc-transfer module. | GET|/ibc/apps/transfer/v1/params| -| `DenomHash` | [QueryDenomHashRequest](#ibc.applications.transfer.v1.QueryDenomHashRequest) | [QueryDenomHashResponse](#ibc.applications.transfer.v1.QueryDenomHashResponse) | DenomHash queries a denomination hash information. | GET|/ibc/apps/transfer/v1/denom_hashes/{trace}| + +

Top

+ +## ibc/applications/fee/v1/metadata.proto + + + + + +### Metadata +Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring +See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee_version` | [string](#string) | | fee_version defines the ICS29 fee version | +| `app_version` | [string](#string) | | app_version defines the underlying application version, which may or may not be a JSON encoded bytestring | + + + + + + + + + + - +

Top

-## ibc/core/client/v1/client.proto +## ibc/applications/fee/v1/query.proto - + -### ClientConsensusStates -ClientConsensusStates defines all the stored consensus states for a given -client. +### QueryCounterpartyAddressRequest +QueryCounterpartyAddressRequest defines the request type for the CounterpartyAddress rpc | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client identifier | -| `consensus_states` | [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) | repeated | consensus states and their heights associated with the client | +| `channel_id` | [string](#string) | | unique channel identifier | +| `relayer_address` | [string](#string) | | the relayer address to which the counterparty is registered | - + -### ClientUpdateProposal -ClientUpdateProposal is a governance proposal. If it passes, the substitute -client's latest consensus state is copied over to the subject client. The proposal -handler may fail if the subject and the substitute do not match in client and -chain parameters (with exception to latest height, frozen height, and chain-id). +### QueryCounterpartyAddressResponse +QueryCounterpartyAddressResponse defines the response type for the CounterpartyAddress rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `counterparty_address` | [string](#string) | | the counterparty address used to compensate forward relaying | + + + + + + + + +### QueryFeeEnabledChannelRequest +QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `port_id` | [string](#string) | | unique port identifier | +| `channel_id` | [string](#string) | | unique channel identifier | + + + + + + + + +### QueryFeeEnabledChannelResponse +QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee_enabled` | [bool](#bool) | | boolean flag representing the fee enabled channel status | + + + + + + + + +### QueryFeeEnabledChannelsRequest +QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| `query_height` | [uint64](#uint64) | | block height at which to query | + + + + + + + + +### QueryFeeEnabledChannelsResponse +QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee_enabled_channels` | [FeeEnabledChannel](#ibc.applications.fee.v1.FeeEnabledChannel) | repeated | list of fee enabled channels | + + + + + + + + +### QueryIncentivizedPacketRequest +QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | unique packet identifier comprised of channel ID, port ID and sequence | +| `query_height` | [uint64](#uint64) | | block height at which to query | + + + + + + + + +### QueryIncentivizedPacketResponse +QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `incentivized_packet` | [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) | | the identified fees for the incentivized packet | + + + + + + + + +### QueryIncentivizedPacketsForChannelRequest +QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets +for a specific channel + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| `port_id` | [string](#string) | | | +| `channel_id` | [string](#string) | | | +| `query_height` | [uint64](#uint64) | | Height to query at | + + + + + + + + +### QueryIncentivizedPacketsForChannelResponse +QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `incentivized_packets` | [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) | repeated | Map of all incentivized_packets | + + + + + + + + +### QueryIncentivizedPacketsRequest +QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| `query_height` | [uint64](#uint64) | | block height at which to query | + + + + + + + + +### QueryIncentivizedPacketsResponse +QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `incentivized_packets` | [IdentifiedPacketFees](#ibc.applications.fee.v1.IdentifiedPacketFees) | repeated | list of identified fees for incentivized packets | + + + + + + + + +### QueryTotalAckFeesRequest +QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | the packet identifier for the associated fees | + + + + + + + + +### QueryTotalAckFeesResponse +QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `ack_fees` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | the total packet acknowledgement fees | + + + + + + + + +### QueryTotalRecvFeesRequest +QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | the packet identifier for the associated fees | + + + + + + + + +### QueryTotalRecvFeesResponse +QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `recv_fees` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | the total packet receive fees | + + + + + + + + +### QueryTotalTimeoutFeesRequest +QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | the packet identifier for the associated fees | + + + + + + + + +### QueryTotalTimeoutFeesResponse +QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `timeout_fees` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | the total packet timeout fees | + + + + + + + + + + + + + + +### Query +Query defines the ICS29 gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `IncentivizedPackets` | [QueryIncentivizedPacketsRequest](#ibc.applications.fee.v1.QueryIncentivizedPacketsRequest) | [QueryIncentivizedPacketsResponse](#ibc.applications.fee.v1.QueryIncentivizedPacketsResponse) | IncentivizedPackets returns all incentivized packets and their associated fees | GET|/ibc/apps/fee/v1/incentivized_packets| +| `IncentivizedPacket` | [QueryIncentivizedPacketRequest](#ibc.applications.fee.v1.QueryIncentivizedPacketRequest) | [QueryIncentivizedPacketResponse](#ibc.applications.fee.v1.QueryIncentivizedPacketResponse) | IncentivizedPacket returns all packet fees for a packet given its identifier | GET|/ibc/apps/fee/v1/incentivized_packet/port/{packet_id.port_id}/channel/{packet_id.channel_id}/sequence/{packet_id.sequence}| +| `IncentivizedPacketsForChannel` | [QueryIncentivizedPacketsForChannelRequest](#ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest) | [QueryIncentivizedPacketsForChannelResponse](#ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse) | Gets all incentivized packets for a specific channel | GET|/ibc/apps/fee/v1/incentivized_packets/port/{port_id}/channel/{channel_id}| +| `TotalRecvFees` | [QueryTotalRecvFeesRequest](#ibc.applications.fee.v1.QueryTotalRecvFeesRequest) | [QueryTotalRecvFeesResponse](#ibc.applications.fee.v1.QueryTotalRecvFeesResponse) | TotalRecvFees returns the total receive fees for a packet given its identifier | GET|/ibc/apps/fee/v1/total_recv_fees/port/{packet_id.port_id}/channel/{packet_id.channel_id}/sequence/{packet_id.sequence}| +| `TotalAckFees` | [QueryTotalAckFeesRequest](#ibc.applications.fee.v1.QueryTotalAckFeesRequest) | [QueryTotalAckFeesResponse](#ibc.applications.fee.v1.QueryTotalAckFeesResponse) | TotalAckFees returns the total acknowledgement fees for a packet given its identifier | GET|/ibc/apps/fee/v1/total_ack_fees/port/{packet_id.port_id}/channel/{packet_id.channel_id}/sequence/{packet_id.sequence}| +| `TotalTimeoutFees` | [QueryTotalTimeoutFeesRequest](#ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest) | [QueryTotalTimeoutFeesResponse](#ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse) | TotalTimeoutFees returns the total timeout fees for a packet given its identifier | GET|/ibc/apps/fee/v1/total_timeout_fees/port/{packet_id.port_id}/channel/{packet_id.channel_id}/sequence/{packet_id.sequence}| +| `CounterpartyAddress` | [QueryCounterpartyAddressRequest](#ibc.applications.fee.v1.QueryCounterpartyAddressRequest) | [QueryCounterpartyAddressResponse](#ibc.applications.fee.v1.QueryCounterpartyAddressResponse) | CounterpartyAddress returns the registered counterparty address for forward relaying | GET|/ibc/apps/fee/v1/counterparty_address/{relayer_address}/channel/{channel_id}| +| `FeeEnabledChannels` | [QueryFeeEnabledChannelsRequest](#ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest) | [QueryFeeEnabledChannelsResponse](#ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse) | FeeEnabledChannels returns a list of all fee enabled channels | GET|/ibc/apps/fee/v1/fee_enabled| +| `FeeEnabledChannel` | [QueryFeeEnabledChannelRequest](#ibc.applications.fee.v1.QueryFeeEnabledChannelRequest) | [QueryFeeEnabledChannelResponse](#ibc.applications.fee.v1.QueryFeeEnabledChannelResponse) | FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel | GET|/ibc/apps/fee/v1/fee_enabled/port/{port_id}/channel/{channel_id}| + + + + + + +

Top

+ +## ibc/applications/fee/v1/tx.proto + + + + + +### MsgPayPacketFee +MsgPayPacketFee defines the request type for the PayPacketFee rpc +This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be +paid for + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee` | [Fee](#ibc.applications.fee.v1.Fee) | | fee encapsulates the recv, ack and timeout fees associated with an IBC packet | +| `source_port_id` | [string](#string) | | the source port unique identifier | +| `source_channel_id` | [string](#string) | | the source channel unique identifer | +| `signer` | [string](#string) | | account address to refund fee if necessary | +| `relayers` | [string](#string) | repeated | optional list of relayers permitted to the receive packet fees | + + + + + + + + +### MsgPayPacketFeeAsync +MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc +This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `packet_id` | [ibc.core.channel.v1.PacketId](#ibc.core.channel.v1.PacketId) | | unique packet identifier comprised of the channel ID, port ID and sequence | +| `packet_fee` | [PacketFee](#ibc.applications.fee.v1.PacketFee) | | the packet fee associated with a particular IBC packet | + + + + + + + + +### MsgPayPacketFeeAsyncResponse +MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc + + + + + + + + +### MsgPayPacketFeeResponse +MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc + + + + + + + + +### MsgRegisterCounterpartyAddress +MsgRegisterCounterpartyAddress defines the request type for the RegisterCounterpartyAddress rpc + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | the relayer address | +| `counterparty_address` | [string](#string) | | the counterparty relayer address | +| `channel_id` | [string](#string) | | unique channel identifier | + + + + + + + + +### MsgRegisterCounterpartyAddressResponse +MsgRegisterCounterpartyAddressResponse defines the response type for the RegisterCounterpartyAddress rpc + + + + + + + + + + + + + + +### Msg +Msg defines the ICS29 Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `RegisterCounterpartyAddress` | [MsgRegisterCounterpartyAddress](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddress) | [MsgRegisterCounterpartyAddressResponse](#ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse) | RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying. This ensures they will be properly compensated for forward relaying since destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function may be called more than once by a relayer, in which case, latest counterparty address is always used. | | +| `PayPacketFee` | [MsgPayPacketFee](#ibc.applications.fee.v1.MsgPayPacketFee) | [MsgPayPacketFeeResponse](#ibc.applications.fee.v1.MsgPayPacketFeeResponse) | PayPacketFee defines a rpc handler method for MsgPayPacketFee PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to incentivize the relaying of the packet at the next sequence NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows initiates the lifecycle of the incentivized packet | | +| `PayPacketFeeAsync` | [MsgPayPacketFeeAsync](#ibc.applications.fee.v1.MsgPayPacketFeeAsync) | [MsgPayPacketFeeAsyncResponse](#ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse) | PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to incentivize the relaying of a known packet (i.e. at a particular sequence) | | + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/controller/v1/controller.proto + + + + + +### Params +Params defines the set of on-chain interchain accounts parameters. +The following parameters may be used to disable the controller submodule. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `controller_enabled` | [bool](#bool) | | controller_enabled enables or disables the controller submodule. | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/controller/v1/query.proto + + + + + +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. + + + + + + + + +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | params defines the parameters of the module. | + + + + + + + + + + + + + + +### Query +Query provides defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Params` | [QueryParamsRequest](#ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest) | [QueryParamsResponse](#ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse) | Params queries all parameters of the ICA controller submodule. | GET|/ibc/apps/interchain_accounts/controller/v1/params| + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/host/v1/host.proto + + + + + +### Params +Params defines the set of on-chain interchain accounts parameters. +The following parameters may be used to disable the host submodule. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `host_enabled` | [bool](#bool) | | host_enabled enables or disables the host submodule. | +| `allow_messages` | [string](#string) | repeated | allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/host/v1/query.proto + + + + + +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. + + + + + + + + +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#ibc.applications.interchain_accounts.host.v1.Params) | | params defines the parameters of the module. | + + + + + + + + + + + + + + +### Query +Query provides defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Params` | [QueryParamsRequest](#ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) | [QueryParamsResponse](#ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) | Params queries all parameters of the ICA host submodule. | GET|/ibc/apps/interchain_accounts/host/v1/params| + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/v1/account.proto + + + + + +### InterchainAccount +An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | +| `account_owner` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/v1/genesis.proto + + + + + +### ActiveChannel +ActiveChannel contains a connection ID, port ID and associated active channel ID + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `connection_id` | [string](#string) | | | +| `port_id` | [string](#string) | | | +| `channel_id` | [string](#string) | | | + + + + + + + + +### ControllerGenesisState +ControllerGenesisState defines the interchain accounts controller genesis state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | | +| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | | +| `ports` | [string](#string) | repeated | | +| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | | + + + + + + + + +### GenesisState +GenesisState defines the interchain accounts genesis state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `controller_genesis_state` | [ControllerGenesisState](#ibc.applications.interchain_accounts.v1.ControllerGenesisState) | | | +| `host_genesis_state` | [HostGenesisState](#ibc.applications.interchain_accounts.v1.HostGenesisState) | | | + + + + + + + + +### HostGenesisState +HostGenesisState defines the interchain accounts host genesis state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | | +| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | | +| `port` | [string](#string) | | | +| `params` | [ibc.applications.interchain_accounts.host.v1.Params](#ibc.applications.interchain_accounts.host.v1.Params) | | | + + + + + + + + +### RegisteredInterchainAccount +RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `connection_id` | [string](#string) | | | +| `port_id` | [string](#string) | | | +| `account_address` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/v1/metadata.proto + + + + + +### Metadata +Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring +See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `version` | [string](#string) | | version defines the ICS27 protocol version | +| `controller_connection_id` | [string](#string) | | controller_connection_id is the connection identifier associated with the controller chain | +| `host_connection_id` | [string](#string) | | host_connection_id is the connection identifier associated with the host chain | +| `address` | [string](#string) | | address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step NOTE: the address field is empty on the OnChanOpenInit handshake step | +| `encoding` | [string](#string) | | encoding defines the supported codec format | +| `tx_type` | [string](#string) | | tx_type defines the type of transactions the interchain account can execute | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/interchain_accounts/v1/packet.proto + + + + + +### CosmosTx +CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | + + + + + + + + +### InterchainAccountPacketData +InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `type` | [Type](#ibc.applications.interchain_accounts.v1.Type) | | | +| `data` | [bytes](#bytes) | | | +| `memo` | [string](#string) | | | + + + + + + + + + + +### Type +Type defines a classification of message issued from a controller chain to its associated interchain accounts +host + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TYPE_UNSPECIFIED | 0 | Default zero value enumeration | +| TYPE_EXECUTE_TX | 1 | Execute a transaction on an interchain accounts host chain | + + + + + + + + + + + +

Top

+ +## ibc/applications/transfer/v1/transfer.proto + + + + + +### DenomTrace +DenomTrace contains the base denomination for ICS20 fungible tokens and the +source tracing information path. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [string](#string) | | path defines the chain of port/channel identifiers used for tracing the source of the fungible token. | +| `base_denom` | [string](#string) | | base denomination of the relayed fungible token. | + + + + + + + + +### Params +Params defines the set of IBC transfer parameters. +NOTE: To prevent a single token from being transferred, set the +TransfersEnabled parameter to true and then set the bank module's SendEnabled +parameter for the denomination to false. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `send_enabled` | [bool](#bool) | | send_enabled enables or disables all cross-chain token transfers from this chain. | +| `receive_enabled` | [bool](#bool) | | receive_enabled enables or disables all cross-chain token transfers to this chain. | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/transfer/v1/genesis.proto + + + + + +### GenesisState +GenesisState defines the ibc-transfer genesis state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `port_id` | [string](#string) | | | +| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | | +| `params` | [Params](#ibc.applications.transfer.v1.Params) | | | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/transfer/v1/query.proto + + + + + +### QueryDenomHashRequest +QueryDenomHashRequest is the request type for the Query/DenomHash RPC +method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `trace` | [string](#string) | | The denomination trace ([port_id]/[channel_id])+/[denom] | + + + + + + + + +### QueryDenomHashResponse +QueryDenomHashResponse is the response type for the Query/DenomHash RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `hash` | [string](#string) | | hash (in hex format) of the denomination trace information. | + + + + + + + + +### QueryDenomTraceRequest +QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC +method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | the title of the update proposal | -| `description` | [string](#string) | | the description of the proposal | -| `subject_client_id` | [string](#string) | | the client identifier for the client to be updated if the proposal passes | -| `substitute_client_id` | [string](#string) | | the substitute client identifier for the client standing in for the subject client | +| `hash` | [string](#string) | | hash (in hex format) of the denomination trace information. | - + -### ConsensusStateWithHeight -ConsensusStateWithHeight defines a consensus state with an additional height -field. +### QueryDenomTraceResponse +QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC +method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `height` | [Height](#ibc.core.client.v1.Height) | | consensus state height | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state | - +| `denom_trace` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | | denom_trace returns the requested denomination trace information. | - -### Height -Height is a monotonically increasing data type -that can be compared against another Height for the purposes of updating and -freezing clients + -Normally the RevisionHeight is incremented at each height while keeping -RevisionNumber the same. However some consensus algorithms may choose to -reset the height in certain conditions e.g. hard forks, state-machine -breaking changes In these cases, the RevisionNumber is incremented so that -height continues to be monitonically increasing even as the RevisionHeight -gets reset +### QueryDenomTracesRequest +QueryConnectionsRequest is the request type for the Query/DenomTraces RPC +method | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `revision_number` | [uint64](#uint64) | | the revision that the client is currently on | -| `revision_height` | [uint64](#uint64) | | the height within the given revision | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### IdentifiedClientState -IdentifiedClientState defines a client state with an additional client -identifier field. +### QueryDenomTracesResponse +QueryConnectionsResponse is the response type for the Query/DenomTraces RPC +method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client identifier | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | client state | - - +| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | denom_traces returns all denominations trace information. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - -### Params -Params defines the set of IBC light client parameters. + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `allowed_clients` | [string](#string) | repeated | allowed_clients defines the list of allowed client state types. | +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. - + -### UpgradeProposal -UpgradeProposal is a gov Content type for initiating an IBC breaking -upgrade. +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `plan` | [cosmos.upgrade.v1beta1.Plan](#cosmos.upgrade.v1beta1.Plan) | | | -| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | An UpgradedClientState must be provided to perform an IBC breaking upgrade. This will make the chain commit to the correct upgraded (self) client state before the upgrade occurs, so that connecting chains can verify that the new upgraded client is valid by verifying a proof on the previous version of the chain. This will allow IBC connections to persist smoothly across planned chain upgrades | +| `params` | [Params](#ibc.applications.transfer.v1.Params) | | params defines the parameters of the module. | @@ -879,6 +1946,19 @@ upgrade. + + + +### Query +Query provides defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `DenomTrace` | [QueryDenomTraceRequest](#ibc.applications.transfer.v1.QueryDenomTraceRequest) | [QueryDenomTraceResponse](#ibc.applications.transfer.v1.QueryDenomTraceResponse) | DenomTrace queries a denomination trace information. | GET|/ibc/apps/transfer/v1/denom_traces/{hash}| +| `DenomTraces` | [QueryDenomTracesRequest](#ibc.applications.transfer.v1.QueryDenomTracesRequest) | [QueryDenomTracesResponse](#ibc.applications.transfer.v1.QueryDenomTracesResponse) | DenomTraces queries all denomination traces. | GET|/ibc/apps/transfer/v1/denom_traces| +| `Params` | [QueryParamsRequest](#ibc.applications.transfer.v1.QueryParamsRequest) | [QueryParamsResponse](#ibc.applications.transfer.v1.QueryParamsResponse) | Params queries all parameters of the ibc-transfer module. | GET|/ibc/apps/transfer/v1/params| +| `DenomHash` | [QueryDenomHashRequest](#ibc.applications.transfer.v1.QueryDenomHashRequest) | [QueryDenomHashResponse](#ibc.applications.transfer.v1.QueryDenomHashResponse) | DenomHash queries a denomination hash information. | GET|/ibc/apps/transfer/v1/denom_hashes/{trace}| + @@ -978,175 +2058,6 @@ https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transf - -

Top

- -## ibc/core/channel/v1/channel.proto - - - - - -### Acknowledgement -Acknowledgement is the recommended acknowledgement format to be used by -app-specific protocols. -NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental -conflicts with other protobuf message formats used for acknowledgements. -The first byte of any message with this format will be the non-ASCII values -`0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: -https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `result` | [bytes](#bytes) | | | -| `error` | [string](#string) | | | - - - - - - - - -### Channel -Channel defines pipeline for exactly-once packet delivery between specific -modules on separate blockchains, which has at least one end capable of -sending packets and one end capable of receiving packets. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `state` | [State](#ibc.core.channel.v1.State) | | current state of the channel end | -| `ordering` | [Order](#ibc.core.channel.v1.Order) | | whether the channel is ordered or unordered | -| `counterparty` | [Counterparty](#ibc.core.channel.v1.Counterparty) | | counterparty channel end | -| `connection_hops` | [string](#string) | repeated | list of connection identifiers, in order, along which packets sent on this channel will travel | -| `version` | [string](#string) | | opaque channel version, which is agreed upon during the handshake | - - - - - - - - -### Counterparty -Counterparty defines a channel end counterparty - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `port_id` | [string](#string) | | port on the counterparty chain which owns the other end of the channel. | -| `channel_id` | [string](#string) | | channel end on the counterparty chain | - - - - - - - - -### IdentifiedChannel -IdentifiedChannel defines a channel with additional port and channel -identifier fields. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `state` | [State](#ibc.core.channel.v1.State) | | current state of the channel end | -| `ordering` | [Order](#ibc.core.channel.v1.Order) | | whether the channel is ordered or unordered | -| `counterparty` | [Counterparty](#ibc.core.channel.v1.Counterparty) | | counterparty channel end | -| `connection_hops` | [string](#string) | repeated | list of connection identifiers, in order, along which packets sent on this channel will travel | -| `version` | [string](#string) | | opaque channel version, which is agreed upon during the handshake | -| `port_id` | [string](#string) | | port identifier | -| `channel_id` | [string](#string) | | channel identifier | - - - - - - - - -### Packet -Packet defines a type that carries data across different chains through IBC - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `sequence` | [uint64](#uint64) | | number corresponds to the order of sends and receives, where a Packet with an earlier sequence number must be sent and received before a Packet with a later sequence number. | -| `source_port` | [string](#string) | | identifies the port on the sending chain. | -| `source_channel` | [string](#string) | | identifies the channel end on the sending chain. | -| `destination_port` | [string](#string) | | identifies the port on the receiving chain. | -| `destination_channel` | [string](#string) | | identifies the channel end on the receiving chain. | -| `data` | [bytes](#bytes) | | actual opaque bytes transferred directly to the application module | -| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | block height after which the packet times out | -| `timeout_timestamp` | [uint64](#uint64) | | block timestamp (in nanoseconds) after which the packet times out | - - - - - - - - -### PacketState -PacketState defines the generic type necessary to retrieve and store -packet commitments, acknowledgements, and receipts. -Caller is responsible for knowing the context necessary to interpret this -state as a commitment, acknowledgement, or a receipt. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `port_id` | [string](#string) | | channel port identifier. | -| `channel_id` | [string](#string) | | channel unique identifier. | -| `sequence` | [uint64](#uint64) | | packet sequence. | -| `data` | [bytes](#bytes) | | embedded data that represents packet state. | - - - - - - - - - - -### Order -Order defines if a channel is ORDERED or UNORDERED - -| Name | Number | Description | -| ---- | ------ | ----------- | -| ORDER_NONE_UNSPECIFIED | 0 | zero-value for channel ordering | -| ORDER_UNORDERED | 1 | packets can be delivered in any order, which may differ from the order in which they were sent. | -| ORDER_ORDERED | 2 | packets are delivered exactly in the order which they were sent | - - - - - -### State -State defines if a channel is in one of the following states: -CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| STATE_UNINITIALIZED_UNSPECIFIED | 0 | Default State | -| STATE_INIT | 1 | A channel has just started the opening handshake. | -| STATE_TRYOPEN | 2 | A channel has acknowledged the handshake step on the counterparty chain. | -| STATE_OPEN | 3 | A channel has completed the handshake. Open channels are ready to send and receive packets. | -| STATE_CLOSED | 4 | A channel has been closed and can no longer be used to send or receive packets. | - - - - - - - - - -

Top

@@ -1895,6 +2806,7 @@ MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `channel_id` | [string](#string) | | | +| `version` | [string](#string) | | | @@ -1930,6 +2842,11 @@ value will be ignored by core IBC. MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `version` | [string](#string) | | | + + diff --git a/docs/roadmap/history.md b/docs/roadmap/history.md deleted file mode 100644 index 575ed5099e6..00000000000 --- a/docs/roadmap/history.md +++ /dev/null @@ -1,44 +0,0 @@ - -# Past roadmap ibc-go - -History of the roadmap for past quarters. - -## Q4 - 2021 - -### Interchain accounts - -- Finalize the issues raised during the internal audit. -- Prepare codebase & specification for two external audits. -- Write developer documentation. -- Integration with hermes relayer and end-2-end testing. -- Create alpha release. - -### Relayer incentivisation - -- Finalize implementation. -- Update specification and write documentation. -- Do internal audit and write issues that may arise. - -### Align implementation with ICS02 - -We will work to bring the ibc-go implementation in line with [ICS02](https://github.com/cosmos/ibc/tree/master/spec/core/ics-002-client-semantics): [#284](https://github.com/cosmos/ibc-go/issues/284), [#285](https://github.com/cosmos/ibc-go/issues/285), [#286](https://github.com/cosmos/ibc-go/issues/286), [#594](https://github.com/cosmos/ibc-go/issues/594) and [#599](https://github.com/cosmos/ibc-go/issues/599). The support for Wasm-based light clients relies on these issues as well. - -### Release schedule - -|Release|Milestone|Date| -|-------|---------|----| -|[`v1.1.0`](https://github.com/cosmos/ibc-go/releases/tag/v1.1.1)||Oct 04, 2021| -|[`v1.2.1`](https://github.com/cosmos/ibc-go/releases/tag/v1.2.1)||Oct 04, 2021| -|[`v2.0.0-rc0`](https://github.com/cosmos/ibc-go/releases/tag/v2.0.0-rc0)|[Link](https://github.com/cosmos/ibc-go/milestone/3)|Oct 05, 2021| -|[`v1.1.2`](https://github.com/cosmos/ibc-go/releases/tag/v1.1.2)||Oct 15, 2021| -|[`v1.2.2`](https://github.com/cosmos/ibc-go/releases/tag/v1.2.2)||Oct 15, 2021| -|[`v1.1.3`](https://github.com/cosmos/ibc-go/releases/tag/v1.1.3)||Nov 09, 2021| -|[`v1.2.3`](https://github.com/cosmos/ibc-go/releases/tag/v1.2.3)||Nov 09, 2021| -|[`v2.0.0`](https://github.com/cosmos/ibc-go/releases/tag/v2.0.0)|[Link](https://github.com/cosmos/ibc-go/milestone/3)|Nov 09, 2021| -|[`v1.1.4`](https://github.com/cosmos/ibc-go/releases/tag/v1.1.5)||Dec 06, 2021| -|[`v1.2.4`](https://github.com/cosmos/ibc-go/releases/tag/v1.2.4)||Dec 06, 2021| -|[`v2.0.1`](https://github.com/cosmos/ibc-go/releases/tag/v2.0.1)|[Link](https://github.com/cosmos/ibc-go/milestone/11)|Dec 06, 2021| -|[`v1.1.5`](https://github.com/cosmos/ibc-go/releases/tag/v1.1.5)||Dec 15, 2021| -|[`v1.2.5`](https://github.com/cosmos/ibc-go/releases/tag/v1.2.5)||Dec 15, 2021| -|[`v2.0.2`](https://github.com/cosmos/ibc-go/releases/tag/v2.0.2)|[Link](https://github.com/cosmos/ibc-go/milestone/20)|Dec 15, 2021| -|[`v3.0.0-alpha1`](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0-alpha1)|[Link](https://github.com/cosmos/ibc-go/milestone/12)|Dec 21, 2021| \ No newline at end of file diff --git a/docs/roadmap/roadmap.md b/docs/roadmap/roadmap.md index 0a4819b4bb1..3ddc67399c7 100644 --- a/docs/roadmap/roadmap.md +++ b/docs/roadmap/roadmap.md @@ -4,102 +4,55 @@ order: 1 # Roadmap ibc-go -_Lastest update: Dec 22, 2021_ +_Lastest update: March 31, 2022_ -This document endeavours to inform the wider IBC community about plans and priorities for work on ibc-go byt 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 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. -The release tags and timelines are educated guesses based on the information at hand at the moment of updating this document. Since predicting the final version number (specially for minor and patch numbers) can be challenging (since we might need to release unforeseen security vulnerability patches or urgent bug fixes), we are using alphabet letters as placeholders. Once we get closer to the release date, the placeholder will be replaced with the right number. An example for clarification... - -Let's assume that the planned release schedule looks like the following: -- At time `t0`: - - The first planned patch release for the `v2.0.x` release series with release tag `v2.0.a`. The placeholder is `a` since this is the first patch release in the planning. - - The first planned minor release for the `v2.x` release series with release tag `v2.a.0`. The placeholder is `a` since this is the first minor release in the planning. -- At time `t0 + delta`: - - The second planned patch release for the `v2.0.x` release series with release tag `v2.0.b`. The placehoder is `b` since this is the next patch release of this release series after `v2.0.a` in the planning. - - The first planned patch release for the new `v2.a.x` release series with release tag `v2.a.a`. The patch version placeholder is `a` because this is the first planned patch release of the `v2.a.x` release series. - -## Q1 - 2022 - -## Features - -### Interchain accounts - -- Work on any issues that may come out of the two external audits. -- Create beta, release candidate and final releases. - -### Relayer incentivisation - -- Work on issues that may arise from internal audit. -- External audit (issues may arise that we need to work on before release). -- Create alpha, beta, release candidate and final release. - -### Align implementation with ICS02 - -- Finalize work for: [#284](https://github.com/cosmos/ibc-go/issues/284), [#285](https://github.com/cosmos/ibc-go/issues/285), [#286](https://github.com/cosmos/ibc-go/issues/286), [#594](https://github.com/cosmos/ibc-go/issues/594) and [#599](https://github.com/cosmos/ibc-go/issues/599). - -### Interchain security - -- Testnet testing of [V1](https://github.com/cosmos/gaia/blob/main/docs/interchain-security.md#v1---full-validator-set). - -### Backlog issues - -- [#545](https://github.com/cosmos/ibc-go/issues/545): Remove the `GetTransferAccount` function, since we never use the ICS20 transfer module account (every escrow address is created as a regular account). -- [#559](https://github.com/cosmos/ibc-go/issues/559): Changes needed to support the migration to SMT storage. This is basically adding a new proof spec that will be used during connection handshake with a chain that has migrated to SMT to verify that the light client of the counterparty chain uses the correct proof specs to be able to verify proofs for that chain. -- And more to be added later! - -## Release schedule - -|Release|Milestone|Date| -|-------|---------|----| -|[`v3.0.0-alpha2`](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0-alpha2)||Jan 07, 2021| - -During this quarter we will also probably release versions that bump the Cosmos SDK to `v0.45` and Tendermint to `v0.35`, but at the moment of writing it is difficult to estimate when. Check our roadmap regularly for updates. - -### H2 January - -- [`v2.0.a`](https://github.com/cosmos/ibc-go/milestone/11) -- [`v3.0.0-beta1`](https://github.com/cosmos/ibc-go/milestone/12): Beta 1 release of `v3.0.0` including Interchain Accounts, an update of Golang from `v1.15` to `v1.17`, and some core improvements. This is a Go-API breaking release because of [#472](https://github.com/cosmos/ibc-go/issues/472) and [#675](https://github.com/cosmos/ibc-go/pull/675). - -### H1 February - -- [`v3.0.0-rc0`](https://github.com/cosmos/ibc-go/milestone/12): Release candidate 0 of `v3.0.0` including Interchain Accounts, an update of Golang from `v1.15` to `v1.17`, and some core improvements. This is a Go-API breaking release because of [#472](https://github.com/cosmos/ibc-go/issues/472) and [#675](https://github.com/cosmos/ibc-go/pull/675). - -### H2 February +## Q2 - 2022 -- [`v3.a.0-alpha1`](https://github.com/cosmos/ibc-go/milestone/16): Alpha release of `v3.a.0` including Relayer Incentivisation. This release will include fixes to issues that surfaced during the internal audit. +At a high level we will focus on: -### H1 March +- Finishing the implementation of [relayer incentivisation](https://github.com/orgs/cosmos/projects/7/views/8). +- Finishing the [refactoring of 02-client](https://github.com/cosmos/ibc-go/milestone/16). +- Finishing the upgrade to Cosmos SDK v0.46 and Tendermint v0.35. +- Implementing and testing the changes needed to support the [transtion to SMT storage](https://github.com/cosmos/ibc-go/milestone/21) in the Cosmos SDK. +- Desiging the implementation and scoping the engineering work for [channel upgradability](https://github.com/cosmos/ibc/blob/master/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md). +- Improving the project's documentation and writing guides for [light client](https://github.com/cosmos/ibc-go/issues/59) and middleware implementation. +- Working on [core backlog issues](https://github.com/cosmos/ibc-go/milestone/8). +- Spending time on expanding and deepening our knowledge of IBC, but also other parts of the Cosmos stack. +- And last, but not least, onboarding new members to the team. -- [`v3.0.0`](https://github.com/cosmos/ibc-go/milestone/12): Final release of `v3.0.0` including Interchain Accounts, an update of Golang from `v1.15` to `v1.17`, and some core improvements. This is a Go-API breaking release because of [#472](https://github.com/cosmos/ibc-go/issues/472) and [#675](https://github.com/cosmos/ibc-go/pull/675). -- [`v3.a.0-beta1`](https://github.com/cosmos/ibc-go/milestone/16): Beta release of `v3.a.0` including Relayer Incentivisation. This release will include fixes to issues that surfaced during the external audit. +For a detail view of each iteration's planned work, please check out our [project board](https://github.com/orgs/cosmos/projects/7). -### H2 March +### Release schedule -- [`v3.a.0-rc0`](https://github.com/cosmos/ibc-go/milestone/16): Release candiate 0 `v3.1.0` including Relayer Incentivisation. +#### **April** -## Q2 - 2022 +In the first half of the month we will probably cut: -### Features +- Alpha/beta pre-releases with the upgrade to SDK 0.46 and Tendermint v0.35. +- [Alpha](https://github.com/cosmos/ibc-go/milestone/5) pre-release with the implementation of relayer incentivisation. -> Full scope still TBD. +In the second half, and depending on the date of the final release of Cosmos SDK 0.46, we will probably cut the final release with the upgrade to SDK 0.46 and Tendermint v0.35, and also a [beta](https://github.com/cosmos/ibc-go/milestone/23) pre-release with the implementation of relayer incentivisation. -### Support for Wasm-based light clients +In the second half of the month we also plan to do a second internal audit of the implementation of relayer incentivisation, and issues will most likely will be created from the audit. Depending on the nature and type of the issues we create, those would be released in a second beta pre-release or in a [release candidate](https://github.com/cosmos/ibc-go/milestone/24). -There is an open [PR](https://github.com/cosmos/ibc-go/pull/208) that implements support for Wasm-based light clients, but it needs to be updated after the finalization of the [ICS28](https://github.com/cosmos/ibc/tree/master/spec/client/ics-008-wasm-client) specification. The PR need thorough review, more tests and potentially implementation changes. +#### **May** -## Release schedule +In the first half we will probably start cutting release candidates with relayer incentivisation and the 02-client refactor. Final release would most likely come out at the end of the month or beginning of June. -During this quarter we will also probably release versions that bump the Cosmos SDK to `v0.46` and to `v1.0`, but at the moment of writing it is difficult to estimate when. Check our roadmap regularly for updates. +#### **June** -### H1 April +We will probably cut at the end of the month or beginning of Q3 patch or minor releases on all the supported release lines with the [small features and core improvements](https://github.com/cosmos/ibc-go/milestone/8) that we work on during the quarter. -- [`v3.a.0`](https://github.com/cosmos/ibc-go/milestone/16): Final release of `v3.a.0` including Relayer Incentivisation. -- [`v4.0.0-rc0`](https://github.com/cosmos/ibc-go/milestone/16): Release candidate 0 of `v4.0.0` including the work for the issues to bring ibc-go implementation in line with ICS02 (which are Go-API breaking changes). +## Q3 - 2022 -### H2 April +We will most likely start the implementation of [channel upgradability](https://github.com/cosmos/ibc/blob/master/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md). At the end of Q2 or maybe beginning of Q3 we might also work on designing the implementation and scoping the engineering work to add support for [ordered channels that can timeout](https://github.com/cosmos/ibc/pull/636), and we could potentially work on this feature also in Q3. -- [`v4.0.0`](https://github.com/cosmos/ibc-go/milestone/16): Release candidate 0 of `v4.0.0` including the work for the issues to bring ibc-go implementation in line with ICS02 (which are Go-API breaking changes). +We will also probably do an audit of the implementation of the [CCV application](https://github.com/cosmos/interchain-security/tree/main/x/ccv) for Interchain Security. +### Release schedule +In this quarter we will make the final release to support the migration to SMT storage. \ No newline at end of file diff --git a/docs/versions b/docs/versions index 45d6f133c48..e568f9a716f 100644 --- a/docs/versions +++ b/docs/versions @@ -1,4 +1,9 @@ +release/v3.0.x v3.0.0 +release/v2.2.x v2.2.0 +release/v2.1.x v2.1.0 release/v2.0.x v2.0.0 +release/v1.4.x v1.4.0 +release/v1.3.x v1.3.0 release/v1.2.x v1.2.0 release/v1.1.x v1.1.0 main main diff --git a/go.mod b/go.mod index 2bc717ea5f3..4f56c03dd9e 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alp require ( github.com/armon/go-metrics v0.3.10 github.com/confio/ics23/go v0.7.0 - github.com/cosmos/cosmos-sdk v0.45.1 + github.com/cosmos/cosmos-sdk v0.45.3 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 @@ -16,13 +16,13 @@ require ( github.com/regen-network/cosmos-proto v0.3.1 github.com/spf13/cast v1.4.1 github.com/spf13/cobra v1.4.0 - github.com/spf13/viper v1.10.1 + github.com/spf13/viper v1.11.0 github.com/stretchr/testify v1.7.1 - github.com/tendermint/tendermint v0.34.14 - github.com/tendermint/tm-db v0.6.4 - google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa + github.com/tendermint/tendermint v0.34.19 + github.com/tendermint/tm-db v0.6.6 + google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac google.golang.org/grpc v1.45.0 - google.golang.org/protobuf v1.27.1 + google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -31,7 +31,7 @@ require ( github.com/99designs/keyring v1.1.6 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/DataDog/zstd v1.4.5 // indirect - github.com/Workiva/go-datastructures v1.0.52 // indirect + github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/btcsuite/btcd v0.22.0-beta // indirect @@ -54,15 +54,16 @@ require ( github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect github.com/gin-gonic/gin v1.7.0 // indirect - github.com/go-kit/kit v0.10.0 // indirect - github.com/go-logfmt/logfmt v0.5.0 // indirect + github.com/go-kit/kit v0.12.0 // indirect + github.com/go-kit/log v0.2.0 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect github.com/golang/snappy v0.0.3 // indirect github.com/google/btree v1.0.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect - github.com/gorilla/websocket v1.4.2 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect @@ -75,32 +76,31 @@ require ( github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect - github.com/klauspost/compress v1.11.7 // indirect - github.com/lib/pq v1.10.2 // indirect + github.com/klauspost/compress v1.13.6 // indirect + github.com/lib/pq v1.10.4 // indirect github.com/libp2p/go-buffer-pool v0.0.2 // indirect - github.com/magiconair/properties v1.8.5 // indirect + github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect - github.com/minio/highwayhash v1.0.1 // indirect + github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/opencontainers/image-spec v1.0.2 // indirect - github.com/opencontainers/runc v1.0.3 // indirect github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.29.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/rs/cors v1.7.0 // indirect + github.com/rs/cors v1.8.2 // indirect github.com/rs/zerolog v1.23.0 // indirect github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect - github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/afero v1.8.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect @@ -110,13 +110,13 @@ require ( github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/zondax/hid v0.9.0 // indirect - go.etcd.io/bbolt v1.3.5 // indirect - golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect - golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f // indirect - golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + go.etcd.io/bbolt v1.3.6 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/ini.v1 v1.66.4 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect nhooyr.io/websocket v1.8.6 // indirect ) diff --git a/go.sum b/go.sum index cb1b3b22474..a8f6d150085 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,10 @@ +bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,6 +17,7 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -26,12 +29,16 @@ cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+Y cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= +cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= +cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= @@ -45,6 +52,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= @@ -52,6 +60,9 @@ github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcI github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= @@ -67,17 +78,22 @@ github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= +github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= @@ -88,13 +104,16 @@ github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrU github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/Workiva/go-datastructures v1.0.52 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= +github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= -github.com/adlio/schema v1.1.13 h1:LeNMVg5Z1FX+Qgz8tJUijBLRdcpbFUElz+d1489On98= github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= +github.com/adlio/schema v1.3.0 h1:eSVYLxYWbm/6ReZBCkLw4Fz7uqC+ZNoPvA39bOwi52A= +github.com/adlio/schema v1.3.0/go.mod h1:51QzxkpeFs6lRY11kPye26IaFPOV+HqEj01t5aXXKfs= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -117,7 +136,12 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= +github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -126,7 +150,6 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= @@ -149,8 +172,10 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= @@ -166,6 +191,7 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= +github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= @@ -187,8 +213,9 @@ github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4ur github.com/confio/ics23/go v0.7.0 h1:00d2kukk7sPoHWL4zZBZwzxnpA2pec1NPdwbSokJ5w8= github.com/confio/ics23/go v0.7.0/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6 h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw= github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.2.1 h1:/EeEo2EtN3umhbbgCveyjifoMYg0pS+nMMEemaYw634= +github.com/containerd/continuity v0.2.1/go.mod h1:wCYX+dRqZdImhGucXOqTQn05AhX6EUDaGEMUzTFFpLg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -202,8 +229,8 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= -github.com/cosmos/cosmos-sdk v0.45.1 h1:PY79YxPea5qlRLExRnzg8/rT1Scc8GGgRs22p7DX99Q= -github.com/cosmos/cosmos-sdk v0.45.1/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ= +github.com/cosmos/cosmos-sdk v0.45.3 h1:PiVSU3IkNEDPhoxOZHk2lPnhwBBJgEYAtAR0jGXRN4g= +github.com/cosmos/cosmos-sdk v0.45.3/go.mod h1:qYm5JEr0ZlbnmoP/Q3b+dYMOliHf4ddHirpILiwZzqg= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -228,6 +255,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= @@ -241,6 +269,7 @@ github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WA github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= @@ -281,13 +310,16 @@ github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -306,13 +338,17 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= +github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= @@ -324,9 +360,10 @@ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7a github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -339,6 +376,10 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -394,8 +435,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= @@ -415,6 +457,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -428,6 +471,9 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= +github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -438,10 +484,12 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -464,6 +512,7 @@ github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uM github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -473,7 +522,9 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -498,16 +549,21 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -519,6 +575,7 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -526,6 +583,8 @@ github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJS github.com/jhump/protoreflect v1.9.0 h1:npqHz788dryJiR/l6K/RUQAyh2SwV91+d1dnh4RjO9w= github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -545,6 +604,7 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= @@ -552,8 +612,10 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -569,8 +631,8 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= +github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -580,8 +642,9 @@ github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc8 github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -603,15 +666,18 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -623,7 +689,7 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= @@ -634,6 +700,7 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= @@ -645,10 +712,16 @@ github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= +github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= +github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= @@ -677,8 +750,9 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= @@ -692,10 +766,12 @@ github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= @@ -711,21 +787,26 @@ github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144T github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8 h1:dy81yyLYJDwMTifq24Oi/IslOslRrDSb3jwDggjz3Z0= +github.com/pelletier/go-toml/v2 v2.0.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= +github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -738,8 +819,9 @@ github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeD github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -757,8 +839,9 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.29.0 h1:3jqPBvKT4OHAbje2Ql7KeaaSicDBCxMYwEJU1zRJceE= -github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -767,8 +850,9 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= @@ -785,8 +869,9 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= +github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.23.0 h1:UskrK+saS9P9Y789yNNulYKdARjPZuS35B8gJF2x60g= @@ -796,6 +881,7 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= +github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= @@ -821,16 +907,16 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -841,17 +927,20 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= +github.com/spf13/viper v1.11.0 h1:7OX/1FS6n7jHD1zGrZTM7WtY13ZELRyosK4k93oPr44= +github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= +github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= @@ -877,19 +966,25 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tendermint v0.34.14 h1:GCXmlS8Bqd2Ix3TQCpwYLUNHe+Y+QyJsm5YE+S/FkPo= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= +github.com/tendermint/tendermint v0.34.19 h1:y0P1qI5wSa9IRuhKnTDA6IUcOrLi1hXJuALR+R7HFEk= +github.com/tendermint/tendermint v0.34.19/go.mod h1:R5+wgIwSxMdKQcmOaeudL0Cjkr3HDkhpcdum6VeU3R4= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= +github.com/tendermint/tm-db v0.6.6 h1:EzhaOfR0bdKyATqcd5PNeyeq8r+V4bRPHBfyFdD9kGM= +github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= +github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -914,15 +1009,20 @@ github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= +go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -937,13 +1037,17 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -959,14 +1063,25 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= @@ -978,6 +1093,7 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1022,6 +1138,7 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1060,9 +1177,18 @@ golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f h1:w6wWR0H+nyVpbSAQbzVEIACVyr/h8l/BEkY6Sokc7Eg= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1074,13 +1200,15 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1126,6 +1254,7 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1152,6 +1281,7 @@ golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1161,6 +1291,7 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1168,6 +1299,7 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1181,14 +1313,24 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= +golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1203,9 +1345,13 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1255,12 +1401,14 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1270,8 +1418,13 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -1294,7 +1447,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= @@ -1306,6 +1458,10 @@ google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdr google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= +google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= +google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= +google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= +google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1354,8 +1510,10 @@ google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1375,13 +1533,24 @@ google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= +google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac h1:qSNTkEN+L2mvWcLgJOR+8bdHX9rN/IdU3A1Ghpfb1Rg= +google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1417,6 +1586,7 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -1433,12 +1603,14 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 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= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -1446,9 +1618,9 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.4 h1:SsAcf+mM7mRZo2nJNGt8mZCjG8ZRaNGMURJw7BsIST4= +gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -1481,7 +1653,9 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/modules/apps/27-interchain-accounts/controller/ibc_module.go b/modules/apps/27-interchain-accounts/controller/ibc_module.go index c00c9f5d1c2..325ec70959b 100644 --- a/modules/apps/27-interchain-accounts/controller/ibc_module.go +++ b/modules/apps/27-interchain-accounts/controller/ibc_module.go @@ -163,3 +163,8 @@ func (im IBCModule) OnTimeoutPacket( return im.app.OnTimeoutPacket(ctx, packet, relayer) } + +// GetAppVersion returns the interchain accounts metadata. +func (im IBCModule) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + return im.keeper.GetAppVersion(ctx, portID, channelID) +} diff --git a/modules/apps/27-interchain-accounts/controller/ibc_module_test.go b/modules/apps/27-interchain-accounts/controller/ibc_module_test.go index c0163e954e1..608996515c1 100644 --- a/modules/apps/27-interchain-accounts/controller/ibc_module_test.go +++ b/modules/apps/27-interchain-accounts/controller/ibc_module_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/tendermint/tendermint/crypto" + icacontroller "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller" "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types" clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" @@ -702,3 +703,23 @@ func (suite *InterchainAccountsTestSuite) TestSingleHostMultipleControllers() { }) } } + +func (suite *InterchainAccountsTestSuite) TestGetAppVersion() { + path := NewICAPath(suite.chainA, suite.chainB) + suite.coordinator.SetupConnections(path) + + err := SetupICAPath(path, TestOwnerAddress) + suite.Require().NoError(err) + + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + controllerModule := cbs.(icacontroller.IBCModule) + + appVersion, found := controllerModule.GetAppVersion(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) + suite.Require().True(found) + suite.Require().Equal(path.EndpointA.ChannelConfig.Version, appVersion) +} diff --git a/modules/apps/27-interchain-accounts/controller/keeper/account.go b/modules/apps/27-interchain-accounts/controller/keeper/account.go index dd87348876e..03eeef69f1f 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/account.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/account.go @@ -10,11 +10,10 @@ import ( ) // RegisterInterchainAccount is the entry point to registering an interchain account. -// It generates a new port identifier using the owner address, connection identifier, -// and counterparty connection identifier. It will bind to the port identifier and -// call 04-channel 'ChanOpenInit'. An error is returned if the port identifier is -// already in use. Gaining access to interchain accounts whose channels have closed -// cannot be done with this function. A regular MsgChanOpenInit must be used. +// It generates a new port identifier using the owner address. It will bind to the +// port identifier and call 04-channel 'ChanOpenInit'. An error is returned if the port +// identifier is already in use. Gaining access to interchain accounts whose channels +// have closed cannot be done with this function. A regular MsgChanOpenInit must be used. func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, connectionID, owner string) error { portID, err := icatypes.NewControllerPortID(owner) if err != nil { diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go index 87af9ae9c6f..86099b954bd 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go @@ -102,6 +102,11 @@ func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability return k.scopedKeeper.ClaimCapability(ctx, cap, name) } +// GetAppVersion calls the ICS4Wrapper GetAppVersion function. +func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + return k.ics4Wrapper.GetAppVersion(ctx, portID, channelID) +} + // GetActiveChannelID retrieves the active channelID from the store, keyed by the provided connectionID and portID func (k Keeper) GetActiveChannelID(ctx sdk.Context, connectionID, portID string) (string, bool) { store := ctx.KVStore(k.storeKey) diff --git a/modules/apps/27-interchain-accounts/controller/keeper/params.go b/modules/apps/27-interchain-accounts/controller/keeper/params.go index d199b8b554d..dce72c0c491 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/params.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/params.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" ) -// IsControllerEnabled retrieves the host enabled boolean from the paramstore. +// IsControllerEnabled retrieves the controller enabled boolean from the paramstore. // True is returned if the controller submodule is enabled. func (k Keeper) IsControllerEnabled(ctx sdk.Context) bool { var res bool @@ -14,12 +14,12 @@ func (k Keeper) IsControllerEnabled(ctx sdk.Context) bool { return res } -// GetParams returns the total set of the host submodule parameters. +// GetParams returns the total set of the controller submodule parameters. func (k Keeper) GetParams(ctx sdk.Context) types.Params { return types.NewParams(k.IsControllerEnabled(ctx)) } -// SetParams sets the total set of the host submodule parameters. +// SetParams sets the total set of the controller submodule parameters. func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { k.paramSpace.SetParamSet(ctx, ¶ms) } diff --git a/modules/apps/27-interchain-accounts/types/expected_keepers.go b/modules/apps/27-interchain-accounts/types/expected_keepers.go index 4c6a1708e43..8fb0b743cda 100644 --- a/modules/apps/27-interchain-accounts/types/expected_keepers.go +++ b/modules/apps/27-interchain-accounts/types/expected_keepers.go @@ -21,6 +21,7 @@ type AccountKeeper interface { // ICS4Wrapper defines the expected ICS4Wrapper for middleware type ICS4Wrapper interface { SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error + GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) } // ChannelKeeper defines the expected IBC channel keeper diff --git a/modules/apps/29-fee/client/cli/cli.go b/modules/apps/29-fee/client/cli/cli.go new file mode 100644 index 00000000000..a0141c20f9a --- /dev/null +++ b/modules/apps/29-fee/client/cli/cli.go @@ -0,0 +1,48 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" +) + +// GetQueryCmd returns the query commands for 29-fee +func GetQueryCmd() *cobra.Command { + queryCmd := &cobra.Command{ + Use: "ibc-fee", + Short: "IBC relayer incentivization query subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + } + + queryCmd.AddCommand( + GetCmdIncentivizedPacket(), + GetCmdIncentivizedPackets(), + GetCmdTotalRecvFees(), + GetCmdTotalAckFees(), + GetCmdTotalTimeoutFees(), + GetCmdIncentivizedPacketsForChannel(), + GetCmdCounterpartyAddress(), + GetCmdFeeEnabledChannel(), + GetCmdFeeEnabledChannels(), + ) + + return queryCmd +} + +// NewTxCmd returns the transaction commands for 29-fee +func NewTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: "ibc-fee", + Short: "IBC relayer incentivization transaction subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + txCmd.AddCommand( + NewPayPacketFeeAsyncTxCmd(), + NewRegisterCounterpartyAddress(), + ) + + return txCmd +} diff --git a/modules/apps/29-fee/client/cli/query.go b/modules/apps/29-fee/client/cli/query.go new file mode 100644 index 00000000000..a183c8f89d3 --- /dev/null +++ b/modules/apps/29-fee/client/cli/query.go @@ -0,0 +1,395 @@ +package cli + +import ( + "fmt" + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + "github.com/spf13/cobra" +) + +// GetCmdIncentivizedPacket returns the unrelayed incentivized packet for a given packetID +func GetCmdIncentivizedPacket() *cobra.Command { + cmd := &cobra.Command{ + Use: "packet [port-id] [channel-id] [sequence]", + Short: "Query for an unrelayed incentivized packet by port-id, channel-id and packet sequence.", + Long: "Query for an unrelayed incentivized packet by port-id, channel-id and packet sequence.", + Args: cobra.ExactArgs(3), + Example: fmt.Sprintf("%s query ibc-fee packet-by-id", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + seq, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + + packetID := channeltypes.PacketId{ + PortId: args[0], + ChannelId: args[1], + Sequence: seq, + } + + req := &types.QueryIncentivizedPacketRequest{ + PacketId: packetID, + QueryHeight: uint64(clientCtx.Height), + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.IncentivizedPacket(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdIncentivizedPackets returns all of the unrelayed incentivized packets +func GetCmdIncentivizedPackets() *cobra.Command { + cmd := &cobra.Command{ + Use: "packets", + Short: "Query for all of the unrelayed incentivized packets and associated fees across all channels.", + Long: "Query for all of the unrelayed incentivized packets and associated fees across all channels.", + Args: cobra.NoArgs, + Example: fmt.Sprintf("%s query ibc-fee packets", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + req := &types.QueryIncentivizedPacketsRequest{ + Pagination: pageReq, + QueryHeight: uint64(clientCtx.Height), + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.IncentivizedPackets(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "packets") + + return cmd +} + +// GetCmdTotalRecvFees returns the command handler for the Query/TotalRecvFees rpc. +func GetCmdTotalRecvFees() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-recv-fees [port-id] [channel-id] [sequence]", + Short: "Query the total receive fees for a packet", + Long: "Query the total receive fees for a packet", + Args: cobra.ExactArgs(3), + Example: fmt.Sprintf("%s query ibc-fee total-recv-fees transfer channel-5 100", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + portID, channelID := args[0], args[1] + seq, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + + packetID := channeltypes.NewPacketId(portID, channelID, seq) + + if err := packetID.Validate(); err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryTotalRecvFeesRequest{ + PacketId: packetID, + } + + res, err := queryClient.TotalRecvFees(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdTotalAckFees returns the command handler for the Query/TotalAckFees rpc. +func GetCmdTotalAckFees() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-ack-fees [port-id] [channel-id] [sequence]", + Short: "Query the total acknowledgement fees for a packet", + Long: "Query the total acknowledgement fees for a packet", + Args: cobra.ExactArgs(3), + Example: fmt.Sprintf("%s query ibc-fee total-ack-fees transfer channel-5 100", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + portID, channelID := args[0], args[1] + seq, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + + packetID := channeltypes.NewPacketId(portID, channelID, seq) + + if err := packetID.Validate(); err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryTotalAckFeesRequest{ + PacketId: packetID, + } + + res, err := queryClient.TotalAckFees(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdTotalTimeoutFees returns the command handler for the Query/TotalTimeoutFees rpc. +func GetCmdTotalTimeoutFees() *cobra.Command { + cmd := &cobra.Command{ + Use: "total-timeout-fees [port-id] [channel-id] [sequence]", + Short: "Query the total timeout fees for a packet", + Long: "Query the total timeout fees for a packet", + Args: cobra.ExactArgs(3), + Example: fmt.Sprintf("%s query ibc-fee total-timeout-fees transfer channel-5 100", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + portID, channelID := args[0], args[1] + seq, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + + packetID := channeltypes.NewPacketId(portID, channelID, seq) + + if err := packetID.Validate(); err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryTotalTimeoutFeesRequest{ + PacketId: packetID, + } + + res, err := queryClient.TotalTimeoutFees(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdCounterpartyAddress returns the command handler for the Query/CounterpartyAddress rpc. +func GetCmdCounterpartyAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "counterparty-address [channel-id] [address]", + Short: "Query the relayer counterparty address on a given channel", + Long: "Query the relayer counterparty address on a given channel", + Args: cobra.ExactArgs(2), + Example: fmt.Sprintf("%s query ibc-fee counterparty-address channel-5 cosmos1layxcsmyye0dc0har9sdfzwckaz8sjwlfsj8zs", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + if _, err := sdk.AccAddressFromBech32(args[1]); err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryCounterpartyAddressRequest{ + ChannelId: args[0], + RelayerAddress: args[1], + } + + res, err := queryClient.CounterpartyAddress(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + return cmd +} + +// GetCmdFeeEnabledChannels returns the command handler for the Query/FeeEnabledChannels rpc. +func GetCmdFeeEnabledChannels() *cobra.Command { + cmd := &cobra.Command{ + Use: "channels", + Short: "Query the ibc-fee enabled channels", + Long: "Query the ibc-fee enabled channels", + Args: cobra.NoArgs, + Example: fmt.Sprintf("%s query ibc-fee channels", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + req := &types.QueryFeeEnabledChannelsRequest{ + Pagination: pageReq, + QueryHeight: uint64(clientCtx.Height), + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.FeeEnabledChannels(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "channels") + + return cmd +} + +// GetCmdFeeEnabledChannel returns the command handler for the Query/FeeEnabledChannel rpc. +func GetCmdFeeEnabledChannel() *cobra.Command { + cmd := &cobra.Command{ + Use: "channel [port-id] [channel-id]", + Short: "Query the ibc-fee enabled status of a channel", + Long: "Query the ibc-fee enabled status of a channel", + Args: cobra.ExactArgs(2), + Example: fmt.Sprintf("%s query ibc-fee channel transfer channel-6", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + req := &types.QueryFeeEnabledChannelRequest{ + PortId: args[0], + ChannelId: args[1], + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.FeeEnabledChannel(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdIncentivizedPacketsForChannel returns all of the unrelayed incentivized packets on a given channel +func GetCmdIncentivizedPacketsForChannel() *cobra.Command { + cmd := &cobra.Command{ + Use: "packets-for-channel [port-id] [channel-id]", + Short: "Query for all of the unrelayed incentivized packets on a given channel", + Long: "Query for all of the unrelayed incentivized packets on a given channel. These are packets that have not yet been relayed.", + Args: cobra.ExactArgs(2), + Example: fmt.Sprintf("%s query ibc-fee packets-for-channel", version.AppName), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + req := &types.QueryIncentivizedPacketsForChannelRequest{ + Pagination: pageReq, + PortId: args[0], + ChannelId: args[1], + QueryHeight: uint64(clientCtx.Height), + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.IncentivizedPacketsForChannel(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "packets-for-channel") + + return cmd +} diff --git a/modules/apps/29-fee/client/cli/tx.go b/modules/apps/29-fee/client/cli/tx.go new file mode 100644 index 00000000000..f1f858b60cd --- /dev/null +++ b/modules/apps/29-fee/client/cli/tx.go @@ -0,0 +1,124 @@ +package cli + +import ( + "fmt" + "strconv" + "strings" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + "github.com/spf13/cobra" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +) + +const ( + flagRecvFee = "recv-fee" + flagAckFee = "ack-fee" + flagTimeoutFee = "timeout-fee" +) + +// NewPayPacketFeeAsyncTxCmd returns the command to create a MsgPayPacketFeeAsync +func NewPayPacketFeeAsyncTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "pay-packet-fee [src-port] [src-channel] [sequence]", + Short: "Pay a fee to incentivize an existing IBC packet", + Long: strings.TrimSpace(`Pay a fee to incentivize an existing IBC packet.`), + Example: fmt.Sprintf("%s tx ibc-fee pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + // NOTE: specifying non-nil relayers is currently unsupported + var relayers []string + + sender := clientCtx.GetFromAddress().String() + seq, err := strconv.ParseUint(args[2], 10, 64) + if err != nil { + return err + } + + packetID := channeltypes.NewPacketId(args[0], args[1], seq) + + recvFeeStr, err := cmd.Flags().GetString(flagRecvFee) + if err != nil { + return err + } + + recvFee, err := sdk.ParseCoinsNormalized(recvFeeStr) + if err != nil { + return err + } + + ackFeeStr, err := cmd.Flags().GetString(flagAckFee) + if err != nil { + return err + } + + ackFee, err := sdk.ParseCoinsNormalized(ackFeeStr) + if err != nil { + return err + } + + timeoutFeeStr, err := cmd.Flags().GetString(flagTimeoutFee) + if err != nil { + return err + } + + timeoutFee, err := sdk.ParseCoinsNormalized(timeoutFeeStr) + if err != nil { + return err + } + + fee := types.Fee{ + RecvFee: recvFee, + AckFee: ackFee, + TimeoutFee: timeoutFee, + } + + packetFee := types.NewPacketFee(fee, sender, relayers) + msg := types.NewMsgPayPacketFeeAsync(packetID, packetFee) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(flagRecvFee, "", "Fee paid to a relayer for relaying a packet receive.") + cmd.Flags().String(flagAckFee, "", "Fee paid to a relayer for relaying a packet acknowledgement.") + cmd.Flags().String(flagTimeoutFee, "", "Fee paid to a relayer for relaying a packet timeout.") + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +// NewRegisterCounterpartyAddress returns the command to create a MsgRegisterCounterpartyAddress +func NewRegisterCounterpartyAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "register-counterparty [address] [counterparty-address] [channel-id]", + Short: "Register a counterparty relayer address on a given channel.", + Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`), + Example: fmt.Sprintf("%s tx ibc-fee register-counterparty cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh osmo1v5y0tz01llxzf4c2afml8s3awue0ymju22wxx2 channel-0", version.AppName), + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgRegisterCounterpartyAddress(args[0], args[1], args[2]) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/modules/apps/29-fee/fee_test.go b/modules/apps/29-fee/fee_test.go new file mode 100644 index 00000000000..d2445adef22 --- /dev/null +++ b/modules/apps/29-fee/fee_test.go @@ -0,0 +1,73 @@ +package fee_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" + ibcmock "github.com/cosmos/ibc-go/v3/testing/mock" +) + +type FeeTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain + chainC *ibctesting.TestChain + + path *ibctesting.Path + pathAToC *ibctesting.Path +} + +func (suite *FeeTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 3) + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) + suite.chainC = suite.coordinator.GetChain(ibctesting.GetChainID(3)) + + path := ibctesting.NewPath(suite.chainA, suite.chainB) + mockFeeVersion := string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})) + path.EndpointA.ChannelConfig.Version = mockFeeVersion + path.EndpointB.ChannelConfig.Version = mockFeeVersion + path.EndpointA.ChannelConfig.PortID = ibctesting.MockFeePort + path.EndpointB.ChannelConfig.PortID = ibctesting.MockFeePort + suite.path = path + + path = ibctesting.NewPath(suite.chainA, suite.chainC) + path.EndpointA.ChannelConfig.Version = mockFeeVersion + path.EndpointB.ChannelConfig.Version = mockFeeVersion + path.EndpointA.ChannelConfig.PortID = ibctesting.MockFeePort + path.EndpointB.ChannelConfig.PortID = ibctesting.MockFeePort + suite.pathAToC = path +} + +func TestIBCFeeTestSuite(t *testing.T) { + suite.Run(t, new(FeeTestSuite)) +} + +func (suite *FeeTestSuite) CreateMockPacket() channeltypes.Packet { + return channeltypes.NewPacket( + ibcmock.MockPacketData, + suite.chainA.SenderAccount.GetSequence(), + suite.path.EndpointA.ChannelConfig.PortID, + suite.path.EndpointA.ChannelID, + suite.path.EndpointB.ChannelConfig.PortID, + suite.path.EndpointB.ChannelID, + clienttypes.NewHeight(0, 100), + 0, + ) +} + +// helper function +func lockFeeModule(chain *ibctesting.TestChain) { + ctx := chain.GetContext() + storeKey := chain.GetSimApp().GetKey(types.ModuleName) + store := ctx.KVStore(storeKey) + store.Set(types.KeyLocked(), []byte{1}) +} diff --git a/modules/apps/29-fee/ibc_module.go b/modules/apps/29-fee/ibc_module.go new file mode 100644 index 00000000000..6ed9faa1f34 --- /dev/null +++ b/modules/apps/29-fee/ibc_module.go @@ -0,0 +1,274 @@ +package fee + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/keeper" + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" + "github.com/cosmos/ibc-go/v3/modules/core/exported" +) + +// IBCModule implements the ICS26 callbacks for the fee middleware given the fee keeper and the underlying application. +type IBCModule struct { + keeper keeper.Keeper + app porttypes.IBCModule +} + +// NewIBCModule creates a new IBCModule given the keeper and underlying application +func NewIBCModule(k keeper.Keeper, app porttypes.IBCModule) IBCModule { + return IBCModule{ + keeper: k, + app: app, + } +} + +// OnChanOpenInit implements the IBCModule interface +func (im IBCModule) OnChanOpenInit( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID string, + channelID string, + chanCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + version string, +) error { + var versionMetadata types.Metadata + if err := types.ModuleCdc.UnmarshalJSON([]byte(version), &versionMetadata); err != nil { + // Since it is valid for fee version to not be specified, the above middleware version may be for a middleware + // lower down in the stack. Thus, if it is not a fee version we pass the entire version string onto the underlying + // application. + return im.app.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, + chanCap, counterparty, version) + } + + if versionMetadata.FeeVersion != types.Version { + return sdkerrors.Wrapf(types.ErrInvalidVersion, "expected %s, got %s", types.Version, versionMetadata.FeeVersion) + } + + im.keeper.SetFeeEnabled(ctx, portID, channelID) + + // call underlying app's OnChanOpenInit callback with the appVersion + return im.app.OnChanOpenInit(ctx, order, connectionHops, portID, channelID, + chanCap, counterparty, versionMetadata.AppVersion) +} + +// OnChanOpenTry implements the IBCModule interface +// If the channel is not fee enabled the underlying application version will be returned +// If the channel is fee enabled we merge the underlying application version with the ics29 version +func (im IBCModule) OnChanOpenTry( + ctx sdk.Context, + order channeltypes.Order, + connectionHops []string, + portID, + channelID string, + chanCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, + counterpartyVersion string, +) (string, error) { + var versionMetadata types.Metadata + if err := types.ModuleCdc.UnmarshalJSON([]byte(counterpartyVersion), &versionMetadata); err != nil { + // Since it is valid for fee version to not be specified, the above middleware version may be for a middleware + // lower down in the stack. Thus, if it is not a fee version we pass the entire version string onto the underlying + // application. + return im.app.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, chanCap, counterparty, counterpartyVersion) + } + + if versionMetadata.FeeVersion != types.Version { + return "", sdkerrors.Wrapf(types.ErrInvalidVersion, "expected %s, got %s", types.Version, versionMetadata.FeeVersion) + } + + im.keeper.SetFeeEnabled(ctx, portID, channelID) + + // call underlying app's OnChanOpenTry callback with the app versions + appVersion, err := im.app.OnChanOpenTry(ctx, order, connectionHops, portID, channelID, chanCap, counterparty, versionMetadata.AppVersion) + if err != nil { + return "", err + } + + versionMetadata.AppVersion = appVersion + + versionBytes, err := types.ModuleCdc.MarshalJSON(&versionMetadata) + if err != nil { + return "", err + } + + return string(versionBytes), nil +} + +// OnChanOpenAck implements the IBCModule interface +func (im IBCModule) OnChanOpenAck( + ctx sdk.Context, + portID, + channelID string, + counterpartyChannelID string, + counterpartyVersion string, +) error { + // If handshake was initialized with fee enabled it must complete with fee enabled. + // If handshake was initialized with fee disabled it must complete with fee disabled. + if im.keeper.IsFeeEnabled(ctx, portID, channelID) { + var versionMetadata types.Metadata + if err := types.ModuleCdc.UnmarshalJSON([]byte(counterpartyVersion), &versionMetadata); err != nil { + return sdkerrors.Wrap(types.ErrInvalidVersion, "failed to unmarshal ICS29 counterparty version metadata") + } + + if versionMetadata.FeeVersion != types.Version { + return sdkerrors.Wrapf(types.ErrInvalidVersion, "expected counterparty fee version: %s, got: %s", types.Version, versionMetadata.FeeVersion) + } + + // call underlying app's OnChanOpenAck callback with the counterparty app version. + return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, versionMetadata.AppVersion) + } + + // call underlying app's OnChanOpenAck callback with the counterparty app version. + return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion) +} + +// OnChanOpenConfirm implements the IBCModule interface +func (im IBCModule) OnChanOpenConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + // call underlying app's OnChanOpenConfirm callback. + return im.app.OnChanOpenConfirm(ctx, portID, channelID) +} + +// OnChanCloseInit implements the IBCModule interface +func (im IBCModule) OnChanCloseInit( + ctx sdk.Context, + portID, + channelID string, +) error { + if err := im.app.OnChanCloseInit(ctx, portID, channelID); err != nil { + return err + } + + if err := im.keeper.RefundFeesOnChannelClosure(ctx, portID, channelID); err != nil { + return err + } + + return nil +} + +// OnChanCloseConfirm implements the IBCModule interface +func (im IBCModule) OnChanCloseConfirm( + ctx sdk.Context, + portID, + channelID string, +) error { + if err := im.app.OnChanCloseConfirm(ctx, portID, channelID); err != nil { + return err + } + + if err := im.keeper.RefundFeesOnChannelClosure(ctx, portID, channelID); err != nil { + return err + } + + return nil +} + +// OnRecvPacket implements the IBCModule interface. +// If fees are not enabled, this callback will default to the ibc-core packet callback +func (im IBCModule) OnRecvPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) exported.Acknowledgement { + if !im.keeper.IsFeeEnabled(ctx, packet.DestinationPort, packet.DestinationChannel) { + return im.app.OnRecvPacket(ctx, packet, relayer) + } + + ack := im.app.OnRecvPacket(ctx, packet, relayer) + + // incase of async aknowledgement (ack == nil) store the relayer address for use later during async WriteAcknowledgement + if ack == nil { + im.keeper.SetRelayerAddressForAsyncAck(ctx, channeltypes.NewPacketId(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()), relayer.String()) + return nil + } + + // if forwardRelayer is not found we refund recv_fee + forwardRelayer, _ := im.keeper.GetCounterpartyAddress(ctx, relayer.String(), packet.GetDestChannel()) + + return types.NewIncentivizedAcknowledgement(forwardRelayer, ack.Acknowledgement(), ack.Success()) +} + +// OnAcknowledgementPacket implements the IBCModule interface +// If fees are not enabled, this callback will default to the ibc-core packet callback +func (im IBCModule) OnAcknowledgementPacket( + ctx sdk.Context, + packet channeltypes.Packet, + acknowledgement []byte, + relayer sdk.AccAddress, +) error { + if !im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) { + return im.app.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer) + } + + ack := new(types.IncentivizedAcknowledgement) + if err := types.ModuleCdc.UnmarshalJSON(acknowledgement, ack); err != nil { + return sdkerrors.Wrapf(err, "cannot unmarshal ICS-29 incentivized packet acknowledgement: %v", ack) + } + + if im.keeper.IsLocked(ctx) { + // if the fee keeper is locked then fee logic should be skipped + // this may occur in the presence of a severe bug which leads to invalid state + // the fee keeper will be unlocked after manual intervention + // the acknowledgement has been unmarshalled into an ics29 acknowledgement + // since the counterparty is still sending incentivized acknowledgements + // for fee enabled channels + // + // Please see ADR 004 for more information. + return im.app.OnAcknowledgementPacket(ctx, packet, ack.Result, relayer) + } + + packetID := channeltypes.NewPacketId(packet.SourcePort, packet.SourceChannel, packet.Sequence) + feesInEscrow, found := im.keeper.GetFeesInEscrow(ctx, packetID) + if found { + im.keeper.DistributePacketFeesOnAcknowledgement(ctx, ack.ForwardRelayerAddress, relayer, feesInEscrow.PacketFees) + + // removes the fees from the store as fees are now paid + im.keeper.DeleteFeesInEscrow(ctx, packetID) + } + + // call underlying callback + return im.app.OnAcknowledgementPacket(ctx, packet, ack.Result, relayer) +} + +// OnTimeoutPacket implements the IBCModule interface +// If fees are not enabled, this callback will default to the ibc-core packet callback +func (im IBCModule) OnTimeoutPacket( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, +) error { + // if the fee keeper is locked then fee logic should be skipped + // this may occur in the presence of a severe bug which leads to invalid state + // the fee keeper will be unlocked after manual intervention + // + // Please see ADR 004 for more information. + if !im.keeper.IsFeeEnabled(ctx, packet.SourcePort, packet.SourceChannel) || im.keeper.IsLocked(ctx) { + return im.app.OnTimeoutPacket(ctx, packet, relayer) + } + + packetID := channeltypes.NewPacketId(packet.SourcePort, packet.SourceChannel, packet.Sequence) + feesInEscrow, found := im.keeper.GetFeesInEscrow(ctx, packetID) + if found { + im.keeper.DistributePacketFeesOnTimeout(ctx, relayer, feesInEscrow.PacketFees) + + // removes the fee from the store as fee is now paid + im.keeper.DeleteFeesInEscrow(ctx, packetID) + } + + // call underlying callback + return im.app.OnTimeoutPacket(ctx, packet, relayer) +} + +// GetAppVersion returns the application version of the underlying application +func (im IBCModule) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + return im.keeper.GetAppVersion(ctx, portID, channelID) +} diff --git a/modules/apps/29-fee/ibc_module_test.go b/modules/apps/29-fee/ibc_module_test.go new file mode 100644 index 00000000000..3f5cf64635a --- /dev/null +++ b/modules/apps/29-fee/ibc_module_test.go @@ -0,0 +1,912 @@ +package fee_test + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + fee "github.com/cosmos/ibc-go/v3/modules/apps/29-fee" + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" + "github.com/cosmos/ibc-go/v3/modules/core/exported" + ibctesting "github.com/cosmos/ibc-go/v3/testing" + ibcmock "github.com/cosmos/ibc-go/v3/testing/mock" +) + +var ( + defaultRecvFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}} + defaultAckFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(200)}} + defaultTimeoutFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(300)}} +) + +// Tests OnChanOpenInit on ChainA +func (suite *FeeTestSuite) TestOnChanOpenInit() { + testCases := []struct { + name string + version string + expPass bool + }{ + { + "success - valid fee middleware and mock version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), + true, + }, + { + "success - fee version not included, only perform mock logic", + ibcmock.Version, + true, + }, + { + "invalid fee middleware version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: "invalid-ics29-1", AppVersion: ibcmock.Version})), + false, + }, + { + "invalid mock version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: "invalid-mock-version"})), + false, + }, + { + "mock version not wrapped", + types.Version, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + // reset suite + suite.SetupTest() + suite.coordinator.SetupConnections(suite.path) + + // setup mock callback + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanOpenInit = func(ctx sdk.Context, order channeltypes.Order, connectionHops []string, + portID, channelID string, chanCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, version string, + ) error { + if version != ibcmock.Version { + return fmt.Errorf("incorrect mock version") + } + return nil + } + + suite.path.EndpointA.ChannelID = ibctesting.FirstChannelID + + counterparty := channeltypes.NewCounterparty(suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID) + channel := &channeltypes.Channel{ + State: channeltypes.INIT, + Ordering: channeltypes.UNORDERED, + Counterparty: counterparty, + ConnectionHops: []string{suite.path.EndpointA.ConnectionID}, + Version: tc.version, + } + + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + chanCap, err := suite.chainA.App.GetScopedIBCKeeper().NewCapability(suite.chainA.GetContext(), host.ChannelCapabilityPath(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID)) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + err = cbs.OnChanOpenInit(suite.chainA.GetContext(), channel.Ordering, channel.GetConnectionHops(), + suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, chanCap, counterparty, channel.Version) + + if tc.expPass { + suite.Require().NoError(err, "unexpected error from version: %s", tc.version) + } else { + suite.Require().Error(err, "error not returned for version: %s", tc.version) + } + }) + } +} + +// Tests OnChanOpenTry on ChainA +func (suite *FeeTestSuite) TestOnChanOpenTry() { + testCases := []struct { + name string + cpVersion string + crossing bool + expPass bool + }{ + { + "success - valid fee middleware version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), + false, + true, + }, + { + "success - valid mock version", + ibcmock.Version, + false, + true, + }, + { + "success - crossing hellos: valid fee middleware", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), + true, + true, + }, + { + "invalid fee middleware version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: "invalid-ics29-1", AppVersion: ibcmock.Version})), + false, + false, + }, + { + "invalid mock version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: "invalid-mock-version"})), + false, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + // reset suite + suite.SetupTest() + suite.coordinator.SetupConnections(suite.path) + suite.path.EndpointB.ChanOpenInit() + + // setup mock callback + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanOpenTry = func(ctx sdk.Context, order channeltypes.Order, connectionHops []string, + portID, channelID string, chanCap *capabilitytypes.Capability, + counterparty channeltypes.Counterparty, counterpartyVersion string, + ) (string, error) { + if counterpartyVersion != ibcmock.Version { + return "", fmt.Errorf("incorrect mock version") + } + return ibcmock.Version, nil + } + + var ( + chanCap *capabilitytypes.Capability + ok bool + err error + ) + if tc.crossing { + suite.path.EndpointA.ChanOpenInit() + chanCap, ok = suite.chainA.GetSimApp().ScopedFeeMockKeeper.GetCapability(suite.chainA.GetContext(), host.ChannelCapabilityPath(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID)) + suite.Require().True(ok) + } else { + chanCap, err = suite.chainA.App.GetScopedIBCKeeper().NewCapability(suite.chainA.GetContext(), host.ChannelCapabilityPath(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID)) + suite.Require().NoError(err) + } + + suite.path.EndpointA.ChannelID = ibctesting.FirstChannelID + + counterparty := channeltypes.NewCounterparty(suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID) + channel := &channeltypes.Channel{ + State: channeltypes.INIT, + Ordering: channeltypes.UNORDERED, + Counterparty: counterparty, + ConnectionHops: []string{suite.path.EndpointA.ConnectionID}, + Version: tc.cpVersion, + } + + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + _, err = cbs.OnChanOpenTry(suite.chainA.GetContext(), channel.Ordering, channel.GetConnectionHops(), + suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, chanCap, counterparty, tc.cpVersion) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } +} + +// Tests OnChanOpenAck on ChainA +func (suite *FeeTestSuite) TestOnChanOpenAck() { + testCases := []struct { + name string + cpVersion string + malleate func(suite *FeeTestSuite) + expPass bool + }{ + { + "success", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), + func(suite *FeeTestSuite) {}, + true, + }, + { + "invalid fee version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: "invalid-ics29-1", AppVersion: ibcmock.Version})), + func(suite *FeeTestSuite) {}, + false, + }, + { + "invalid mock version", + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: "invalid-mock-version"})), + func(suite *FeeTestSuite) {}, + false, + }, + { + "invalid version fails to unmarshal metadata", + "invalid-version", + func(suite *FeeTestSuite) {}, + false, + }, + { + "previous INIT set without fee, however counterparty set fee version", // note this can only happen with incompetent or malicious counterparty chain + string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})), + func(suite *FeeTestSuite) { + // do the first steps without fee version, then pass the fee version as counterparty version in ChanOpenACK + suite.path.EndpointA.ChannelConfig.Version = ibcmock.Version + suite.path.EndpointB.ChannelConfig.Version = ibcmock.Version + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.SetupConnections(suite.path) + + // setup mock callback + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanOpenAck = func( + ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string, + ) error { + if counterpartyVersion != ibcmock.Version { + return fmt.Errorf("incorrect mock version") + } + return nil + } + + // malleate test case + tc.malleate(suite) + + suite.path.EndpointA.ChanOpenInit() + suite.path.EndpointB.ChanOpenTry() + + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + err = cbs.OnChanOpenAck(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, suite.path.EndpointA.Counterparty.ChannelID, tc.cpVersion) + if tc.expPass { + suite.Require().NoError(err, "unexpected error for case: %s", tc.name) + } else { + suite.Require().Error(err, "%s expected error but returned none", tc.name) + } + }) + } +} + +func (suite *FeeTestSuite) TestOnChanCloseInit() { + var ( + refundAcc sdk.AccAddress + fee types.Fee + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", func() {}, true, + }, + { + "application callback fails", func() { + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseInit = func( + ctx sdk.Context, portID, channelID string, + ) error { + return fmt.Errorf("application callback fails") + } + }, false, + }, + { + "RefundFeesOnChannelClosure fails - invalid refund address", func() { + // store the fee in state & update escrow account balance + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(1)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, "invalid refund address", nil)}) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) // setup channel + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + fee = types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + } + + refundAcc = suite.chainA.SenderAccount.GetAddress() + packetFee := types.NewPacketFee(fee, refundAcc.String(), []string{}) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + tc.malleate() + + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + err = cbs.OnChanCloseInit(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } +} + +// Tests OnChanCloseConfirm on chainA +func (suite *FeeTestSuite) TestOnChanCloseConfirm() { + var ( + refundAcc sdk.AccAddress + fee types.Fee + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", func() {}, true, + }, + { + "application callback fails", func() { + suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanCloseConfirm = func( + ctx sdk.Context, portID, channelID string, + ) error { + return fmt.Errorf("application callback fails") + } + }, false, + }, + { + "RefundChannelFeesOnClosure fails - refund address is invalid", func() { + // store the fee in state & update escrow account balance + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(1)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, "invalid refund address", nil)}) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) // setup channel + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + fee = types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + } + + refundAcc = suite.chainA.SenderAccount.GetAddress() + packetFee := types.NewPacketFee(fee, refundAcc.String(), []string{}) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + tc.malleate() + + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + err = cbs.OnChanCloseConfirm(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + + }) + } +} + +func (suite *FeeTestSuite) TestOnRecvPacket() { + testCases := []struct { + name string + malleate func() + // forwardRelayer bool indicates if there is a forwardRelayer address set + forwardRelayer bool + feeEnabled bool + }{ + { + "success", + func() {}, + true, + true, + }, + { + "async write acknowledgement: ack is nil", + func() { + // setup mock callback + suite.chainB.GetSimApp().FeeMockModule.IBCApp.OnRecvPacket = func( + ctx sdk.Context, + packet channeltypes.Packet, + relayer sdk.AccAddress, + ) exported.Acknowledgement { + return nil + } + }, + true, + true, + }, + { + "fee not enabled", + func() { + suite.chainB.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainB.GetContext(), suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID) + }, + true, + false, + }, + { + "forward address is not found", + func() { + suite.chainB.GetSimApp().IBCFeeKeeper.SetCounterpartyAddress(suite.chainB.GetContext(), suite.chainA.SenderAccount.GetAddress().String(), "", suite.path.EndpointB.ChannelID) + }, + false, + true, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + // setup pathAToC (chainA -> chainC) first in order to have different channel IDs for chainA & chainB + suite.coordinator.Setup(suite.pathAToC) + // setup path for chainA -> chainB + suite.coordinator.Setup(suite.path) + + suite.chainB.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainB.GetContext(), suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID) + + packet := suite.CreateMockPacket() + + // set up module and callbacks + module, _, err := suite.chainB.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainB.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainB.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + suite.chainB.GetSimApp().IBCFeeKeeper.SetCounterpartyAddress(suite.chainB.GetContext(), suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), suite.path.EndpointB.ChannelID) + + // malleate test case + tc.malleate() + + result := cbs.OnRecvPacket(suite.chainB.GetContext(), packet, suite.chainA.SenderAccount.GetAddress()) + + switch { + case tc.name == "success": + forwardAddr, _ := suite.chainB.GetSimApp().IBCFeeKeeper.GetCounterpartyAddress(suite.chainB.GetContext(), suite.chainA.SenderAccount.GetAddress().String(), suite.path.EndpointB.ChannelID) + + expectedAck := types.IncentivizedAcknowledgement{ + Result: ibcmock.MockAcknowledgement.Acknowledgement(), + ForwardRelayerAddress: forwardAddr, + UnderlyingAppSuccess: true, + } + suite.Require().Equal(expectedAck, result) + + case !tc.feeEnabled: + suite.Require().Equal(ibcmock.MockAcknowledgement, result) + + case tc.forwardRelayer && result == nil: + suite.Require().Equal(nil, result) + packetID := channeltypes.NewPacketId(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) + + // retrieve the forward relayer that was stored in `onRecvPacket` + relayer, _ := suite.chainB.GetSimApp().IBCFeeKeeper.GetRelayerAddressForAsyncAck(suite.chainB.GetContext(), packetID) + suite.Require().Equal(relayer, suite.chainA.SenderAccount.GetAddress().String()) + + case !tc.forwardRelayer: + expectedAck := types.IncentivizedAcknowledgement{ + Result: ibcmock.MockAcknowledgement.Acknowledgement(), + ForwardRelayerAddress: "", + UnderlyingAppSuccess: true, + } + suite.Require().Equal(expectedAck, result) + } + }) + } +} + +// different channel than sending chain +func (suite *FeeTestSuite) TestOnAcknowledgementPacket() { + var ( + ack []byte + packetFee types.PacketFee + originalBalance sdk.Coins + expectedBalance sdk.Coins + expectedRelayerBalance sdk.Coins + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() { + expectedRelayerBalance = packetFee.Fee.RecvFee.Add(packetFee.Fee.AckFee[0]) + }, + true, + }, + { + "no op success without a packet fee", + func() { + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, suite.chainA.SenderAccount.GetSequence()) + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetID) + + ack = types.IncentivizedAcknowledgement{ + Result: ibcmock.MockAcknowledgement.Acknowledgement(), + ForwardRelayerAddress: suite.chainA.SenderAccount.GetAddress().String(), + }.Acknowledgement() + + expectedBalance = originalBalance + }, + true, + }, + { + "ack wrong format", + func() { + ack = []byte("unsupported acknowledgement format") + + expectedBalance = originalBalance + }, + false, + }, + { + "channel is not fee not enabled, success", + func() { + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + ack = ibcmock.MockAcknowledgement.Acknowledgement() + + expectedBalance = originalBalance + }, + true, + }, + { + "success: fee module is disabled, skip fee logic", + func() { + lockFeeModule(suite.chainA) + + expectedBalance = originalBalance + }, + true, + }, + { + "fail on distribute receive fee (blocked address)", + func() { + blockedAddr := suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress() + + ack = types.IncentivizedAcknowledgement{ + Result: ibcmock.MockAcknowledgement.Acknowledgement(), + ForwardRelayerAddress: blockedAddr.String(), + }.Acknowledgement() + + expectedRelayerBalance = packetFee.Fee.AckFee + expectedBalance = expectedBalance.Add(packetFee.Fee.RecvFee...) + }, + true, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) + packet := suite.CreateMockPacket() + + expectedRelayerBalance = sdk.Coins{} // reset + + // set up module and callbacks + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + // escrow the packet fee + packetID := channeltypes.NewPacketId(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + packetFee = types.NewPacketFee( + types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + }, + suite.chainA.SenderAccount.GetAddress().String(), + []string{}, + ) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) + err = suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), types.ModuleName, packetFee.Fee.Total()) + suite.Require().NoError(err) + + relayerAddr := suite.chainB.SenderAccount.GetAddress() + + // must be changed explicitly + ack = types.IncentivizedAcknowledgement{ + Result: ibcmock.MockAcknowledgement.Acknowledgement(), + ForwardRelayerAddress: relayerAddr.String(), + }.Acknowledgement() + + // log original sender balance + // NOTE: balance is logged after escrowing tokens + originalBalance = sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)) + + // default to success case + expectedBalance = originalBalance.Add(packetFee.Fee.TimeoutFee[0]) + + // malleate test case + tc.malleate() + + err = cbs.OnAcknowledgementPacket(suite.chainA.GetContext(), packet, ack, relayerAddr) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + + suite.Require().Equal( + expectedBalance, + sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)), + ) + + relayerBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), relayerAddr, ibctesting.TestCoin.Denom)) + suite.Require().Equal( + expectedRelayerBalance, + relayerBalance, + ) + }) + } +} + +func (suite *FeeTestSuite) TestOnTimeoutPacket() { + var ( + relayerAddr sdk.AccAddress + packetFee types.PacketFee + originalBalance sdk.Coins + expectedBalance sdk.Coins + ) + testCases := []struct { + name string + malleate func() + expFeeDistributed bool + }{ + { + "success", + func() {}, + true, + }, + { + "fee not enabled", + func() { + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + + expectedBalance = originalBalance + }, + false, + }, + { + "fee module is disabled, skip fee logic", + func() { + lockFeeModule(suite.chainA) + + expectedBalance = originalBalance + }, + false, + }, + { + "no op if identified packet fee doesn't exist", + func() { + // delete packet fee + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, suite.chainA.SenderAccount.GetSequence()) + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetID) + + expectedBalance = originalBalance + }, + false, + }, + { + "distribute fee fails for timeout fee (blocked address)", + func() { + relayerAddr = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress() + + expectedBalance = originalBalance. + Add(packetFee.Fee.RecvFee...). + Add(packetFee.Fee.AckFee...). + Add(packetFee.Fee.TimeoutFee...) + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) + packet := suite.CreateMockPacket() + + // set up module and callbacks + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + packetID := channeltypes.NewPacketId(packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + + // must be explicitly changed + relayerAddr = suite.chainB.SenderAccount.GetAddress() + + packetFee = types.NewPacketFee( + types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + }, + suite.chainA.SenderAccount.GetAddress().String(), + []string{}, + ) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) + err = suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), types.ModuleName, packetFee.Fee.Total()) + suite.Require().NoError(err) + + // log original sender balance + // NOTE: balance is logged after escrowing tokens + originalBalance = sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)) + + // default to success case + expectedBalance = originalBalance. + Add(packetFee.Fee.RecvFee[0]). + Add(packetFee.Fee.AckFee[0]) + + // malleate test case + tc.malleate() + + err = cbs.OnTimeoutPacket(suite.chainA.GetContext(), packet, relayerAddr) + suite.Require().NoError(err) + + suite.Require().Equal( + expectedBalance, + sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)), + ) + + relayerBalance := sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), relayerAddr, ibctesting.TestCoin.Denom)) + if tc.expFeeDistributed { + // there should no longer be a fee in escrow for this packet + found := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) + suite.Require().False(found) + + suite.Require().Equal(packetFee.Fee.TimeoutFee, relayerBalance) + } else { + suite.Require().Empty(relayerBalance) + } + }) + } +} + +func (suite *FeeTestSuite) TestGetAppVersion() { + var ( + portID string + channelID string + expAppVersion string + ) + testCases := []struct { + name string + malleate func() + expFound bool + }{ + { + "success for fee enabled channel", + func() { + expAppVersion = ibcmock.Version + }, + true, + }, + { + "success for non fee enabled channel", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.EndpointA.ChannelConfig.PortID = ibctesting.MockFeePort + path.EndpointB.ChannelConfig.PortID = ibctesting.MockFeePort + // by default a new path uses a non fee channel + suite.coordinator.Setup(path) + portID = path.EndpointA.ChannelConfig.PortID + channelID = path.EndpointA.ChannelID + + expAppVersion = ibcmock.Version + }, + true, + }, + { + "channel does not exist", + func() { + channelID = "does not exist" + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) + + portID = suite.path.EndpointA.ChannelConfig.PortID + channelID = suite.path.EndpointA.ChannelID + + // malleate test case + tc.malleate() + + module, _, err := suite.chainA.App.GetIBCKeeper().PortKeeper.LookupModuleByPort(suite.chainA.GetContext(), ibctesting.MockFeePort) + suite.Require().NoError(err) + + cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module) + suite.Require().True(ok) + + feeModule := cbs.(fee.IBCModule) + + appVersion, found := feeModule.GetAppVersion(suite.chainA.GetContext(), portID, channelID) + + if tc.expFound { + suite.Require().True(found) + suite.Require().Equal(expAppVersion, appVersion) + } else { + suite.Require().False(found) + suite.Require().Empty(appVersion) + } + }) + } +} diff --git a/modules/apps/29-fee/keeper/escrow.go b/modules/apps/29-fee/keeper/escrow.go new file mode 100644 index 00000000000..0ca84684440 --- /dev/null +++ b/modules/apps/29-fee/keeper/escrow.go @@ -0,0 +1,232 @@ +package keeper + +import ( + "bytes" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +) + +// escrowPacketFee sends the packet fee to the 29-fee module account to hold in escrow +func (k Keeper) escrowPacketFee(ctx sdk.Context, packetID channeltypes.PacketId, packetFee types.PacketFee) error { + // check if the refund address is valid + refundAddr, err := sdk.AccAddressFromBech32(packetFee.RefundAddress) + if err != nil { + return err + } + + refundAcc := k.authKeeper.GetAccount(ctx, refundAddr) + if refundAcc == nil { + return sdkerrors.Wrapf(types.ErrRefundAccNotFound, "account with address: %s not found", packetFee.RefundAddress) + } + + coins := packetFee.Fee.Total() + if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, refundAddr, types.ModuleName, coins); err != nil { + return err + } + + // multiple fees may be escrowed for a single packet, firstly create a slice containing the new fee + // retrieve any previous fees stored in escrow for the packet and append them to the list + fees := []types.PacketFee{packetFee} + if feesInEscrow, found := k.GetFeesInEscrow(ctx, packetID); found { + fees = append(fees, feesInEscrow.PacketFees...) + } + + packetFees := types.NewPacketFees(fees) + k.SetFeesInEscrow(ctx, packetID, packetFees) + + EmitIncentivizedPacket(ctx, packetID, packetFee) + + return nil +} + +// DistributePacketFeesOnAcknowledgement pays all the acknowledgement & receive fees for a given packetID while refunding the timeout fees to the refund account. +func (k Keeper) DistributePacketFeesOnAcknowledgement(ctx sdk.Context, forwardRelayer string, reverseRelayer sdk.AccAddress, packetFees []types.PacketFee) { + // cache context before trying to distribute fees + // if the escrow account has insufficient balance then we want to avoid partially distributing fees + cacheCtx, writeFn := ctx.CacheContext() + + forwardAddr, _ := sdk.AccAddressFromBech32(forwardRelayer) + + for _, packetFee := range packetFees { + if !k.EscrowAccountHasBalance(cacheCtx, packetFee.Fee.Total()) { + // if the escrow account does not have sufficient funds then there must exist a severe bug + // the fee module should be locked until manual intervention fixes the issue + // a locked fee module will simply skip fee logic, all channels will temporarily function as + // fee disabled channels + // NOTE: we use the uncached context to lock the fee module so that the state changes from + // locking the fee module are persisted + k.lockFeeModule(ctx) + + return + } + + // check if refundAcc address works + refundAddr, err := sdk.AccAddressFromBech32(packetFee.RefundAddress) + if err != nil { + panic(fmt.Sprintf("could not parse refundAcc %s to sdk.AccAddress", packetFee.RefundAddress)) + } + + k.distributePacketFeeOnAcknowledgement(cacheCtx, refundAddr, forwardAddr, reverseRelayer, packetFee) + } + + // write the cache + writeFn() + + // NOTE: The context returned by CacheContext() refers to a new EventManager, so it needs to explicitly set events to the original context. + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) +} + +// distributePacketFeeOnAcknowledgement pays the receive fee for a given packetID while refunding the timeout fee to the refund account associated with the Fee. +// If there was no forward relayer or the associated forward relayer address is blocked, the receive fee is refunded. +func (k Keeper) distributePacketFeeOnAcknowledgement(ctx sdk.Context, refundAddr, forwardRelayer, reverseRelayer sdk.AccAddress, packetFee types.PacketFee) { + // distribute fee to valid forward relayer address otherwise refund the fee + if !forwardRelayer.Empty() && !k.bankKeeper.BlockedAddr(forwardRelayer) { + // distribute fee for forward relaying + k.distributeFee(ctx, forwardRelayer, refundAddr, packetFee.Fee.RecvFee) + } else { + // refund onRecv fee as forward relayer is not valid address + k.distributeFee(ctx, refundAddr, refundAddr, packetFee.Fee.RecvFee) + } + + // distribute fee for reverse relaying + k.distributeFee(ctx, reverseRelayer, refundAddr, packetFee.Fee.AckFee) + + // refund timeout fee for unused timeout + k.distributeFee(ctx, refundAddr, refundAddr, packetFee.Fee.TimeoutFee) + +} + +// DistributePacketsFeesOnTimeout pays all the timeout fees for a given packetID while refunding the acknowledgement & receive fees to the refund account. +func (k Keeper) DistributePacketFeesOnTimeout(ctx sdk.Context, timeoutRelayer sdk.AccAddress, packetFees []types.PacketFee) { + // cache context before trying to distribute fees + // if the escrow account has insufficient balance then we want to avoid partially distributing fees + cacheCtx, writeFn := ctx.CacheContext() + + for _, packetFee := range packetFees { + if !k.EscrowAccountHasBalance(cacheCtx, packetFee.Fee.Total()) { + // if the escrow account does not have sufficient funds then there must exist a severe bug + // the fee module should be locked until manual intervention fixes the issue + // a locked fee module will simply skip fee logic, all channels will temporarily function as + // fee disabled channels + // NOTE: we use the uncached context to lock the fee module so that the state changes from + // locking the fee module are persisted + k.lockFeeModule(ctx) + + return + } + + // check if refundAcc address works + refundAddr, err := sdk.AccAddressFromBech32(packetFee.RefundAddress) + if err != nil { + panic(fmt.Sprintf("could not parse refundAcc %s to sdk.AccAddress", packetFee.RefundAddress)) + } + + k.distributePacketFeeOnTimeout(cacheCtx, refundAddr, timeoutRelayer, packetFee) + } + + // write the cache + writeFn() + + // NOTE: The context returned by CacheContext() refers to a new EventManager, so it needs to explicitly set events to the original context. + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) +} + +// distributePacketFeeOnTimeout pays the timeout fee to the timeout relayer and refunds the acknowledgement & receive fee. +func (k Keeper) distributePacketFeeOnTimeout(ctx sdk.Context, refundAddr, timeoutRelayer sdk.AccAddress, packetFee types.PacketFee) { + // refund receive fee for unused forward relaying + k.distributeFee(ctx, refundAddr, refundAddr, packetFee.Fee.RecvFee) + + // refund ack fee for unused reverse relaying + k.distributeFee(ctx, refundAddr, refundAddr, packetFee.Fee.AckFee) + + // distribute fee for timeout relaying + k.distributeFee(ctx, timeoutRelayer, refundAddr, packetFee.Fee.TimeoutFee) +} + +// distributeFee will attempt to distribute the escrowed fee to the receiver address. +// If the distribution fails for any reason (such as the receiving address being blocked), +// the state changes will be discarded. +func (k Keeper) distributeFee(ctx sdk.Context, receiver, refundAccAddress sdk.AccAddress, fee sdk.Coins) { + // cache context before trying to distribute fees + cacheCtx, writeFn := ctx.CacheContext() + + err := k.bankKeeper.SendCoinsFromModuleToAccount(cacheCtx, types.ModuleName, receiver, fee) + if err != nil { + if bytes.Equal(receiver, refundAccAddress) { + return // if sending to the refund address already failed, then return (no-op) + } + + // if an error is returned from x/bank and the receiver is not the refundAccAddress + // then attempt to refund the fee to the original sender + err := k.bankKeeper.SendCoinsFromModuleToAccount(cacheCtx, types.ModuleName, refundAccAddress, fee) + if err != nil { + return // if sending to the refund address fails, no-op + } + } + + // write the cache + writeFn() + + // NOTE: The context returned by CacheContext() refers to a new EventManager, so it needs to explicitly set events to the original context. + ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events()) +} + +// RefundFeesOnChannelClosure will refund all fees associated with the given port and channel identifiers. +// If the escrow account runs out of balance then fee module will become locked as this implies the presence +// of a severe bug. When the fee module is locked, no fee distributions will be performed. +// Please see ADR 004 for more information. +func (k Keeper) RefundFeesOnChannelClosure(ctx sdk.Context, portID, channelID string) error { + identifiedPacketFees := k.GetIdentifiedPacketFeesForChannel(ctx, portID, channelID) + + // cache context before trying to distribute fees + // if the escrow account has insufficient balance then we want to avoid partially distributing fees + cacheCtx, writeFn := ctx.CacheContext() + + for _, identifiedPacketFee := range identifiedPacketFees { + for _, packetFee := range identifiedPacketFee.PacketFees { + + if !k.EscrowAccountHasBalance(cacheCtx, packetFee.Fee.Total()) { + // if the escrow account does not have sufficient funds then there must exist a severe bug + // the fee module should be locked until manual intervention fixes the issue + // a locked fee module will simply skip fee logic, all channels will temporarily function as + // fee disabled channels + // NOTE: we use the uncached context to lock the fee module so that the state changes from + // locking the fee module are persisted + k.lockFeeModule(ctx) + + // return a nil error so state changes are committed but distribution stops + return nil + } + + refundAddr, err := sdk.AccAddressFromBech32(packetFee.RefundAddress) + if err != nil { + return err + } + + // if the refund address is blocked, skip and continue distribution + if k.bankKeeper.BlockedAddr(refundAddr) { + continue + } + + // refund all fees to refund address + // Use SendCoins rather than the module account send functions since refund address may be a user account or module address. + moduleAcc := k.GetFeeModuleAddress() + if err = k.bankKeeper.SendCoins(cacheCtx, moduleAcc, refundAddr, packetFee.Fee.Total()); err != nil { + return err + } + + } + + k.DeleteFeesInEscrow(cacheCtx, identifiedPacketFee.PacketId) + } + + // write the cache + writeFn() + + return nil +} diff --git a/modules/apps/29-fee/keeper/escrow_test.go b/modules/apps/29-fee/keeper/escrow_test.go new file mode 100644 index 00000000000..e2a43afe586 --- /dev/null +++ b/modules/apps/29-fee/keeper/escrow_test.go @@ -0,0 +1,464 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tendermint/tendermint/crypto/secp256k1" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +) + +func (suite *KeeperTestSuite) TestDistributeFee() { + var ( + forwardRelayer string + forwardRelayerBal sdk.Coin + reverseRelayer sdk.AccAddress + reverseRelayerBal sdk.Coin + refundAcc sdk.AccAddress + refundAccBal sdk.Coin + packetFee types.PacketFee + packetFees []types.PacketFee + ) + + testCases := []struct { + name string + malleate func() + expResult func() + }{ + { + "success", + func() {}, + func() { + // check if the reverse relayer is paid + expectedReverseAccBal := reverseRelayerBal.Add(defaultAckFee[0]).Add(defaultAckFee[0]) + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), reverseRelayer, sdk.DefaultBondDenom) + suite.Require().Equal(expectedReverseAccBal, balance) + + // check if the forward relayer is paid + forward, err := sdk.AccAddressFromBech32(forwardRelayer) + suite.Require().NoError(err) + + expectedForwardAccBal := forwardRelayerBal.Add(defaultRecvFee[0]).Add(defaultRecvFee[0]) + balance = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), forward, sdk.DefaultBondDenom) + suite.Require().Equal(expectedForwardAccBal, balance) + + // check if the refund acc has been refunded the timeoutFee + expectedRefundAccBal := refundAccBal.Add(defaultTimeoutFee[0].Add(defaultTimeoutFee[0])) + balance = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + suite.Require().Equal(expectedRefundAccBal, balance) + + // check the module acc wallet is now empty + balance = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(0)), balance) + }, + }, + { + "escrow account out of balance, fee module becomes locked - no distribution", func() { + // pass in an extra packet fee + packetFees = append(packetFees, packetFee) + }, + func() { + suite.Require().True(suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(suite.chainA.GetContext())) + + // check if the module acc contains all the fees + expectedModuleAccBal := packetFee.Fee.Total().Add(packetFee.Fee.Total()...) + balance := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress()) + suite.Require().Equal(expectedModuleAccBal, balance) + }, + }, + { + "invalid forward address", + func() { + forwardRelayer = "invalid address" + }, + func() { + // check if the refund acc has been refunded the timeoutFee & recvFee + expectedRefundAccBal := refundAccBal.Add(defaultTimeoutFee[0]).Add(defaultRecvFee[0]).Add(defaultTimeoutFee[0]).Add(defaultRecvFee[0]) + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + suite.Require().Equal(expectedRefundAccBal, balance) + }, + }, + { + "invalid forward address: blocked address", + func() { + forwardRelayer = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress().String() + }, + func() { + // check if the refund acc has been refunded the timeoutFee & recvFee + expectedRefundAccBal := refundAccBal.Add(defaultTimeoutFee[0]).Add(defaultRecvFee[0]).Add(defaultTimeoutFee[0]).Add(defaultRecvFee[0]) + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + suite.Require().Equal(expectedRefundAccBal, balance) + }, + }, + { + "invalid receiver address: ack fee returned to sender", + func() { + reverseRelayer = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress() + }, + func() { + // check if the refund acc has been refunded the timeoutFee & ackFee + expectedRefundAccBal := refundAccBal.Add(defaultTimeoutFee[0]).Add(defaultAckFee[0]).Add(defaultTimeoutFee[0]).Add(defaultAckFee[0]) + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + suite.Require().Equal(expectedRefundAccBal, balance) + }, + }, + { + "invalid refund address: no-op, timeout fee remains in escrow", + func() { + packetFees[0].RefundAddress = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress().String() + packetFees[1].RefundAddress = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress().String() + }, + func() { + // check if the module acc contains the timeoutFee + expectedModuleAccBal := sdk.NewCoin(sdk.DefaultBondDenom, defaultTimeoutFee.Add(defaultTimeoutFee...).AmountOf(sdk.DefaultBondDenom)) + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(expectedModuleAccBal, balance) + }, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() // reset + suite.coordinator.Setup(suite.path) // setup channel + + // setup accounts + forwardRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() + reverseRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + refundAcc = suite.chainA.SenderAccount.GetAddress() + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + // escrow the packet fees & store the fees in state + packetFee = types.NewPacketFee(fee, refundAcc.String(), []string{}) + packetFees = []types.PacketFee{packetFee, packetFee} + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees(packetFees)) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, packetFee.Fee.Total().Add(packetFee.Fee.Total()...)) + suite.Require().NoError(err) + + tc.malleate() + + // fetch the account balances before fee distribution (forward, reverse, refund) + forwardAccAddress, _ := sdk.AccAddressFromBech32(forwardRelayer) + forwardRelayerBal = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), forwardAccAddress, sdk.DefaultBondDenom) + reverseRelayerBal = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), reverseRelayer, sdk.DefaultBondDenom) + refundAccBal = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + + suite.chainA.GetSimApp().IBCFeeKeeper.DistributePacketFeesOnAcknowledgement(suite.chainA.GetContext(), forwardRelayer, reverseRelayer, packetFees) + + tc.expResult() + }) + } +} + +func (suite *KeeperTestSuite) TestDistributePacketFeesOnTimeout() { + var ( + timeoutRelayer sdk.AccAddress + timeoutRelayerBal sdk.Coin + refundAcc sdk.AccAddress + refundAccBal sdk.Coin + packetFee types.PacketFee + packetFees []types.PacketFee + ) + + testCases := []struct { + name string + malleate func() + expResult func() + }{ + { + "success", + func() {}, + func() { + // check if the timeout relayer is paid + expectedTimeoutAccBal := timeoutRelayerBal.Add(defaultTimeoutFee[0]).Add(defaultTimeoutFee[0]) + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), timeoutRelayer, sdk.DefaultBondDenom) + suite.Require().Equal(expectedTimeoutAccBal, balance) + + // check if the refund acc has been refunded the recv/ack fees + expectedRefundAccBal := refundAccBal.Add(defaultAckFee[0]).Add(defaultAckFee[0]).Add(defaultRecvFee[0]).Add(defaultRecvFee[0]) + balance = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + suite.Require().Equal(expectedRefundAccBal, balance) + + // check the module acc wallet is now empty + balance = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(0)), balance) + }, + }, + { + "escrow account out of balance, fee module becomes locked - no distribution", func() { + // pass in an extra packet fee + packetFees = append(packetFees, packetFee) + }, + func() { + suite.Require().True(suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(suite.chainA.GetContext())) + + // check if the module acc contains all the fees + expectedModuleAccBal := packetFee.Fee.Total().Add(packetFee.Fee.Total()...) + balance := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress()) + suite.Require().Equal(expectedModuleAccBal, balance) + }, + }, + { + "invalid timeout relayer address: timeout fee returned to sender", + func() { + timeoutRelayer = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress() + }, + func() { + // check if the refund acc has been refunded the all the fees + expectedRefundAccBal := sdk.Coins{refundAccBal}.Add(packetFee.Fee.Total()...).Add(packetFee.Fee.Total()...)[0] + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + suite.Require().Equal(expectedRefundAccBal, balance) + }, + }, + { + "invalid refund address: no-op, recv and ack fees remain in escrow", + func() { + packetFees[0].RefundAddress = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress().String() + packetFees[1].RefundAddress = suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress().String() + }, + func() { + // check if the module acc contains the timeoutFee + expectedModuleAccBal := sdk.NewCoin(sdk.DefaultBondDenom, defaultRecvFee.Add(defaultRecvFee[0]).Add(defaultAckFee[0]).Add(defaultAckFee[0]).AmountOf(sdk.DefaultBondDenom)) + balance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(expectedModuleAccBal, balance) + }, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() // reset + suite.coordinator.Setup(suite.path) // setup channel + + // setup accounts + timeoutRelayer = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + refundAcc = suite.chainA.SenderAccount.GetAddress() + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + // escrow the packet fees & store the fees in state + packetFee = types.NewPacketFee(fee, refundAcc.String(), []string{}) + packetFees = []types.PacketFee{packetFee, packetFee} + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees(packetFees)) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, packetFee.Fee.Total().Add(packetFee.Fee.Total()...)) + suite.Require().NoError(err) + + tc.malleate() + + // fetch the account balances before fee distribution (forward, reverse, refund) + timeoutRelayerBal = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), timeoutRelayer, sdk.DefaultBondDenom) + refundAccBal = suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), refundAcc, sdk.DefaultBondDenom) + + suite.chainA.GetSimApp().IBCFeeKeeper.DistributePacketFeesOnTimeout(suite.chainA.GetContext(), timeoutRelayer, packetFees) + + tc.expResult() + }) + } +} + +func (suite *KeeperTestSuite) TestRefundFeesOnChannelClosure() { + var ( + expIdentifiedPacketFees []types.IdentifiedPacketFees + expEscrowBal sdk.Coins + expRefundBal sdk.Coins + refundAcc sdk.AccAddress + fee types.Fee + locked bool + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", func() { + for i := 1; i < 6; i++ { + // store the fee in state & update escrow account balance + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(i)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, refundAcc.String(), nil)}) + identifiedPacketFees := types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expIdentifiedPacketFees = append(expIdentifiedPacketFees, identifiedPacketFees) + } + }, true, + }, + { + "success with undistributed packet fees on a different channel", func() { + for i := 1; i < 6; i++ { + // store the fee in state & update escrow account balance + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(i)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, refundAcc.String(), nil)}) + identifiedPacketFees := types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expIdentifiedPacketFees = append(expIdentifiedPacketFees, identifiedPacketFees) + } + + // set packet fee for a different channel + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, "channel-1", uint64(1)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, refundAcc.String(), nil)}) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, "channel-1") + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expEscrowBal = fee.Total() + expRefundBal = expRefundBal.Sub(fee.Total()) + }, true, + }, + { + "escrow account empty, module should become locked", func() { + locked = true + + // store the fee in state without updating escrow account balance + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(1)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, refundAcc.String(), nil)}) + identifiedPacketFees := types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + + expIdentifiedPacketFees = []types.IdentifiedPacketFees{identifiedPacketFees} + }, + true, + }, + { + "escrow account goes negative on second packet, module should become locked", func() { + locked = true + + // store 2 fees in state + packetID1 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(1)) + packetID2 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(2)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, refundAcc.String(), nil)}) + identifiedPacketFee1 := types.NewIdentifiedPacketFees(packetID1, packetFees.PacketFees) + identifiedPacketFee2 := types.NewIdentifiedPacketFees(packetID2, packetFees.PacketFees) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID1, packetFees) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID2, packetFees) + + // update escrow account balance for 1 fee + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expIdentifiedPacketFees = []types.IdentifiedPacketFees{identifiedPacketFee1, identifiedPacketFee2} + }, true, + }, + { + "invalid refund acc address", func() { + // store the fee in state & update escrow account balance + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(1)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, "invalid refund address", nil)}) + identifiedPacketFees := types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expIdentifiedPacketFees = []types.IdentifiedPacketFees{identifiedPacketFees} + }, false, + }, + { + "distributing to blocked address is skipped", func() { + blockedAddr := suite.chainA.GetSimApp().AccountKeeper.GetModuleAccount(suite.chainA.GetContext(), transfertypes.ModuleName).GetAddress().String() + + // store the fee in state & update escrow account balance + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, uint64(1)) + packetFees := types.NewPacketFees([]types.PacketFee{types.NewPacketFee(fee, blockedAddr, nil)}) + identifiedPacketFees := types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, packetFees) + + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), refundAcc, types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expIdentifiedPacketFees = []types.IdentifiedPacketFees{identifiedPacketFees} + + expEscrowBal = fee.Total() + expRefundBal = expRefundBal.Sub(fee.Total()) + }, true, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() // reset + suite.coordinator.Setup(suite.path) // setup channel + expIdentifiedPacketFees = []types.IdentifiedPacketFees{} + expEscrowBal = sdk.Coins{} + locked = false + + // setup + refundAcc = suite.chainA.SenderAccount.GetAddress() + moduleAcc := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress() + + // expected refund balance if the refunds are successful + // NOTE: tc.malleate() should transfer from refund balance to correctly set the escrow balance + expRefundBal = suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), refundAcc) + + fee = types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + } + + tc.malleate() + + // refundAcc balance before distribution + originalRefundBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), refundAcc) + originalEscrowBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), moduleAcc) + + err := suite.chainA.GetSimApp().IBCFeeKeeper.RefundFeesOnChannelClosure(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + + // refundAcc balance after RefundFeesOnChannelClosure + refundBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), refundAcc) + escrowBal := suite.chainA.GetSimApp().BankKeeper.GetAllBalances(suite.chainA.GetContext(), moduleAcc) + + if tc.expPass { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + + suite.Require().Equal(locked, suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(suite.chainA.GetContext())) + + if locked || !tc.expPass { + // refund account and escrow account balances should remain unchanged + suite.Require().Equal(originalRefundBal, refundBal) + suite.Require().Equal(originalEscrowBal, escrowBal) + + // ensure none of the fees were deleted + suite.Require().Equal(expIdentifiedPacketFees, suite.chainA.GetSimApp().IBCFeeKeeper.GetIdentifiedPacketFeesForChannel(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID)) + } else { + suite.Require().Equal(expEscrowBal, escrowBal) // escrow balance should be empty + suite.Require().Equal(expRefundBal, refundBal) // all packets should have been refunded + + // all fees in escrow should be deleted for this channel + suite.Require().Empty(suite.chainA.GetSimApp().IBCFeeKeeper.GetIdentifiedPacketFeesForChannel(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID)) + } + + }) + } +} diff --git a/modules/apps/29-fee/keeper/events.go b/modules/apps/29-fee/keeper/events.go new file mode 100644 index 00000000000..9ff6f320ffc --- /dev/null +++ b/modules/apps/29-fee/keeper/events.go @@ -0,0 +1,25 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +) + +// EmitIncentivizedPacket emits an event so that relayers know an incentivized packet is ready to be relayed +func EmitIncentivizedPacket(ctx sdk.Context, packetID channeltypes.PacketId, packetFee types.PacketFee) { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeIncentivizedPacket, + sdk.NewAttribute(channeltypes.AttributeKeyPortID, packetID.PortId), + sdk.NewAttribute(channeltypes.AttributeKeyChannelID, packetID.ChannelId), + sdk.NewAttribute(channeltypes.AttributeKeySequence, fmt.Sprint(packetID.Sequence)), + sdk.NewAttribute(types.AttributeKeyRecvFee, packetFee.Fee.RecvFee.String()), + sdk.NewAttribute(types.AttributeKeyAckFee, packetFee.Fee.AckFee.String()), + sdk.NewAttribute(types.AttributeKeyTimeoutFee, packetFee.Fee.TimeoutFee.String()), + ), + ) +} diff --git a/modules/apps/29-fee/keeper/genesis.go b/modules/apps/29-fee/keeper/genesis.go new file mode 100644 index 00000000000..70b6a5012a2 --- /dev/null +++ b/modules/apps/29-fee/keeper/genesis.go @@ -0,0 +1,36 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" +) + +// InitGenesis initializes the fee middleware application state from a provided genesis state +func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { + for _, identifiedFees := range state.IdentifiedFees { + k.SetFeesInEscrow(ctx, identifiedFees.PacketId, types.NewPacketFees(identifiedFees.PacketFees)) + } + + for _, relayer := range state.RegisteredRelayers { + k.SetCounterpartyAddress(ctx, relayer.Address, relayer.CounterpartyAddress, relayer.ChannelId) + } + + for _, forwardAddr := range state.ForwardRelayers { + k.SetRelayerAddressForAsyncAck(ctx, forwardAddr.PacketId, forwardAddr.Address) + } + + for _, enabledChan := range state.FeeEnabledChannels { + k.SetFeeEnabled(ctx, enabledChan.PortId, enabledChan.ChannelId) + } +} + +// ExportGenesis returns the fee middleware application exported genesis +func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { + return &types.GenesisState{ + IdentifiedFees: k.GetAllIdentifiedPacketFees(ctx), + FeeEnabledChannels: k.GetAllFeeEnabledChannels(ctx), + RegisteredRelayers: k.GetAllRelayerAddresses(ctx), + ForwardRelayers: k.GetAllForwardRelayerAddresses(ctx), + } +} diff --git a/modules/apps/29-fee/keeper/genesis_test.go b/modules/apps/29-fee/keeper/genesis_test.go new file mode 100644 index 00000000000..8aa30385e58 --- /dev/null +++ b/modules/apps/29-fee/keeper/genesis_test.go @@ -0,0 +1,113 @@ +package keeper_test + +import ( + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" +) + +func (suite *KeeperTestSuite) TestInitGenesis() { + // build PacketId & Fee + refundAcc := suite.chainA.SenderAccount.GetAddress() + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + fee := types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + } + + // relayer addresses + sender := suite.chainA.SenderAccount.GetAddress().String() + counterparty := suite.chainB.SenderAccount.GetAddress().String() + + genesisState := types.GenesisState{ + IdentifiedFees: []types.IdentifiedPacketFees{ + { + PacketId: packetID, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc.String(), + Relayers: nil, + }, + }, + }, + }, + FeeEnabledChannels: []types.FeeEnabledChannel{ + { + PortId: ibctesting.MockFeePort, + ChannelId: ibctesting.FirstChannelID, + }, + }, + RegisteredRelayers: []types.RegisteredRelayerAddress{ + { + Address: sender, + CounterpartyAddress: counterparty, + ChannelId: ibctesting.FirstChannelID, + }, + }, + } + + suite.chainA.GetSimApp().IBCFeeKeeper.InitGenesis(suite.chainA.GetContext(), genesisState) + + // check fee + feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetID) + suite.Require().True(found) + suite.Require().Equal(genesisState.IdentifiedFees[0].PacketFees, feesInEscrow.PacketFees) + + // check fee is enabled + isEnabled := suite.chainA.GetSimApp().IBCFeeKeeper.IsFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + suite.Require().True(isEnabled) + + // check relayers + addr, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetCounterpartyAddress(suite.chainA.GetContext(), sender, ibctesting.FirstChannelID) + suite.Require().True(found) + suite.Require().Equal(genesisState.RegisteredRelayers[0].CounterpartyAddress, addr) +} + +func (suite *KeeperTestSuite) TestExportGenesis() { + // set fee enabled + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + // setup & escrow the packet fee + refundAcc := suite.chainA.SenderAccount.GetAddress() + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + fee := types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + } + + packetFee := types.NewPacketFee(fee, refundAcc.String(), []string{}) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) + + // relayer addresses + sender := suite.chainA.SenderAccount.GetAddress().String() + counterparty := suite.chainB.SenderAccount.GetAddress().String() + // set counterparty address + suite.chainA.GetSimApp().IBCFeeKeeper.SetCounterpartyAddress(suite.chainA.GetContext(), sender, counterparty, ibctesting.FirstChannelID) + + // set forward relayer address + suite.chainA.GetSimApp().IBCFeeKeeper.SetRelayerAddressForAsyncAck(suite.chainA.GetContext(), packetID, sender) + + // export genesis + genesisState := suite.chainA.GetSimApp().IBCFeeKeeper.ExportGenesis(suite.chainA.GetContext()) + + // check fee enabled + suite.Require().Equal(ibctesting.FirstChannelID, genesisState.FeeEnabledChannels[0].ChannelId) + suite.Require().Equal(ibctesting.MockFeePort, genesisState.FeeEnabledChannels[0].PortId) + + // check fee + suite.Require().Equal(packetID, genesisState.IdentifiedFees[0].PacketId) + suite.Require().Equal(fee, genesisState.IdentifiedFees[0].PacketFees[0].Fee) + suite.Require().Equal(refundAcc.String(), genesisState.IdentifiedFees[0].PacketFees[0].RefundAddress) + suite.Require().Equal([]string(nil), genesisState.IdentifiedFees[0].PacketFees[0].Relayers) + + // check registered relayer addresses + suite.Require().Equal(sender, genesisState.RegisteredRelayers[0].Address) + suite.Require().Equal(counterparty, genesisState.RegisteredRelayers[0].CounterpartyAddress) + + // check registered relayer addresses + suite.Require().Equal(sender, genesisState.ForwardRelayers[0].Address) + suite.Require().Equal(packetID, genesisState.ForwardRelayers[0].PacketId) +} diff --git a/modules/apps/29-fee/keeper/grpc_query.go b/modules/apps/29-fee/keeper/grpc_query.go new file mode 100644 index 00000000000..10da5bc5595 --- /dev/null +++ b/modules/apps/29-fee/keeper/grpc_query.go @@ -0,0 +1,244 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/query" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" +) + +var _ types.QueryServer = Keeper{} + +// IncentivizedPackets implements the Query/IncentivizedPackets gRPC method +func (k Keeper) IncentivizedPackets(goCtx context.Context, req *types.QueryIncentivizedPacketsRequest) (*types.QueryIncentivizedPacketsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx).WithBlockHeight(int64(req.QueryHeight)) + + var identifiedPackets []types.IdentifiedPacketFees + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.FeesInEscrowPrefix)) + _, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { + packetID, err := types.ParseKeyFeesInEscrow(types.FeesInEscrowPrefix + string(key)) + if err != nil { + return err + } + + packetFees := k.MustUnmarshalFees(value) + identifiedPackets = append(identifiedPackets, types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees)) + return nil + }) + + if err != nil { + return nil, status.Error(codes.NotFound, err.Error()) + } + + return &types.QueryIncentivizedPacketsResponse{ + IncentivizedPackets: identifiedPackets, + }, nil +} + +// IncentivizedPacket implements the Query/IncentivizedPacket gRPC method +func (k Keeper) IncentivizedPacket(goCtx context.Context, req *types.QueryIncentivizedPacketRequest) (*types.QueryIncentivizedPacketResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx).WithBlockHeight(int64(req.QueryHeight)) + + feesInEscrow, exists := k.GetFeesInEscrow(ctx, req.PacketId) + if !exists { + return nil, status.Error( + codes.NotFound, + sdkerrors.Wrapf(types.ErrFeeNotFound, "channel: %s, port: %s, sequence: %d", req.PacketId.ChannelId, req.PacketId.PortId, req.PacketId.Sequence).Error()) + } + + return &types.QueryIncentivizedPacketResponse{ + IncentivizedPacket: types.NewIdentifiedPacketFees(req.PacketId, feesInEscrow.PacketFees), + }, nil +} + +// IncentivizedPacketsForChannel implements the Query/IncentivizedPacketsForChannel gRPC method +func (k Keeper) IncentivizedPacketsForChannel(goCtx context.Context, req *types.QueryIncentivizedPacketsForChannelRequest) (*types.QueryIncentivizedPacketsForChannelResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx).WithBlockHeight(int64(req.QueryHeight)) + + var packets []*types.IdentifiedPacketFees + keyPrefix := types.KeyFeesInEscrowChannelPrefix(req.PortId, req.ChannelId) + store := prefix.NewStore(ctx.KVStore(k.storeKey), keyPrefix) + _, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { + packetID, err := types.ParseKeyFeesInEscrow(string(keyPrefix) + string(key)) + if err != nil { + return err + } + + packetFees := k.MustUnmarshalFees(value) + + identifiedPacketFees := types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees) + packets = append(packets, &identifiedPacketFees) + + return nil + }) + + if err != nil { + return nil, status.Error(codes.NotFound, err.Error()) + } + + return &types.QueryIncentivizedPacketsForChannelResponse{ + IncentivizedPackets: packets, + }, nil +} + +// TotalRecvFees implements the Query/TotalRecvFees gRPC method +func (k Keeper) TotalRecvFees(goCtx context.Context, req *types.QueryTotalRecvFeesRequest) (*types.QueryTotalRecvFeesResponse, error) { + + ctx := sdk.UnwrapSDKContext(goCtx) + + feesInEscrow, found := k.GetFeesInEscrow(ctx, req.PacketId) + if !found { + return nil, status.Errorf( + codes.NotFound, + sdkerrors.Wrapf(types.ErrFeeNotFound, "channel: %s, port: %s, sequence: %d", req.PacketId.ChannelId, req.PacketId.PortId, req.PacketId.Sequence).Error(), + ) + } + + var recvFees sdk.Coins + for _, packetFee := range feesInEscrow.PacketFees { + recvFees = recvFees.Add(packetFee.Fee.RecvFee...) + } + + return &types.QueryTotalRecvFeesResponse{ + RecvFees: recvFees, + }, nil +} + +// TotalAckFees implements the Query/TotalAckFees gRPC method +func (k Keeper) TotalAckFees(goCtx context.Context, req *types.QueryTotalAckFeesRequest) (*types.QueryTotalAckFeesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + feesInEscrow, found := k.GetFeesInEscrow(ctx, req.PacketId) + if !found { + return nil, status.Errorf( + codes.NotFound, + sdkerrors.Wrapf(types.ErrFeeNotFound, "channel: %s, port: %s, sequence: %d", req.PacketId.ChannelId, req.PacketId.PortId, req.PacketId.Sequence).Error(), + ) + } + + var ackFees sdk.Coins + for _, packetFee := range feesInEscrow.PacketFees { + ackFees = ackFees.Add(packetFee.Fee.AckFee...) + } + + return &types.QueryTotalAckFeesResponse{ + AckFees: ackFees, + }, nil +} + +// TotalTimeoutFees implements the Query/TotalTimeoutFees gRPC method +func (k Keeper) TotalTimeoutFees(goCtx context.Context, req *types.QueryTotalTimeoutFeesRequest) (*types.QueryTotalTimeoutFeesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + feesInEscrow, found := k.GetFeesInEscrow(ctx, req.PacketId) + if !found { + return nil, status.Errorf( + codes.NotFound, + sdkerrors.Wrapf(types.ErrFeeNotFound, "channel: %s, port: %s, sequence: %d", req.PacketId.ChannelId, req.PacketId.PortId, req.PacketId.Sequence).Error(), + ) + } + + var timeoutFees sdk.Coins + for _, packetFee := range feesInEscrow.PacketFees { + timeoutFees = timeoutFees.Add(packetFee.Fee.TimeoutFee...) + } + + return &types.QueryTotalTimeoutFeesResponse{ + TimeoutFees: timeoutFees, + }, nil +} + +// CounterpartyAddress implements the Query/CounterpartyAddress gRPC method and returns the registered counterparty address for forward relaying +func (k Keeper) CounterpartyAddress(goCtx context.Context, req *types.QueryCounterpartyAddressRequest) (*types.QueryCounterpartyAddressResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + counterpartyAddr, found := k.GetCounterpartyAddress(ctx, req.RelayerAddress, req.ChannelId) + if !found { + return nil, status.Errorf(codes.NotFound, "counterparty address not found for address: %s on channel: %s", req.RelayerAddress, req.ChannelId) + } + + return &types.QueryCounterpartyAddressResponse{ + CounterpartyAddress: counterpartyAddr, + }, nil +} + +// FeeEnabledChannels implements the Query/FeeEnabledChannels gRPC method and returns a list of fee enabled channels +func (k Keeper) FeeEnabledChannels(goCtx context.Context, req *types.QueryFeeEnabledChannelsRequest) (*types.QueryFeeEnabledChannelsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx).WithBlockHeight(int64(req.QueryHeight)) + + var feeEnabledChannels []types.FeeEnabledChannel + store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(types.FeeEnabledKeyPrefix)) + _, err := query.Paginate(store, req.Pagination, func(key, value []byte) error { + portID, channelID, err := types.ParseKeyFeeEnabled(types.FeeEnabledKeyPrefix + string(key)) + if err != nil { + return err + } + + feeEnabledChannel := types.FeeEnabledChannel{ + PortId: portID, + ChannelId: channelID, + } + + feeEnabledChannels = append(feeEnabledChannels, feeEnabledChannel) + + return nil + }) + + if err != nil { + return nil, status.Error(codes.NotFound, err.Error()) + } + + return &types.QueryFeeEnabledChannelsResponse{ + FeeEnabledChannels: feeEnabledChannels, + }, nil +} + +// FeeEnabledChannel implements the Query/FeeEnabledChannel gRPC method and returns true if the provided +// port and channel identifiers belong to a fee enabled channel +func (k Keeper) FeeEnabledChannel(goCtx context.Context, req *types.QueryFeeEnabledChannelRequest) (*types.QueryFeeEnabledChannelResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + isFeeEnabled := k.IsFeeEnabled(ctx, req.PortId, req.ChannelId) + + return &types.QueryFeeEnabledChannelResponse{ + FeeEnabled: isFeeEnabled, + }, nil +} diff --git a/modules/apps/29-fee/keeper/grpc_query_test.go b/modules/apps/29-fee/keeper/grpc_query_test.go new file mode 100644 index 00000000000..d665c655ccf --- /dev/null +++ b/modules/apps/29-fee/keeper/grpc_query_test.go @@ -0,0 +1,641 @@ +package keeper_test + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/tendermint/tendermint/crypto/secp256k1" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" +) + +func (suite *KeeperTestSuite) TestQueryIncentivizedPackets() { + var ( + req *types.QueryIncentivizedPacketsRequest + expectedPackets []types.IdentifiedPacketFees + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() { + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), []string(nil)) + + for i := 0; i < 3; i++ { + // escrow packet fees for three different packets + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, uint64(i+1)) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) + + expectedPackets = append(expectedPackets, types.NewIdentifiedPacketFees(packetID, []types.PacketFee{packetFee})) + } + + req = &types.QueryIncentivizedPacketsRequest{ + Pagination: &query.PageRequest{ + Limit: 5, + CountTotal: false, + }, + QueryHeight: 0, + } + }, + true, + }, + { + "empty pagination", + func() { + expectedPackets = nil + req = &types.QueryIncentivizedPacketsRequest{} + }, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + tc.malleate() // malleate mutates test data + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.IncentivizedPackets(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(expectedPackets, res.IncentivizedPackets) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryIncentivizedPacket() { + var ( + req *types.QueryIncentivizedPacketRequest + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "fees not found for packet id", + func() { + req = &types.QueryIncentivizedPacketRequest{ + PacketId: channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 100), + QueryHeight: 0, + } + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), []string(nil)) + + packetFees := []types.PacketFee{packetFee, packetFee, packetFee} + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees(packetFees)) + + req = &types.QueryIncentivizedPacketRequest{ + PacketId: packetID, + QueryHeight: 0, + } + + tc.malleate() // malleate mutates test data + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.IncentivizedPacket(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(types.NewIdentifiedPacketFees(packetID, []types.PacketFee{packetFee, packetFee, packetFee}), res.IncentivizedPacket) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryIncentivizedPacketsForChannel() { + var ( + req *types.QueryIncentivizedPacketsForChannelRequest + expIdentifiedPacketFees []*types.IdentifiedPacketFees + ) + + fee := types.Fee{ + AckFee: sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}}, + RecvFee: sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}}, + TimeoutFee: sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}}, + } + + testCases := []struct { + msg string + malleate func() + expPass bool + }{ + { + "empty pagination", + func() { + expIdentifiedPacketFees = nil + req = &types.QueryIncentivizedPacketsForChannelRequest{} + }, + true, + }, + { + "success", + func() { + req = &types.QueryIncentivizedPacketsForChannelRequest{ + Pagination: &query.PageRequest{ + Limit: 5, + CountTotal: false, + }, + PortId: ibctesting.MockFeePort, + ChannelId: ibctesting.FirstChannelID, + QueryHeight: 0, + } + }, + true, + }, + { + "no packets for specified channel", + func() { + expIdentifiedPacketFees = nil + req = &types.QueryIncentivizedPacketsForChannelRequest{ + Pagination: &query.PageRequest{ + Limit: 5, + CountTotal: false, + }, + PortId: ibctesting.MockFeePort, + ChannelId: "channel-10", + QueryHeight: 0, + } + }, + true, + }, + } + + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() // reset + + // setup + refundAcc := suite.chainA.SenderAccount.GetAddress() + packetFee := types.NewPacketFee(fee, refundAcc.String(), nil) + packetFees := types.NewPacketFees([]types.PacketFee{packetFee, packetFee, packetFee}) + + identifiedFees1 := types.NewIdentifiedPacketFees(channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1), packetFees.PacketFees) + identifiedFees2 := types.NewIdentifiedPacketFees(channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 2), packetFees.PacketFees) + identifiedFees3 := types.NewIdentifiedPacketFees(channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 3), packetFees.PacketFees) + + expIdentifiedPacketFees = append(expIdentifiedPacketFees, &identifiedFees1, &identifiedFees2, &identifiedFees3) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + for _, identifiedPacketFees := range expIdentifiedPacketFees { + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), identifiedPacketFees.PacketId, types.NewPacketFees(identifiedPacketFees.PacketFees)) + } + + tc.malleate() + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + + res, err := suite.queryClient.IncentivizedPacketsForChannel(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Require().Equal(expIdentifiedPacketFees, res.IncentivizedPackets) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryTotalRecvFees() { + var ( + req *types.QueryTotalRecvFeesRequest + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "packet not found", + func() { + req.PacketId = channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 100) + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), []string(nil)) + + packetFees := []types.PacketFee{packetFee, packetFee, packetFee} + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees(packetFees)) + + req = &types.QueryTotalRecvFeesRequest{ + PacketId: packetID, + } + + tc.malleate() + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.TotalRecvFees(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + + // expected total is three times the default recv fee + expectedFees := defaultRecvFee.Add(defaultRecvFee...).Add(defaultRecvFee...) + suite.Require().Equal(expectedFees, res.RecvFees) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryTotalAckFees() { + var ( + req *types.QueryTotalAckFeesRequest + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "packet not found", + func() { + req.PacketId = channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 100) + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), []string(nil)) + + packetFees := []types.PacketFee{packetFee, packetFee, packetFee} + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees(packetFees)) + + req = &types.QueryTotalAckFeesRequest{ + PacketId: packetID, + } + + tc.malleate() + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.TotalAckFees(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + + // expected total is three times the default acknowledgement fee + expectedFees := defaultAckFee.Add(defaultAckFee...).Add(defaultAckFee...) + suite.Require().Equal(expectedFees, res.AckFees) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryTotalTimeoutFees() { + var ( + req *types.QueryTotalTimeoutFeesRequest + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "packet not found", + func() { + req.PacketId = channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 100) + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), []string(nil)) + + packetFees := []types.PacketFee{packetFee, packetFee, packetFee} + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees(packetFees)) + + req = &types.QueryTotalTimeoutFeesRequest{ + PacketId: packetID, + } + + tc.malleate() + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.TotalTimeoutFees(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().NotNil(res) + + // expected total is three times the default acknowledgement fee + expectedFees := defaultTimeoutFee.Add(defaultTimeoutFee...).Add(defaultTimeoutFee...) + suite.Require().Equal(expectedFees, res.TimeoutFees) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryCounterpartyAddress() { + var ( + req *types.QueryCounterpartyAddressRequest + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "counterparty address not found: invalid channel", + func() { + req.ChannelId = "invalid-channel-id" + }, + false, + }, + { + "counterparty address not found: invalid address", + func() { + req.RelayerAddress = "invalid-addr" + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + pk := secp256k1.GenPrivKey().PubKey() + expectedCounterpartyAddr := sdk.AccAddress(pk.Address()) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetCounterpartyAddress( + suite.chainA.GetContext(), + suite.chainA.SenderAccount.GetAddress().String(), + expectedCounterpartyAddr.String(), + suite.path.EndpointA.ChannelID, + ) + + req = &types.QueryCounterpartyAddressRequest{ + ChannelId: suite.path.EndpointA.ChannelID, + RelayerAddress: suite.chainA.SenderAccount.GetAddress().String(), + } + + tc.malleate() + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.CounterpartyAddress(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expectedCounterpartyAddr.String(), res.CounterpartyAddress) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryFeeEnabledChannels() { + var ( + req *types.QueryFeeEnabledChannelsRequest + expFeeEnabledChannels []types.FeeEnabledChannel + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "success: empty pagination", + func() { + req = &types.QueryFeeEnabledChannelsRequest{} + }, + true, + }, + { + "success: with multiple fee enabled channels", + func() { + suite.coordinator.Setup(suite.pathAToC) + + expChannel := types.FeeEnabledChannel{ + PortId: suite.pathAToC.EndpointA.ChannelConfig.PortID, + ChannelId: suite.pathAToC.EndpointA.ChannelID, + } + + expFeeEnabledChannels = append(expFeeEnabledChannels, expChannel) + }, + true, + }, + { + "success: pagination with multiple fee enabled channels", + func() { + // start at index 1, as channel-0 is already added to expFeeEnabledChannels below + for i := 1; i < 10; i++ { + channelID := channeltypes.FormatChannelIdentifier(uint64(i)) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, channelID) + + expChannel := types.FeeEnabledChannel{ + PortId: ibctesting.MockFeePort, + ChannelId: channelID, + } + + if i < 5 { // add only the first 5 channels, as our default pagination limit is 5 + expFeeEnabledChannels = append(expFeeEnabledChannels, expChannel) + } + } + + suite.chainA.NextBlock() + }, + true, + }, + { + "empty response", + func() { + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + expFeeEnabledChannels = nil + + suite.chainA.NextBlock() + }, + true, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + suite.coordinator.Setup(suite.path) + + expChannel := types.FeeEnabledChannel{ + PortId: suite.path.EndpointA.ChannelConfig.PortID, + ChannelId: suite.path.EndpointA.ChannelID, + } + + expFeeEnabledChannels = []types.FeeEnabledChannel{expChannel} + + req = &types.QueryFeeEnabledChannelsRequest{ + Pagination: &query.PageRequest{ + Limit: 5, + CountTotal: false, + }, + QueryHeight: 0, + } + + tc.malleate() + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.FeeEnabledChannels(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().Equal(expFeeEnabledChannels, res.FeeEnabledChannels) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestQueryFeeEnabledChannel() { + var ( + req *types.QueryFeeEnabledChannelRequest + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "fee not enabled on channel", + func() { + req.ChannelId = "invalid-channel-id" + req.PortId = "invalid-port-id" + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + suite.SetupTest() // reset + + suite.coordinator.Setup(suite.path) + + req = &types.QueryFeeEnabledChannelRequest{ + PortId: suite.path.EndpointA.ChannelConfig.PortID, + ChannelId: suite.path.EndpointA.ChannelID, + } + + tc.malleate() + + ctx := sdk.WrapSDKContext(suite.chainA.GetContext()) + res, err := suite.queryClient.FeeEnabledChannel(ctx, req) + + if tc.expPass { + suite.Require().NoError(err) + suite.Require().True(res.FeeEnabled) + } else { + suite.Require().False(res.FeeEnabled) + } + }) + } +} diff --git a/modules/apps/29-fee/keeper/keeper.go b/modules/apps/29-fee/keeper/keeper.go new file mode 100644 index 00000000000..e0317d3660a --- /dev/null +++ b/modules/apps/29-fee/keeper/keeper.go @@ -0,0 +1,335 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" +) + +// Middleware must implement types.ChannelKeeper and types.PortKeeper expected interfaces +// so that it can wrap IBC channel and port logic for underlying application. +var ( + _ types.ChannelKeeper = Keeper{} + _ types.PortKeeper = Keeper{} +) + +// Keeper defines the IBC fungible transfer keeper +type Keeper struct { + storeKey sdk.StoreKey + cdc codec.BinaryCodec + + authKeeper types.AccountKeeper + ics4Wrapper types.ICS4Wrapper + channelKeeper types.ChannelKeeper + portKeeper types.PortKeeper + bankKeeper types.BankKeeper +} + +// NewKeeper creates a new 29-fee Keeper instance +func NewKeeper( + cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, + ics4Wrapper types.ICS4Wrapper, channelKeeper types.ChannelKeeper, portKeeper types.PortKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, +) Keeper { + + return Keeper{ + cdc: cdc, + storeKey: key, + ics4Wrapper: ics4Wrapper, + channelKeeper: channelKeeper, + portKeeper: portKeeper, + authKeeper: authKeeper, + bankKeeper: bankKeeper, + } +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+host.ModuleName+"-"+types.ModuleName) +} + +// BindPort defines a wrapper function for the port Keeper's function in +// order to expose it to module's InitGenesis function +func (k Keeper) BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability { + return k.portKeeper.BindPort(ctx, portID) +} + +// GetChannel wraps IBC ChannelKeeper's GetChannel function +func (k Keeper) GetChannel(ctx sdk.Context, portID, channelID string) (channeltypes.Channel, bool) { + return k.channelKeeper.GetChannel(ctx, portID, channelID) +} + +// GetNextSequenceSend wraps IBC ChannelKeeper's GetNextSequenceSend function +func (k Keeper) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) { + return k.channelKeeper.GetNextSequenceSend(ctx, portID, channelID) +} + +// GetFeeModuleAddress returns the ICS29 Fee ModuleAccount address +func (k Keeper) GetFeeModuleAddress() sdk.AccAddress { + return k.authKeeper.GetModuleAddress(types.ModuleName) +} + +// EscrowAccountHasBalance verifies if the escrow account has the provided fee. +func (k Keeper) EscrowAccountHasBalance(ctx sdk.Context, coins sdk.Coins) bool { + for _, coin := range coins { + if !k.bankKeeper.HasBalance(ctx, k.GetFeeModuleAddress(), coin) { + return false + } + } + + return true +} + +// lockFeeModule sets a flag to determine if fee handling logic should run for the given channel +// identified by channel and port identifiers. +// Please see ADR 004 for more information. +func (k Keeper) lockFeeModule(ctx sdk.Context) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyLocked(), []byte{1}) +} + +// IsLocked indicates if the fee module is locked +// Please see ADR 004 for more information. +func (k Keeper) IsLocked(ctx sdk.Context) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.KeyLocked()) +} + +// SetFeeEnabled sets a flag to determine if fee handling logic should run for the given channel +// identified by channel and port identifiers. +func (k Keeper) SetFeeEnabled(ctx sdk.Context, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyFeeEnabled(portID, channelID), []byte{1}) +} + +// DeleteFeeEnabled deletes the fee enabled flag for a given portID and channelID +func (k Keeper) DeleteFeeEnabled(ctx sdk.Context, portID, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.KeyFeeEnabled(portID, channelID)) +} + +// IsFeeEnabled returns whether fee handling logic should be run for the given port. It will check the +// fee enabled flag for the given port and channel identifiers +func (k Keeper) IsFeeEnabled(ctx sdk.Context, portID, channelID string) bool { + store := ctx.KVStore(k.storeKey) + return store.Get(types.KeyFeeEnabled(portID, channelID)) != nil +} + +// GetAllFeeEnabledChannels returns a list of all ics29 enabled channels containing portID & channelID that are stored in state +func (k Keeper) GetAllFeeEnabledChannels(ctx sdk.Context) []types.FeeEnabledChannel { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, []byte(types.FeeEnabledKeyPrefix)) + defer iterator.Close() + + var enabledChArr []types.FeeEnabledChannel + for ; iterator.Valid(); iterator.Next() { + portID, channelID, err := types.ParseKeyFeeEnabled(string(iterator.Key())) + if err != nil { + panic(err) + } + ch := types.FeeEnabledChannel{ + PortId: portID, + ChannelId: channelID, + } + + enabledChArr = append(enabledChArr, ch) + } + + return enabledChArr +} + +// SetCounterpartyAddress maps the destination chain relayer address to the source relayer address +// The receiving chain must store the mapping from: address -> counterpartyAddress for the given channel +func (k Keeper) SetCounterpartyAddress(ctx sdk.Context, address, counterpartyAddress, channelID string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyCounterpartyRelayer(address, channelID), []byte(counterpartyAddress)) +} + +// GetCounterpartyAddress gets the relayer counterparty address given a destination relayer address +func (k Keeper) GetCounterpartyAddress(ctx sdk.Context, address, channelID string) (string, bool) { + store := ctx.KVStore(k.storeKey) + key := types.KeyCounterpartyRelayer(address, channelID) + + if !store.Has(key) { + return "", false + } + + addr := string(store.Get(key)) + return addr, true +} + +// GetAllRelayerAddresses returns all registered relayer addresses +func (k Keeper) GetAllRelayerAddresses(ctx sdk.Context) []types.RegisteredRelayerAddress { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, []byte(types.CounterpartyRelayerAddressKeyPrefix)) + defer iterator.Close() + + var registeredAddrArr []types.RegisteredRelayerAddress + for ; iterator.Valid(); iterator.Next() { + address, channelID, err := types.ParseKeyCounterpartyRelayer(string(iterator.Key())) + if err != nil { + panic(err) + } + + addr := types.RegisteredRelayerAddress{ + Address: address, + CounterpartyAddress: string(iterator.Value()), + ChannelId: channelID, + } + + registeredAddrArr = append(registeredAddrArr, addr) + } + + return registeredAddrArr +} + +// SetRelayerAddressForAsyncAck sets the forward relayer address during OnRecvPacket in case of async acknowledgement +func (k Keeper) SetRelayerAddressForAsyncAck(ctx sdk.Context, packetID channeltypes.PacketId, address string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.KeyForwardRelayerAddress(packetID), []byte(address)) +} + +// GetRelayerAddressForAsyncAck gets forward relayer address for a particular packet +func (k Keeper) GetRelayerAddressForAsyncAck(ctx sdk.Context, packetID channeltypes.PacketId) (string, bool) { + store := ctx.KVStore(k.storeKey) + key := types.KeyForwardRelayerAddress(packetID) + if !store.Has(key) { + return "", false + } + + addr := string(store.Get(key)) + return addr, true +} + +// GetAllForwardRelayerAddresses returns all forward relayer addresses stored for async acknowledgements +func (k Keeper) GetAllForwardRelayerAddresses(ctx sdk.Context) []types.ForwardRelayerAddress { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, []byte(types.ForwardRelayerPrefix)) + defer iterator.Close() + + var forwardRelayerAddr []types.ForwardRelayerAddress + for ; iterator.Valid(); iterator.Next() { + packetID, err := types.ParseKeyForwardRelayerAddress(string(iterator.Key())) + if err != nil { + panic(err) + } + + addr := types.ForwardRelayerAddress{ + Address: string(iterator.Value()), + PacketId: packetID, + } + + forwardRelayerAddr = append(forwardRelayerAddr, addr) + } + + return forwardRelayerAddr +} + +// Deletes the forwardRelayerAddr associated with the packetID +func (k Keeper) DeleteForwardRelayerAddress(ctx sdk.Context, packetID channeltypes.PacketId) { + store := ctx.KVStore(k.storeKey) + key := types.KeyForwardRelayerAddress(packetID) + store.Delete(key) +} + +// GetFeesInEscrow returns all escrowed packet fees for a given packetID +func (k Keeper) GetFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId) (types.PacketFees, bool) { + store := ctx.KVStore(k.storeKey) + key := types.KeyFeesInEscrow(packetID) + bz := store.Get(key) + if bz == nil { + return types.PacketFees{}, false + } + + return k.MustUnmarshalFees(bz), true +} + +// HasFeesInEscrow returns true if packet fees exist for the provided packetID +func (k Keeper) HasFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId) bool { + store := ctx.KVStore(k.storeKey) + key := types.KeyFeesInEscrow(packetID) + + return store.Has(key) +} + +// SetFeesInEscrow sets the given packet fees in escrow keyed by the packetID +func (k Keeper) SetFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId, fees types.PacketFees) { + store := ctx.KVStore(k.storeKey) + bz := k.MustMarshalFees(fees) + store.Set(types.KeyFeesInEscrow(packetID), bz) +} + +// DeleteFeesInEscrow deletes the fee associated with the given packetID +func (k Keeper) DeleteFeesInEscrow(ctx sdk.Context, packetID channeltypes.PacketId) { + store := ctx.KVStore(k.storeKey) + key := types.KeyFeesInEscrow(packetID) + store.Delete(key) +} + +// GetIdentifiedPacketFeesForChannel returns all the currently escrowed fees on a given channel. +func (k Keeper) GetIdentifiedPacketFeesForChannel(ctx sdk.Context, portID, channelID string) []types.IdentifiedPacketFees { + var identifiedPacketFees []types.IdentifiedPacketFees + + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, types.KeyFeesInEscrowChannelPrefix(portID, channelID)) + + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + packetID, err := types.ParseKeyFeesInEscrow(string(iterator.Key())) + if err != nil { + panic(err) + } + + packetFees := k.MustUnmarshalFees(iterator.Value()) + + identifiedFee := types.NewIdentifiedPacketFees(packetID, packetFees.PacketFees) + identifiedPacketFees = append(identifiedPacketFees, identifiedFee) + } + + return identifiedPacketFees +} + +// GetAllIdentifiedPacketFees returns a list of all IdentifiedPacketFees that are stored in state +func (k Keeper) GetAllIdentifiedPacketFees(ctx sdk.Context) []types.IdentifiedPacketFees { + store := ctx.KVStore(k.storeKey) + iterator := sdk.KVStorePrefixIterator(store, []byte(types.FeesInEscrowPrefix)) + defer iterator.Close() + + var identifiedFees []types.IdentifiedPacketFees + for ; iterator.Valid(); iterator.Next() { + packetID, err := types.ParseKeyFeesInEscrow(string(iterator.Key())) + if err != nil { + panic(err) + } + + feesInEscrow := k.MustUnmarshalFees(iterator.Value()) + + identifiedFee := types.IdentifiedPacketFees{ + PacketId: packetID, + PacketFees: feesInEscrow.PacketFees, + } + + identifiedFees = append(identifiedFees, identifiedFee) + } + + return identifiedFees +} + +// MustMarshalFees attempts to encode a Fee object and returns the +// raw encoded bytes. It panics on error. +func (k Keeper) MustMarshalFees(fees types.PacketFees) []byte { + return k.cdc.MustMarshal(&fees) +} + +// MustUnmarshalFees attempts to decode and return a Fee object from +// raw encoded bytes. It panics on error. +func (k Keeper) MustUnmarshalFees(bz []byte) types.PacketFees { + var fees types.PacketFees + k.cdc.MustUnmarshal(bz, &fees) + return fees +} diff --git a/modules/apps/29-fee/keeper/keeper_test.go b/modules/apps/29-fee/keeper/keeper_test.go new file mode 100644 index 00000000000..7446ecbab64 --- /dev/null +++ b/modules/apps/29-fee/keeper/keeper_test.go @@ -0,0 +1,259 @@ +package keeper_test + +import ( + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" + ibcmock "github.com/cosmos/ibc-go/v3/testing/mock" +) + +var ( + defaultRecvFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}} + defaultAckFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(200)}} + defaultTimeoutFee = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(300)}} + invalidCoins = sdk.Coins{sdk.Coin{Denom: "invalidDenom", Amount: sdk.NewInt(100)}} +) + +type KeeperTestSuite struct { + suite.Suite + + coordinator *ibctesting.Coordinator + + // testing chains used for convenience and readability + chainA *ibctesting.TestChain + chainB *ibctesting.TestChain + chainC *ibctesting.TestChain + + path *ibctesting.Path + pathAToC *ibctesting.Path + + queryClient types.QueryClient +} + +func (suite *KeeperTestSuite) SetupTest() { + suite.coordinator = ibctesting.NewCoordinator(suite.T(), 3) + suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(1)) + suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) + suite.chainC = suite.coordinator.GetChain(ibctesting.GetChainID(3)) + + path := ibctesting.NewPath(suite.chainA, suite.chainB) + mockFeeVersion := string(types.ModuleCdc.MustMarshalJSON(&types.Metadata{FeeVersion: types.Version, AppVersion: ibcmock.Version})) + path.EndpointA.ChannelConfig.Version = mockFeeVersion + path.EndpointB.ChannelConfig.Version = mockFeeVersion + path.EndpointA.ChannelConfig.PortID = ibctesting.MockFeePort + path.EndpointB.ChannelConfig.PortID = ibctesting.MockFeePort + suite.path = path + + path = ibctesting.NewPath(suite.chainA, suite.chainC) + path.EndpointA.ChannelConfig.Version = mockFeeVersion + path.EndpointB.ChannelConfig.Version = mockFeeVersion + path.EndpointA.ChannelConfig.PortID = ibctesting.MockFeePort + path.EndpointB.ChannelConfig.PortID = ibctesting.MockFeePort + suite.pathAToC = path + + queryHelper := baseapp.NewQueryServerTestHelper(suite.chainA.GetContext(), suite.chainA.GetSimApp().InterfaceRegistry()) + types.RegisterQueryServer(queryHelper, suite.chainA.GetSimApp().IBCFeeKeeper) + suite.queryClient = types.NewQueryClient(queryHelper) +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +// helper function +func lockFeeModule(chain *ibctesting.TestChain) { + ctx := chain.GetContext() + storeKey := chain.GetSimApp().GetKey(types.ModuleName) + store := ctx.KVStore(storeKey) + store.Set(types.KeyLocked(), []byte{1}) +} + +func (suite *KeeperTestSuite) TestEscrowAccountHasBalance() { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + suite.Require().False(suite.chainA.GetSimApp().IBCFeeKeeper.EscrowAccountHasBalance(suite.chainA.GetContext(), fee.Total())) + + // set fee in escrow account + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), types.ModuleName, fee.Total()) + suite.Require().Nil(err) + + suite.Require().True(suite.chainA.GetSimApp().IBCFeeKeeper.EscrowAccountHasBalance(suite.chainA.GetContext(), fee.Total())) + + // increase ack fee + fee.AckFee = fee.AckFee.Add(defaultAckFee...) + suite.Require().False(suite.chainA.GetSimApp().IBCFeeKeeper.EscrowAccountHasBalance(suite.chainA.GetContext(), fee.Total())) +} + +func (suite *KeeperTestSuite) TestFeesInEscrow() { + suite.coordinator.Setup(suite.path) + + // escrow five fees for packet sequence 1 + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), nil) + packetFees := []types.PacketFee{packetFee, packetFee, packetFee, packetFee, packetFee} + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees(packetFees)) + + // retrieve the fees in escrow and assert the length of PacketFees + feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetID) + suite.Require().True(found) + suite.Require().Len(feesInEscrow.PacketFees, 5, fmt.Sprintf("expected length 5, but got %d", len(feesInEscrow.PacketFees))) + + // delete fees for packet sequence 1 + suite.chainA.GetSimApp().IBCFeeKeeper.DeleteFeesInEscrow(suite.chainA.GetContext(), packetID) + hasFeesInEscrow := suite.chainA.GetSimApp().IBCFeeKeeper.HasFeesInEscrow(suite.chainA.GetContext(), packetID) + suite.Require().False(hasFeesInEscrow) +} + +func (suite *KeeperTestSuite) TestIsLocked() { + ctx := suite.chainA.GetContext() + suite.Require().False(suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(ctx)) + + lockFeeModule(suite.chainA) + + suite.Require().True(suite.chainA.GetSimApp().IBCFeeKeeper.IsLocked(ctx)) +} + +func (suite *KeeperTestSuite) TestGetIdentifiedPacketFeesForChannel() { + suite.coordinator.Setup(suite.path) + + // escrow a fee + refundAcc := suite.chainA.SenderAccount.GetAddress() + packetID1 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + packetID2 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 2) + packetID5 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 51) + + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + // escrow the packet fee + packetFee := types.NewPacketFee(fee, refundAcc.String(), []string{}) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID1, types.NewPacketFees([]types.PacketFee{packetFee})) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID2, types.NewPacketFees([]types.PacketFee{packetFee})) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID5, types.NewPacketFees([]types.PacketFee{packetFee})) + + // set fees in escrow for packetIDs on different channel + diffChannel := "channel-1" + diffPacketID1 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, diffChannel, 1) + diffPacketID2 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, diffChannel, 2) + diffPacketID5 := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, diffChannel, 5) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), diffPacketID1, types.NewPacketFees([]types.PacketFee{packetFee})) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), diffPacketID2, types.NewPacketFees([]types.PacketFee{packetFee})) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), diffPacketID5, types.NewPacketFees([]types.PacketFee{packetFee})) + + expectedFees := []types.IdentifiedPacketFees{ + { + PacketId: packetID1, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc.String(), + Relayers: nil, + }, + }, + }, + { + PacketId: packetID2, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc.String(), + Relayers: nil, + }, + }, + }, + { + PacketId: packetID5, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc.String(), + Relayers: nil, + }, + }, + }, + } + + identifiedFees := suite.chainA.GetSimApp().IBCFeeKeeper.GetIdentifiedPacketFeesForChannel(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID) + suite.Require().Len(identifiedFees, len(expectedFees)) + suite.Require().Equal(identifiedFees, expectedFees) +} + +func (suite *KeeperTestSuite) TestGetAllIdentifiedPacketFees() { + suite.coordinator.Setup(suite.path) + + // escrow a fee + refundAcc := suite.chainA.SenderAccount.GetAddress() + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + // escrow the packet fee + packetFee := types.NewPacketFee(fee, refundAcc.String(), []string{}) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, types.NewPacketFees([]types.PacketFee{packetFee})) + + expectedFees := []types.IdentifiedPacketFees{ + { + PacketId: packetID, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc.String(), + Relayers: nil, + }, + }, + }, + } + + identifiedFees := suite.chainA.GetSimApp().IBCFeeKeeper.GetAllIdentifiedPacketFees(suite.chainA.GetContext()) + suite.Require().Len(identifiedFees, len(expectedFees)) + suite.Require().Equal(identifiedFees, expectedFees) +} + +func (suite *KeeperTestSuite) TestGetAllFeeEnabledChannels() { + validPortId := "ibcmoduleport" + // set two channels enabled + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), ibctesting.MockFeePort, ibctesting.FirstChannelID) + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeeEnabled(suite.chainA.GetContext(), validPortId, ibctesting.FirstChannelID) + + expectedCh := []types.FeeEnabledChannel{ + { + PortId: validPortId, + ChannelId: ibctesting.FirstChannelID, + }, + { + PortId: ibctesting.MockFeePort, + ChannelId: ibctesting.FirstChannelID, + }, + } + + ch := suite.chainA.GetSimApp().IBCFeeKeeper.GetAllFeeEnabledChannels(suite.chainA.GetContext()) + suite.Require().Len(ch, len(expectedCh)) + suite.Require().Equal(ch, expectedCh) +} + +func (suite *KeeperTestSuite) TestGetAllRelayerAddresses() { + sender := suite.chainA.SenderAccount.GetAddress().String() + counterparty := suite.chainB.SenderAccount.GetAddress().String() + + suite.chainA.GetSimApp().IBCFeeKeeper.SetCounterpartyAddress(suite.chainA.GetContext(), sender, counterparty, ibctesting.FirstChannelID) + + expectedAddr := []types.RegisteredRelayerAddress{ + { + Address: sender, + CounterpartyAddress: counterparty, + ChannelId: ibctesting.FirstChannelID, + }, + } + + addr := suite.chainA.GetSimApp().IBCFeeKeeper.GetAllRelayerAddresses(suite.chainA.GetContext()) + suite.Require().Len(addr, len(expectedAddr)) + suite.Require().Equal(addr, expectedAddr) +} diff --git a/modules/apps/29-fee/keeper/msg_server.go b/modules/apps/29-fee/keeper/msg_server.go new file mode 100644 index 00000000000..69f6520c759 --- /dev/null +++ b/modules/apps/29-fee/keeper/msg_server.go @@ -0,0 +1,79 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +) + +var _ types.MsgServer = Keeper{} + +// RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their counterparty address before relaying +// This ensures they will be properly compensated for forward relaying on the source chain since the destination chain must send back relayer's source address (counterparty address) in acknowledgement +// This function may be called more than once by relayers, in which case, the previous counterparty address will be overwritten by the new counterparty address +func (k Keeper) RegisterCounterpartyAddress(goCtx context.Context, msg *types.MsgRegisterCounterpartyAddress) (*types.MsgRegisterCounterpartyAddressResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + k.SetCounterpartyAddress( + ctx, msg.Address, msg.CounterpartyAddress, msg.ChannelId, + ) + + k.Logger(ctx).Info("Registering counterparty address for relayer.", "Address:", msg.Address, "Counterparty Address:", msg.CounterpartyAddress) + + return &types.MsgRegisterCounterpartyAddressResponse{}, nil +} + +// PayPacketFee defines a rpc handler method for MsgPayPacketFee +// PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to relay the packet with the next sequence +func (k Keeper) PayPacketFee(goCtx context.Context, msg *types.MsgPayPacketFee) (*types.MsgPayPacketFeeResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if !k.IsFeeEnabled(ctx, msg.SourcePortId, msg.SourceChannelId) { + // users may not escrow fees on this channel. Must send packets without a fee message + return nil, types.ErrFeeNotEnabled + } + + if k.IsLocked(ctx) { + return nil, types.ErrFeeModuleLocked + } + + // get the next sequence + sequence, found := k.GetNextSequenceSend(ctx, msg.SourcePortId, msg.SourceChannelId) + if !found { + return nil, channeltypes.ErrSequenceSendNotFound + } + + packetID := channeltypes.NewPacketId(msg.SourcePortId, msg.SourceChannelId, sequence) + packetFee := types.NewPacketFee(msg.Fee, msg.Signer, msg.Relayers) + + if err := k.escrowPacketFee(ctx, packetID, packetFee); err != nil { + return nil, err + } + + return &types.MsgPayPacketFeeResponse{}, nil +} + +// PayPacketFee defines a rpc handler method for MsgPayPacketFee +// PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to +// incentivize the relaying of a known packet +func (k Keeper) PayPacketFeeAsync(goCtx context.Context, msg *types.MsgPayPacketFeeAsync) (*types.MsgPayPacketFeeAsyncResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if !k.IsFeeEnabled(ctx, msg.PacketId.PortId, msg.PacketId.ChannelId) { + // users may not escrow fees on this channel. Must send packets without a fee message + return nil, types.ErrFeeNotEnabled + } + + if k.IsLocked(ctx) { + return nil, types.ErrFeeModuleLocked + } + + if err := k.escrowPacketFee(ctx, msg.PacketId, msg.PacketFee); err != nil { + return nil, err + } + + return &types.MsgPayPacketFeeAsyncResponse{}, nil +} diff --git a/modules/apps/29-fee/keeper/msg_server_test.go b/modules/apps/29-fee/keeper/msg_server_test.go new file mode 100644 index 00000000000..8a927559a51 --- /dev/null +++ b/modules/apps/29-fee/keeper/msg_server_test.go @@ -0,0 +1,310 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" +) + +func (suite *KeeperTestSuite) TestRegisterCounterpartyAddress() { + var ( + sender string + counterparty string + ) + + testCases := []struct { + name string + expPass bool + malleate func() + }{ + { + "success", + true, + func() {}, + }, + { + "counterparty is an arbitrary string", + true, + func() { counterparty = "arbitrary-string" }, + }, + } + + for _, tc := range testCases { + suite.SetupTest() + ctx := suite.chainA.GetContext() + + sender = suite.chainA.SenderAccount.GetAddress().String() + counterparty = suite.chainB.SenderAccount.GetAddress().String() + tc.malleate() + msg := types.NewMsgRegisterCounterpartyAddress(sender, counterparty, ibctesting.FirstChannelID) + + _, err := suite.chainA.SendMsgs(msg) + + if tc.expPass { + suite.Require().NoError(err) // message committed + + counterpartyAddress, _ := suite.chainA.GetSimApp().IBCFeeKeeper.GetCounterpartyAddress(ctx, suite.chainA.SenderAccount.GetAddress().String(), ibctesting.FirstChannelID) + suite.Require().Equal(counterparty, counterpartyAddress) + } else { + suite.Require().Error(err) + } + } +} + +func (suite *KeeperTestSuite) TestPayPacketFee() { + var ( + expEscrowBalance sdk.Coins + expFeesInEscrow []types.PacketFee + msg *types.MsgPayPacketFee + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "success with existing packet fees in escrow", + func() { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), nil) + feesInEscrow := types.NewPacketFees([]types.PacketFee{packetFee}) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, feesInEscrow) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expEscrowBalance = expEscrowBalance.Add(fee.Total()...) + expFeesInEscrow = append(expFeesInEscrow, packetFee) + }, + true, + }, + { + "fee module is locked", + func() { + lockFeeModule(suite.chainA) + }, + false, + }, + { + "fee module disabled on channel", + func() { + msg.SourcePortId = "invalid-port" + msg.SourceChannelId = "invalid-channel" + }, + false, + }, + { + "invalid refund address", + func() { + msg.Signer = "invalid-address" + }, + false, + }, + { + "refund account does not exist", + func() { + msg.Signer = suite.chainB.SenderAccount.GetAddress().String() + }, + false, + }, + { + "acknowledgement fee balance not found", + func() { + msg.Fee.AckFee = invalidCoins + }, + false, + }, + { + "receive fee balance not found", + func() { + msg.Fee.RecvFee = invalidCoins + }, + false, + }, + { + "timeout fee balance not found", + func() { + msg.Fee.TimeoutFee = invalidCoins + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) // setup channel + + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + msg = types.NewMsgPayPacketFee( + fee, + suite.path.EndpointA.ChannelConfig.PortID, + suite.path.EndpointA.ChannelID, + suite.chainA.SenderAccount.GetAddress().String(), + nil, + ) + + expEscrowBalance = fee.Total() + expPacketFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), nil) + expFeesInEscrow = []types.PacketFee{expPacketFee} + + tc.malleate() + + _, err := suite.chainA.GetSimApp().IBCFeeKeeper.PayPacketFee(sdk.WrapSDKContext(suite.chainA.GetContext()), msg) + + if tc.expPass { + suite.Require().NoError(err) // message committed + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetID) + suite.Require().True(found) + suite.Require().Equal(expFeesInEscrow, feesInEscrow.PacketFees) + + escrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(expEscrowBalance.AmountOf(sdk.DefaultBondDenom), escrowBalance.Amount) + } else { + suite.Require().Error(err) + + escrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(sdk.NewInt(0), escrowBalance.Amount) + } + }) + } +} + +func (suite *KeeperTestSuite) TestPayPacketFeeAsync() { + var ( + expEscrowBalance sdk.Coins + expFeesInEscrow []types.PacketFee + msg *types.MsgPayPacketFeeAsync + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "success with existing packet fees in escrow", + func() { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), nil) + feesInEscrow := types.NewPacketFees([]types.PacketFee{packetFee}) + + suite.chainA.GetSimApp().IBCFeeKeeper.SetFeesInEscrow(suite.chainA.GetContext(), packetID, feesInEscrow) + err := suite.chainA.GetSimApp().BankKeeper.SendCoinsFromAccountToModule(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), types.ModuleName, fee.Total()) + suite.Require().NoError(err) + + expEscrowBalance = expEscrowBalance.Add(fee.Total()...) + expFeesInEscrow = append(expFeesInEscrow, packetFee) + }, + true, + }, + { + "fee module is locked", + func() { + lockFeeModule(suite.chainA) + }, + false, + }, + { + "fee module disabled on channel", + func() { + msg.PacketId.PortId = "invalid-port" + msg.PacketId.ChannelId = "invalid-channel" + }, + false, + }, + { + "invalid refund address", + func() { + msg.PacketFee.RefundAddress = "invalid-address" + }, + false, + }, + { + "refund account does not exist", + func() { + msg.PacketFee.RefundAddress = suite.chainB.SenderAccount.GetAddress().String() + }, + false, + }, + { + "acknowledgement fee balance not found", + func() { + msg.PacketFee.Fee.AckFee = invalidCoins + }, + false, + }, + { + "receive fee balance not found", + func() { + msg.PacketFee.Fee.RecvFee = invalidCoins + }, + false, + }, + { + "timeout fee balance not found", + func() { + msg.PacketFee.Fee.TimeoutFee = invalidCoins + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) // setup channel + + packetID := channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, suite.chainA.SenderAccount.GetAddress().String(), nil) + + expEscrowBalance = fee.Total() + expFeesInEscrow = []types.PacketFee{packetFee} + msg = types.NewMsgPayPacketFeeAsync(packetID, packetFee) + + tc.malleate() + + _, err := suite.chainA.GetSimApp().IBCFeeKeeper.PayPacketFeeAsync(sdk.WrapSDKContext(suite.chainA.GetContext()), msg) + + if tc.expPass { + suite.Require().NoError(err) // message committed + + feesInEscrow, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetFeesInEscrow(suite.chainA.GetContext(), packetID) + suite.Require().True(found) + suite.Require().Equal(expFeesInEscrow, feesInEscrow.PacketFees) + + escrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(expEscrowBalance.AmountOf(sdk.DefaultBondDenom), escrowBalance.Amount) + } else { + suite.Require().Error(err) + + escrowBalance := suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.GetSimApp().IBCFeeKeeper.GetFeeModuleAddress(), sdk.DefaultBondDenom) + suite.Require().Equal(sdk.NewInt(0), escrowBalance.Amount) + } + }) + } +} diff --git a/modules/apps/29-fee/keeper/relay.go b/modules/apps/29-fee/keeper/relay.go new file mode 100644 index 00000000000..476497bfbbb --- /dev/null +++ b/modules/apps/29-fee/keeper/relay.go @@ -0,0 +1,65 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" +) + +// SendPacket wraps IBC ChannelKeeper's SendPacket function +func (k Keeper) SendPacket(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI) error { + return k.ics4Wrapper.SendPacket(ctx, chanCap, packet) +} + +// WriteAcknowledgement wraps IBC ChannelKeeper's WriteAcknowledgement function +// ICS29 WriteAcknowledgement is used for asynchronous acknowledgements +func (k Keeper) WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, acknowledgement ibcexported.Acknowledgement) error { + if !k.IsFeeEnabled(ctx, packet.GetDestPort(), packet.GetDestChannel()) { + // ics4Wrapper may be core IBC or higher-level middleware + return k.ics4Wrapper.WriteAcknowledgement(ctx, chanCap, packet, acknowledgement) + } + + packetID := channeltypes.NewPacketId(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) + + // retrieve the forward relayer that was stored in `onRecvPacket` + relayer, found := k.GetRelayerAddressForAsyncAck(ctx, packetID) + if !found { + return sdkerrors.Wrapf(types.ErrRelayerNotFoundForAsyncAck, "no relayer address stored for async acknowledgement for packet with portID: %s, channelID: %s, sequence: %d", packetID.PortId, packetID.ChannelId, packetID.Sequence) + } + + // it is possible that a relayer has not registered a counterparty address. + // if there is no registered counterparty address then write acknowledgement with empty relayer address and refund recv_fee. + forwardRelayer, _ := k.GetCounterpartyAddress(ctx, relayer, packet.GetDestChannel()) + + ack := types.NewIncentivizedAcknowledgement(forwardRelayer, acknowledgement.Acknowledgement(), acknowledgement.Success()) + + k.DeleteForwardRelayerAddress(ctx, packetID) + + // ics4Wrapper may be core IBC or higher-level middleware + return k.ics4Wrapper.WriteAcknowledgement(ctx, chanCap, packet, ack) +} + +// GetAppVersion returns the underlying application version. +func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + version, found := k.ics4Wrapper.GetAppVersion(ctx, portID, channelID) + if !found { + return "", false + } + + if !k.IsFeeEnabled(ctx, portID, channelID) { + return version, true + } + + var metadata types.Metadata + if err := types.ModuleCdc.UnmarshalJSON([]byte(version), &metadata); err != nil { + panic(fmt.Errorf("unable to unmarshal metadata for fee enabled channel: %w", err)) + } + + return metadata.AppVersion, true +} diff --git a/modules/apps/29-fee/keeper/relay_test.go b/modules/apps/29-fee/keeper/relay_test.go new file mode 100644 index 00000000000..d0a9e620f9d --- /dev/null +++ b/modules/apps/29-fee/keeper/relay_test.go @@ -0,0 +1,172 @@ +package keeper_test + +import ( + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" + ibcmock "github.com/cosmos/ibc-go/v3/testing/mock" +) + +func (suite *KeeperTestSuite) TestWriteAcknowledgementAsync() { + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() { + suite.chainB.GetSimApp().IBCFeeKeeper.SetRelayerAddressForAsyncAck(suite.chainB.GetContext(), channeltypes.NewPacketId(suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID, 1), suite.chainA.SenderAccount.GetAddress().String()) + suite.chainB.GetSimApp().IBCFeeKeeper.SetCounterpartyAddress(suite.chainB.GetContext(), suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), suite.path.EndpointB.ChannelID) + }, + true, + }, + { + "relayer address not set for async WriteAcknowledgement", + func() {}, + false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + + // open incentivized channels + // setup pathAToC (chainA -> chainC) first in order to have different channel IDs for chainA & chainB + suite.coordinator.Setup(suite.pathAToC) + // setup path for chainA -> chainB + suite.coordinator.Setup(suite.path) + + // build packet + timeoutTimestamp := ^uint64(0) + packet := channeltypes.NewPacket( + []byte("packetData"), + 1, + suite.path.EndpointA.ChannelConfig.PortID, + suite.path.EndpointA.ChannelID, + suite.path.EndpointB.ChannelConfig.PortID, + suite.path.EndpointB.ChannelID, + clienttypes.ZeroHeight(), + timeoutTimestamp, + ) + + ack := channeltypes.NewResultAcknowledgement([]byte("success")) + chanCap := suite.chainB.GetChannelCapability(suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID) + + // malleate test case + tc.malleate() + + err := suite.chainB.GetSimApp().IBCFeeKeeper.WriteAcknowledgement(suite.chainB.GetContext(), chanCap, packet, ack) + + if tc.expPass { + suite.Require().NoError(err) + _, found := suite.chainB.GetSimApp().IBCFeeKeeper.GetRelayerAddressForAsyncAck(suite.chainB.GetContext(), channeltypes.NewPacketId(suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, 1)) + suite.Require().False(found) + + expectedAck := types.NewIncentivizedAcknowledgement(suite.chainB.SenderAccount.GetAddress().String(), ack.Acknowledgement(), ack.Success()) + commitedAck, _ := suite.chainB.GetSimApp().GetIBCKeeper().ChannelKeeper.GetPacketAcknowledgement(suite.chainB.GetContext(), packet.DestinationPort, packet.DestinationChannel, 1) + suite.Require().Equal(commitedAck, channeltypes.CommitAcknowledgement(expectedAck.Acknowledgement())) + } else { + suite.Require().Error(err) + } + }) + } +} + +func (suite *KeeperTestSuite) TestWriteAcknowledgementAsyncFeeDisabled() { + // open incentivized channel + suite.coordinator.Setup(suite.path) + suite.chainB.GetSimApp().IBCFeeKeeper.DeleteFeeEnabled(suite.chainB.GetContext(), suite.path.EndpointB.ChannelConfig.PortID, "channel-0") + + // build packet + timeoutTimestamp := ^uint64(0) + packet := channeltypes.NewPacket( + []byte("packetData"), + 1, + suite.path.EndpointA.ChannelConfig.PortID, + suite.path.EndpointA.ChannelID, + suite.path.EndpointB.ChannelConfig.PortID, + suite.path.EndpointB.ChannelID, + clienttypes.ZeroHeight(), + timeoutTimestamp, + ) + + ack := channeltypes.NewResultAcknowledgement([]byte("success")) + chanCap := suite.chainB.GetChannelCapability(suite.path.EndpointB.ChannelConfig.PortID, suite.path.EndpointB.ChannelID) + + err := suite.chainB.GetSimApp().IBCFeeKeeper.WriteAcknowledgement(suite.chainB.GetContext(), chanCap, packet, ack) + suite.Require().NoError(err) + + packetAck, _ := suite.chainB.GetSimApp().GetIBCKeeper().ChannelKeeper.GetPacketAcknowledgement(suite.chainB.GetContext(), packet.DestinationPort, packet.DestinationChannel, 1) + suite.Require().Equal(packetAck, channeltypes.CommitAcknowledgement(ack.Acknowledgement())) +} + +func (suite *KeeperTestSuite) TestGetAppVersion() { + var ( + portID string + channelID string + expAppVersion string + ) + testCases := []struct { + name string + malleate func() + expFound bool + }{ + { + "success for fee enabled channel", + func() { + expAppVersion = ibcmock.Version + }, + true, + }, + { + "success for non fee enabled channel", + func() { + path := ibctesting.NewPath(suite.chainA, suite.chainB) + path.EndpointA.ChannelConfig.PortID = ibctesting.MockFeePort + path.EndpointB.ChannelConfig.PortID = ibctesting.MockFeePort + // by default a new path uses a non fee channel + suite.coordinator.Setup(path) + portID = path.EndpointA.ChannelConfig.PortID + channelID = path.EndpointA.ChannelID + + expAppVersion = ibcmock.Version + }, + true, + }, + { + "channel does not exist", + func() { + channelID = "does not exist" + }, + false, + }, + } + + for _, tc := range testCases { + tc := tc + suite.Run(tc.name, func() { + suite.SetupTest() + suite.coordinator.Setup(suite.path) + + portID = suite.path.EndpointA.ChannelConfig.PortID + channelID = suite.path.EndpointA.ChannelID + + // malleate test case + tc.malleate() + + appVersion, found := suite.chainA.GetSimApp().IBCFeeKeeper.GetAppVersion(suite.chainA.GetContext(), portID, channelID) + + if tc.expFound { + suite.Require().True(found) + suite.Require().Equal(expAppVersion, appVersion) + } else { + suite.Require().False(found) + suite.Require().Empty(appVersion) + } + }) + } +} diff --git a/modules/apps/29-fee/module.go b/modules/apps/29-fee/module.go new file mode 100644 index 00000000000..e493e047837 --- /dev/null +++ b/modules/apps/29-fee/module.go @@ -0,0 +1,172 @@ +package fee + +import ( + "context" + "encoding/json" + "fmt" + "math/rand" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/client/cli" + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/keeper" + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + porttypes "github.com/cosmos/ibc-go/v3/modules/core/05-port/types" +) + +var ( + _ module.AppModule = AppModule{} + _ porttypes.IBCModule = IBCModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// AppModuleBasic is the 29-fee AppModuleBasic +type AppModuleBasic struct{} + +// Name implements AppModuleBasic interface +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec implements AppModuleBasic interface +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// RegisterInterfaces registers module concrete types into protobuf Any. +func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// DefaultGenesis returns default genesis state as raw bytes for the ibc +// 29-fee module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the 29-fee module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var gs types.GenesisState + if err := cdc.UnmarshalJSON(bz, &gs); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return gs.Validate() +} + +// RegisterRESTRoutes implements AppModuleBasic interface +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for ics29 fee module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +} + +// GetTxCmd implements AppModuleBasic interface +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd() +} + +// GetQueryCmd implements AppModuleBasic interface +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// AppModule represents the AppModule for this module +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +// NewAppModule creates a new 29-fee module +func NewAppModule(k keeper.Keeper) AppModule { + return AppModule{ + keeper: k, + } +} + +// RegisterInvariants implements the AppModule interface +func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { +} + +// Route implements the AppModule interface +func (am AppModule) Route() sdk.Route { + return sdk.Route{} +} + +// QuerierRoute implements the AppModule interface +func (AppModule) QuerierRoute() string { + return types.QuerierRoute +} + +// LegacyQuerierHandler implements the AppModule interface +func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers module services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// InitGenesis performs genesis initialization for the ibc-29-fee module. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + am.keeper.InitGenesis(ctx, genesisState) + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the ibc-29-fee +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := am.keeper.ExportGenesis(ctx) + return cdc.MustMarshalJSON(gs) +} + +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } + +// BeginBlock implements the AppModule interface +func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { +} + +// EndBlock implements the AppModule interface +func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the 29-fee module. +func (AppModule) GenerateGenesisState(_ *module.SimulationState) { +} + +// ProposalContents doesn't return any content functions for governance proposals. +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized ibc-29-fee param changes for the simulator. +func (AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + return nil +} + +// RegisterStoreDecoder registers a decoder for 29-fee module's types +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { +} + +// WeightedOperations returns the all the 29-fee module operations with their respective weights. +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + return nil +} diff --git a/modules/apps/29-fee/transfer_test.go b/modules/apps/29-fee/transfer_test.go new file mode 100644 index 00000000000..9d7557fd6c4 --- /dev/null +++ b/modules/apps/29-fee/transfer_test.go @@ -0,0 +1,72 @@ +package fee_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + clienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" +) + +// 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.Version})) + path.EndpointA.ChannelConfig.Version = feeTransferVersion + path.EndpointB.ChannelConfig.Version = feeTransferVersion + path.EndpointA.ChannelConfig.PortID = transfertypes.PortID + path.EndpointB.ChannelConfig.PortID = transfertypes.PortID + + suite.coordinator.Setup(path) + + // set up coin & ics20 packet + coin := ibctesting.TestCoin + fee := types.Fee{ + RecvFee: defaultRecvFee, + AckFee: defaultAckFee, + TimeoutFee: defaultTimeoutFee, + } + + 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, coin, suite.chainA.SenderAccount.GetAddress().String(), suite.chainB.SenderAccount.GetAddress().String(), clienttypes.NewHeight(0, 100), 0), + } + res, err := suite.chainA.SendMsgs(msgs...) + 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)) + + packet, err := ibctesting.ParsePacketFromEvents(res.GetEvents()) + 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.NewMsgRegisterCounterpartyAddress(suite.chainB.SenderAccount.GetAddress().String(), relayerAddress.String(), ibctesting.FirstChannelID) + _, err = suite.chainB.SendMsgs(msgRegister) + suite.Require().NoError(err) // message committed + + // relay packet + err = path.RelayPacket(packet) + suite.Require().NoError(err) // relay committed + + // ensure relayers got paid + // relayer for forward relay: chainB.SenderAccount + // relayer for reverse relay: chainA.SenderAccount + + // 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.Add(fee.TimeoutFee...), // ack fee paid, timeout fee refunded + sdk.NewCoins(suite.chainA.GetSimApp().BankKeeper.GetBalance(suite.chainA.GetContext(), suite.chainA.SenderAccount.GetAddress(), ibctesting.TestCoin.Denom)).Sub(originalChainASenderAccountBalance), + ) + +} diff --git a/modules/apps/29-fee/types/ack.go b/modules/apps/29-fee/types/ack.go new file mode 100644 index 00000000000..229d8e4cc3f --- /dev/null +++ b/modules/apps/29-fee/types/ack.go @@ -0,0 +1,27 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewIncentivizedAcknowledgement creates a new instance of IncentivizedAcknowledgement +func NewIncentivizedAcknowledgement(relayer string, ack []byte, success bool) IncentivizedAcknowledgement { + return IncentivizedAcknowledgement{ + Result: ack, + ForwardRelayerAddress: relayer, + UnderlyingAppSuccess: success, + } +} + +// Success implements the Acknowledgement interface. The acknowledgement is +// considered successful if the forward relayer address is empty. Otherwise it is +// considered a failed acknowledgement. +func (ack IncentivizedAcknowledgement) Success() bool { + return ack.UnderlyingAppSuccess +} + +// Acknowledgement implements the Acknowledgement interface. It returns the +// acknowledgement serialised using JSON. +func (ack IncentivizedAcknowledgement) Acknowledgement() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&ack)) +} diff --git a/modules/apps/29-fee/types/ack.pb.go b/modules/apps/29-fee/types/ack.pb.go new file mode 100644 index 00000000000..4f6437da224 --- /dev/null +++ b/modules/apps/29-fee/types/ack.pb.go @@ -0,0 +1,423 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/fee/v1/ack.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +type IncentivizedAcknowledgement struct { + // the underlying app acknowledgement result bytes + Result []byte `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"` + // the relayer address which submits the recv packet message + ForwardRelayerAddress string `protobuf:"bytes,2,opt,name=forward_relayer_address,json=forwardRelayerAddress,proto3" json:"forward_relayer_address,omitempty" yaml:"forward_relayer_address"` + // success flag of the base application callback + UnderlyingAppSuccess bool `protobuf:"varint,3,opt,name=underlying_app_success,json=underlyingAppSuccess,proto3" json:"underlying_app_success,omitempty" yaml:"underlying_app_successl"` +} + +func (m *IncentivizedAcknowledgement) Reset() { *m = IncentivizedAcknowledgement{} } +func (m *IncentivizedAcknowledgement) String() string { return proto.CompactTextString(m) } +func (*IncentivizedAcknowledgement) ProtoMessage() {} +func (*IncentivizedAcknowledgement) Descriptor() ([]byte, []int) { + return fileDescriptor_ab2834946fb65ea4, []int{0} +} +func (m *IncentivizedAcknowledgement) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IncentivizedAcknowledgement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IncentivizedAcknowledgement.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IncentivizedAcknowledgement) XXX_Merge(src proto.Message) { + xxx_messageInfo_IncentivizedAcknowledgement.Merge(m, src) +} +func (m *IncentivizedAcknowledgement) XXX_Size() int { + return m.Size() +} +func (m *IncentivizedAcknowledgement) XXX_DiscardUnknown() { + xxx_messageInfo_IncentivizedAcknowledgement.DiscardUnknown(m) +} + +var xxx_messageInfo_IncentivizedAcknowledgement proto.InternalMessageInfo + +func (m *IncentivizedAcknowledgement) GetResult() []byte { + if m != nil { + return m.Result + } + return nil +} + +func (m *IncentivizedAcknowledgement) GetForwardRelayerAddress() string { + if m != nil { + return m.ForwardRelayerAddress + } + return "" +} + +func (m *IncentivizedAcknowledgement) GetUnderlyingAppSuccess() bool { + if m != nil { + return m.UnderlyingAppSuccess + } + return false +} + +func init() { + proto.RegisterType((*IncentivizedAcknowledgement)(nil), "ibc.applications.fee.v1.IncentivizedAcknowledgement") +} + +func init() { proto.RegisterFile("ibc/applications/fee/v1/ack.proto", fileDescriptor_ab2834946fb65ea4) } + +var fileDescriptor_ab2834946fb65ea4 = []byte{ + // 315 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xb1, 0x4e, 0xf3, 0x30, + 0x14, 0x85, 0xeb, 0xff, 0x97, 0x2a, 0x88, 0x98, 0xa2, 0xd2, 0x56, 0x20, 0x85, 0x92, 0xa9, 0x4b, + 0x63, 0x95, 0x8a, 0x01, 0xb6, 0x76, 0x63, 0x42, 0x0a, 0x0b, 0xea, 0x12, 0x39, 0xf6, 0x6d, 0xb0, + 0xea, 0xd8, 0x96, 0xed, 0xa4, 0x0a, 0x4f, 0xc1, 0x63, 0x31, 0x76, 0x64, 0x42, 0xa8, 0x1d, 0xd9, + 0x78, 0x02, 0x94, 0xa6, 0x12, 0x1d, 0x60, 0xbb, 0xf7, 0x9c, 0x4f, 0x67, 0xf8, 0xbc, 0x4b, 0x9e, + 0x52, 0x4c, 0xb4, 0x16, 0x9c, 0x12, 0xc7, 0x95, 0xb4, 0x78, 0x01, 0x80, 0xcb, 0x31, 0x26, 0x74, + 0x19, 0x69, 0xa3, 0x9c, 0xf2, 0x7b, 0x3c, 0xa5, 0xd1, 0x21, 0x12, 0x2d, 0x00, 0xa2, 0x72, 0x7c, + 0xd6, 0xc9, 0x54, 0xa6, 0x76, 0x0c, 0xae, 0xaf, 0x06, 0x0f, 0x3f, 0x91, 0x77, 0x7e, 0x27, 0x29, + 0x48, 0xc7, 0x4b, 0xfe, 0x0c, 0x6c, 0x4a, 0x97, 0x52, 0xad, 0x04, 0xb0, 0x0c, 0x72, 0x90, 0xce, + 0xef, 0x7a, 0x6d, 0x03, 0xb6, 0x10, 0xae, 0x8f, 0x06, 0x68, 0x78, 0x12, 0xef, 0x3f, 0x7f, 0xee, + 0xf5, 0x16, 0xca, 0xac, 0x88, 0x61, 0x89, 0x01, 0x41, 0x2a, 0x30, 0x09, 0x61, 0xcc, 0x80, 0xb5, + 0xfd, 0x7f, 0x03, 0x34, 0x3c, 0x9e, 0x85, 0x5f, 0xef, 0x17, 0x41, 0x45, 0x72, 0x71, 0x1b, 0xfe, + 0x01, 0x86, 0xf1, 0xe9, 0xbe, 0x89, 0x9b, 0x62, 0xda, 0xe4, 0xfe, 0xa3, 0xd7, 0x2d, 0x24, 0x03, + 0x23, 0x2a, 0x2e, 0xb3, 0x84, 0x68, 0x9d, 0xd8, 0x82, 0xd2, 0x7a, 0xfa, 0xff, 0x00, 0x0d, 0x8f, + 0x0e, 0xa7, 0x7f, 0xe7, 0x44, 0x18, 0x77, 0x7e, 0x9a, 0xa9, 0xd6, 0x0f, 0x4d, 0x3e, 0xbb, 0x7f, + 0xdd, 0x04, 0x68, 0xbd, 0x09, 0xd0, 0xc7, 0x26, 0x40, 0x2f, 0xdb, 0xa0, 0xb5, 0xde, 0x06, 0xad, + 0xb7, 0x6d, 0xd0, 0x9a, 0x5f, 0x67, 0xdc, 0x3d, 0x15, 0x69, 0x44, 0x55, 0x8e, 0xa9, 0xb2, 0xb9, + 0xb2, 0x98, 0xa7, 0x74, 0x94, 0x29, 0x5c, 0x4e, 0x70, 0xae, 0x58, 0x21, 0xc0, 0xd6, 0xe6, 0x2d, + 0xbe, 0xba, 0x19, 0xd5, 0xd2, 0x5d, 0xa5, 0xc1, 0xa6, 0xed, 0x9d, 0xc5, 0xc9, 0x77, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x2e, 0x38, 0x5f, 0x80, 0x99, 0x01, 0x00, 0x00, +} + +func (m *IncentivizedAcknowledgement) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IncentivizedAcknowledgement) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IncentivizedAcknowledgement) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UnderlyingAppSuccess { + i-- + if m.UnderlyingAppSuccess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if len(m.ForwardRelayerAddress) > 0 { + i -= len(m.ForwardRelayerAddress) + copy(dAtA[i:], m.ForwardRelayerAddress) + i = encodeVarintAck(dAtA, i, uint64(len(m.ForwardRelayerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Result) > 0 { + i -= len(m.Result) + copy(dAtA[i:], m.Result) + i = encodeVarintAck(dAtA, i, uint64(len(m.Result))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAck(dAtA []byte, offset int, v uint64) int { + offset -= sovAck(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *IncentivizedAcknowledgement) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Result) + if l > 0 { + n += 1 + l + sovAck(uint64(l)) + } + l = len(m.ForwardRelayerAddress) + if l > 0 { + n += 1 + l + sovAck(uint64(l)) + } + if m.UnderlyingAppSuccess { + n += 2 + } + return n +} + +func sovAck(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAck(x uint64) (n int) { + return sovAck(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *IncentivizedAcknowledgement) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IncentivizedAcknowledgement: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IncentivizedAcknowledgement: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Result", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAck + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Result = append(m.Result[:0], dAtA[iNdEx:postIndex]...) + if m.Result == nil { + m.Result = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForwardRelayerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAck + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAck + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForwardRelayerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnderlyingAppSuccess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAck + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UnderlyingAppSuccess = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipAck(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAck + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAck(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAck + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAck + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAck + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAck + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAck + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAck + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAck = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAck = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAck = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/apps/29-fee/types/codec.go b/modules/apps/29-fee/types/codec.go new file mode 100644 index 00000000000..871f148b043 --- /dev/null +++ b/modules/apps/29-fee/types/codec.go @@ -0,0 +1,48 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +// RegisterLegacyAminoCodec registers the necessary x/ibc 29-fee interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgRegisterCounterpartyAddress{}, "cosmos-sdk/MsgRegisterCounterpartyAddress", nil) + cdc.RegisterConcrete(&MsgPayPacketFee{}, "cosmos-sdk/MsgPayPacketFee", nil) + cdc.RegisterConcrete(&MsgPayPacketFeeAsync{}, "cosmos-sdk/MsgPayPacketFeeAsync", nil) +} + +// RegisterInterfaces register the 29-fee module interfaces to protobuf +// Any. +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgRegisterCounterpartyAddress{}, + &MsgPayPacketFee{}, + &MsgPayPacketFeeAsync{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/ibc-transfer module codec. Note, the codec + // should ONLY be used in certain instances of tests and for JSON encoding. + // + // The actual codec used for serialization should be provided to x/ibc transfer and + // defined at the application level. + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + + // AminoCdc is a amino codec created to support amino json compatible msgs. + AminoCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} diff --git a/modules/apps/29-fee/types/errors.go b/modules/apps/29-fee/types/errors.go new file mode 100644 index 00000000000..812db0a43a4 --- /dev/null +++ b/modules/apps/29-fee/types/errors.go @@ -0,0 +1,19 @@ +package types + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// 29-fee sentinel errors +var ( + ErrInvalidVersion = sdkerrors.Register(ModuleName, 2, "invalid ICS29 middleware version") + ErrRefundAccNotFound = sdkerrors.Register(ModuleName, 3, "no account found for given refund address") + ErrBalanceNotFound = sdkerrors.Register(ModuleName, 4, "balance not found for given account address") + ErrFeeNotFound = sdkerrors.Register(ModuleName, 5, "there is no fee escrowed for the given packetID") + ErrRelayersNotNil = sdkerrors.Register(ModuleName, 6, "relayers must be nil. This feature is not supported") + ErrCounterpartyAddressEmpty = sdkerrors.Register(ModuleName, 7, "counterparty address must not be empty") + ErrForwardRelayerAddressNotFound = sdkerrors.Register(ModuleName, 8, "forward relayer address not found") + ErrFeeNotEnabled = sdkerrors.Register(ModuleName, 9, "fee module is not enabled for this channel. If this error occurs after channel setup, fee module may not be enabled") + ErrRelayerNotFoundForAsyncAck = sdkerrors.Register(ModuleName, 10, "relayer address must be stored for async WriteAcknowledgement") + ErrFeeModuleLocked = sdkerrors.Register(ModuleName, 11, "the fee module is currently locked, a severe bug has been detected") +) diff --git a/modules/apps/29-fee/types/events.go b/modules/apps/29-fee/types/events.go new file mode 100644 index 00000000000..cac882d98d3 --- /dev/null +++ b/modules/apps/29-fee/types/events.go @@ -0,0 +1,10 @@ +package types + +// 29-fee events +const ( + EventTypeIncentivizedPacket = "incentivized_ibc_packet" + + AttributeKeyRecvFee = "recv_fee" + AttributeKeyAckFee = "ack_fee" + AttributeKeyTimeoutFee = "timeout_fee" +) diff --git a/modules/apps/29-fee/types/expected_keepers.go b/modules/apps/29-fee/types/expected_keepers.go new file mode 100644 index 00000000000..1d9d3439b07 --- /dev/null +++ b/modules/apps/29-fee/types/expected_keepers.go @@ -0,0 +1,42 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported" +) + +// AccountKeeper defines the contract required for account APIs. +type AccountKeeper interface { + GetModuleAddress(name string) sdk.AccAddress + GetAccount(sdk.Context, sdk.AccAddress) types.AccountI +} + +// ICS4Wrapper defines the expected ICS4Wrapper for middleware +type ICS4Wrapper interface { + WriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, acknowledgement ibcexported.Acknowledgement) error + SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error + GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) +} + +// ChannelKeeper defines the expected IBC channel keeper +type ChannelKeeper interface { + GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool) + GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) +} + +// PortKeeper defines the expected IBC port keeper +type PortKeeper interface { + BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability +} + +// BankKeeper defines the expected bank keeper +type BankKeeper interface { + HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error + BlockedAddr(sdk.AccAddress) bool +} diff --git a/modules/apps/29-fee/types/fee.go b/modules/apps/29-fee/types/fee.go new file mode 100644 index 00000000000..1f979c732d8 --- /dev/null +++ b/modules/apps/29-fee/types/fee.go @@ -0,0 +1,92 @@ +package types + +import ( + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +) + +// NewPacketFee creates and returns a new PacketFee struct including the incentivization fees, refund addres and relayers +func NewPacketFee(fee Fee, refundAddr string, relayers []string) PacketFee { + return PacketFee{ + Fee: fee, + RefundAddress: refundAddr, + Relayers: relayers, + } +} + +// Validate performs basic stateless validation of the associated PacketFee +func (p PacketFee) Validate() error { + _, err := sdk.AccAddressFromBech32(p.RefundAddress) + if err != nil { + return sdkerrors.Wrap(err, "failed to convert RefundAddress into sdk.AccAddress") + } + + // enforce relayer is nil + if p.Relayers != nil { + return ErrRelayersNotNil + } + + if err := p.Fee.Validate(); err != nil { + return err + } + + return nil +} + +// NewPacketFees creates and returns a new PacketFees struct including a list of type PacketFee +func NewPacketFees(packetFees []PacketFee) PacketFees { + return PacketFees{ + PacketFees: packetFees, + } +} + +// NewIdentifiedPacketFees creates and returns a new IdentifiedPacketFees struct containing a packet ID and packet fees +func NewIdentifiedPacketFees(packetID channeltypes.PacketId, packetFees []PacketFee) IdentifiedPacketFees { + return IdentifiedPacketFees{ + PacketId: packetID, + PacketFees: packetFees, + } +} + +// NewFee creates and returns a new Fee struct encapsulating the receive, acknowledgement and timeout fees as sdk.Coins +func NewFee(recvFee, ackFee, timeoutFee sdk.Coins) Fee { + return Fee{ + RecvFee: recvFee, + AckFee: ackFee, + TimeoutFee: timeoutFee, + } +} + +// Total returns the total amount for a given Fee +func (f Fee) Total() sdk.Coins { + return f.RecvFee.Add(f.AckFee...).Add(f.TimeoutFee...) +} + +// Validate asserts that each Fee is valid and all three Fees are not empty or zero +func (fee Fee) Validate() error { + var errFees []string + if !fee.AckFee.IsValid() { + errFees = append(errFees, "ack fee invalid") + } + if !fee.RecvFee.IsValid() { + errFees = append(errFees, "recv fee invalid") + } + if !fee.TimeoutFee.IsValid() { + errFees = append(errFees, "timeout fee invalid") + } + + if len(errFees) > 0 { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "contains invalid fees: %s", strings.Join(errFees, " , ")) + } + + // if all three fee's are zero or empty return an error + if fee.AckFee.IsZero() && fee.RecvFee.IsZero() && fee.TimeoutFee.IsZero() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "all fees are zero") + } + + return nil +} diff --git a/modules/apps/29-fee/types/fee.pb.go b/modules/apps/29-fee/types/fee.pb.go new file mode 100644 index 00000000000..1867eb351e5 --- /dev/null +++ b/modules/apps/29-fee/types/fee.pb.go @@ -0,0 +1,1182 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/fee/v1/fee.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Fee defines the ICS29 receive, acknowledgement and timeout fees +type Fee struct { + // the packet receive fee + RecvFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=recv_fee,json=recvFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"recv_fee" yaml:"recv_fee"` + // the packet acknowledgement fee + AckFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=ack_fee,json=ackFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"ack_fee" yaml:"ack_fee"` + // the packet timeout fee + TimeoutFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=timeout_fee,json=timeoutFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"timeout_fee" yaml:"timeout_fee"` +} + +func (m *Fee) Reset() { *m = Fee{} } +func (m *Fee) String() string { return proto.CompactTextString(m) } +func (*Fee) ProtoMessage() {} +func (*Fee) Descriptor() ([]byte, []int) { + return fileDescriptor_cb3319f1af2a53e5, []int{0} +} +func (m *Fee) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Fee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Fee.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Fee) XXX_Merge(src proto.Message) { + xxx_messageInfo_Fee.Merge(m, src) +} +func (m *Fee) XXX_Size() int { + return m.Size() +} +func (m *Fee) XXX_DiscardUnknown() { + xxx_messageInfo_Fee.DiscardUnknown(m) +} + +var xxx_messageInfo_Fee proto.InternalMessageInfo + +func (m *Fee) GetRecvFee() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.RecvFee + } + return nil +} + +func (m *Fee) GetAckFee() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.AckFee + } + return nil +} + +func (m *Fee) GetTimeoutFee() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.TimeoutFee + } + return nil +} + +// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers +type PacketFee struct { + // fee encapsulates the recv, ack and timeout fees associated with an IBC packet + Fee Fee `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee"` + // the refund address for unspent fees + RefundAddress string `protobuf:"bytes,2,opt,name=refund_address,json=refundAddress,proto3" json:"refund_address,omitempty" yaml:"refund_address"` + // optional list of relayers permitted to receive fees + Relayers []string `protobuf:"bytes,3,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *PacketFee) Reset() { *m = PacketFee{} } +func (m *PacketFee) String() string { return proto.CompactTextString(m) } +func (*PacketFee) ProtoMessage() {} +func (*PacketFee) Descriptor() ([]byte, []int) { + return fileDescriptor_cb3319f1af2a53e5, []int{1} +} +func (m *PacketFee) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketFee.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PacketFee) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketFee.Merge(m, src) +} +func (m *PacketFee) XXX_Size() int { + return m.Size() +} +func (m *PacketFee) XXX_DiscardUnknown() { + xxx_messageInfo_PacketFee.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketFee proto.InternalMessageInfo + +func (m *PacketFee) GetFee() Fee { + if m != nil { + return m.Fee + } + return Fee{} +} + +func (m *PacketFee) GetRefundAddress() string { + if m != nil { + return m.RefundAddress + } + return "" +} + +func (m *PacketFee) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + +// PacketFees contains a list of type PacketFee +type PacketFees struct { + // list of packet fees + PacketFees []PacketFee `protobuf:"bytes,1,rep,name=packet_fees,json=packetFees,proto3" json:"packet_fees" yaml:"packet_fees"` +} + +func (m *PacketFees) Reset() { *m = PacketFees{} } +func (m *PacketFees) String() string { return proto.CompactTextString(m) } +func (*PacketFees) ProtoMessage() {} +func (*PacketFees) Descriptor() ([]byte, []int) { + return fileDescriptor_cb3319f1af2a53e5, []int{2} +} +func (m *PacketFees) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketFees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketFees.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PacketFees) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketFees.Merge(m, src) +} +func (m *PacketFees) XXX_Size() int { + return m.Size() +} +func (m *PacketFees) XXX_DiscardUnknown() { + xxx_messageInfo_PacketFees.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketFees proto.InternalMessageInfo + +func (m *PacketFees) GetPacketFees() []PacketFee { + if m != nil { + return m.PacketFees + } + return nil +} + +// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId +type IdentifiedPacketFees struct { + // unique packet identifier comprised of the channel ID, port ID and sequence + PacketId types1.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id" yaml:"packet_id"` + // list of packet fees + PacketFees []PacketFee `protobuf:"bytes,2,rep,name=packet_fees,json=packetFees,proto3" json:"packet_fees" yaml:"packet_fees"` +} + +func (m *IdentifiedPacketFees) Reset() { *m = IdentifiedPacketFees{} } +func (m *IdentifiedPacketFees) String() string { return proto.CompactTextString(m) } +func (*IdentifiedPacketFees) ProtoMessage() {} +func (*IdentifiedPacketFees) Descriptor() ([]byte, []int) { + return fileDescriptor_cb3319f1af2a53e5, []int{3} +} +func (m *IdentifiedPacketFees) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IdentifiedPacketFees) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IdentifiedPacketFees.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IdentifiedPacketFees) XXX_Merge(src proto.Message) { + xxx_messageInfo_IdentifiedPacketFees.Merge(m, src) +} +func (m *IdentifiedPacketFees) XXX_Size() int { + return m.Size() +} +func (m *IdentifiedPacketFees) XXX_DiscardUnknown() { + xxx_messageInfo_IdentifiedPacketFees.DiscardUnknown(m) +} + +var xxx_messageInfo_IdentifiedPacketFees proto.InternalMessageInfo + +func (m *IdentifiedPacketFees) GetPacketId() types1.PacketId { + if m != nil { + return m.PacketId + } + return types1.PacketId{} +} + +func (m *IdentifiedPacketFees) GetPacketFees() []PacketFee { + if m != nil { + return m.PacketFees + } + return nil +} + +func init() { + proto.RegisterType((*Fee)(nil), "ibc.applications.fee.v1.Fee") + proto.RegisterType((*PacketFee)(nil), "ibc.applications.fee.v1.PacketFee") + proto.RegisterType((*PacketFees)(nil), "ibc.applications.fee.v1.PacketFees") + proto.RegisterType((*IdentifiedPacketFees)(nil), "ibc.applications.fee.v1.IdentifiedPacketFees") +} + +func init() { proto.RegisterFile("ibc/applications/fee/v1/fee.proto", fileDescriptor_cb3319f1af2a53e5) } + +var fileDescriptor_cb3319f1af2a53e5 = []byte{ + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x31, 0x6f, 0x13, 0x31, + 0x14, 0xc7, 0x73, 0x09, 0x6a, 0x1b, 0x47, 0x14, 0x74, 0x2a, 0x22, 0x8d, 0xe0, 0x52, 0x3c, 0x65, + 0x89, 0xad, 0xa4, 0x30, 0xc0, 0x04, 0x57, 0x29, 0x52, 0x27, 0xd0, 0x89, 0x89, 0x25, 0xf2, 0xd9, + 0x2f, 0xa9, 0x95, 0xdc, 0xf9, 0x74, 0xbe, 0x44, 0xca, 0xca, 0x27, 0xe0, 0x1b, 0xb0, 0xf3, 0x49, + 0xba, 0x20, 0x75, 0x64, 0x0a, 0x28, 0xf9, 0x06, 0xdd, 0x91, 0x90, 0x7d, 0x4e, 0x94, 0x82, 0xaa, + 0xaa, 0x12, 0xd3, 0xf9, 0xd9, 0xef, 0xef, 0xdf, 0xb3, 0xdf, 0xff, 0x8c, 0x5e, 0xc8, 0x98, 0x53, + 0x96, 0x65, 0x53, 0xc9, 0x59, 0x21, 0x55, 0xaa, 0xe9, 0x08, 0x80, 0xce, 0x7b, 0xe6, 0x43, 0xb2, + 0x5c, 0x15, 0xca, 0x7f, 0x2a, 0x63, 0x4e, 0x76, 0x53, 0x88, 0x59, 0x9b, 0xf7, 0x5a, 0x01, 0x57, + 0x3a, 0x51, 0x9a, 0xc6, 0x4c, 0x1b, 0x49, 0x0c, 0x05, 0xeb, 0x51, 0xae, 0x64, 0x5a, 0x0a, 0x5b, + 0x47, 0x63, 0x35, 0x56, 0x76, 0x48, 0xcd, 0xc8, 0xcd, 0x5a, 0x22, 0x57, 0x39, 0x50, 0x7e, 0xc1, + 0xd2, 0x14, 0xa6, 0x86, 0xe6, 0x86, 0x65, 0x0a, 0xfe, 0x5d, 0x45, 0xb5, 0x01, 0x80, 0xbf, 0x40, + 0x07, 0x39, 0xf0, 0xf9, 0x70, 0x04, 0xd0, 0xf4, 0x4e, 0x6a, 0x9d, 0x46, 0xff, 0x98, 0x94, 0x4c, + 0x62, 0x98, 0xc4, 0x31, 0xc9, 0x99, 0x92, 0x69, 0x78, 0x76, 0xb9, 0x6c, 0x57, 0xae, 0x97, 0xed, + 0x47, 0x0b, 0x96, 0x4c, 0xdf, 0xe0, 0x8d, 0x10, 0x7f, 0xfb, 0xd9, 0xee, 0x8c, 0x65, 0x71, 0x31, + 0x8b, 0x09, 0x57, 0x09, 0x75, 0x35, 0x97, 0x9f, 0xae, 0x16, 0x13, 0x5a, 0x2c, 0x32, 0xd0, 0x76, + 0x0f, 0x1d, 0xed, 0x1b, 0x99, 0x41, 0xcf, 0xd1, 0x3e, 0xe3, 0x13, 0x4b, 0xae, 0xde, 0x45, 0x0e, + 0x1d, 0xf9, 0xb0, 0x24, 0x3b, 0xdd, 0xfd, 0xc0, 0x7b, 0x8c, 0x4f, 0x0c, 0xf7, 0xb3, 0x87, 0x1a, + 0x85, 0x4c, 0x40, 0xcd, 0x0a, 0x0b, 0xaf, 0xdd, 0x05, 0x1f, 0x38, 0xb8, 0x5f, 0xc2, 0x77, 0xb4, + 0xf7, 0x2b, 0x00, 0x39, 0xe5, 0x00, 0x00, 0x7f, 0xf5, 0x50, 0xfd, 0x03, 0xe3, 0x13, 0x30, 0x91, + 0xff, 0x12, 0xd5, 0xca, 0x06, 0x78, 0x9d, 0x46, 0xff, 0x19, 0xb9, 0xc5, 0x0d, 0x64, 0x00, 0x10, + 0x3e, 0x30, 0xc5, 0x44, 0x26, 0xdd, 0x7f, 0x8b, 0x0e, 0x73, 0x18, 0xcd, 0x52, 0x31, 0x64, 0x42, + 0xe4, 0xa0, 0x75, 0xb3, 0x7a, 0xe2, 0x75, 0xea, 0xe1, 0xf1, 0xf5, 0xb2, 0xfd, 0x64, 0xd3, 0xa2, + 0xdd, 0x75, 0x1c, 0x3d, 0x2c, 0x27, 0xde, 0x95, 0xb1, 0xdf, 0x32, 0xdd, 0x9f, 0xb2, 0x05, 0xe4, + 0xda, 0x5e, 0x43, 0x3d, 0xda, 0xc6, 0x38, 0x41, 0x68, 0x5b, 0xa0, 0xf6, 0x87, 0xa8, 0x91, 0xd9, + 0xc8, 0x1c, 0x5b, 0x3b, 0xab, 0xe0, 0x5b, 0x2b, 0xdd, 0x2a, 0xc3, 0xd6, 0xcd, 0xcb, 0xdb, 0xd9, + 0x04, 0x47, 0x28, 0xdb, 0x02, 0xf0, 0x77, 0x0f, 0x1d, 0x9d, 0x0b, 0x48, 0x0b, 0x39, 0x92, 0x20, + 0x76, 0xc8, 0x1f, 0x51, 0xdd, 0x89, 0xa4, 0x70, 0x37, 0xf4, 0xdc, 0x72, 0x8d, 0xc1, 0xc9, 0xc6, + 0xd5, 0x5b, 0xe6, 0xb9, 0x08, 0x9b, 0x0e, 0xf9, 0xf8, 0x06, 0x52, 0x0a, 0x1c, 0x1d, 0x64, 0x2e, + 0xe7, 0xef, 0xf3, 0x54, 0xff, 0xf7, 0x79, 0xc2, 0xf7, 0x97, 0xab, 0xc0, 0xbb, 0x5a, 0x05, 0xde, + 0xaf, 0x55, 0xe0, 0x7d, 0x59, 0x07, 0x95, 0xab, 0x75, 0x50, 0xf9, 0xb1, 0x0e, 0x2a, 0x9f, 0x5e, + 0xfd, 0x6b, 0x18, 0x19, 0xf3, 0xee, 0x58, 0xd1, 0xf9, 0x29, 0x4d, 0x94, 0x98, 0x4d, 0x41, 0x9b, + 0xf7, 0x42, 0xd3, 0xfe, 0xeb, 0xae, 0x79, 0x2a, 0xac, 0x87, 0xe2, 0x3d, 0xfb, 0xe3, 0x9e, 0xfe, + 0x09, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x6c, 0xa2, 0x41, 0x4f, 0x04, 0x00, 0x00, +} + +func (m *Fee) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Fee) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Fee) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TimeoutFee) > 0 { + for iNdEx := len(m.TimeoutFee) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TimeoutFee[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.AckFee) > 0 { + for iNdEx := len(m.AckFee) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AckFee[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.RecvFee) > 0 { + for iNdEx := len(m.RecvFee) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecvFee[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PacketFee) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PacketFee) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketFee) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintFee(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.RefundAddress) > 0 { + i -= len(m.RefundAddress) + copy(dAtA[i:], m.RefundAddress) + i = encodeVarintFee(dAtA, i, uint64(len(m.RefundAddress))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *PacketFees) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PacketFees) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketFees) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PacketFees) > 0 { + for iNdEx := len(m.PacketFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PacketFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *IdentifiedPacketFees) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IdentifiedPacketFees) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IdentifiedPacketFees) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PacketFees) > 0 { + for iNdEx := len(m.PacketFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PacketFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFee(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintFee(dAtA []byte, offset int, v uint64) int { + offset -= sovFee(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Fee) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RecvFee) > 0 { + for _, e := range m.RecvFee { + l = e.Size() + n += 1 + l + sovFee(uint64(l)) + } + } + if len(m.AckFee) > 0 { + for _, e := range m.AckFee { + l = e.Size() + n += 1 + l + sovFee(uint64(l)) + } + } + if len(m.TimeoutFee) > 0 { + for _, e := range m.TimeoutFee { + l = e.Size() + n += 1 + l + sovFee(uint64(l)) + } + } + return n +} + +func (m *PacketFee) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Fee.Size() + n += 1 + l + sovFee(uint64(l)) + l = len(m.RefundAddress) + if l > 0 { + n += 1 + l + sovFee(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovFee(uint64(l)) + } + } + return n +} + +func (m *PacketFees) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.PacketFees) > 0 { + for _, e := range m.PacketFees { + l = e.Size() + n += 1 + l + sovFee(uint64(l)) + } + } + return n +} + +func (m *IdentifiedPacketFees) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PacketId.Size() + n += 1 + l + sovFee(uint64(l)) + if len(m.PacketFees) > 0 { + for _, e := range m.PacketFees { + l = e.Size() + n += 1 + l + sovFee(uint64(l)) + } + } + return n +} + +func sovFee(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFee(x uint64) (n int) { + return sovFee(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Fee) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Fee: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Fee: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecvFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecvFee = append(m.RecvFee, types.Coin{}) + if err := m.RecvFee[len(m.RecvFee)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AckFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AckFee = append(m.AckFee, types.Coin{}) + if err := m.AckFee[len(m.AckFee)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TimeoutFee = append(m.TimeoutFee, types.Coin{}) + if err := m.TimeoutFee[len(m.TimeoutFee)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFee(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFee + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PacketFee) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PacketFee: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketFee: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RefundAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RefundAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFee(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFee + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PacketFees) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PacketFees: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketFees: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketFees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PacketFees = append(m.PacketFees, PacketFee{}) + if err := m.PacketFees[len(m.PacketFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFee(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFee + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IdentifiedPacketFees) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IdentifiedPacketFees: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IdentifiedPacketFees: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketFees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFee + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFee + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFee + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PacketFees = append(m.PacketFees, PacketFee{}) + if err := m.PacketFees[len(m.PacketFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFee(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFee + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFee(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFee + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFee + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFee + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthFee + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFee + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFee + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFee = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFee = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFee = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/apps/29-fee/types/fee_test.go b/modules/apps/29-fee/types/fee_test.go new file mode 100644 index 00000000000..2b02e5b857b --- /dev/null +++ b/modules/apps/29-fee/types/fee_test.go @@ -0,0 +1,123 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto/secp256k1" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" +) + +var ( + // defaultRecvFee is the default packet receive fee used for testing purposes + defaultRecvFee = sdk.NewCoins(sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}) + + // defaultAckFee is the default packet acknowledgement fee used for testing purposes + defaultAckFee = sdk.NewCoins(sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(200)}) + + // defaultTimeoutFee is the default packet timeout fee used for testing purposes + defaultTimeoutFee = sdk.NewCoins(sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(300)}) + + // invalidFee is an invalid coin set used to trigger error cases for testing purposes + invalidFee = sdk.Coins{sdk.Coin{Denom: "invalid-denom", Amount: sdk.NewInt(-2)}} + + // defaultAccAddress is the default account used for testing purposes + defaultAccAddress = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() +) + +func TestFeeTotal(t *testing.T) { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + + total := fee.Total() + require.Equal(t, sdk.NewInt(600), total.AmountOf(sdk.DefaultBondDenom)) +} + +func TestPacketFeeValidation(t *testing.T) { + var ( + packetFee types.PacketFee + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "should fail when refund address is invalid", + func() { + packetFee.RefundAddress = "invalid-address" + }, + false, + }, + { + "should fail when all fees are invalid", + func() { + packetFee.Fee.AckFee = invalidFee + packetFee.Fee.RecvFee = invalidFee + packetFee.Fee.TimeoutFee = invalidFee + }, + false, + }, + { + "should fail with single invalid fee", + func() { + packetFee.Fee.AckFee = invalidFee + }, + false, + }, + { + "should fail with two invalid fees", + func() { + packetFee.Fee.TimeoutFee = invalidFee + packetFee.Fee.AckFee = invalidFee + }, + false, + }, + { + "should pass with two empty fees", + func() { + packetFee.Fee.TimeoutFee = sdk.Coins{} + packetFee.Fee.AckFee = sdk.Coins{} + }, + true, + }, + { + "should pass with one empty fee", + func() { + packetFee.Fee.TimeoutFee = sdk.Coins{} + }, + true, + }, + { + "should fail if all fees are empty", + func() { + packetFee.Fee.AckFee = sdk.Coins{} + packetFee.Fee.RecvFee = sdk.Coins{} + packetFee.Fee.TimeoutFee = sdk.Coins{} + }, + false, + }, + } + + for _, tc := range testCases { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee = types.NewPacketFee(fee, defaultAccAddress, nil) + + tc.malleate() // malleate mutates test data + + err := packetFee.Validate() + + if tc.expPass { + require.NoError(t, err) + } else { + require.Error(t, err) + } + } +} diff --git a/modules/apps/29-fee/types/genesis.go b/modules/apps/29-fee/types/genesis.go new file mode 100644 index 00000000000..be9299fcd94 --- /dev/null +++ b/modules/apps/29-fee/types/genesis.go @@ -0,0 +1,81 @@ +package types + +import ( + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" +) + +// NewGenesisState creates a 29-fee GenesisState instance. +func NewGenesisState(identifiedFees []IdentifiedPacketFees, feeEnabledChannels []FeeEnabledChannel, registeredRelayers []RegisteredRelayerAddress, forwardRelayers []ForwardRelayerAddress) *GenesisState { + return &GenesisState{ + IdentifiedFees: identifiedFees, + FeeEnabledChannels: feeEnabledChannels, + RegisteredRelayers: registeredRelayers, + ForwardRelayers: forwardRelayers, + } +} + +// DefaultGenesisState returns a GenesisState with "transfer" as the default PortID. +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + IdentifiedFees: []IdentifiedPacketFees{}, + ForwardRelayers: []ForwardRelayerAddress{}, + FeeEnabledChannels: []FeeEnabledChannel{}, + RegisteredRelayers: []RegisteredRelayerAddress{}, + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // Validate IdentifiedPacketFees + for _, identifiedFees := range gs.IdentifiedFees { + if err := identifiedFees.PacketId.Validate(); err != nil { + return err + } + + for _, packetFee := range identifiedFees.PacketFees { + if err := packetFee.Validate(); err != nil { + return err + } + } + } + + // Validate FeeEnabledChannels + for _, feeCh := range gs.FeeEnabledChannels { + if err := host.PortIdentifierValidator(feeCh.PortId); err != nil { + return sdkerrors.Wrap(err, "invalid source port ID") + } + if err := host.ChannelIdentifierValidator(feeCh.ChannelId); err != nil { + return sdkerrors.Wrap(err, "invalid source channel ID") + } + } + + // Validate RegisteredRelayers + for _, rel := range gs.RegisteredRelayers { + if _, err := sdk.AccAddressFromBech32(rel.Address); err != nil { + return sdkerrors.Wrap(err, "failed to convert source relayer address into sdk.AccAddress") + } + + if strings.TrimSpace(rel.CounterpartyAddress) == "" { + return ErrCounterpartyAddressEmpty + } + } + + // Validate ForwardRelayers + for _, rel := range gs.ForwardRelayers { + if _, err := sdk.AccAddressFromBech32(rel.Address); err != nil { + return sdkerrors.Wrap(err, "failed to convert forward relayer address into sdk.AccAddress") + } + + if err := rel.PacketId.Validate(); err != nil { + return err + } + } + + return nil +} diff --git a/modules/apps/29-fee/types/genesis.pb.go b/modules/apps/29-fee/types/genesis.pb.go new file mode 100644 index 00000000000..af78add463e --- /dev/null +++ b/modules/apps/29-fee/types/genesis.pb.go @@ -0,0 +1,1273 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/fee/v1/genesis.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the ICS29 fee middleware genesis state +type GenesisState struct { + // list of identified packet fees + IdentifiedFees []IdentifiedPacketFees `protobuf:"bytes,1,rep,name=identified_fees,json=identifiedFees,proto3" json:"identified_fees" yaml:"identified_fees"` + // list of fee enabled channels + FeeEnabledChannels []FeeEnabledChannel `protobuf:"bytes,2,rep,name=fee_enabled_channels,json=feeEnabledChannels,proto3" json:"fee_enabled_channels" yaml:"fee_enabled_channels"` + // list of registered relayer addresses + RegisteredRelayers []RegisteredRelayerAddress `protobuf:"bytes,3,rep,name=registered_relayers,json=registeredRelayers,proto3" json:"registered_relayers" yaml:"registered_relayers"` + // list of forward relayer addresses + ForwardRelayers []ForwardRelayerAddress `protobuf:"bytes,4,rep,name=forward_relayers,json=forwardRelayers,proto3" json:"forward_relayers" yaml:"forward_relayers"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_7191992e856dff95, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetIdentifiedFees() []IdentifiedPacketFees { + if m != nil { + return m.IdentifiedFees + } + return nil +} + +func (m *GenesisState) GetFeeEnabledChannels() []FeeEnabledChannel { + if m != nil { + return m.FeeEnabledChannels + } + return nil +} + +func (m *GenesisState) GetRegisteredRelayers() []RegisteredRelayerAddress { + if m != nil { + return m.RegisteredRelayers + } + return nil +} + +func (m *GenesisState) GetForwardRelayers() []ForwardRelayerAddress { + if m != nil { + return m.ForwardRelayers + } + return nil +} + +// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +type FeeEnabledChannel struct { + // unique port identifier + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + // unique channel identifier + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` +} + +func (m *FeeEnabledChannel) Reset() { *m = FeeEnabledChannel{} } +func (m *FeeEnabledChannel) String() string { return proto.CompactTextString(m) } +func (*FeeEnabledChannel) ProtoMessage() {} +func (*FeeEnabledChannel) Descriptor() ([]byte, []int) { + return fileDescriptor_7191992e856dff95, []int{1} +} +func (m *FeeEnabledChannel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FeeEnabledChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FeeEnabledChannel.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FeeEnabledChannel) XXX_Merge(src proto.Message) { + xxx_messageInfo_FeeEnabledChannel.Merge(m, src) +} +func (m *FeeEnabledChannel) XXX_Size() int { + return m.Size() +} +func (m *FeeEnabledChannel) XXX_DiscardUnknown() { + xxx_messageInfo_FeeEnabledChannel.DiscardUnknown(m) +} + +var xxx_messageInfo_FeeEnabledChannel proto.InternalMessageInfo + +func (m *FeeEnabledChannel) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *FeeEnabledChannel) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +// RegisteredRelayerAddress contains the address and counterparty address for a specific relayer (for distributing fees) +type RegisteredRelayerAddress struct { + // the relayer address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // the counterparty relayer address + CounterpartyAddress string `protobuf:"bytes,2,opt,name=counterparty_address,json=counterpartyAddress,proto3" json:"counterparty_address,omitempty" yaml:"counterparty_address"` + // unique channel identifier + ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` +} + +func (m *RegisteredRelayerAddress) Reset() { *m = RegisteredRelayerAddress{} } +func (m *RegisteredRelayerAddress) String() string { return proto.CompactTextString(m) } +func (*RegisteredRelayerAddress) ProtoMessage() {} +func (*RegisteredRelayerAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_7191992e856dff95, []int{2} +} +func (m *RegisteredRelayerAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RegisteredRelayerAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RegisteredRelayerAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RegisteredRelayerAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_RegisteredRelayerAddress.Merge(m, src) +} +func (m *RegisteredRelayerAddress) XXX_Size() int { + return m.Size() +} +func (m *RegisteredRelayerAddress) XXX_DiscardUnknown() { + xxx_messageInfo_RegisteredRelayerAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_RegisteredRelayerAddress proto.InternalMessageInfo + +func (m *RegisteredRelayerAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *RegisteredRelayerAddress) GetCounterpartyAddress() string { + if m != nil { + return m.CounterpartyAddress + } + return "" +} + +func (m *RegisteredRelayerAddress) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements +type ForwardRelayerAddress struct { + // the forward relayer address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // unique packet identifer comprised of the channel ID, port ID and sequence + PacketId types.PacketId `protobuf:"bytes,2,opt,name=packet_id,json=packetId,proto3" json:"packet_id" yaml:"packet_id"` +} + +func (m *ForwardRelayerAddress) Reset() { *m = ForwardRelayerAddress{} } +func (m *ForwardRelayerAddress) String() string { return proto.CompactTextString(m) } +func (*ForwardRelayerAddress) ProtoMessage() {} +func (*ForwardRelayerAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_7191992e856dff95, []int{3} +} +func (m *ForwardRelayerAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ForwardRelayerAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ForwardRelayerAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ForwardRelayerAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForwardRelayerAddress.Merge(m, src) +} +func (m *ForwardRelayerAddress) XXX_Size() int { + return m.Size() +} +func (m *ForwardRelayerAddress) XXX_DiscardUnknown() { + xxx_messageInfo_ForwardRelayerAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_ForwardRelayerAddress proto.InternalMessageInfo + +func (m *ForwardRelayerAddress) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *ForwardRelayerAddress) GetPacketId() types.PacketId { + if m != nil { + return m.PacketId + } + return types.PacketId{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "ibc.applications.fee.v1.GenesisState") + proto.RegisterType((*FeeEnabledChannel)(nil), "ibc.applications.fee.v1.FeeEnabledChannel") + proto.RegisterType((*RegisteredRelayerAddress)(nil), "ibc.applications.fee.v1.RegisteredRelayerAddress") + proto.RegisterType((*ForwardRelayerAddress)(nil), "ibc.applications.fee.v1.ForwardRelayerAddress") +} + +func init() { + proto.RegisterFile("ibc/applications/fee/v1/genesis.proto", fileDescriptor_7191992e856dff95) +} + +var fileDescriptor_7191992e856dff95 = []byte{ + // 579 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4d, 0x6f, 0xd4, 0x30, + 0x14, 0xdc, 0xb4, 0x55, 0x4b, 0x5d, 0xd4, 0x0f, 0xb7, 0xa5, 0x51, 0x11, 0x49, 0x31, 0x42, 0xaa, + 0x40, 0x4d, 0xb4, 0x2d, 0x1c, 0xe0, 0xc6, 0x22, 0x8a, 0xf6, 0x04, 0x32, 0x9c, 0xb8, 0x44, 0xf9, + 0x78, 0x49, 0x2d, 0xb2, 0x71, 0x64, 0xbb, 0x41, 0xcb, 0x8d, 0x0b, 0x1c, 0xe1, 0x17, 0x71, 0xee, + 0xb1, 0x47, 0x4e, 0x2b, 0xd4, 0xfe, 0x83, 0xfe, 0x02, 0x94, 0x38, 0xe9, 0x6e, 0x97, 0x0d, 0xe2, + 0xf6, 0x62, 0xcf, 0xbc, 0x19, 0x8f, 0xf3, 0x8c, 0x1e, 0xb2, 0x20, 0x74, 0xfd, 0x3c, 0x4f, 0x59, + 0xe8, 0x2b, 0xc6, 0x33, 0xe9, 0xc6, 0x00, 0x6e, 0xd1, 0x75, 0x13, 0xc8, 0x40, 0x32, 0xe9, 0xe4, + 0x82, 0x2b, 0x8e, 0x77, 0x58, 0x10, 0x3a, 0x93, 0x30, 0x27, 0x06, 0x70, 0x8a, 0xee, 0xee, 0x56, + 0xc2, 0x13, 0x5e, 0x61, 0xdc, 0xb2, 0xd2, 0xf0, 0xdd, 0xfb, 0x6d, 0x5d, 0x4b, 0xd6, 0x04, 0x24, + 0xe4, 0x02, 0xdc, 0xf0, 0xc4, 0xcf, 0x32, 0x48, 0xcb, 0xed, 0xba, 0xd4, 0x10, 0xf2, 0x7d, 0x01, + 0xdd, 0x7e, 0xad, 0x6d, 0xbc, 0x53, 0xbe, 0x02, 0x5c, 0xa0, 0x35, 0x16, 0x41, 0xa6, 0x58, 0xcc, + 0x20, 0xf2, 0x62, 0x00, 0x69, 0x1a, 0x7b, 0xf3, 0xfb, 0x2b, 0x87, 0x07, 0x4e, 0x8b, 0x3f, 0xa7, + 0x7f, 0x8d, 0x7f, 0xeb, 0x87, 0x1f, 0x41, 0x1d, 0x03, 0xc8, 0x9e, 0x75, 0x36, 0xb2, 0x3b, 0x57, + 0x23, 0xfb, 0xce, 0xd0, 0x1f, 0xa4, 0xcf, 0xc9, 0x54, 0x4f, 0x42, 0x57, 0xc7, 0x2b, 0x25, 0x1e, + 0x7f, 0x31, 0xd0, 0x56, 0x0c, 0xe0, 0x41, 0xe6, 0x07, 0x29, 0x44, 0x5e, 0x6d, 0x53, 0x9a, 0x73, + 0x95, 0xfa, 0xa3, 0x56, 0xf5, 0x63, 0x80, 0x57, 0x9a, 0xf3, 0x52, 0x53, 0x7a, 0x0f, 0x6a, 0xe9, + 0xbb, 0x5a, 0x7a, 0x56, 0x57, 0x42, 0x71, 0x3c, 0xcd, 0x93, 0xf8, 0xab, 0x81, 0x36, 0x05, 0x24, + 0x4c, 0x2a, 0x10, 0x10, 0x79, 0x02, 0x52, 0x7f, 0x08, 0x42, 0x9a, 0xf3, 0x95, 0x85, 0x6e, 0xab, + 0x05, 0x7a, 0xcd, 0xa1, 0x9a, 0xf2, 0x22, 0x8a, 0x04, 0x48, 0xd9, 0x23, 0xb5, 0x93, 0x5d, 0xed, + 0x64, 0x46, 0x6f, 0x42, 0xb1, 0x98, 0x66, 0x4b, 0xfc, 0x19, 0xad, 0xc7, 0x5c, 0x7c, 0xf2, 0xc5, + 0x84, 0x89, 0x85, 0xca, 0x84, 0xd3, 0x9e, 0x83, 0x26, 0x4c, 0x39, 0xb0, 0x6b, 0x07, 0x3b, 0x75, + 0x16, 0x53, 0x5d, 0x09, 0x5d, 0x8b, 0x6f, 0xf0, 0x24, 0x29, 0xd0, 0xc6, 0x5f, 0x91, 0xe2, 0xc7, + 0x68, 0x29, 0xe7, 0x42, 0x79, 0x2c, 0x32, 0x8d, 0x3d, 0x63, 0x7f, 0xb9, 0x87, 0xaf, 0x46, 0xf6, + 0xaa, 0xee, 0x59, 0x6f, 0x10, 0xba, 0x58, 0x56, 0xfd, 0x08, 0x3f, 0x41, 0xa8, 0xce, 0xb9, 0xc4, + 0xcf, 0x55, 0xf8, 0xed, 0xab, 0x91, 0xbd, 0xa1, 0xf1, 0xe3, 0x3d, 0x42, 0x97, 0xeb, 0x8f, 0x7e, + 0x44, 0x7e, 0x1a, 0xc8, 0x6c, 0x0b, 0x12, 0x9b, 0x68, 0xc9, 0xd7, 0xa5, 0xd6, 0xa7, 0xcd, 0x27, + 0xa6, 0x68, 0x2b, 0xe4, 0xa7, 0x99, 0x02, 0x91, 0xfb, 0x42, 0x0d, 0xbd, 0x06, 0xa6, 0x65, 0xed, + 0xf1, 0x6f, 0x30, 0x0b, 0x45, 0xe8, 0xe6, 0xe4, 0x72, 0xa3, 0x76, 0xf3, 0x00, 0xf3, 0xff, 0x79, + 0x80, 0x6f, 0x06, 0xda, 0x9e, 0x79, 0x09, 0xff, 0x70, 0xff, 0x1e, 0x2d, 0xe7, 0xd5, 0xcc, 0x34, + 0x49, 0xad, 0x1c, 0xde, 0xab, 0x6e, 0xb8, 0x9c, 0x5a, 0xa7, 0x19, 0xd5, 0xa2, 0xeb, 0xe8, 0xc9, + 0xea, 0x47, 0x3d, 0xb3, 0xbe, 0xd0, 0xf5, 0x3a, 0xfc, 0x86, 0x4d, 0xe8, 0xad, 0xbc, 0xc1, 0xbc, + 0x39, 0xbb, 0xb0, 0x8c, 0xf3, 0x0b, 0xcb, 0xf8, 0x7d, 0x61, 0x19, 0x3f, 0x2e, 0xad, 0xce, 0xf9, + 0xa5, 0xd5, 0xf9, 0x75, 0x69, 0x75, 0x3e, 0x3c, 0x4d, 0x98, 0x3a, 0x39, 0x0d, 0x9c, 0x90, 0x0f, + 0xdc, 0x90, 0xcb, 0x01, 0x97, 0x2e, 0x0b, 0xc2, 0x83, 0x84, 0xbb, 0xc5, 0x91, 0x3b, 0xe0, 0xd1, + 0x69, 0x0a, 0xb2, 0x7c, 0x54, 0xa4, 0x7b, 0xf8, 0xec, 0xa0, 0x7c, 0x4f, 0xd4, 0x30, 0x07, 0x19, + 0x2c, 0x56, 0x8f, 0xc5, 0xd1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x33, 0x0f, 0x78, 0xca, + 0x04, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ForwardRelayers) > 0 { + for iNdEx := len(m.ForwardRelayers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ForwardRelayers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.RegisteredRelayers) > 0 { + for iNdEx := len(m.RegisteredRelayers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RegisteredRelayers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.FeeEnabledChannels) > 0 { + for iNdEx := len(m.FeeEnabledChannels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeEnabledChannels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.IdentifiedFees) > 0 { + for iNdEx := len(m.IdentifiedFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IdentifiedFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FeeEnabledChannel) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FeeEnabledChannel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FeeEnabledChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RegisteredRelayerAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RegisteredRelayerAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisteredRelayerAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.CounterpartyAddress) > 0 { + i -= len(m.CounterpartyAddress) + copy(dAtA[i:], m.CounterpartyAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.CounterpartyAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ForwardRelayerAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ForwardRelayerAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ForwardRelayerAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.IdentifiedFees) > 0 { + for _, e := range m.IdentifiedFees { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.FeeEnabledChannels) > 0 { + for _, e := range m.FeeEnabledChannels { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.RegisteredRelayers) > 0 { + for _, e := range m.RegisteredRelayers { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.ForwardRelayers) > 0 { + for _, e := range m.ForwardRelayers { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *FeeEnabledChannel) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *RegisteredRelayerAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.CounterpartyAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func (m *ForwardRelayerAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.PacketId.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdentifiedFees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IdentifiedFees = append(m.IdentifiedFees, IdentifiedPacketFees{}) + if err := m.IdentifiedFees[len(m.IdentifiedFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabledChannels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeEnabledChannels = append(m.FeeEnabledChannels, FeeEnabledChannel{}) + if err := m.FeeEnabledChannels[len(m.FeeEnabledChannels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisteredRelayers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegisteredRelayers = append(m.RegisteredRelayers, RegisteredRelayerAddress{}) + if err := m.RegisteredRelayers[len(m.RegisteredRelayers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ForwardRelayers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ForwardRelayers = append(m.ForwardRelayers, ForwardRelayerAddress{}) + if err := m.ForwardRelayers[len(m.ForwardRelayers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FeeEnabledChannel) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FeeEnabledChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FeeEnabledChannel: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RegisteredRelayerAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RegisteredRelayerAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RegisteredRelayerAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ForwardRelayerAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ForwardRelayerAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ForwardRelayerAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/apps/29-fee/types/genesis_test.go b/modules/apps/29-fee/types/genesis_test.go new file mode 100644 index 00000000000..d574257e706 --- /dev/null +++ b/modules/apps/29-fee/types/genesis_test.go @@ -0,0 +1,215 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto/secp256k1" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + transfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" +) + +var ( + addr1 = sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()).String() + addr2 = sdk.AccAddress("testaddr2").String() + validCoins = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(100)}} + validCoins2 = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(200)}} + validCoins3 = sdk.Coins{sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: sdk.NewInt(300)}} +) + +func TestValidateGenesis(t *testing.T) { + var ( + packetID channeltypes.PacketId + fee types.Fee + refundAcc string + sender string + forwardAddr string + counterparty string + portID string + channelID string + packetChannelID string + seq uint64 + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "valid genesis", + func() {}, + true, + }, + { + "invalid packetID: invalid channel", + func() { + packetID = channeltypes.NewPacketId( + portID, + "", + seq, + ) + }, + false, + }, + { + "invalid packetID: invalid port", + func() { + packetID = channeltypes.NewPacketId( + "", + channelID, + seq, + ) + }, + false, + }, + { + "invalid packetID: invalid sequence", + func() { + packetID = channeltypes.NewPacketId( + portID, + channelID, + 0, + ) + }, + false, + }, + { + "invalid packetID: invalid fee", + func() { + fee = types.Fee{ + sdk.Coins{}, + sdk.Coins{}, + sdk.Coins{}, + } + }, + false, + }, + { + "invalid packetID: invalid refundAcc", + func() { + refundAcc = "" + }, + false, + }, + { + "invalid FeeEnabledChannel: invalid ChannelID", + func() { + channelID = "" + }, + false, + }, + { + "invalid FeeEnabledChannel: invalid PortID", + func() { + portID = "" + }, + false, + }, + { + "invalid RegisteredRelayers: invalid sender", + func() { + sender = "" + }, + false, + }, + { + "invalid RegisteredRelayers: invalid counterparty", + func() { + counterparty = " " + }, + false, + }, + { + "invalid ForwardRelayerAddress: invalid forwardAddr", + func() { + forwardAddr = "" + }, + false, + }, + { + "invalid ForwardRelayerAddress: invalid packet", + func() { + packetChannelID = "1" + }, + false, + }, + } + + for _, tc := range testCases { + portID = transfertypes.PortID + channelID = ibctesting.FirstChannelID + packetChannelID = ibctesting.FirstChannelID + seq = uint64(1) + + // build PacketId & Fee + packetID = channeltypes.NewPacketId( + portID, + channelID, + seq, + ) + fee = types.Fee{ + validCoins, + validCoins2, + validCoins3, + } + + refundAcc = addr1 + + // relayer addresses + sender = addr1 + counterparty = addr2 + forwardAddr = addr2 + + tc.malleate() + + genState := types.GenesisState{ + IdentifiedFees: []types.IdentifiedPacketFees{ + { + PacketId: packetID, + PacketFees: []types.PacketFee{ + { + Fee: fee, + RefundAddress: refundAcc, + Relayers: nil, + }, + }, + }, + }, + FeeEnabledChannels: []types.FeeEnabledChannel{ + { + PortId: portID, + ChannelId: channelID, + }, + }, + RegisteredRelayers: []types.RegisteredRelayerAddress{ + { + Address: sender, + CounterpartyAddress: counterparty, + }, + }, + ForwardRelayers: []types.ForwardRelayerAddress{ + { + Address: forwardAddr, + PacketId: channeltypes.NewPacketId(portID, packetChannelID, 1), + }, + }, + } + + err := genState.Validate() + if tc.expPass { + require.NoError(t, err, tc.name) + } else { + require.Error(t, err, tc.name) + } + } +} + +func TestValidateDefaultGenesis(t *testing.T) { + err := types.DefaultGenesisState().Validate() + require.NoError(t, err) +} diff --git a/modules/apps/29-fee/types/keys.go b/modules/apps/29-fee/types/keys.go new file mode 100644 index 00000000000..188a75e7ac3 --- /dev/null +++ b/modules/apps/29-fee/types/keys.go @@ -0,0 +1,139 @@ +package types + +import ( + "fmt" + "strconv" + "strings" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" +) + +const ( + // ModuleName defines the 29-fee name + ModuleName = "feeibc" + + // StoreKey is the store key string for IBC fee module + StoreKey = ModuleName + + // RouterKey is the message route for IBC fee module + RouterKey = ModuleName + + // QuerierRoute is the querier route for IBC fee module + QuerierRoute = ModuleName + + Version = "fee29-1" + + // FeeEnabledPrefix is the key prefix for storing fee enabled flag + FeeEnabledKeyPrefix = "feeEnabled" + + // CounterpartyRelayerAddressKeyPrefix is the key prefix for relayer address mapping + CounterpartyRelayerAddressKeyPrefix = "relayerAddress" + + // FeesInEscrowPrefix is the key prefix for fee in escrow mapping + FeesInEscrowPrefix = "feesInEscrow" + + // ForwardRelayerPrefix is the key prefix for forward relayer addresses stored in state for async acknowledgements + ForwardRelayerPrefix = "forwardRelayer" +) + +// KeyLocked returns the key used to lock and unlock the fee module. This key is used +// in the presence of a severe bug. +func KeyLocked() []byte { + return []byte("locked") +} + +// KeyFeeEnabled returns the key that stores a flag to determine if fee logic should +// be enabled for the given port and channel identifiers. +func KeyFeeEnabled(portID, channelID string) []byte { + return []byte(fmt.Sprintf("%s/%s/%s", FeeEnabledKeyPrefix, portID, channelID)) +} + +// ParseKeyFeeEnabled parses the key used to indicate if the fee logic should be +// enabled for the given port and channel identifiers. +func ParseKeyFeeEnabled(key string) (portID, channelID string, err error) { + keySplit := strings.Split(key, "/") + if len(keySplit) != 3 { + return "", "", sdkerrors.Wrapf( + sdkerrors.ErrLogic, "key provided is incorrect: the key split has incorrect length, expected %d, got %d", 3, len(keySplit), + ) + } + + if keySplit[0] != FeeEnabledKeyPrefix { + return "", "", sdkerrors.Wrapf(sdkerrors.ErrLogic, "key prefix is incorrect: expected %s, got %s", FeeEnabledKeyPrefix, keySplit[0]) + } + + portID = keySplit[1] + channelID = keySplit[2] + + return portID, channelID, nil +} + +// KeyCounterpartyRelayer returns the key for relayer address -> counterparty address mapping +func KeyCounterpartyRelayer(address, channelID string) []byte { + return []byte(fmt.Sprintf("%s/%s/%s", CounterpartyRelayerAddressKeyPrefix, address, channelID)) +} + +// ParseKeyCounterpartyRelayer returns the registered relayer address and channelID used to store the counterpartyrelayer address +func ParseKeyCounterpartyRelayer(key string) (address string, channelID string, error error) { + keySplit := strings.Split(key, "/") + if len(keySplit) != 3 { + return "", "", sdkerrors.Wrapf( + sdkerrors.ErrLogic, "key provided is incorrect: the key split has incorrect length, expected %d, got %d", 3, len(keySplit), + ) + } + + return keySplit[1], keySplit[2], nil +} + +// KeyForwardRelayerAddress returns the key for packetID -> forwardAddress mapping +func KeyForwardRelayerAddress(packetID channeltypes.PacketId) []byte { + return []byte(fmt.Sprintf("%s/%s/%s/%d", ForwardRelayerPrefix, packetID.PortId, packetID.ChannelId, packetID.Sequence)) +} + +// ParseKeyForwardRelayerAddress parses the key used to store the forward relayer address and returns the packetID +func ParseKeyForwardRelayerAddress(key string) (channeltypes.PacketId, error) { + keySplit := strings.Split(key, "/") + if len(keySplit) != 4 { + return channeltypes.PacketId{}, sdkerrors.Wrapf( + sdkerrors.ErrLogic, "key provided is incorrect: the key split has incorrect length, expected %d, got %d", 4, len(keySplit), + ) + } + + seq, err := strconv.ParseUint(keySplit[3], 10, 64) + if err != nil { + return channeltypes.PacketId{}, err + } + + packetID := channeltypes.NewPacketId(keySplit[1], keySplit[2], seq) + return packetID, nil +} + +// KeyFeesInEscrow returns the key for escrowed fees +func KeyFeesInEscrow(packetID channeltypes.PacketId) []byte { + return []byte(fmt.Sprintf("%s/%d", KeyFeesInEscrowChannelPrefix(packetID.PortId, packetID.ChannelId), packetID.Sequence)) +} + +// ParseKeyFeesInEscrow parses the key used to store fees in escrow and returns the packet id +func ParseKeyFeesInEscrow(key string) (channeltypes.PacketId, error) { + keySplit := strings.Split(key, "/") + if len(keySplit) != 4 { + return channeltypes.PacketId{}, sdkerrors.Wrapf( + sdkerrors.ErrLogic, "key provided is incorrect: the key split has incorrect length, expected %d, got %d", 4, len(keySplit), + ) + } + + seq, err := strconv.ParseUint(keySplit[3], 10, 64) + if err != nil { + return channeltypes.PacketId{}, err + } + + packetID := channeltypes.NewPacketId(keySplit[1], keySplit[2], seq) + return packetID, nil +} + +// KeyFeesInEscrowChannelPrefix returns the key prefix for escrowed fees on the given channel +func KeyFeesInEscrowChannelPrefix(portID, channelID string) []byte { + return []byte(fmt.Sprintf("%s/%s/%s", FeesInEscrowPrefix, portID, channelID)) +} diff --git a/modules/apps/29-fee/types/keys_test.go b/modules/apps/29-fee/types/keys_test.go new file mode 100644 index 00000000000..22dc91b6a57 --- /dev/null +++ b/modules/apps/29-fee/types/keys_test.go @@ -0,0 +1,176 @@ +package types_test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" +) + +var ( + validPacketID = channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) +) + +func TestKeyCounterpartyRelayer(t *testing.T) { + var ( + relayerAddress = "relayer_address" + channelID = "channel-0" + ) + + key := types.KeyCounterpartyRelayer(relayerAddress, channelID) + require.Equal(t, string(key), fmt.Sprintf("%s/%s/%s", types.CounterpartyRelayerAddressKeyPrefix, relayerAddress, channelID)) +} + +func TestKeyFeesInEscrow(t *testing.T) { + key := types.KeyFeesInEscrow(validPacketID) + require.Equal(t, string(key), fmt.Sprintf("%s/%s/%s/%d", types.FeesInEscrowPrefix, ibctesting.MockFeePort, ibctesting.FirstChannelID, 1)) +} + +func TestParseKeyFeeEnabled(t *testing.T) { + testCases := []struct { + name string + key string + expPass bool + }{ + { + "success", + string(types.KeyFeeEnabled(ibctesting.MockPort, ibctesting.FirstChannelID)), + true, + }, + { + "incorrect key - key split has incorrect length", + string(types.KeyFeesInEscrow(validPacketID)), + false, + }, + { + "incorrect key - key split has incorrect length", + fmt.Sprintf("%s/%s/%s", "fee", ibctesting.MockPort, ibctesting.FirstChannelID), + false, + }, + } + + for _, tc := range testCases { + portID, channelID, err := types.ParseKeyFeeEnabled(tc.key) + + if tc.expPass { + require.NoError(t, err) + require.Equal(t, ibctesting.MockPort, portID) + require.Equal(t, ibctesting.FirstChannelID, channelID) + } else { + require.Error(t, err) + require.Empty(t, portID) + require.Empty(t, channelID) + } + } +} + +func TestParseKeyFeesInEscrow(t *testing.T) { + + testCases := []struct { + name string + key string + expPass bool + }{ + { + "success", + string(types.KeyFeesInEscrow(validPacketID)), + true, + }, + { + "incorrect key - key split has incorrect length", + string(types.KeyFeeEnabled(validPacketID.PortId, validPacketID.ChannelId)), + false, + }, + { + "incorrect key - sequence cannot be parsed", + fmt.Sprintf("%s/%s", types.KeyFeesInEscrowChannelPrefix(validPacketID.PortId, validPacketID.ChannelId), "sequence"), + false, + }, + } + + for _, tc := range testCases { + packetID, err := types.ParseKeyFeesInEscrow(tc.key) + + if tc.expPass { + require.NoError(t, err) + require.Equal(t, validPacketID, packetID) + } else { + require.Error(t, err) + } + } +} + +func TestParseKeyForwardRelayerAddress(t *testing.T) { + + testCases := []struct { + name string + key string + expPass bool + }{ + { + "success", + string(types.KeyForwardRelayerAddress(validPacketID)), + true, + }, + { + "incorrect key - key split has incorrect length", + "forwardRelayer/transfer/channel-0", + false, + }, + { + "incorrect key - sequence is not correct", + "forwardRelayer/transfer/channel-0/sequence", + false, + }, + } + + for _, tc := range testCases { + packetID, err := types.ParseKeyForwardRelayerAddress(tc.key) + + if tc.expPass { + require.NoError(t, err) + require.Equal(t, validPacketID, packetID) + } else { + require.Error(t, err) + } + } +} + +func TestParseKeyCounterpartyRelayer(t *testing.T) { + var ( + relayerAddress = "relayer_address" + ) + + testCases := []struct { + name string + key string + expPass bool + }{ + { + "success", + string(types.KeyCounterpartyRelayer(relayerAddress, ibctesting.FirstChannelID)), + true, + }, + { + "incorrect key - key split has incorrect length", + "relayerAddress/relayer_address/transfer/channel-0", + false, + }, + } + + for _, tc := range testCases { + address, channelID, err := types.ParseKeyCounterpartyRelayer(tc.key) + + if tc.expPass { + require.NoError(t, err) + require.Equal(t, relayerAddress, address) + require.Equal(t, ibctesting.FirstChannelID, channelID) + } else { + require.Error(t, err) + } + } +} diff --git a/modules/apps/29-fee/types/metadata.pb.go b/modules/apps/29-fee/types/metadata.pb.go new file mode 100644 index 00000000000..95bb9244946 --- /dev/null +++ b/modules/apps/29-fee/types/metadata.pb.go @@ -0,0 +1,378 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/fee/v1/metadata.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring +// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning +type Metadata struct { + // fee_version defines the ICS29 fee version + FeeVersion string `protobuf:"bytes,1,opt,name=fee_version,json=feeVersion,proto3" json:"fee_version,omitempty" yaml:"fee_version"` + // app_version defines the underlying application version, which may or may not be a JSON encoded bytestring + AppVersion string `protobuf:"bytes,2,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty" yaml:"app_version"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_03d0f000eda681ce, []int{0} +} +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return m.Size() +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *Metadata) GetFeeVersion() string { + if m != nil { + return m.FeeVersion + } + return "" +} + +func (m *Metadata) GetAppVersion() string { + if m != nil { + return m.AppVersion + } + return "" +} + +func init() { + proto.RegisterType((*Metadata)(nil), "ibc.applications.fee.v1.Metadata") +} + +func init() { + proto.RegisterFile("ibc/applications/fee/v1/metadata.proto", fileDescriptor_03d0f000eda681ce) +} + +var fileDescriptor_03d0f000eda681ce = []byte{ + // 248 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0xcb, 0x4c, 0x4a, 0xd6, + 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x4f, 0x4b, 0x4d, + 0xd5, 0x2f, 0x33, 0xd4, 0xcf, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, + 0x2f, 0xc9, 0x17, 0x12, 0xcf, 0x4c, 0x4a, 0xd6, 0x43, 0x56, 0xa7, 0x97, 0x96, 0x9a, 0xaa, 0x57, + 0x66, 0x28, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa3, 0x0f, 0x62, 0x41, 0x94, 0x2b, 0xd5, + 0x70, 0x71, 0xf8, 0x42, 0x0d, 0x10, 0x32, 0xe7, 0xe2, 0x4e, 0x4b, 0x4d, 0x8d, 0x2f, 0x4b, 0x2d, + 0x2a, 0xce, 0xcc, 0xcf, 0x93, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x74, 0x12, 0xfb, 0x74, 0x4f, 0x5e, + 0xa8, 0x32, 0x31, 0x37, 0xc7, 0x4a, 0x09, 0x49, 0x52, 0x29, 0x88, 0x2b, 0x2d, 0x35, 0x35, 0x0c, + 0xc2, 0x01, 0x69, 0x4c, 0x2c, 0x28, 0x80, 0x6b, 0x64, 0x42, 0xd7, 0x88, 0x24, 0xa9, 0x14, 0xc4, + 0x95, 0x58, 0x50, 0x00, 0xd5, 0xe8, 0xe4, 0x7f, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, + 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, + 0x0c, 0x51, 0xa6, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xc9, 0xf9, + 0xc5, 0xb9, 0xf9, 0xc5, 0xfa, 0x99, 0x49, 0xc9, 0xba, 0xe9, 0xf9, 0xfa, 0x65, 0xc6, 0xfa, 0xb9, + 0xf9, 0x29, 0xa5, 0x39, 0xa9, 0xc5, 0xa0, 0xe0, 0x28, 0xd6, 0x37, 0xb2, 0xd4, 0x05, 0x85, 0x44, + 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x57, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x04, 0x84, 0x58, 0xe0, 0x2e, 0x01, 0x00, 0x00, +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AppVersion) > 0 { + i -= len(m.AppVersion) + copy(dAtA[i:], m.AppVersion) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.AppVersion))) + i-- + dAtA[i] = 0x12 + } + if len(m.FeeVersion) > 0 { + i -= len(m.FeeVersion) + copy(dAtA[i:], m.FeeVersion) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.FeeVersion))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMetadata(dAtA []byte, offset int, v uint64) int { + offset -= sovMetadata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FeeVersion) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.AppVersion) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func sovMetadata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMetadata(x uint64) (n int) { + return sovMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMetadata(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMetadata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMetadata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMetadata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMetadata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMetadata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMetadata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/apps/29-fee/types/msgs.go b/modules/apps/29-fee/types/msgs.go new file mode 100644 index 00000000000..d2fec3e542f --- /dev/null +++ b/modules/apps/29-fee/types/msgs.go @@ -0,0 +1,164 @@ +package types + +import ( + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + host "github.com/cosmos/ibc-go/v3/modules/core/24-host" +) + +// msg types +const ( + TypeMsgPayPacketFee = "payPacketFee" + TypeMsgPayPacketFeeAsync = "payPacketFeeAsync" +) + +// NewMsgRegisterCounterpartyAddress creates a new instance of MsgRegisterCounterpartyAddress +func NewMsgRegisterCounterpartyAddress(address, counterpartyAddress, channelID string) *MsgRegisterCounterpartyAddress { + return &MsgRegisterCounterpartyAddress{ + Address: address, + CounterpartyAddress: counterpartyAddress, + ChannelId: channelID, + } +} + +// ValidateBasic performs a basic check of the MsgRegisterCounterpartyAddress fields +func (msg MsgRegisterCounterpartyAddress) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrap(err, "failed to convert msg.Address into sdk.AccAddress") + } + + if strings.TrimSpace(msg.CounterpartyAddress) == "" { + return ErrCounterpartyAddressEmpty + } + + // validate channelId + if err := host.ChannelIdentifierValidator(msg.ChannelId); err != nil { + return err + } + + return nil +} + +// GetSigners implements sdk.Msg +func (msg MsgRegisterCounterpartyAddress) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Address) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} + +// NewMsgPayPacketFee creates a new instance of MsgPayPacketFee +func NewMsgPayPacketFee(fee Fee, sourcePortId, sourceChannelId, signer string, relayers []string) *MsgPayPacketFee { + return &MsgPayPacketFee{ + Fee: fee, + SourcePortId: sourcePortId, + SourceChannelId: sourceChannelId, + Signer: signer, + Relayers: relayers, + } +} + +// ValidateBasic performs a basic check of the MsgPayPacketFee fields +func (msg MsgPayPacketFee) ValidateBasic() error { + // validate channelId + if err := host.ChannelIdentifierValidator(msg.SourceChannelId); err != nil { + return err + } + + // validate portId + if err := host.PortIdentifierValidator(msg.SourcePortId); err != nil { + return err + } + + // signer check + if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { + return sdkerrors.Wrap(err, "failed to convert msg.Signer into sdk.AccAddress") + } + + // enforce relayer is nil + if msg.Relayers != nil { + return ErrRelayersNotNil + } + + if err := msg.Fee.Validate(); err != nil { + return err + } + + return nil +} + +// GetSigners implements sdk.Msg +func (msg MsgPayPacketFee) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} + +// Route implements sdk.Msg +func (msg MsgPayPacketFee) Route() string { + return RouterKey +} + +// Type implements sdk.Msg +func (msg MsgPayPacketFee) Type() string { + return TypeMsgPayPacketFee +} + +// GetSignBytes implements sdk.Msg. +func (msg MsgPayPacketFee) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +// NewMsgPayPacketAsync creates a new instance of MsgPayPacketFee +func NewMsgPayPacketFeeAsync(packetID channeltypes.PacketId, packetFee PacketFee) *MsgPayPacketFeeAsync { + return &MsgPayPacketFeeAsync{ + PacketId: packetID, + PacketFee: packetFee, + } +} + +// ValidateBasic performs a basic check of the MsgPayPacketFeeAsync fields +func (msg MsgPayPacketFeeAsync) ValidateBasic() error { + if err := msg.PacketId.Validate(); err != nil { + return err + } + + if err := msg.PacketFee.Validate(); err != nil { + return err + } + + return nil +} + +// GetSigners implements sdk.Msg +// The signer of the fee message must be the refund address +func (msg MsgPayPacketFeeAsync) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.PacketFee.RefundAddress) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} + +// Route implements sdk.Msg +func (msg MsgPayPacketFeeAsync) Route() string { + return RouterKey +} + +// Type implements sdk.Msg +func (msg MsgPayPacketFeeAsync) Type() string { + return TypeMsgPayPacketFeeAsync +} + +// GetSignBytes implements sdk.Msg. +func (msg MsgPayPacketFeeAsync) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} diff --git a/modules/apps/29-fee/types/msgs_test.go b/modules/apps/29-fee/types/msgs_test.go new file mode 100644 index 00000000000..d314a4f4193 --- /dev/null +++ b/modules/apps/29-fee/types/msgs_test.go @@ -0,0 +1,319 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" + channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/cosmos/ibc-go/v3/testing" + + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/crypto/secp256k1" +) + +func TestMsgRegisterCountepartyAddressValidation(t *testing.T) { + var ( + msg *types.MsgRegisterCounterpartyAddress + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "validate with incorrect destination relayer address", + func() { + msg.Address = "invalid-address" + }, + false, + }, + { + "invalid counterparty address", + func() { + msg.CounterpartyAddress = "" + }, + false, + }, + { + "invalid counterparty address: whitespaced empty string", + func() { + msg.CounterpartyAddress = " " + }, + false, + }, + { + "invalid channelID", + func() { + msg.ChannelId = "" + }, + false, + }, + } + + for i, tc := range testCases { + msg = types.NewMsgRegisterCounterpartyAddress(defaultAccAddress, defaultAccAddress, ibctesting.FirstChannelID) + + tc.malleate() + + err := msg.ValidateBasic() + + if tc.expPass { + require.NoError(t, err, "valid test case %d failed: %s", i, tc.name) + } else { + require.Error(t, err, "invalid test case %d passed: %s", i, tc.name) + } + } +} + +func TestRegisterCountepartyAddressGetSigners(t *testing.T) { + accAddress := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + msg := types.NewMsgRegisterCounterpartyAddress(accAddress.String(), defaultAccAddress, ibctesting.FirstChannelID) + require.Equal(t, []sdk.AccAddress{sdk.AccAddress(accAddress)}, msg.GetSigners()) +} + +func TestMsgPayPacketFeeValidation(t *testing.T) { + var ( + msg *types.MsgPayPacketFee + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "invalid channelID", + func() { + msg.SourceChannelId = "" + }, + false, + }, + { + "invalid portID", + func() { + msg.SourcePortId = "" + }, + false, + }, + { + "relayers is not nil", + func() { + msg.Relayers = []string{defaultAccAddress} + }, + false, + }, + { + "invalid signer address", + func() { + msg.Signer = "invalid-address" + }, + false, + }, + } + + for _, tc := range testCases { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + msg = types.NewMsgPayPacketFee(fee, ibctesting.MockFeePort, ibctesting.FirstChannelID, defaultAccAddress, nil) + + tc.malleate() // malleate mutates test data + + err := msg.ValidateBasic() + + if tc.expPass { + require.NoError(t, err) + } else { + require.Error(t, err) + } + } +} + +func TestPayPacketFeeGetSigners(t *testing.T) { + refundAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + msg := types.NewMsgPayPacketFee(fee, ibctesting.MockFeePort, ibctesting.FirstChannelID, refundAddr.String(), nil) + + require.Equal(t, []sdk.AccAddress{refundAddr}, msg.GetSigners()) +} + +func TestMsgPayPacketFeeRoute(t *testing.T) { + var msg types.MsgPayPacketFee + require.Equal(t, types.RouterKey, msg.Route()) +} + +func TestMsgPayPacketFeeType(t *testing.T) { + var msg types.MsgPayPacketFee + require.Equal(t, "payPacketFee", msg.Type()) +} + +func TestMsgPayPacketFeeGetSignBytes(t *testing.T) { + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + msg := types.NewMsgPayPacketFee(fee, ibctesting.MockFeePort, ibctesting.FirstChannelID, defaultAccAddress, nil) + + require.NotPanics(t, func() { + _ = msg.GetSignBytes() + }) +} + +func TestMsgPayPacketFeeAsyncValidation(t *testing.T) { + var ( + msg *types.MsgPayPacketFeeAsync + ) + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "invalid channelID", + func() { + msg.PacketId.ChannelId = "" + }, + false, + }, + { + "invalid portID", + func() { + msg.PacketId.PortId = "" + }, + false, + }, + { + "invalid sequence", + func() { + msg.PacketId.Sequence = 0 + }, + false, + }, + { + "relayers is not nil", + func() { + msg.PacketFee.Relayers = []string{defaultAccAddress} + }, + false, + }, + { + "invalid signer address", + func() { + msg.PacketFee.RefundAddress = "invalid-addr" + }, + false, + }, + { + "should fail when all fees are invalid", + func() { + msg.PacketFee.Fee.AckFee = invalidFee + msg.PacketFee.Fee.RecvFee = invalidFee + msg.PacketFee.Fee.TimeoutFee = invalidFee + }, + false, + }, + { + "should fail with single invalid fee", + func() { + msg.PacketFee.Fee.AckFee = invalidFee + }, + false, + }, + { + "should fail with two invalid fees", + func() { + msg.PacketFee.Fee.AckFee = invalidFee + msg.PacketFee.Fee.TimeoutFee = invalidFee + }, + false, + }, + { + "should pass with two empty fees", + func() { + msg.PacketFee.Fee.AckFee = sdk.Coins{} + msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} + }, + true, + }, + { + "should pass with one empty fee", + func() { + msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} + }, + true, + }, + { + "should fail if all fees are empty", + func() { + msg.PacketFee.Fee.AckFee = sdk.Coins{} + msg.PacketFee.Fee.RecvFee = sdk.Coins{} + msg.PacketFee.Fee.TimeoutFee = sdk.Coins{} + }, + false, + }, + } + + for _, tc := range testCases { + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, defaultAccAddress, nil) + + msg = types.NewMsgPayPacketFeeAsync(packetID, packetFee) + + tc.malleate() // malleate mutates test data + + err := msg.ValidateBasic() + + if tc.expPass { + require.NoError(t, err) + } else { + require.Error(t, err) + } + } +} + +func TestPayPacketFeeAsyncGetSigners(t *testing.T) { + refundAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address()) + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, refundAddr.String(), nil) + + msg := types.NewMsgPayPacketFeeAsync(packetID, packetFee) + + require.Equal(t, []sdk.AccAddress{refundAddr}, msg.GetSigners()) +} + +func TestMsgPayPacketFeeAsyncRoute(t *testing.T) { + var msg types.MsgPayPacketFeeAsync + require.Equal(t, types.RouterKey, msg.Route()) +} + +func TestMsgPayPacketFeeAsyncType(t *testing.T) { + var msg types.MsgPayPacketFeeAsync + require.Equal(t, "payPacketFeeAsync", msg.Type()) +} + +func TestMsgPayPacketFeeAsyncGetSignBytes(t *testing.T) { + packetID := channeltypes.NewPacketId(ibctesting.MockFeePort, ibctesting.FirstChannelID, 1) + fee := types.NewFee(defaultRecvFee, defaultAckFee, defaultTimeoutFee) + packetFee := types.NewPacketFee(fee, defaultAccAddress, nil) + + msg := types.NewMsgPayPacketFeeAsync(packetID, packetFee) + + require.NotPanics(t, func() { + _ = msg.GetSignBytes() + }) +} diff --git a/modules/apps/29-fee/types/query.pb.go b/modules/apps/29-fee/types/query.pb.go new file mode 100644 index 00000000000..32677378fe3 --- /dev/null +++ b/modules/apps/29-fee/types/query.pb.go @@ -0,0 +1,4162 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/fee/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + types "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc +type QueryIncentivizedPacketsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // block height at which to query + QueryHeight uint64 `protobuf:"varint,2,opt,name=query_height,json=queryHeight,proto3" json:"query_height,omitempty"` +} + +func (m *QueryIncentivizedPacketsRequest) Reset() { *m = QueryIncentivizedPacketsRequest{} } +func (m *QueryIncentivizedPacketsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizedPacketsRequest) ProtoMessage() {} +func (*QueryIncentivizedPacketsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{0} +} +func (m *QueryIncentivizedPacketsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizedPacketsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizedPacketsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIncentivizedPacketsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizedPacketsRequest.Merge(m, src) +} +func (m *QueryIncentivizedPacketsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizedPacketsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizedPacketsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizedPacketsRequest proto.InternalMessageInfo + +func (m *QueryIncentivizedPacketsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryIncentivizedPacketsRequest) GetQueryHeight() uint64 { + if m != nil { + return m.QueryHeight + } + return 0 +} + +// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc +type QueryIncentivizedPacketsResponse struct { + // list of identified fees for incentivized packets + IncentivizedPackets []IdentifiedPacketFees `protobuf:"bytes,1,rep,name=incentivized_packets,json=incentivizedPackets,proto3" json:"incentivized_packets"` +} + +func (m *QueryIncentivizedPacketsResponse) Reset() { *m = QueryIncentivizedPacketsResponse{} } +func (m *QueryIncentivizedPacketsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizedPacketsResponse) ProtoMessage() {} +func (*QueryIncentivizedPacketsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{1} +} +func (m *QueryIncentivizedPacketsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizedPacketsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizedPacketsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIncentivizedPacketsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizedPacketsResponse.Merge(m, src) +} +func (m *QueryIncentivizedPacketsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizedPacketsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizedPacketsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizedPacketsResponse proto.InternalMessageInfo + +func (m *QueryIncentivizedPacketsResponse) GetIncentivizedPackets() []IdentifiedPacketFees { + if m != nil { + return m.IncentivizedPackets + } + return nil +} + +// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +type QueryIncentivizedPacketRequest struct { + // unique packet identifier comprised of channel ID, port ID and sequence + PacketId types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id"` + // block height at which to query + QueryHeight uint64 `protobuf:"varint,2,opt,name=query_height,json=queryHeight,proto3" json:"query_height,omitempty"` +} + +func (m *QueryIncentivizedPacketRequest) Reset() { *m = QueryIncentivizedPacketRequest{} } +func (m *QueryIncentivizedPacketRequest) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizedPacketRequest) ProtoMessage() {} +func (*QueryIncentivizedPacketRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{2} +} +func (m *QueryIncentivizedPacketRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizedPacketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizedPacketRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIncentivizedPacketRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizedPacketRequest.Merge(m, src) +} +func (m *QueryIncentivizedPacketRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizedPacketRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizedPacketRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizedPacketRequest proto.InternalMessageInfo + +func (m *QueryIncentivizedPacketRequest) GetPacketId() types.PacketId { + if m != nil { + return m.PacketId + } + return types.PacketId{} +} + +func (m *QueryIncentivizedPacketRequest) GetQueryHeight() uint64 { + if m != nil { + return m.QueryHeight + } + return 0 +} + +// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc +type QueryIncentivizedPacketResponse struct { + // the identified fees for the incentivized packet + IncentivizedPacket IdentifiedPacketFees `protobuf:"bytes,1,opt,name=incentivized_packet,json=incentivizedPacket,proto3" json:"incentivized_packet"` +} + +func (m *QueryIncentivizedPacketResponse) Reset() { *m = QueryIncentivizedPacketResponse{} } +func (m *QueryIncentivizedPacketResponse) String() string { return proto.CompactTextString(m) } +func (*QueryIncentivizedPacketResponse) ProtoMessage() {} +func (*QueryIncentivizedPacketResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{3} +} +func (m *QueryIncentivizedPacketResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizedPacketResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizedPacketResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIncentivizedPacketResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizedPacketResponse.Merge(m, src) +} +func (m *QueryIncentivizedPacketResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizedPacketResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizedPacketResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizedPacketResponse proto.InternalMessageInfo + +func (m *QueryIncentivizedPacketResponse) GetIncentivizedPacket() IdentifiedPacketFees { + if m != nil { + return m.IncentivizedPacket + } + return IdentifiedPacketFees{} +} + +// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets +// for a specific channel +type QueryIncentivizedPacketsForChannelRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + PortId string `protobuf:"bytes,2,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty"` + ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // Height to query at + QueryHeight uint64 `protobuf:"varint,4,opt,name=query_height,json=queryHeight,proto3" json:"query_height,omitempty"` +} + +func (m *QueryIncentivizedPacketsForChannelRequest) Reset() { + *m = QueryIncentivizedPacketsForChannelRequest{} +} +func (m *QueryIncentivizedPacketsForChannelRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryIncentivizedPacketsForChannelRequest) ProtoMessage() {} +func (*QueryIncentivizedPacketsForChannelRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{4} +} +func (m *QueryIncentivizedPacketsForChannelRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizedPacketsForChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizedPacketsForChannelRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIncentivizedPacketsForChannelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizedPacketsForChannelRequest.Merge(m, src) +} +func (m *QueryIncentivizedPacketsForChannelRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizedPacketsForChannelRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizedPacketsForChannelRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizedPacketsForChannelRequest proto.InternalMessageInfo + +func (m *QueryIncentivizedPacketsForChannelRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryIncentivizedPacketsForChannelRequest) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *QueryIncentivizedPacketsForChannelRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *QueryIncentivizedPacketsForChannelRequest) GetQueryHeight() uint64 { + if m != nil { + return m.QueryHeight + } + return 0 +} + +// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC +type QueryIncentivizedPacketsForChannelResponse struct { + // Map of all incentivized_packets + IncentivizedPackets []*IdentifiedPacketFees `protobuf:"bytes,1,rep,name=incentivized_packets,json=incentivizedPackets,proto3" json:"incentivized_packets,omitempty"` +} + +func (m *QueryIncentivizedPacketsForChannelResponse) Reset() { + *m = QueryIncentivizedPacketsForChannelResponse{} +} +func (m *QueryIncentivizedPacketsForChannelResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryIncentivizedPacketsForChannelResponse) ProtoMessage() {} +func (*QueryIncentivizedPacketsForChannelResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{5} +} +func (m *QueryIncentivizedPacketsForChannelResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryIncentivizedPacketsForChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryIncentivizedPacketsForChannelResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryIncentivizedPacketsForChannelResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryIncentivizedPacketsForChannelResponse.Merge(m, src) +} +func (m *QueryIncentivizedPacketsForChannelResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryIncentivizedPacketsForChannelResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryIncentivizedPacketsForChannelResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryIncentivizedPacketsForChannelResponse proto.InternalMessageInfo + +func (m *QueryIncentivizedPacketsForChannelResponse) GetIncentivizedPackets() []*IdentifiedPacketFees { + if m != nil { + return m.IncentivizedPackets + } + return nil +} + +// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc +type QueryTotalRecvFeesRequest struct { + // the packet identifier for the associated fees + PacketId types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id"` +} + +func (m *QueryTotalRecvFeesRequest) Reset() { *m = QueryTotalRecvFeesRequest{} } +func (m *QueryTotalRecvFeesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalRecvFeesRequest) ProtoMessage() {} +func (*QueryTotalRecvFeesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{6} +} +func (m *QueryTotalRecvFeesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalRecvFeesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalRecvFeesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalRecvFeesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalRecvFeesRequest.Merge(m, src) +} +func (m *QueryTotalRecvFeesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalRecvFeesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalRecvFeesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalRecvFeesRequest proto.InternalMessageInfo + +func (m *QueryTotalRecvFeesRequest) GetPacketId() types.PacketId { + if m != nil { + return m.PacketId + } + return types.PacketId{} +} + +// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc +type QueryTotalRecvFeesResponse struct { + // the total packet receive fees + RecvFees github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=recv_fees,json=recvFees,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"recv_fees" yaml:"recv_fees"` +} + +func (m *QueryTotalRecvFeesResponse) Reset() { *m = QueryTotalRecvFeesResponse{} } +func (m *QueryTotalRecvFeesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalRecvFeesResponse) ProtoMessage() {} +func (*QueryTotalRecvFeesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{7} +} +func (m *QueryTotalRecvFeesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalRecvFeesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalRecvFeesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalRecvFeesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalRecvFeesResponse.Merge(m, src) +} +func (m *QueryTotalRecvFeesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalRecvFeesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalRecvFeesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalRecvFeesResponse proto.InternalMessageInfo + +func (m *QueryTotalRecvFeesResponse) GetRecvFees() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.RecvFees + } + return nil +} + +// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc +type QueryTotalAckFeesRequest struct { + // the packet identifier for the associated fees + PacketId types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id"` +} + +func (m *QueryTotalAckFeesRequest) Reset() { *m = QueryTotalAckFeesRequest{} } +func (m *QueryTotalAckFeesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalAckFeesRequest) ProtoMessage() {} +func (*QueryTotalAckFeesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{8} +} +func (m *QueryTotalAckFeesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalAckFeesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalAckFeesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalAckFeesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalAckFeesRequest.Merge(m, src) +} +func (m *QueryTotalAckFeesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalAckFeesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalAckFeesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalAckFeesRequest proto.InternalMessageInfo + +func (m *QueryTotalAckFeesRequest) GetPacketId() types.PacketId { + if m != nil { + return m.PacketId + } + return types.PacketId{} +} + +// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc +type QueryTotalAckFeesResponse struct { + // the total packet acknowledgement fees + AckFees github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=ack_fees,json=ackFees,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"ack_fees" yaml:"ack_fees"` +} + +func (m *QueryTotalAckFeesResponse) Reset() { *m = QueryTotalAckFeesResponse{} } +func (m *QueryTotalAckFeesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalAckFeesResponse) ProtoMessage() {} +func (*QueryTotalAckFeesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{9} +} +func (m *QueryTotalAckFeesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalAckFeesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalAckFeesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalAckFeesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalAckFeesResponse.Merge(m, src) +} +func (m *QueryTotalAckFeesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalAckFeesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalAckFeesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalAckFeesResponse proto.InternalMessageInfo + +func (m *QueryTotalAckFeesResponse) GetAckFees() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.AckFees + } + return nil +} + +// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc +type QueryTotalTimeoutFeesRequest struct { + // the packet identifier for the associated fees + PacketId types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id"` +} + +func (m *QueryTotalTimeoutFeesRequest) Reset() { *m = QueryTotalTimeoutFeesRequest{} } +func (m *QueryTotalTimeoutFeesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalTimeoutFeesRequest) ProtoMessage() {} +func (*QueryTotalTimeoutFeesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{10} +} +func (m *QueryTotalTimeoutFeesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalTimeoutFeesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalTimeoutFeesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalTimeoutFeesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalTimeoutFeesRequest.Merge(m, src) +} +func (m *QueryTotalTimeoutFeesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalTimeoutFeesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalTimeoutFeesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalTimeoutFeesRequest proto.InternalMessageInfo + +func (m *QueryTotalTimeoutFeesRequest) GetPacketId() types.PacketId { + if m != nil { + return m.PacketId + } + return types.PacketId{} +} + +// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc +type QueryTotalTimeoutFeesResponse struct { + // the total packet timeout fees + TimeoutFees github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=timeout_fees,json=timeoutFees,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"timeout_fees" yaml:"timeout_fees"` +} + +func (m *QueryTotalTimeoutFeesResponse) Reset() { *m = QueryTotalTimeoutFeesResponse{} } +func (m *QueryTotalTimeoutFeesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalTimeoutFeesResponse) ProtoMessage() {} +func (*QueryTotalTimeoutFeesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{11} +} +func (m *QueryTotalTimeoutFeesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalTimeoutFeesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalTimeoutFeesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalTimeoutFeesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalTimeoutFeesResponse.Merge(m, src) +} +func (m *QueryTotalTimeoutFeesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalTimeoutFeesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalTimeoutFeesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalTimeoutFeesResponse proto.InternalMessageInfo + +func (m *QueryTotalTimeoutFeesResponse) GetTimeoutFees() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.TimeoutFees + } + return nil +} + +// QueryCounterpartyAddressRequest defines the request type for the CounterpartyAddress rpc +type QueryCounterpartyAddressRequest struct { + // unique channel identifier + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + // the relayer address to which the counterparty is registered + RelayerAddress string `protobuf:"bytes,2,opt,name=relayer_address,json=relayerAddress,proto3" json:"relayer_address,omitempty" yaml:"relayer_address"` +} + +func (m *QueryCounterpartyAddressRequest) Reset() { *m = QueryCounterpartyAddressRequest{} } +func (m *QueryCounterpartyAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCounterpartyAddressRequest) ProtoMessage() {} +func (*QueryCounterpartyAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{12} +} +func (m *QueryCounterpartyAddressRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCounterpartyAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCounterpartyAddressRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCounterpartyAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCounterpartyAddressRequest.Merge(m, src) +} +func (m *QueryCounterpartyAddressRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCounterpartyAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCounterpartyAddressRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCounterpartyAddressRequest proto.InternalMessageInfo + +func (m *QueryCounterpartyAddressRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *QueryCounterpartyAddressRequest) GetRelayerAddress() string { + if m != nil { + return m.RelayerAddress + } + return "" +} + +// QueryCounterpartyAddressResponse defines the response type for the CounterpartyAddress rpc +type QueryCounterpartyAddressResponse struct { + // the counterparty address used to compensate forward relaying + CounterpartyAddress string `protobuf:"bytes,1,opt,name=counterparty_address,json=counterpartyAddress,proto3" json:"counterparty_address,omitempty" yaml:"counterparty_address"` +} + +func (m *QueryCounterpartyAddressResponse) Reset() { *m = QueryCounterpartyAddressResponse{} } +func (m *QueryCounterpartyAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCounterpartyAddressResponse) ProtoMessage() {} +func (*QueryCounterpartyAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{13} +} +func (m *QueryCounterpartyAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCounterpartyAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCounterpartyAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCounterpartyAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCounterpartyAddressResponse.Merge(m, src) +} +func (m *QueryCounterpartyAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCounterpartyAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCounterpartyAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCounterpartyAddressResponse proto.InternalMessageInfo + +func (m *QueryCounterpartyAddressResponse) GetCounterpartyAddress() string { + if m != nil { + return m.CounterpartyAddress + } + return "" +} + +// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc +type QueryFeeEnabledChannelsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // block height at which to query + QueryHeight uint64 `protobuf:"varint,2,opt,name=query_height,json=queryHeight,proto3" json:"query_height,omitempty"` +} + +func (m *QueryFeeEnabledChannelsRequest) Reset() { *m = QueryFeeEnabledChannelsRequest{} } +func (m *QueryFeeEnabledChannelsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFeeEnabledChannelsRequest) ProtoMessage() {} +func (*QueryFeeEnabledChannelsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{14} +} +func (m *QueryFeeEnabledChannelsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeEnabledChannelsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeEnabledChannelsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeEnabledChannelsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeEnabledChannelsRequest.Merge(m, src) +} +func (m *QueryFeeEnabledChannelsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeEnabledChannelsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeEnabledChannelsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeEnabledChannelsRequest proto.InternalMessageInfo + +func (m *QueryFeeEnabledChannelsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *QueryFeeEnabledChannelsRequest) GetQueryHeight() uint64 { + if m != nil { + return m.QueryHeight + } + return 0 +} + +// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc +type QueryFeeEnabledChannelsResponse struct { + // list of fee enabled channels + FeeEnabledChannels []FeeEnabledChannel `protobuf:"bytes,1,rep,name=fee_enabled_channels,json=feeEnabledChannels,proto3" json:"fee_enabled_channels" yaml:"fee_enabled_channels"` +} + +func (m *QueryFeeEnabledChannelsResponse) Reset() { *m = QueryFeeEnabledChannelsResponse{} } +func (m *QueryFeeEnabledChannelsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFeeEnabledChannelsResponse) ProtoMessage() {} +func (*QueryFeeEnabledChannelsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{15} +} +func (m *QueryFeeEnabledChannelsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeEnabledChannelsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeEnabledChannelsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeEnabledChannelsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeEnabledChannelsResponse.Merge(m, src) +} +func (m *QueryFeeEnabledChannelsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeEnabledChannelsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeEnabledChannelsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeEnabledChannelsResponse proto.InternalMessageInfo + +func (m *QueryFeeEnabledChannelsResponse) GetFeeEnabledChannels() []FeeEnabledChannel { + if m != nil { + return m.FeeEnabledChannels + } + return nil +} + +// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc +type QueryFeeEnabledChannelRequest struct { + // unique port identifier + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + // unique channel identifier + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` +} + +func (m *QueryFeeEnabledChannelRequest) Reset() { *m = QueryFeeEnabledChannelRequest{} } +func (m *QueryFeeEnabledChannelRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFeeEnabledChannelRequest) ProtoMessage() {} +func (*QueryFeeEnabledChannelRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{16} +} +func (m *QueryFeeEnabledChannelRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeEnabledChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeEnabledChannelRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeEnabledChannelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeEnabledChannelRequest.Merge(m, src) +} +func (m *QueryFeeEnabledChannelRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeEnabledChannelRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeEnabledChannelRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeEnabledChannelRequest proto.InternalMessageInfo + +func (m *QueryFeeEnabledChannelRequest) GetPortId() string { + if m != nil { + return m.PortId + } + return "" +} + +func (m *QueryFeeEnabledChannelRequest) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc +type QueryFeeEnabledChannelResponse struct { + // boolean flag representing the fee enabled channel status + FeeEnabled bool `protobuf:"varint,1,opt,name=fee_enabled,json=feeEnabled,proto3" json:"fee_enabled,omitempty" yaml:"fee_enabled"` +} + +func (m *QueryFeeEnabledChannelResponse) Reset() { *m = QueryFeeEnabledChannelResponse{} } +func (m *QueryFeeEnabledChannelResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFeeEnabledChannelResponse) ProtoMessage() {} +func (*QueryFeeEnabledChannelResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0638a8a78ca2503c, []int{17} +} +func (m *QueryFeeEnabledChannelResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeEnabledChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeEnabledChannelResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeEnabledChannelResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeEnabledChannelResponse.Merge(m, src) +} +func (m *QueryFeeEnabledChannelResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeEnabledChannelResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeEnabledChannelResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeEnabledChannelResponse proto.InternalMessageInfo + +func (m *QueryFeeEnabledChannelResponse) GetFeeEnabled() bool { + if m != nil { + return m.FeeEnabled + } + return false +} + +func init() { + proto.RegisterType((*QueryIncentivizedPacketsRequest)(nil), "ibc.applications.fee.v1.QueryIncentivizedPacketsRequest") + proto.RegisterType((*QueryIncentivizedPacketsResponse)(nil), "ibc.applications.fee.v1.QueryIncentivizedPacketsResponse") + proto.RegisterType((*QueryIncentivizedPacketRequest)(nil), "ibc.applications.fee.v1.QueryIncentivizedPacketRequest") + proto.RegisterType((*QueryIncentivizedPacketResponse)(nil), "ibc.applications.fee.v1.QueryIncentivizedPacketResponse") + proto.RegisterType((*QueryIncentivizedPacketsForChannelRequest)(nil), "ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelRequest") + proto.RegisterType((*QueryIncentivizedPacketsForChannelResponse)(nil), "ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse") + proto.RegisterType((*QueryTotalRecvFeesRequest)(nil), "ibc.applications.fee.v1.QueryTotalRecvFeesRequest") + proto.RegisterType((*QueryTotalRecvFeesResponse)(nil), "ibc.applications.fee.v1.QueryTotalRecvFeesResponse") + proto.RegisterType((*QueryTotalAckFeesRequest)(nil), "ibc.applications.fee.v1.QueryTotalAckFeesRequest") + proto.RegisterType((*QueryTotalAckFeesResponse)(nil), "ibc.applications.fee.v1.QueryTotalAckFeesResponse") + proto.RegisterType((*QueryTotalTimeoutFeesRequest)(nil), "ibc.applications.fee.v1.QueryTotalTimeoutFeesRequest") + proto.RegisterType((*QueryTotalTimeoutFeesResponse)(nil), "ibc.applications.fee.v1.QueryTotalTimeoutFeesResponse") + proto.RegisterType((*QueryCounterpartyAddressRequest)(nil), "ibc.applications.fee.v1.QueryCounterpartyAddressRequest") + proto.RegisterType((*QueryCounterpartyAddressResponse)(nil), "ibc.applications.fee.v1.QueryCounterpartyAddressResponse") + proto.RegisterType((*QueryFeeEnabledChannelsRequest)(nil), "ibc.applications.fee.v1.QueryFeeEnabledChannelsRequest") + proto.RegisterType((*QueryFeeEnabledChannelsResponse)(nil), "ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse") + proto.RegisterType((*QueryFeeEnabledChannelRequest)(nil), "ibc.applications.fee.v1.QueryFeeEnabledChannelRequest") + proto.RegisterType((*QueryFeeEnabledChannelResponse)(nil), "ibc.applications.fee.v1.QueryFeeEnabledChannelResponse") +} + +func init() { + proto.RegisterFile("ibc/applications/fee/v1/query.proto", fileDescriptor_0638a8a78ca2503c) +} + +var fileDescriptor_0638a8a78ca2503c = []byte{ + // 1281 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x58, 0x4f, 0x6f, 0x1b, 0x45, + 0x1c, 0xcd, 0xa4, 0xa1, 0x4d, 0x26, 0xa1, 0x4d, 0xc7, 0xa1, 0x4d, 0x4d, 0x62, 0xa7, 0x53, 0x0a, + 0x21, 0x28, 0xbb, 0x8a, 0x43, 0x9b, 0x96, 0x53, 0x6b, 0x43, 0x68, 0x04, 0x82, 0x76, 0x95, 0x0b, + 0x08, 0xe4, 0xae, 0x77, 0xc7, 0xce, 0x2a, 0xce, 0xce, 0x76, 0x77, 0x6d, 0x70, 0xd3, 0x20, 0x35, + 0x52, 0x84, 0x04, 0x15, 0x42, 0x42, 0xe2, 0x80, 0xb8, 0x22, 0x24, 0x24, 0xb8, 0xf3, 0x0d, 0x7a, + 0xaa, 0x2a, 0x71, 0xe1, 0x64, 0xaa, 0x84, 0x4f, 0x60, 0x71, 0x40, 0xe2, 0x82, 0x76, 0x66, 0x76, + 0xbd, 0xee, 0xee, 0x26, 0xde, 0x92, 0x88, 0x53, 0xec, 0xf9, 0xfd, 0x99, 0xf7, 0xde, 0xfc, 0x3c, + 0xf3, 0x14, 0x78, 0xc1, 0xa8, 0x68, 0xb2, 0x6a, 0x59, 0x75, 0x43, 0x53, 0x5d, 0x83, 0x9a, 0x8e, + 0x5c, 0x25, 0x44, 0x6e, 0x2e, 0xc8, 0x77, 0x1a, 0xc4, 0x6e, 0x49, 0x96, 0x4d, 0x5d, 0x8a, 0xce, + 0x1a, 0x15, 0x4d, 0x0a, 0x27, 0x49, 0x55, 0x42, 0xa4, 0xe6, 0x42, 0x76, 0xa2, 0x46, 0x6b, 0x94, + 0xe5, 0xc8, 0xde, 0x27, 0x9e, 0x9e, 0x9d, 0xaa, 0x51, 0x5a, 0xab, 0x13, 0x59, 0xb5, 0x0c, 0x59, + 0x35, 0x4d, 0xea, 0x8a, 0x22, 0x1e, 0xcd, 0x69, 0xd4, 0xd9, 0xa0, 0x8e, 0x5c, 0x51, 0x1d, 0x6f, + 0xa3, 0x0a, 0x71, 0xd5, 0x05, 0x59, 0xa3, 0x86, 0x29, 0xe2, 0x73, 0xe1, 0x38, 0x43, 0x11, 0x64, + 0x59, 0x6a, 0xcd, 0x30, 0x59, 0x33, 0x91, 0x7b, 0x3e, 0x09, 0xbd, 0x87, 0x8f, 0xa7, 0x5c, 0x4c, + 0x4a, 0xa9, 0x11, 0x93, 0x38, 0x86, 0x13, 0xee, 0xa4, 0x51, 0x9b, 0xc8, 0xda, 0x9a, 0x6a, 0x9a, + 0xa4, 0xee, 0xa5, 0x88, 0x8f, 0x3c, 0x05, 0x3f, 0x00, 0x30, 0x7f, 0xcb, 0xc3, 0xb3, 0x62, 0x6a, + 0xc4, 0x74, 0x8d, 0xa6, 0x71, 0x97, 0xe8, 0x37, 0x55, 0x6d, 0x9d, 0xb8, 0x8e, 0x42, 0xee, 0x34, + 0x88, 0xe3, 0xa2, 0x65, 0x08, 0xbb, 0x20, 0x27, 0xc1, 0x0c, 0x98, 0x1d, 0x2d, 0xbc, 0x2c, 0x71, + 0x46, 0x92, 0xc7, 0x48, 0xe2, 0xba, 0x0a, 0x46, 0xd2, 0x4d, 0xb5, 0x46, 0x44, 0xad, 0x12, 0xaa, + 0x44, 0xe7, 0xe1, 0x18, 0x4b, 0x2c, 0xaf, 0x11, 0xa3, 0xb6, 0xe6, 0x4e, 0x0e, 0xce, 0x80, 0xd9, + 0x21, 0x65, 0x94, 0xad, 0xdd, 0x60, 0x4b, 0xf8, 0x0b, 0x00, 0x67, 0x92, 0xe1, 0x38, 0x16, 0x35, + 0x1d, 0x82, 0xaa, 0x70, 0xc2, 0x08, 0x85, 0xcb, 0x16, 0x8f, 0x4f, 0x82, 0x99, 0x63, 0xb3, 0xa3, + 0x85, 0x79, 0x29, 0xe1, 0x60, 0xa5, 0x15, 0xdd, 0xab, 0xa9, 0x1a, 0x7e, 0xc7, 0x65, 0x42, 0x9c, + 0xe2, 0xd0, 0xc3, 0x76, 0x7e, 0x40, 0xc9, 0x18, 0xd1, 0xfd, 0xf0, 0x0e, 0x80, 0xb9, 0x04, 0x30, + 0xbe, 0x34, 0xd7, 0xe0, 0x08, 0xdf, 0xbd, 0x6c, 0xe8, 0x42, 0x99, 0x69, 0xb6, 0xbf, 0xa7, 0xba, + 0xe4, 0x4b, 0xdd, 0xf4, 0x34, 0xf1, 0xb2, 0x56, 0x74, 0xb1, 0xdf, 0xb0, 0x25, 0xbe, 0xf7, 0x23, + 0xca, 0xe7, 0xc9, 0x67, 0x14, 0x68, 0xa2, 0xc3, 0x4c, 0x8c, 0x26, 0x02, 0xd2, 0x33, 0x49, 0x82, + 0xa2, 0x92, 0xe0, 0x47, 0x00, 0xbe, 0x9a, 0x74, 0x3c, 0xcb, 0xd4, 0x2e, 0x71, 0xbe, 0x87, 0x3d, + 0x37, 0x67, 0xe1, 0x09, 0x8b, 0xda, 0x4c, 0x62, 0x4f, 0x9d, 0x11, 0xe5, 0xb8, 0xf7, 0x75, 0x45, + 0x47, 0xd3, 0x10, 0x0a, 0x89, 0xbd, 0xd8, 0x31, 0x16, 0x1b, 0x11, 0x2b, 0x31, 0xd2, 0x0e, 0x45, + 0xa5, 0xfd, 0x0a, 0xc0, 0xb9, 0x7e, 0x08, 0x09, 0x95, 0x6f, 0x1f, 0xe2, 0xe4, 0xc5, 0xcf, 0xdc, + 0xc7, 0xf0, 0x1c, 0xc3, 0xb3, 0x4a, 0x5d, 0xb5, 0xae, 0x10, 0xad, 0xc9, 0x52, 0x0f, 0x6b, 0xda, + 0xf0, 0x77, 0x00, 0x66, 0xe3, 0xfa, 0x0b, 0x7e, 0xf7, 0xe0, 0x88, 0x4d, 0xb4, 0x66, 0xb9, 0x4a, + 0x88, 0x4f, 0xea, 0x5c, 0xcf, 0x81, 0xf9, 0x47, 0x55, 0xa2, 0x86, 0x59, 0x7c, 0xd3, 0x6b, 0xde, + 0x69, 0xe7, 0xc7, 0x5b, 0xea, 0x46, 0xfd, 0x0d, 0x1c, 0x54, 0xe2, 0x9f, 0xfe, 0xc8, 0xcf, 0xd6, + 0x0c, 0x77, 0xad, 0x51, 0x91, 0x34, 0xba, 0x21, 0x8b, 0xbb, 0x8f, 0xff, 0x99, 0x77, 0xf4, 0x75, + 0xd9, 0x6d, 0x59, 0xc4, 0x61, 0x4d, 0x1c, 0x65, 0xd8, 0x16, 0x28, 0xf0, 0x47, 0x70, 0xb2, 0x8b, + 0xed, 0xba, 0xb6, 0x7e, 0xb8, 0xd4, 0xbf, 0x05, 0x61, 0x69, 0x83, 0xf6, 0x82, 0x79, 0x0b, 0x0e, + 0xab, 0xda, 0x7a, 0x9f, 0xc4, 0x4b, 0x82, 0xf8, 0x29, 0x4e, 0xdc, 0x2f, 0x4c, 0xc7, 0xfb, 0x84, + 0xca, 0x21, 0xe0, 0xdb, 0x70, 0xaa, 0x8b, 0x6b, 0xd5, 0xd8, 0x20, 0xb4, 0xe1, 0x1e, 0x2e, 0xf5, + 0x1f, 0x01, 0x9c, 0x4e, 0xd8, 0x42, 0xd0, 0xdf, 0x01, 0x70, 0xcc, 0xe5, 0xeb, 0x7d, 0x6a, 0xf0, + 0xb6, 0xd0, 0x20, 0xc3, 0x35, 0x08, 0x17, 0xa7, 0xd3, 0x61, 0xd4, 0xed, 0xe2, 0xc1, 0xdf, 0xfb, + 0x57, 0x5d, 0x89, 0x36, 0x4c, 0x97, 0xd8, 0x96, 0x6a, 0xbb, 0xad, 0xeb, 0xba, 0x6e, 0x13, 0x27, + 0xd0, 0xe3, 0xf5, 0x9e, 0x5f, 0xbd, 0x27, 0xc8, 0x48, 0xf1, 0x85, 0x4e, 0x3b, 0x7f, 0x9a, 0x23, + 0xe9, 0xc6, 0x70, 0xf8, 0x32, 0x28, 0xc1, 0x53, 0x36, 0xa9, 0xab, 0x2d, 0x62, 0x97, 0x55, 0xde, + 0x8f, 0x5f, 0x26, 0xc5, 0x6c, 0xa7, 0x9d, 0x3f, 0xe3, 0x4f, 0x70, 0x4f, 0x02, 0x56, 0x4e, 0x8a, + 0x15, 0x81, 0x00, 0x37, 0xc5, 0xeb, 0x14, 0x8b, 0x4e, 0x48, 0xa9, 0xc0, 0x09, 0x2d, 0x14, 0x0e, + 0x76, 0xe3, 0x40, 0xf3, 0x9d, 0x76, 0xfe, 0x45, 0x01, 0x34, 0x26, 0x0b, 0x2b, 0x19, 0x2d, 0xda, + 0x1b, 0x7f, 0xe9, 0xbf, 0x44, 0xcb, 0x84, 0xbc, 0x65, 0xaa, 0x95, 0x3a, 0xd1, 0xc5, 0xd5, 0xf4, + 0x7f, 0x3c, 0xd2, 0x3f, 0xf8, 0x87, 0x14, 0x87, 0x46, 0xa8, 0x70, 0x1f, 0xc0, 0x89, 0x2a, 0x21, + 0x65, 0xc2, 0xe3, 0x65, 0x71, 0x10, 0xfe, 0x60, 0xcd, 0x25, 0x5e, 0x95, 0x91, 0x9e, 0xc5, 0x0b, + 0x62, 0xd2, 0x84, 0x6c, 0x71, 0x5d, 0xb1, 0x82, 0xaa, 0x11, 0x2c, 0x78, 0xdb, 0x1f, 0xfb, 0x48, + 0x4f, 0x5f, 0xb4, 0xd7, 0xba, 0x2f, 0x0b, 0x3f, 0x1e, 0xd4, 0x69, 0xe7, 0x4f, 0xf2, 0x7d, 0x44, + 0x00, 0x07, 0xaf, 0x4d, 0xef, 0xdc, 0x0d, 0xf6, 0x37, 0x77, 0xf8, 0x83, 0xa4, 0x93, 0x0b, 0xa4, + 0x5a, 0x82, 0xa3, 0x21, 0x4e, 0x0c, 0xc8, 0x70, 0xf1, 0x4c, 0xa7, 0x9d, 0x47, 0x11, 0xc2, 0x58, + 0x81, 0x5d, 0x9e, 0x85, 0x5f, 0xc6, 0xe1, 0x73, 0xac, 0x37, 0xfa, 0x15, 0xc0, 0x4c, 0xcc, 0x0b, + 0x86, 0xae, 0x24, 0xca, 0x7c, 0x80, 0xe7, 0xcb, 0x5e, 0x7d, 0x86, 0x4a, 0xce, 0x07, 0xcf, 0x6f, + 0xff, 0xf6, 0xe7, 0x37, 0x83, 0xaf, 0xa0, 0x8b, 0xb2, 0x70, 0xa9, 0x81, 0x3b, 0x8d, 0x7b, 0x3b, + 0xd1, 0x83, 0x41, 0x88, 0xa2, 0xed, 0xd0, 0x52, 0x5a, 0x00, 0x3e, 0xf2, 0x2b, 0xe9, 0x0b, 0x05, + 0xf0, 0x6d, 0xc0, 0x90, 0xdf, 0x43, 0x77, 0xfb, 0x41, 0x2e, 0x7b, 0x63, 0x21, 0x6f, 0x06, 0x57, + 0xb3, 0x24, 0x06, 0x66, 0x2b, 0x30, 0xdb, 0xa1, 0x58, 0x77, 0x38, 0xb6, 0x64, 0xc7, 0x03, 0x6a, + 0x6a, 0x24, 0x1c, 0xf7, 0xd7, 0xb6, 0xd0, 0x3f, 0x00, 0x4e, 0xef, 0x6b, 0x46, 0x50, 0x31, 0xf5, + 0xd1, 0x44, 0xac, 0x59, 0xb6, 0xf4, 0x9f, 0x7a, 0x08, 0xbd, 0x6e, 0x31, 0xb9, 0xde, 0x41, 0x2b, + 0x7d, 0x1d, 0xb4, 0xaf, 0x57, 0x44, 0xa5, 0x90, 0x36, 0xe8, 0x6f, 0x00, 0x9f, 0xef, 0xb1, 0x26, + 0xa8, 0xb0, 0x3f, 0xd2, 0x38, 0x9f, 0x94, 0x5d, 0x4c, 0x55, 0x23, 0xd8, 0x7c, 0xc6, 0xd8, 0x7c, + 0x8a, 0x9a, 0x11, 0x36, 0xae, 0x97, 0x5f, 0x0e, 0xec, 0xcd, 0x11, 0x1d, 0xfc, 0x5f, 0x00, 0x8e, + 0x85, 0xad, 0x09, 0x5a, 0xe8, 0x83, 0x45, 0xaf, 0x4b, 0xca, 0x16, 0xd2, 0x94, 0x08, 0xde, 0x5b, + 0x8c, 0xf7, 0x27, 0xa8, 0x91, 0xc0, 0xdb, 0x77, 0x37, 0x47, 0x44, 0x7b, 0x67, 0x10, 0x8e, 0x3f, + 0x6d, 0x4b, 0xd0, 0xa5, 0x3e, 0x78, 0x44, 0x9d, 0x52, 0xf6, 0x72, 0xda, 0x32, 0x21, 0xc1, 0x7d, + 0xfe, 0xc3, 0xdf, 0x44, 0xad, 0x04, 0x0d, 0xc2, 0xee, 0xe6, 0x88, 0x74, 0x78, 0x02, 0x60, 0x26, + 0xc6, 0x56, 0x1c, 0x74, 0x85, 0x27, 0xfb, 0xa4, 0x83, 0xae, 0xf0, 0x7d, 0x3c, 0x0c, 0x5e, 0x65, + 0x7a, 0xbc, 0x87, 0xde, 0x8d, 0xe8, 0x11, 0x67, 0x5a, 0xe4, 0xcd, 0xa7, 0x8c, 0x53, 0xc2, 0x8f, + 0xfb, 0x67, 0x00, 0x51, 0xd4, 0x32, 0x1c, 0x74, 0xd3, 0x27, 0x5a, 0x9e, 0x83, 0x6e, 0xfa, 0x64, + 0x77, 0x82, 0x5f, 0x62, 0xfc, 0x72, 0x68, 0x2a, 0xc2, 0x2f, 0xf4, 0xd8, 0xa2, 0x47, 0x00, 0x9e, + 0x8e, 0x34, 0x41, 0x97, 0x53, 0xee, 0xea, 0xa3, 0x5d, 0x4a, 0x5d, 0x27, 0xc0, 0xde, 0x60, 0x60, + 0x8b, 0xe8, 0xda, 0x7e, 0x60, 0xfb, 0xb9, 0x5d, 0x8b, 0xef, 0x3f, 0xdc, 0xcd, 0x81, 0xc7, 0xbb, + 0x39, 0xf0, 0x64, 0x37, 0x07, 0xbe, 0xde, 0xcb, 0x0d, 0x3c, 0xde, 0xcb, 0x0d, 0xfc, 0xbe, 0x97, + 0x1b, 0xf8, 0xf0, 0x52, 0xd4, 0xae, 0x1b, 0x15, 0x6d, 0xbe, 0x46, 0xe5, 0xe6, 0xa2, 0xbc, 0x41, + 0xf5, 0x46, 0x9d, 0x38, 0x7c, 0xeb, 0xc2, 0xd5, 0x79, 0x6f, 0x77, 0xe6, 0xe0, 0x2b, 0xc7, 0xd9, + 0x3f, 0x91, 0x16, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x61, 0x8e, 0x05, 0x2f, 0x71, 0x13, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // IncentivizedPackets returns all incentivized packets and their associated fees + IncentivizedPackets(ctx context.Context, in *QueryIncentivizedPacketsRequest, opts ...grpc.CallOption) (*QueryIncentivizedPacketsResponse, error) + // IncentivizedPacket returns all packet fees for a packet given its identifier + IncentivizedPacket(ctx context.Context, in *QueryIncentivizedPacketRequest, opts ...grpc.CallOption) (*QueryIncentivizedPacketResponse, error) + // Gets all incentivized packets for a specific channel + IncentivizedPacketsForChannel(ctx context.Context, in *QueryIncentivizedPacketsForChannelRequest, opts ...grpc.CallOption) (*QueryIncentivizedPacketsForChannelResponse, error) + // TotalRecvFees returns the total receive fees for a packet given its identifier + TotalRecvFees(ctx context.Context, in *QueryTotalRecvFeesRequest, opts ...grpc.CallOption) (*QueryTotalRecvFeesResponse, error) + // TotalAckFees returns the total acknowledgement fees for a packet given its identifier + TotalAckFees(ctx context.Context, in *QueryTotalAckFeesRequest, opts ...grpc.CallOption) (*QueryTotalAckFeesResponse, error) + // TotalTimeoutFees returns the total timeout fees for a packet given its identifier + TotalTimeoutFees(ctx context.Context, in *QueryTotalTimeoutFeesRequest, opts ...grpc.CallOption) (*QueryTotalTimeoutFeesResponse, error) + // CounterpartyAddress returns the registered counterparty address for forward relaying + CounterpartyAddress(ctx context.Context, in *QueryCounterpartyAddressRequest, opts ...grpc.CallOption) (*QueryCounterpartyAddressResponse, error) + // FeeEnabledChannels returns a list of all fee enabled channels + FeeEnabledChannels(ctx context.Context, in *QueryFeeEnabledChannelsRequest, opts ...grpc.CallOption) (*QueryFeeEnabledChannelsResponse, error) + // FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel + FeeEnabledChannel(ctx context.Context, in *QueryFeeEnabledChannelRequest, opts ...grpc.CallOption) (*QueryFeeEnabledChannelResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) IncentivizedPackets(ctx context.Context, in *QueryIncentivizedPacketsRequest, opts ...grpc.CallOption) (*QueryIncentivizedPacketsResponse, error) { + out := new(QueryIncentivizedPacketsResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/IncentivizedPackets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IncentivizedPacket(ctx context.Context, in *QueryIncentivizedPacketRequest, opts ...grpc.CallOption) (*QueryIncentivizedPacketResponse, error) { + out := new(QueryIncentivizedPacketResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/IncentivizedPacket", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) IncentivizedPacketsForChannel(ctx context.Context, in *QueryIncentivizedPacketsForChannelRequest, opts ...grpc.CallOption) (*QueryIncentivizedPacketsForChannelResponse, error) { + out := new(QueryIncentivizedPacketsForChannelResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/IncentivizedPacketsForChannel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TotalRecvFees(ctx context.Context, in *QueryTotalRecvFeesRequest, opts ...grpc.CallOption) (*QueryTotalRecvFeesResponse, error) { + out := new(QueryTotalRecvFeesResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/TotalRecvFees", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TotalAckFees(ctx context.Context, in *QueryTotalAckFeesRequest, opts ...grpc.CallOption) (*QueryTotalAckFeesResponse, error) { + out := new(QueryTotalAckFeesResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/TotalAckFees", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TotalTimeoutFees(ctx context.Context, in *QueryTotalTimeoutFeesRequest, opts ...grpc.CallOption) (*QueryTotalTimeoutFeesResponse, error) { + out := new(QueryTotalTimeoutFeesResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/TotalTimeoutFees", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CounterpartyAddress(ctx context.Context, in *QueryCounterpartyAddressRequest, opts ...grpc.CallOption) (*QueryCounterpartyAddressResponse, error) { + out := new(QueryCounterpartyAddressResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/CounterpartyAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) FeeEnabledChannels(ctx context.Context, in *QueryFeeEnabledChannelsRequest, opts ...grpc.CallOption) (*QueryFeeEnabledChannelsResponse, error) { + out := new(QueryFeeEnabledChannelsResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/FeeEnabledChannels", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) FeeEnabledChannel(ctx context.Context, in *QueryFeeEnabledChannelRequest, opts ...grpc.CallOption) (*QueryFeeEnabledChannelResponse, error) { + out := new(QueryFeeEnabledChannelResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Query/FeeEnabledChannel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // IncentivizedPackets returns all incentivized packets and their associated fees + IncentivizedPackets(context.Context, *QueryIncentivizedPacketsRequest) (*QueryIncentivizedPacketsResponse, error) + // IncentivizedPacket returns all packet fees for a packet given its identifier + IncentivizedPacket(context.Context, *QueryIncentivizedPacketRequest) (*QueryIncentivizedPacketResponse, error) + // Gets all incentivized packets for a specific channel + IncentivizedPacketsForChannel(context.Context, *QueryIncentivizedPacketsForChannelRequest) (*QueryIncentivizedPacketsForChannelResponse, error) + // TotalRecvFees returns the total receive fees for a packet given its identifier + TotalRecvFees(context.Context, *QueryTotalRecvFeesRequest) (*QueryTotalRecvFeesResponse, error) + // TotalAckFees returns the total acknowledgement fees for a packet given its identifier + TotalAckFees(context.Context, *QueryTotalAckFeesRequest) (*QueryTotalAckFeesResponse, error) + // TotalTimeoutFees returns the total timeout fees for a packet given its identifier + TotalTimeoutFees(context.Context, *QueryTotalTimeoutFeesRequest) (*QueryTotalTimeoutFeesResponse, error) + // CounterpartyAddress returns the registered counterparty address for forward relaying + CounterpartyAddress(context.Context, *QueryCounterpartyAddressRequest) (*QueryCounterpartyAddressResponse, error) + // FeeEnabledChannels returns a list of all fee enabled channels + FeeEnabledChannels(context.Context, *QueryFeeEnabledChannelsRequest) (*QueryFeeEnabledChannelsResponse, error) + // FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel + FeeEnabledChannel(context.Context, *QueryFeeEnabledChannelRequest) (*QueryFeeEnabledChannelResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) IncentivizedPackets(ctx context.Context, req *QueryIncentivizedPacketsRequest) (*QueryIncentivizedPacketsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncentivizedPackets not implemented") +} +func (*UnimplementedQueryServer) IncentivizedPacket(ctx context.Context, req *QueryIncentivizedPacketRequest) (*QueryIncentivizedPacketResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncentivizedPacket not implemented") +} +func (*UnimplementedQueryServer) IncentivizedPacketsForChannel(ctx context.Context, req *QueryIncentivizedPacketsForChannelRequest) (*QueryIncentivizedPacketsForChannelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IncentivizedPacketsForChannel not implemented") +} +func (*UnimplementedQueryServer) TotalRecvFees(ctx context.Context, req *QueryTotalRecvFeesRequest) (*QueryTotalRecvFeesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalRecvFees not implemented") +} +func (*UnimplementedQueryServer) TotalAckFees(ctx context.Context, req *QueryTotalAckFeesRequest) (*QueryTotalAckFeesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalAckFees not implemented") +} +func (*UnimplementedQueryServer) TotalTimeoutFees(ctx context.Context, req *QueryTotalTimeoutFeesRequest) (*QueryTotalTimeoutFeesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalTimeoutFees not implemented") +} +func (*UnimplementedQueryServer) CounterpartyAddress(ctx context.Context, req *QueryCounterpartyAddressRequest) (*QueryCounterpartyAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CounterpartyAddress not implemented") +} +func (*UnimplementedQueryServer) FeeEnabledChannels(ctx context.Context, req *QueryFeeEnabledChannelsRequest) (*QueryFeeEnabledChannelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeeEnabledChannels not implemented") +} +func (*UnimplementedQueryServer) FeeEnabledChannel(ctx context.Context, req *QueryFeeEnabledChannelRequest) (*QueryFeeEnabledChannelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeeEnabledChannel not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_IncentivizedPackets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIncentivizedPacketsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IncentivizedPackets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/IncentivizedPackets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IncentivizedPackets(ctx, req.(*QueryIncentivizedPacketsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IncentivizedPacket_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIncentivizedPacketRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IncentivizedPacket(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/IncentivizedPacket", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IncentivizedPacket(ctx, req.(*QueryIncentivizedPacketRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_IncentivizedPacketsForChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryIncentivizedPacketsForChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).IncentivizedPacketsForChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/IncentivizedPacketsForChannel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).IncentivizedPacketsForChannel(ctx, req.(*QueryIncentivizedPacketsForChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalRecvFees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalRecvFeesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalRecvFees(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/TotalRecvFees", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalRecvFees(ctx, req.(*QueryTotalRecvFeesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalAckFees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalAckFeesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalAckFees(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/TotalAckFees", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalAckFees(ctx, req.(*QueryTotalAckFeesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalTimeoutFees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalTimeoutFeesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalTimeoutFees(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/TotalTimeoutFees", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalTimeoutFees(ctx, req.(*QueryTotalTimeoutFeesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CounterpartyAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCounterpartyAddressRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CounterpartyAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/CounterpartyAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CounterpartyAddress(ctx, req.(*QueryCounterpartyAddressRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_FeeEnabledChannels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFeeEnabledChannelsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FeeEnabledChannels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/FeeEnabledChannels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FeeEnabledChannels(ctx, req.(*QueryFeeEnabledChannelsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_FeeEnabledChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFeeEnabledChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FeeEnabledChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Query/FeeEnabledChannel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FeeEnabledChannel(ctx, req.(*QueryFeeEnabledChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.fee.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IncentivizedPackets", + Handler: _Query_IncentivizedPackets_Handler, + }, + { + MethodName: "IncentivizedPacket", + Handler: _Query_IncentivizedPacket_Handler, + }, + { + MethodName: "IncentivizedPacketsForChannel", + Handler: _Query_IncentivizedPacketsForChannel_Handler, + }, + { + MethodName: "TotalRecvFees", + Handler: _Query_TotalRecvFees_Handler, + }, + { + MethodName: "TotalAckFees", + Handler: _Query_TotalAckFees_Handler, + }, + { + MethodName: "TotalTimeoutFees", + Handler: _Query_TotalTimeoutFees_Handler, + }, + { + MethodName: "CounterpartyAddress", + Handler: _Query_CounterpartyAddress_Handler, + }, + { + MethodName: "FeeEnabledChannels", + Handler: _Query_FeeEnabledChannels_Handler, + }, + { + MethodName: "FeeEnabledChannel", + Handler: _Query_FeeEnabledChannel_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/fee/v1/query.proto", +} + +func (m *QueryIncentivizedPacketsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIncentivizedPacketsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizedPacketsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.QueryHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIncentivizedPacketsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIncentivizedPacketsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizedPacketsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.IncentivizedPackets) > 0 { + for iNdEx := len(m.IncentivizedPackets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IncentivizedPackets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryIncentivizedPacketRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIncentivizedPacketRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizedPacketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.QueryHeight)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryIncentivizedPacketResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIncentivizedPacketResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizedPacketResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.IncentivizedPacket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryIncentivizedPacketsForChannelRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIncentivizedPacketsForChannelRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizedPacketsForChannelRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.QueryHeight)) + i-- + dAtA[i] = 0x20 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0x12 + } + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryIncentivizedPacketsForChannelResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryIncentivizedPacketsForChannelResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryIncentivizedPacketsForChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.IncentivizedPackets) > 0 { + for iNdEx := len(m.IncentivizedPackets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IncentivizedPackets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTotalRecvFeesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalRecvFeesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalRecvFeesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryTotalRecvFeesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalRecvFeesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalRecvFeesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RecvFees) > 0 { + for iNdEx := len(m.RecvFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RecvFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTotalAckFeesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalAckFeesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalAckFeesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryTotalAckFeesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalAckFeesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalAckFeesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.AckFees) > 0 { + for iNdEx := len(m.AckFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AckFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryTotalTimeoutFeesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalTimeoutFeesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalTimeoutFeesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryTotalTimeoutFeesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalTimeoutFeesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalTimeoutFeesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TimeoutFees) > 0 { + for iNdEx := len(m.TimeoutFees) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TimeoutFees[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryCounterpartyAddressRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCounterpartyAddressRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCounterpartyAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RelayerAddress) > 0 { + i -= len(m.RelayerAddress) + copy(dAtA[i:], m.RelayerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RelayerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCounterpartyAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCounterpartyAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCounterpartyAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CounterpartyAddress) > 0 { + i -= len(m.CounterpartyAddress) + copy(dAtA[i:], m.CounterpartyAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.CounterpartyAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFeeEnabledChannelsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeEnabledChannelsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeEnabledChannelsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.QueryHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.QueryHeight)) + i-- + dAtA[i] = 0x10 + } + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFeeEnabledChannelsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeEnabledChannelsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeEnabledChannelsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeEnabledChannels) > 0 { + for iNdEx := len(m.FeeEnabledChannels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeEnabledChannels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryFeeEnabledChannelRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeEnabledChannelRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeEnabledChannelRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFeeEnabledChannelResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeEnabledChannelResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeEnabledChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FeeEnabled { + i-- + if m.FeeEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryIncentivizedPacketsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.QueryHeight != 0 { + n += 1 + sovQuery(uint64(m.QueryHeight)) + } + return n +} + +func (m *QueryIncentivizedPacketsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.IncentivizedPackets) > 0 { + for _, e := range m.IncentivizedPackets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryIncentivizedPacketRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PacketId.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.QueryHeight != 0 { + n += 1 + sovQuery(uint64(m.QueryHeight)) + } + return n +} + +func (m *QueryIncentivizedPacketResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.IncentivizedPacket.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryIncentivizedPacketsForChannelRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.QueryHeight != 0 { + n += 1 + sovQuery(uint64(m.QueryHeight)) + } + return n +} + +func (m *QueryIncentivizedPacketsForChannelResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.IncentivizedPackets) > 0 { + for _, e := range m.IncentivizedPackets { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryTotalRecvFeesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PacketId.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTotalRecvFeesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RecvFees) > 0 { + for _, e := range m.RecvFees { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryTotalAckFeesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PacketId.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTotalAckFeesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AckFees) > 0 { + for _, e := range m.AckFees { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryTotalTimeoutFeesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PacketId.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTotalTimeoutFeesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.TimeoutFees) > 0 { + for _, e := range m.TimeoutFees { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryCounterpartyAddressRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.RelayerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCounterpartyAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CounterpartyAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFeeEnabledChannelsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.QueryHeight != 0 { + n += 1 + sovQuery(uint64(m.QueryHeight)) + } + return n +} + +func (m *QueryFeeEnabledChannelsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FeeEnabledChannels) > 0 { + for _, e := range m.FeeEnabledChannels { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryFeeEnabledChannelRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFeeEnabledChannelResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FeeEnabled { + n += 2 + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryIncentivizedPacketsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIncentivizedPacketsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizedPacketsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryHeight", wireType) + } + m.QueryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizedPacketsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIncentivizedPacketsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizedPacketsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncentivizedPackets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncentivizedPackets = append(m.IncentivizedPackets, IdentifiedPacketFees{}) + if err := m.IncentivizedPackets[len(m.IncentivizedPackets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizedPacketRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIncentivizedPacketRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizedPacketRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryHeight", wireType) + } + m.QueryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizedPacketResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIncentivizedPacketResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizedPacketResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncentivizedPacket", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.IncentivizedPacket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizedPacketsForChannelRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIncentivizedPacketsForChannelRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizedPacketsForChannelRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryHeight", wireType) + } + m.QueryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryIncentivizedPacketsForChannelResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryIncentivizedPacketsForChannelResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryIncentivizedPacketsForChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IncentivizedPackets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IncentivizedPackets = append(m.IncentivizedPackets, &IdentifiedPacketFees{}) + if err := m.IncentivizedPackets[len(m.IncentivizedPackets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalRecvFeesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalRecvFeesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalRecvFeesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalRecvFeesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalRecvFeesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalRecvFeesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecvFees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RecvFees = append(m.RecvFees, types1.Coin{}) + if err := m.RecvFees[len(m.RecvFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalAckFeesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalAckFeesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalAckFeesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalAckFeesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalAckFeesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalAckFeesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AckFees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AckFees = append(m.AckFees, types1.Coin{}) + if err := m.AckFees[len(m.AckFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalTimeoutFeesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalTimeoutFeesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalTimeoutFeesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalTimeoutFeesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalTimeoutFeesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalTimeoutFeesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutFees", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TimeoutFees = append(m.TimeoutFees, types1.Coin{}) + if err := m.TimeoutFees[len(m.TimeoutFees)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCounterpartyAddressRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCounterpartyAddressRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCounterpartyAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RelayerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RelayerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCounterpartyAddressResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCounterpartyAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCounterpartyAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeeEnabledChannelsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeEnabledChannelsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeEnabledChannelsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryHeight", wireType) + } + m.QueryHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.QueryHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeeEnabledChannelsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeEnabledChannelsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeEnabledChannelsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabledChannels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeEnabledChannels = append(m.FeeEnabledChannels, FeeEnabledChannel{}) + if err := m.FeeEnabledChannels[len(m.FeeEnabledChannels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeeEnabledChannelRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeEnabledChannelRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeEnabledChannelRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeeEnabledChannelResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeEnabledChannelResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeEnabledChannelResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FeeEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/apps/29-fee/types/query.pb.gw.go b/modules/apps/29-fee/types/query.pb.gw.go new file mode 100644 index 00000000000..9b9e47c5939 --- /dev/null +++ b/modules/apps/29-fee/types/query.pb.gw.go @@ -0,0 +1,1264 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: ibc/applications/fee/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +var ( + filter_Query_IncentivizedPackets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_IncentivizedPackets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizedPacketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizedPackets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.IncentivizedPackets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IncentivizedPackets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizedPacketsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizedPackets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.IncentivizedPackets(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_IncentivizedPacket_0 = &utilities.DoubleArray{Encoding: map[string]int{"packet_id": 0, "port_id": 1, "channel_id": 2, "sequence": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Query_IncentivizedPacket_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizedPacketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizedPacket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.IncentivizedPacket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IncentivizedPacket_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizedPacketRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizedPacket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.IncentivizedPacket(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_IncentivizedPacketsForChannel_0 = &utilities.DoubleArray{Encoding: map[string]int{"port_id": 0, "channel_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_IncentivizedPacketsForChannel_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizedPacketsForChannelRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id") + } + + protoReq.PortId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err) + } + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizedPacketsForChannel_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.IncentivizedPacketsForChannel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_IncentivizedPacketsForChannel_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryIncentivizedPacketsForChannelRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id") + } + + protoReq.PortId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err) + } + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_IncentivizedPacketsForChannel_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.IncentivizedPacketsForChannel(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_TotalRecvFees_0 = &utilities.DoubleArray{Encoding: map[string]int{"packet_id": 0, "port_id": 1, "channel_id": 2, "sequence": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Query_TotalRecvFees_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalRecvFeesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalRecvFees_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TotalRecvFees(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalRecvFees_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalRecvFeesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalRecvFees_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TotalRecvFees(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_TotalAckFees_0 = &utilities.DoubleArray{Encoding: map[string]int{"packet_id": 0, "port_id": 1, "channel_id": 2, "sequence": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Query_TotalAckFees_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalAckFeesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalAckFees_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TotalAckFees(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalAckFees_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalAckFeesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalAckFees_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TotalAckFees(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_TotalTimeoutFees_0 = &utilities.DoubleArray{Encoding: map[string]int{"packet_id": 0, "port_id": 1, "channel_id": 2, "sequence": 3}, Base: []int{1, 1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 2, 2, 2, 3, 4, 5}} +) + +func request_Query_TotalTimeoutFees_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalTimeoutFeesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalTimeoutFees_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TotalTimeoutFees(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalTimeoutFees_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalTimeoutFeesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["packet_id.port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.port_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.port_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.port_id", err) + } + + val, ok = pathParams["packet_id.channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.channel_id") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.channel_id", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.channel_id", err) + } + + val, ok = pathParams["packet_id.sequence"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "packet_id.sequence") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "packet_id.sequence", val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "packet_id.sequence", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TotalTimeoutFees_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TotalTimeoutFees(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_CounterpartyAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCounterpartyAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["relayer_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "relayer_address") + } + + protoReq.RelayerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "relayer_address", err) + } + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := client.CounterpartyAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CounterpartyAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCounterpartyAddressRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["relayer_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "relayer_address") + } + + protoReq.RelayerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "relayer_address", err) + } + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := server.CounterpartyAddress(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_FeeEnabledChannels_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_FeeEnabledChannels_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeEnabledChannelsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FeeEnabledChannels_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FeeEnabledChannels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FeeEnabledChannels_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeEnabledChannelsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FeeEnabledChannels_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.FeeEnabledChannels(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_FeeEnabledChannel_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeEnabledChannelRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id") + } + + protoReq.PortId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err) + } + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := client.FeeEnabledChannel(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FeeEnabledChannel_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeEnabledChannelRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["port_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "port_id") + } + + protoReq.PortId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "port_id", err) + } + + val, ok = pathParams["channel_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "channel_id") + } + + protoReq.ChannelId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "channel_id", err) + } + + msg, err := server.FeeEnabledChannel(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_IncentivizedPackets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IncentivizedPackets_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizedPackets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IncentivizedPacket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IncentivizedPacket_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizedPacket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IncentivizedPacketsForChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_IncentivizedPacketsForChannel_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizedPacketsForChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalRecvFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalRecvFees_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalRecvFees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalAckFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalAckFees_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalAckFees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalTimeoutFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalTimeoutFees_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalTimeoutFees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CounterpartyAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CounterpartyAddress_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CounterpartyAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FeeEnabledChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_FeeEnabledChannels_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeEnabledChannels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FeeEnabledChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_FeeEnabledChannel_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeEnabledChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_IncentivizedPackets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IncentivizedPackets_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizedPackets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IncentivizedPacket_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IncentivizedPacket_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizedPacket_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_IncentivizedPacketsForChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_IncentivizedPacketsForChannel_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_IncentivizedPacketsForChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalRecvFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TotalRecvFees_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalRecvFees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalAckFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TotalAckFees_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalAckFees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalTimeoutFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TotalTimeoutFees_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalTimeoutFees_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CounterpartyAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CounterpartyAddress_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CounterpartyAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FeeEnabledChannels_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_FeeEnabledChannels_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeEnabledChannels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FeeEnabledChannel_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_FeeEnabledChannel_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeEnabledChannel_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_IncentivizedPackets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "apps", "fee", "v1", "incentivized_packets"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_IncentivizedPacket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9, 1, 0, 4, 1, 5, 10}, []string{"ibc", "apps", "fee", "v1", "incentivized_packet", "port", "packet_id.port_id", "channel", "packet_id.channel_id", "sequence", "packet_id.sequence"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_IncentivizedPacketsForChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"ibc", "apps", "fee", "v1", "incentivized_packets", "port", "port_id", "channel", "channel_id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_TotalRecvFees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9, 1, 0, 4, 1, 5, 10}, []string{"ibc", "apps", "fee", "v1", "total_recv_fees", "port", "packet_id.port_id", "channel", "packet_id.channel_id", "sequence", "packet_id.sequence"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_TotalAckFees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9, 1, 0, 4, 1, 5, 10}, []string{"ibc", "apps", "fee", "v1", "total_ack_fees", "port", "packet_id.port_id", "channel", "packet_id.channel_id", "sequence", "packet_id.sequence"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_TotalTimeoutFees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9, 1, 0, 4, 1, 5, 10}, []string{"ibc", "apps", "fee", "v1", "total_timeout_fees", "port", "packet_id.port_id", "channel", "packet_id.channel_id", "sequence", "packet_id.sequence"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_CounterpartyAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6, 1, 0, 4, 1, 5, 7}, []string{"ibc", "apps", "fee", "v1", "counterparty_address", "relayer_address", "channel", "channel_id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_FeeEnabledChannels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"ibc", "apps", "fee", "v1", "fee_enabled"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_FeeEnabledChannel_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"ibc", "apps", "fee", "v1", "fee_enabled", "port", "port_id", "channel", "channel_id"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_IncentivizedPackets_0 = runtime.ForwardResponseMessage + + forward_Query_IncentivizedPacket_0 = runtime.ForwardResponseMessage + + forward_Query_IncentivizedPacketsForChannel_0 = runtime.ForwardResponseMessage + + forward_Query_TotalRecvFees_0 = runtime.ForwardResponseMessage + + forward_Query_TotalAckFees_0 = runtime.ForwardResponseMessage + + forward_Query_TotalTimeoutFees_0 = runtime.ForwardResponseMessage + + forward_Query_CounterpartyAddress_0 = runtime.ForwardResponseMessage + + forward_Query_FeeEnabledChannels_0 = runtime.ForwardResponseMessage + + forward_Query_FeeEnabledChannel_0 = runtime.ForwardResponseMessage +) diff --git a/modules/apps/29-fee/types/tx.pb.go b/modules/apps/29-fee/types/tx.pb.go new file mode 100644 index 00000000000..1cecc607dc9 --- /dev/null +++ b/modules/apps/29-fee/types/tx.pb.go @@ -0,0 +1,1544 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/fee/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgRegisterCounterpartyAddress defines the request type for the RegisterCounterpartyAddress rpc +type MsgRegisterCounterpartyAddress struct { + // the relayer address + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // the counterparty relayer address + CounterpartyAddress string `protobuf:"bytes,2,opt,name=counterparty_address,json=counterpartyAddress,proto3" json:"counterparty_address,omitempty" yaml:"counterparty_address"` + // unique channel identifier + ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` +} + +func (m *MsgRegisterCounterpartyAddress) Reset() { *m = MsgRegisterCounterpartyAddress{} } +func (m *MsgRegisterCounterpartyAddress) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterCounterpartyAddress) ProtoMessage() {} +func (*MsgRegisterCounterpartyAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_05c93128649f1b96, []int{0} +} +func (m *MsgRegisterCounterpartyAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterCounterpartyAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterCounterpartyAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterCounterpartyAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterCounterpartyAddress.Merge(m, src) +} +func (m *MsgRegisterCounterpartyAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterCounterpartyAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterCounterpartyAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterCounterpartyAddress proto.InternalMessageInfo + +// MsgRegisterCounterpartyAddressResponse defines the response type for the RegisterCounterpartyAddress rpc +type MsgRegisterCounterpartyAddressResponse struct { +} + +func (m *MsgRegisterCounterpartyAddressResponse) Reset() { + *m = MsgRegisterCounterpartyAddressResponse{} +} +func (m *MsgRegisterCounterpartyAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterCounterpartyAddressResponse) ProtoMessage() {} +func (*MsgRegisterCounterpartyAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_05c93128649f1b96, []int{1} +} +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterCounterpartyAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterCounterpartyAddressResponse.Merge(m, src) +} +func (m *MsgRegisterCounterpartyAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterCounterpartyAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterCounterpartyAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterCounterpartyAddressResponse proto.InternalMessageInfo + +// MsgPayPacketFee defines the request type for the PayPacketFee rpc +// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be +// paid for +type MsgPayPacketFee struct { + // fee encapsulates the recv, ack and timeout fees associated with an IBC packet + Fee Fee `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee"` + // the source port unique identifier + SourcePortId string `protobuf:"bytes,2,opt,name=source_port_id,json=sourcePortId,proto3" json:"source_port_id,omitempty" yaml:"source_port_id"` + // the source channel unique identifer + SourceChannelId string `protobuf:"bytes,3,opt,name=source_channel_id,json=sourceChannelId,proto3" json:"source_channel_id,omitempty" yaml:"source_channel_id"` + // account address to refund fee if necessary + Signer string `protobuf:"bytes,4,opt,name=signer,proto3" json:"signer,omitempty"` + // optional list of relayers permitted to the receive packet fees + Relayers []string `protobuf:"bytes,5,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *MsgPayPacketFee) Reset() { *m = MsgPayPacketFee{} } +func (m *MsgPayPacketFee) String() string { return proto.CompactTextString(m) } +func (*MsgPayPacketFee) ProtoMessage() {} +func (*MsgPayPacketFee) Descriptor() ([]byte, []int) { + return fileDescriptor_05c93128649f1b96, []int{2} +} +func (m *MsgPayPacketFee) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPayPacketFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPayPacketFee.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPayPacketFee) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayPacketFee.Merge(m, src) +} +func (m *MsgPayPacketFee) XXX_Size() int { + return m.Size() +} +func (m *MsgPayPacketFee) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayPacketFee.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPayPacketFee proto.InternalMessageInfo + +// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc +type MsgPayPacketFeeResponse struct { +} + +func (m *MsgPayPacketFeeResponse) Reset() { *m = MsgPayPacketFeeResponse{} } +func (m *MsgPayPacketFeeResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPayPacketFeeResponse) ProtoMessage() {} +func (*MsgPayPacketFeeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_05c93128649f1b96, []int{3} +} +func (m *MsgPayPacketFeeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPayPacketFeeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPayPacketFeeResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPayPacketFeeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayPacketFeeResponse.Merge(m, src) +} +func (m *MsgPayPacketFeeResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPayPacketFeeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayPacketFeeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPayPacketFeeResponse proto.InternalMessageInfo + +// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc +// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) +type MsgPayPacketFeeAsync struct { + // unique packet identifier comprised of the channel ID, port ID and sequence + PacketId types.PacketId `protobuf:"bytes,1,opt,name=packet_id,json=packetId,proto3" json:"packet_id" yaml:"packet_id"` + // the packet fee associated with a particular IBC packet + PacketFee PacketFee `protobuf:"bytes,2,opt,name=packet_fee,json=packetFee,proto3" json:"packet_fee" yaml:"packet_fee"` +} + +func (m *MsgPayPacketFeeAsync) Reset() { *m = MsgPayPacketFeeAsync{} } +func (m *MsgPayPacketFeeAsync) String() string { return proto.CompactTextString(m) } +func (*MsgPayPacketFeeAsync) ProtoMessage() {} +func (*MsgPayPacketFeeAsync) Descriptor() ([]byte, []int) { + return fileDescriptor_05c93128649f1b96, []int{4} +} +func (m *MsgPayPacketFeeAsync) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPayPacketFeeAsync) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPayPacketFeeAsync.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPayPacketFeeAsync) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayPacketFeeAsync.Merge(m, src) +} +func (m *MsgPayPacketFeeAsync) XXX_Size() int { + return m.Size() +} +func (m *MsgPayPacketFeeAsync) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayPacketFeeAsync.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPayPacketFeeAsync proto.InternalMessageInfo + +// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc +type MsgPayPacketFeeAsyncResponse struct { +} + +func (m *MsgPayPacketFeeAsyncResponse) Reset() { *m = MsgPayPacketFeeAsyncResponse{} } +func (m *MsgPayPacketFeeAsyncResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPayPacketFeeAsyncResponse) ProtoMessage() {} +func (*MsgPayPacketFeeAsyncResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_05c93128649f1b96, []int{5} +} +func (m *MsgPayPacketFeeAsyncResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPayPacketFeeAsyncResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPayPacketFeeAsyncResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgPayPacketFeeAsyncResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayPacketFeeAsyncResponse.Merge(m, src) +} +func (m *MsgPayPacketFeeAsyncResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPayPacketFeeAsyncResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayPacketFeeAsyncResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPayPacketFeeAsyncResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgRegisterCounterpartyAddress)(nil), "ibc.applications.fee.v1.MsgRegisterCounterpartyAddress") + proto.RegisterType((*MsgRegisterCounterpartyAddressResponse)(nil), "ibc.applications.fee.v1.MsgRegisterCounterpartyAddressResponse") + proto.RegisterType((*MsgPayPacketFee)(nil), "ibc.applications.fee.v1.MsgPayPacketFee") + proto.RegisterType((*MsgPayPacketFeeResponse)(nil), "ibc.applications.fee.v1.MsgPayPacketFeeResponse") + proto.RegisterType((*MsgPayPacketFeeAsync)(nil), "ibc.applications.fee.v1.MsgPayPacketFeeAsync") + proto.RegisterType((*MsgPayPacketFeeAsyncResponse)(nil), "ibc.applications.fee.v1.MsgPayPacketFeeAsyncResponse") +} + +func init() { proto.RegisterFile("ibc/applications/fee/v1/tx.proto", fileDescriptor_05c93128649f1b96) } + +var fileDescriptor_05c93128649f1b96 = []byte{ + // 630 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x4d, 0x4f, 0xdb, 0x40, + 0x10, 0x8d, 0x09, 0xa5, 0x64, 0x8b, 0x4a, 0xb3, 0x85, 0x62, 0x0c, 0xb5, 0xa9, 0x0f, 0x55, 0x2e, + 0xd8, 0xe5, 0x4b, 0x55, 0xb9, 0x20, 0x82, 0x84, 0xca, 0x01, 0x15, 0x59, 0x3d, 0x55, 0x95, 0x90, + 0xb3, 0x9e, 0x18, 0xb7, 0x89, 0xd7, 0xda, 0x75, 0xa2, 0xfa, 0x0f, 0x54, 0x3d, 0x72, 0xeb, 0x95, + 0x9f, 0xc3, 0xa9, 0xe2, 0xd0, 0x43, 0x4f, 0x56, 0x05, 0x97, 0x9e, 0xf3, 0x0b, 0xaa, 0xf5, 0x97, + 0x1c, 0x48, 0x22, 0xda, 0x9b, 0x77, 0xe6, 0xcd, 0xdb, 0x37, 0x6f, 0xc6, 0x8b, 0xd6, 0xbc, 0x16, + 0x31, 0xed, 0x20, 0xe8, 0x78, 0xc4, 0x0e, 0x3d, 0xea, 0x73, 0xb3, 0x0d, 0x60, 0xf6, 0x37, 0xcc, + 0xf0, 0x8b, 0x11, 0x30, 0x1a, 0x52, 0xbc, 0xe4, 0xb5, 0x88, 0x51, 0x46, 0x18, 0x6d, 0x00, 0xa3, + 0xbf, 0xa1, 0x2c, 0xb8, 0xd4, 0xa5, 0x09, 0xc6, 0x14, 0x5f, 0x29, 0x5c, 0x79, 0x31, 0x8e, 0x50, + 0x54, 0x95, 0x20, 0x84, 0x32, 0x30, 0xc9, 0x99, 0xed, 0xfb, 0xd0, 0x11, 0xe9, 0xec, 0x33, 0x85, + 0xe8, 0x3f, 0x24, 0xa4, 0x1e, 0x73, 0xd7, 0x02, 0xd7, 0xe3, 0x21, 0xb0, 0x03, 0xda, 0xf3, 0x43, + 0x60, 0x81, 0xcd, 0xc2, 0x68, 0xdf, 0x71, 0x18, 0x70, 0x8e, 0x65, 0xf4, 0xd0, 0x4e, 0x3f, 0x65, + 0x69, 0x4d, 0x6a, 0xd4, 0xac, 0xfc, 0x88, 0x2d, 0xb4, 0x40, 0x4a, 0x05, 0xa7, 0x39, 0x6c, 0x4a, + 0xc0, 0x9a, 0xda, 0x20, 0xd6, 0x56, 0x22, 0xbb, 0xdb, 0xd9, 0xd5, 0x47, 0xa1, 0x74, 0xeb, 0x29, + 0x19, 0x71, 0xdb, 0x36, 0x42, 0x99, 0xc2, 0x53, 0xcf, 0x91, 0xab, 0x09, 0xd3, 0xe2, 0x20, 0xd6, + 0xea, 0x19, 0x53, 0x91, 0xd3, 0xad, 0x5a, 0x76, 0x38, 0x72, 0x76, 0x67, 0xbf, 0x5d, 0x68, 0x95, + 0x3f, 0x17, 0x5a, 0x45, 0x6f, 0xa0, 0x97, 0x93, 0xfb, 0xb1, 0x80, 0x07, 0xd4, 0xe7, 0xa0, 0x9f, + 0x4f, 0xa1, 0xf9, 0x63, 0xee, 0x9e, 0xd8, 0xd1, 0x89, 0x4d, 0x3e, 0x43, 0x78, 0x08, 0x80, 0xb7, + 0x51, 0xb5, 0x0d, 0x90, 0xf4, 0xf9, 0x68, 0x73, 0xd5, 0x18, 0x33, 0x11, 0xe3, 0x10, 0xa0, 0x39, + 0x7d, 0x19, 0x6b, 0x15, 0x4b, 0xc0, 0xf1, 0x1e, 0x7a, 0xcc, 0x69, 0x8f, 0x11, 0x38, 0x0d, 0x28, + 0x0b, 0x85, 0xee, 0xd4, 0x81, 0xe5, 0x41, 0xac, 0x2d, 0xa6, 0xba, 0x87, 0xf3, 0xba, 0x35, 0x97, + 0x06, 0x4e, 0x28, 0x0b, 0x8f, 0x1c, 0xfc, 0x16, 0xd5, 0x33, 0xc0, 0x9d, 0xde, 0x57, 0x07, 0xb1, + 0x26, 0x0f, 0x71, 0x94, 0x2d, 0x98, 0x4f, 0x63, 0x07, 0xb9, 0x11, 0xf8, 0x19, 0x9a, 0xe1, 0x9e, + 0xeb, 0x03, 0x93, 0xa7, 0x93, 0x59, 0x65, 0x27, 0xac, 0xa0, 0x59, 0x06, 0x1d, 0x3b, 0x02, 0xc6, + 0xe5, 0x07, 0x6b, 0xd5, 0x46, 0xcd, 0x2a, 0xce, 0x25, 0xf3, 0x96, 0xd1, 0xd2, 0x2d, 0x47, 0x0a, + 0xb7, 0x7e, 0x4a, 0x68, 0xe1, 0x56, 0x6e, 0x9f, 0x47, 0x3e, 0xc1, 0xef, 0x51, 0x2d, 0x48, 0x22, + 0x42, 0x73, 0x6a, 0xdc, 0xf3, 0xc4, 0x38, 0xb1, 0x78, 0x46, 0xbe, 0x6d, 0xfd, 0x0d, 0x23, 0xad, + 0x3b, 0x72, 0x9a, 0xb2, 0x70, 0x6e, 0x10, 0x6b, 0x4f, 0xd2, 0xb6, 0x8a, 0x6a, 0xdd, 0x9a, 0x0d, + 0x32, 0x0c, 0xfe, 0x88, 0x50, 0x16, 0x17, 0xf3, 0x98, 0x4a, 0x68, 0xf5, 0xb1, 0xf3, 0x28, 0x24, + 0x35, 0x97, 0x33, 0xee, 0xfa, 0x10, 0x77, 0x1b, 0x40, 0xb7, 0x32, 0x99, 0x87, 0x00, 0xa5, 0x8e, + 0x55, 0xb4, 0x3a, 0xaa, 0xab, 0xbc, 0xed, 0xcd, 0xaf, 0x55, 0x54, 0x3d, 0xe6, 0x2e, 0xfe, 0x2e, + 0xa1, 0x95, 0x49, 0x3f, 0xc9, 0xeb, 0xb1, 0xda, 0x26, 0x6f, 0xa3, 0xb2, 0xf7, 0x9f, 0x85, 0xb9, + 0x42, 0xfc, 0x09, 0xcd, 0x0d, 0xad, 0x70, 0x63, 0x12, 0x61, 0x19, 0xa9, 0xbc, 0xba, 0x2f, 0xb2, + 0xb8, 0x2b, 0x42, 0xf5, 0xbb, 0x0b, 0xb0, 0x7e, 0x5f, 0x9a, 0x04, 0xae, 0xec, 0xfc, 0x13, 0x3c, + 0xbf, 0xba, 0xf9, 0xee, 0xf2, 0x5a, 0x95, 0xae, 0xae, 0x55, 0xe9, 0xf7, 0xb5, 0x2a, 0x9d, 0xdf, + 0xa8, 0x95, 0xab, 0x1b, 0xb5, 0xf2, 0xeb, 0x46, 0xad, 0x7c, 0xd8, 0x71, 0xbd, 0xf0, 0xac, 0xd7, + 0x32, 0x08, 0xed, 0x9a, 0x84, 0xf2, 0x2e, 0xe5, 0xa6, 0xd7, 0x22, 0xeb, 0x2e, 0x35, 0xfb, 0x5b, + 0x66, 0x97, 0x3a, 0xbd, 0x0e, 0x70, 0xf1, 0x50, 0x72, 0x73, 0xf3, 0xcd, 0xba, 0x78, 0x23, 0xc3, + 0x28, 0x00, 0xde, 0x9a, 0x49, 0x1e, 0xc0, 0xad, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xf7, + 0x58, 0xab, 0x99, 0x05, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress + // RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their + // counterparty address before relaying. This ensures they will be properly compensated for forward relaying since + // destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function + // may be called more than once by a relayer, in which case, latest counterparty address is always used. + RegisterCounterpartyAddress(ctx context.Context, in *MsgRegisterCounterpartyAddress, opts ...grpc.CallOption) (*MsgRegisterCounterpartyAddressResponse, error) + // PayPacketFee defines a rpc handler method for MsgPayPacketFee + // PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of the packet at the next sequence + // NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows + // initiates the lifecycle of the incentivized packet + PayPacketFee(ctx context.Context, in *MsgPayPacketFee, opts ...grpc.CallOption) (*MsgPayPacketFeeResponse, error) + // PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync + // PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of a known packet (i.e. at a particular sequence) + PayPacketFeeAsync(ctx context.Context, in *MsgPayPacketFeeAsync, opts ...grpc.CallOption) (*MsgPayPacketFeeAsyncResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) RegisterCounterpartyAddress(ctx context.Context, in *MsgRegisterCounterpartyAddress, opts ...grpc.CallOption) (*MsgRegisterCounterpartyAddressResponse, error) { + out := new(MsgRegisterCounterpartyAddressResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Msg/RegisterCounterpartyAddress", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) PayPacketFee(ctx context.Context, in *MsgPayPacketFee, opts ...grpc.CallOption) (*MsgPayPacketFeeResponse, error) { + out := new(MsgPayPacketFeeResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Msg/PayPacketFee", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) PayPacketFeeAsync(ctx context.Context, in *MsgPayPacketFeeAsync, opts ...grpc.CallOption) (*MsgPayPacketFeeAsyncResponse, error) { + out := new(MsgPayPacketFeeAsyncResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.fee.v1.Msg/PayPacketFeeAsync", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress + // RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their + // counterparty address before relaying. This ensures they will be properly compensated for forward relaying since + // destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function + // may be called more than once by a relayer, in which case, latest counterparty address is always used. + RegisterCounterpartyAddress(context.Context, *MsgRegisterCounterpartyAddress) (*MsgRegisterCounterpartyAddressResponse, error) + // PayPacketFee defines a rpc handler method for MsgPayPacketFee + // PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of the packet at the next sequence + // NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows + // initiates the lifecycle of the incentivized packet + PayPacketFee(context.Context, *MsgPayPacketFee) (*MsgPayPacketFeeResponse, error) + // PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync + // PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of a known packet (i.e. at a particular sequence) + PayPacketFeeAsync(context.Context, *MsgPayPacketFeeAsync) (*MsgPayPacketFeeAsyncResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) RegisterCounterpartyAddress(ctx context.Context, req *MsgRegisterCounterpartyAddress) (*MsgRegisterCounterpartyAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterCounterpartyAddress not implemented") +} +func (*UnimplementedMsgServer) PayPacketFee(ctx context.Context, req *MsgPayPacketFee) (*MsgPayPacketFeeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayPacketFee not implemented") +} +func (*UnimplementedMsgServer) PayPacketFeeAsync(ctx context.Context, req *MsgPayPacketFeeAsync) (*MsgPayPacketFeeAsyncResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayPacketFeeAsync not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_RegisterCounterpartyAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterCounterpartyAddress) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterCounterpartyAddress(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Msg/RegisterCounterpartyAddress", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterCounterpartyAddress(ctx, req.(*MsgRegisterCounterpartyAddress)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_PayPacketFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPayPacketFee) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PayPacketFee(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Msg/PayPacketFee", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PayPacketFee(ctx, req.(*MsgPayPacketFee)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_PayPacketFeeAsync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgPayPacketFeeAsync) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PayPacketFeeAsync(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.fee.v1.Msg/PayPacketFeeAsync", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PayPacketFeeAsync(ctx, req.(*MsgPayPacketFeeAsync)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.fee.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RegisterCounterpartyAddress", + Handler: _Msg_RegisterCounterpartyAddress_Handler, + }, + { + MethodName: "PayPacketFee", + Handler: _Msg_PayPacketFee_Handler, + }, + { + MethodName: "PayPacketFeeAsync", + Handler: _Msg_PayPacketFeeAsync_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/fee/v1/tx.proto", +} + +func (m *MsgRegisterCounterpartyAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterCounterpartyAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterCounterpartyAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.CounterpartyAddress) > 0 { + i -= len(m.CounterpartyAddress) + copy(dAtA[i:], m.CounterpartyAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.CounterpartyAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterCounterpartyAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRegisterCounterpartyAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterCounterpartyAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPayPacketFee) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPayPacketFee) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPayPacketFee) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x22 + } + if len(m.SourceChannelId) > 0 { + i -= len(m.SourceChannelId) + copy(dAtA[i:], m.SourceChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourceChannelId))) + i-- + dAtA[i] = 0x1a + } + if len(m.SourcePortId) > 0 { + i -= len(m.SourcePortId) + copy(dAtA[i:], m.SourcePortId) + i = encodeVarintTx(dAtA, i, uint64(len(m.SourcePortId))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgPayPacketFeeResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPayPacketFeeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPayPacketFeeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgPayPacketFeeAsync) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPayPacketFeeAsync) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPayPacketFeeAsync) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PacketFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.PacketId.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *MsgPayPacketFeeAsyncResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgPayPacketFeeAsyncResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPayPacketFeeAsyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgRegisterCounterpartyAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.CounterpartyAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterCounterpartyAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPayPacketFee) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Fee.Size() + n += 1 + l + sovTx(uint64(l)) + l = len(m.SourcePortId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SourceChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgPayPacketFeeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgPayPacketFeeAsync) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.PacketId.Size() + n += 1 + l + sovTx(uint64(l)) + l = m.PacketFee.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgPayPacketFeeAsyncResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgRegisterCounterpartyAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRegisterCounterpartyAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterCounterpartyAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CounterpartyAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CounterpartyAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRegisterCounterpartyAddressResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRegisterCounterpartyAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterCounterpartyAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPayPacketFee) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPayPacketFee: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPayPacketFee: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPayPacketFeeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPayPacketFeeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPayPacketFeeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPayPacketFeeAsync) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPayPacketFeeAsync: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPayPacketFeeAsync: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketId", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PacketFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPayPacketFeeAsyncResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgPayPacketFeeAsyncResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPayPacketFeeAsyncResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/apps/transfer/ibc_module_test.go b/modules/apps/transfer/ibc_module_test.go index 92d0f30d4c7..3dcb5518cbb 100644 --- a/modules/apps/transfer/ibc_module_test.go +++ b/modules/apps/transfer/ibc_module_test.go @@ -13,9 +13,10 @@ import ( func (suite *TransferTestSuite) TestOnChanOpenInit() { var ( - channel *channeltypes.Channel - path *ibctesting.Path - chanCap *capabilitytypes.Capability + channel *channeltypes.Channel + path *ibctesting.Path + chanCap *capabilitytypes.Capability + counterparty channeltypes.Counterparty ) testCases := []struct { @@ -64,7 +65,7 @@ func (suite *TransferTestSuite) TestOnChanOpenInit() { suite.coordinator.SetupConnections(path) path.EndpointA.ChannelID = ibctesting.FirstChannelID - counterparty := channeltypes.NewCounterparty(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) + counterparty = channeltypes.NewCounterparty(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) channel = &channeltypes.Channel{ State: channeltypes.INIT, Ordering: channeltypes.UNORDERED, @@ -85,7 +86,7 @@ func (suite *TransferTestSuite) TestOnChanOpenInit() { tc.malleate() // explicitly change fields in channel and testChannel err = cbs.OnChanOpenInit(suite.chainA.GetContext(), channel.Ordering, channel.GetConnectionHops(), - path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, chanCap, channel.Counterparty, channel.GetVersion(), + path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, chanCap, counterparty, channel.GetVersion(), ) if tc.expPass { @@ -103,6 +104,7 @@ func (suite *TransferTestSuite) TestOnChanOpenTry() { channel *channeltypes.Channel chanCap *capabilitytypes.Capability path *ibctesting.Path + counterparty channeltypes.Counterparty counterpartyVersion string ) @@ -153,7 +155,7 @@ func (suite *TransferTestSuite) TestOnChanOpenTry() { suite.coordinator.SetupConnections(path) path.EndpointA.ChannelID = ibctesting.FirstChannelID - counterparty := channeltypes.NewCounterparty(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) + counterparty = channeltypes.NewCounterparty(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID) channel = &channeltypes.Channel{ State: channeltypes.TRYOPEN, Ordering: channeltypes.UNORDERED, diff --git a/modules/apps/transfer/keeper/genesis.go b/modules/apps/transfer/keeper/genesis.go index 35bbd231a59..d4020508cc9 100644 --- a/modules/apps/transfer/keeper/genesis.go +++ b/modules/apps/transfer/keeper/genesis.go @@ -28,12 +28,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { } k.SetParams(ctx, state.Params) - - // check if the module account exists - moduleAcc := k.GetTransferAccount(ctx) - if moduleAcc == nil { - panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) - } } // ExportGenesis exports ibc-transfer module's portID and denom trace info into its genesis state. diff --git a/modules/apps/transfer/keeper/keeper.go b/modules/apps/transfer/keeper/keeper.go index 46e3c51aa2a..d3f32d95df7 100644 --- a/modules/apps/transfer/keeper/keeper.go +++ b/modules/apps/transfer/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -64,11 +63,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+host.ModuleName+"-"+types.ModuleName) } -// GetTransferAccount returns the ICS20 - transfers ModuleAccount -func (k Keeper) GetTransferAccount(ctx sdk.Context) authtypes.ModuleAccountI { - return k.authKeeper.GetModuleAccount(ctx, types.ModuleName) -} - // IsBound checks if the transfer module is already bound to the desired port func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) diff --git a/modules/apps/transfer/keeper/keeper_test.go b/modules/apps/transfer/keeper/keeper_test.go index 1e29626c987..40ceb6d782f 100644 --- a/modules/apps/transfer/keeper/keeper_test.go +++ b/modules/apps/transfer/keeper/keeper_test.go @@ -4,9 +4,7 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" ibctesting "github.com/cosmos/ibc-go/v3/testing" @@ -46,16 +44,6 @@ func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { return path } -func (suite *KeeperTestSuite) TestGetTransferAccount() { - expectedMaccAddr := sdk.AccAddress(crypto.AddressHash([]byte(types.ModuleName))) - - macc := suite.chainA.GetSimApp().TransferKeeper.GetTransferAccount(suite.chainA.GetContext()) - - suite.Require().NotNil(macc) - suite.Require().Equal(types.ModuleName, macc.GetName()) - suite.Require().Equal(expectedMaccAddr, macc.GetAddress()) -} - func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } diff --git a/modules/core/02-client/keeper/keeper_test.go b/modules/core/02-client/keeper/keeper_test.go index 535b2f1685f..f56607e4dcf 100644 --- a/modules/core/02-client/keeper/keeper_test.go +++ b/modules/core/02-client/keeper/keeper_test.go @@ -66,7 +66,8 @@ type KeeperTestSuite struct { now time.Time past time.Time solomachine *ibctesting.Solomachine - signers map[string]tmtypes.PrivValidator + + signers map[string]tmtypes.PrivValidator // TODO: deprecate queryClient types.QueryClient diff --git a/modules/core/04-channel/keeper/events.go b/modules/core/04-channel/keeper/events.go index d299d6afeda..731d298a2ae 100644 --- a/modules/core/04-channel/keeper/events.go +++ b/modules/core/04-channel/keeper/events.go @@ -20,6 +20,7 @@ func EmitChannelOpenInitEvent(ctx sdk.Context, portID string, channelID string, sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeVersion, channel.Version), ), }) @@ -41,6 +42,7 @@ func EmitChannelOpenTryEvent(ctx sdk.Context, portID string, channelID string, c sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId), sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId), sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]), + sdk.NewAttribute(types.AttributeVersion, channel.Version), ), }) ctx.EventManager().EmitEvents(sdk.Events{ diff --git a/modules/core/04-channel/keeper/keeper.go b/modules/core/04-channel/keeper/keeper.go index 65378039ad9..ca2f824ad48 100644 --- a/modules/core/04-channel/keeper/keeper.go +++ b/modules/core/04-channel/keeper/keeper.go @@ -86,6 +86,16 @@ func (k Keeper) SetChannel(ctx sdk.Context, portID, channelID string, channel ty store.Set(host.ChannelKey(portID, channelID), bz) } +// GetAppVersion gets the version for the specified channel. +func (k Keeper) GetAppVersion(ctx sdk.Context, portID, channelID string) (string, bool) { + channel, found := k.GetChannel(ctx, portID, channelID) + if !found { + return "", false + } + + return channel.Version, true +} + // GetNextChannelSequence gets the next channel sequence from the store. func (k Keeper) GetNextChannelSequence(ctx sdk.Context) uint64 { store := ctx.KVStore(k.storeKey) diff --git a/modules/core/04-channel/keeper/keeper_test.go b/modules/core/04-channel/keeper/keeper_test.go index 60888f11c3c..f04664d71f4 100644 --- a/modules/core/04-channel/keeper/keeper_test.go +++ b/modules/core/04-channel/keeper/keeper_test.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" ibctesting "github.com/cosmos/ibc-go/v3/testing" + ibcmock "github.com/cosmos/ibc-go/v3/testing/mock" ) // KeeperTestSuite is a testing suite to test keeper functions. @@ -62,6 +63,24 @@ func (suite *KeeperTestSuite) TestSetChannel() { suite.Equal(expectedCounterparty, storedChannel.Counterparty) } +func (suite *KeeperTestSuite) TestGetAppVersion() { + // create client and connections on both chains + path := ibctesting.NewPath(suite.chainA, suite.chainB) + suite.coordinator.SetupConnections(path) + + version, found := suite.chainA.App.GetIBCKeeper().ChannelKeeper.GetAppVersion(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) + suite.Require().False(found) + suite.Require().Empty(version) + + // init channel + err := path.EndpointA.ChanOpenInit() + suite.NoError(err) + + channelVersion, found := suite.chainA.App.GetIBCKeeper().ChannelKeeper.GetAppVersion(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID) + suite.Require().True(found) + suite.Require().Equal(ibcmock.Version, channelVersion) +} + // TestGetAllChannels creates multiple channels on chain A through various connections // and tests their retrieval. 2 channels are on connA0 and 1 channel is on connA1 func (suite KeeperTestSuite) TestGetAllChannels() { diff --git a/modules/core/04-channel/keeper/packet.go b/modules/core/04-channel/keeper/packet.go index 51b02f9bece..c3e8e45b89c 100644 --- a/modules/core/04-channel/keeper/packet.go +++ b/modules/core/04-channel/keeper/packet.go @@ -2,6 +2,7 @@ package keeper import ( "bytes" + "strconv" "time" sdk "github.com/cosmos/cosmos-sdk/types" @@ -129,7 +130,7 @@ func (k Keeper) SendPacket( k.Logger(ctx).Info( "packet sent", - "sequence", packet.GetSequence(), + "sequence", strconv.FormatUint(packet.GetSequence(), 10), "src_port", packet.GetSourcePort(), "src_channel", packet.GetSourceChannel(), "dst_port", packet.GetDestPort(), @@ -284,7 +285,7 @@ func (k Keeper) RecvPacket( // log that a packet has been received & executed k.Logger(ctx).Info( "packet received", - "sequence", packet.GetSequence(), + "sequence", strconv.FormatUint(packet.GetSequence(), 10), "src_port", packet.GetSourcePort(), "src_channel", packet.GetSourceChannel(), "dst_port", packet.GetDestPort(), @@ -494,7 +495,7 @@ func (k Keeper) AcknowledgePacket( // log that a packet has been acknowledged k.Logger(ctx).Info( "packet acknowledged", - "sequence", packet.GetSequence(), + "sequence", strconv.FormatUint(packet.GetSequence(), 10), "src_port", packet.GetSourcePort(), "src_channel", packet.GetSourceChannel(), "dst_port", packet.GetDestPort(), diff --git a/modules/core/04-channel/keeper/timeout.go b/modules/core/04-channel/keeper/timeout.go index b446aa7ea4c..5a14ef85b6b 100644 --- a/modules/core/04-channel/keeper/timeout.go +++ b/modules/core/04-channel/keeper/timeout.go @@ -2,6 +2,7 @@ package keeper import ( "bytes" + "strconv" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -159,7 +160,7 @@ func (k Keeper) TimeoutExecuted( k.Logger(ctx).Info( "packet timed-out", - "sequence", packet.GetSequence(), + "sequence", strconv.FormatUint(packet.GetSequence(), 10), "src_port", packet.GetSourcePort(), "src_channel", packet.GetSourceChannel(), "dst_port", packet.GetDestPort(), diff --git a/modules/core/04-channel/types/channel.pb.go b/modules/core/04-channel/types/channel.pb.go index 4ebbe01c977..3ce5ce3a2e1 100644 --- a/modules/core/04-channel/types/channel.pb.go +++ b/modules/core/04-channel/types/channel.pb.go @@ -347,6 +347,51 @@ func (m *PacketState) XXX_DiscardUnknown() { var xxx_messageInfo_PacketState proto.InternalMessageInfo +// PacketId is an identifer for a unique Packet +// Source chains refer to packets by source port/channel +// Destination chains refer to packets by destination port/channel +type PacketId struct { + // channel port identifier + PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` + // channel unique identifier + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + // packet sequence + Sequence uint64 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (m *PacketId) Reset() { *m = PacketId{} } +func (m *PacketId) String() string { return proto.CompactTextString(m) } +func (*PacketId) ProtoMessage() {} +func (*PacketId) Descriptor() ([]byte, []int) { + return fileDescriptor_c3a07336710636a0, []int{5} +} +func (m *PacketId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PacketId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PacketId.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PacketId) XXX_Merge(src proto.Message) { + xxx_messageInfo_PacketId.Merge(m, src) +} +func (m *PacketId) XXX_Size() int { + return m.Size() +} +func (m *PacketId) XXX_DiscardUnknown() { + xxx_messageInfo_PacketId.DiscardUnknown(m) +} + +var xxx_messageInfo_PacketId proto.InternalMessageInfo + // Acknowledgement is the recommended acknowledgement format to be used by // app-specific protocols. // NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental @@ -367,7 +412,7 @@ func (m *Acknowledgement) Reset() { *m = Acknowledgement{} } func (m *Acknowledgement) String() string { return proto.CompactTextString(m) } func (*Acknowledgement) ProtoMessage() {} func (*Acknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_c3a07336710636a0, []int{5} + return fileDescriptor_c3a07336710636a0, []int{6} } func (m *Acknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -449,70 +494,72 @@ func init() { proto.RegisterType((*Counterparty)(nil), "ibc.core.channel.v1.Counterparty") proto.RegisterType((*Packet)(nil), "ibc.core.channel.v1.Packet") proto.RegisterType((*PacketState)(nil), "ibc.core.channel.v1.PacketState") + proto.RegisterType((*PacketId)(nil), "ibc.core.channel.v1.PacketId") proto.RegisterType((*Acknowledgement)(nil), "ibc.core.channel.v1.Acknowledgement") } func init() { proto.RegisterFile("ibc/core/channel/v1/channel.proto", fileDescriptor_c3a07336710636a0) } var fileDescriptor_c3a07336710636a0 = []byte{ - // 911 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xcd, 0x8e, 0xda, 0x56, - 0x14, 0xc6, 0x83, 0xf9, 0x3b, 0x0c, 0x0c, 0x73, 0xd3, 0x21, 0xae, 0x9b, 0x60, 0x62, 0x75, 0x31, - 0x4a, 0x15, 0xc8, 0x24, 0x51, 0xab, 0x66, 0xd5, 0xe1, 0x27, 0x1a, 0xab, 0x11, 0x8c, 0x0c, 0xb3, - 0x68, 0x36, 0x14, 0xec, 0x5b, 0xb0, 0x02, 0xbe, 0xd4, 0xbe, 0x30, 0x9a, 0x37, 0x88, 0x58, 0xf5, - 0x05, 0x90, 0x2a, 0x55, 0xed, 0x2b, 0xf4, 0x15, 0xb2, 0xcc, 0xb2, 0x2b, 0xab, 0x9a, 0x59, 0x74, - 0xcf, 0x0b, 0xb4, 0xf2, 0xbd, 0xd7, 0xfc, 0x4c, 0xa2, 0x2c, 0xbb, 0xca, 0x8a, 0x7b, 0xbe, 0xef, - 0x3b, 0x3f, 0x3e, 0xe7, 0x70, 0x2f, 0x3c, 0x70, 0x06, 0x56, 0xd5, 0x22, 0x1e, 0xae, 0x5a, 0xa3, - 0xbe, 0xeb, 0xe2, 0x71, 0x75, 0x7e, 0x12, 0x1d, 0x2b, 0x53, 0x8f, 0x50, 0x82, 0xee, 0x38, 0x03, - 0xab, 0x12, 0x4a, 0x2a, 0x11, 0x3e, 0x3f, 0x51, 0x3f, 0x1b, 0x92, 0x21, 0x61, 0x7c, 0x35, 0x3c, - 0x71, 0xa9, 0xaa, 0x6d, 0xa2, 0x8d, 0x1d, 0xec, 0x52, 0x16, 0x8c, 0x9d, 0xb8, 0x40, 0xff, 0x7d, - 0x0f, 0x52, 0x75, 0x1e, 0x05, 0x3d, 0x86, 0x84, 0x4f, 0xfb, 0x14, 0x2b, 0x52, 0x59, 0x3a, 0xce, - 0x3f, 0x51, 0x2b, 0x1f, 0xc8, 0x53, 0xe9, 0x84, 0x0a, 0x93, 0x0b, 0xd1, 0xd7, 0x90, 0x26, 0x9e, - 0x8d, 0x3d, 0xc7, 0x1d, 0x2a, 0x7b, 0x1f, 0x71, 0x6a, 0x87, 0x22, 0x73, 0xad, 0x45, 0xdf, 0xc3, - 0xbe, 0x45, 0x66, 0x2e, 0xc5, 0xde, 0xb4, 0xef, 0xd1, 0x2b, 0x25, 0x5e, 0x96, 0x8e, 0xb3, 0x4f, - 0x1e, 0x7c, 0xd0, 0xb7, 0xbe, 0x25, 0xac, 0xc9, 0x6f, 0x03, 0x2d, 0x66, 0xee, 0x38, 0xa3, 0x3a, - 0x1c, 0x58, 0xc4, 0x75, 0xb1, 0x45, 0x1d, 0xe2, 0xf6, 0x46, 0x64, 0xea, 0x2b, 0x72, 0x39, 0x7e, - 0x9c, 0xa9, 0xa9, 0xab, 0x40, 0x2b, 0x5e, 0xf5, 0x27, 0xe3, 0xe7, 0xfa, 0x2d, 0x81, 0x6e, 0xe6, - 0x37, 0xc8, 0x19, 0x99, 0xfa, 0x48, 0x81, 0xd4, 0x1c, 0x7b, 0xbe, 0x43, 0x5c, 0x25, 0x51, 0x96, - 0x8e, 0x33, 0x66, 0x64, 0x3e, 0x97, 0xdf, 0xfc, 0xaa, 0xc5, 0xf4, 0x7f, 0xf6, 0xe0, 0xd0, 0xb0, - 0xb1, 0x4b, 0x9d, 0x9f, 0x1c, 0x6c, 0x7f, 0xea, 0xd8, 0x47, 0x3a, 0x86, 0xee, 0x42, 0x6a, 0x4a, - 0x3c, 0xda, 0x73, 0x6c, 0x25, 0xc9, 0x98, 0x64, 0x68, 0x1a, 0x36, 0xba, 0x0f, 0x20, 0xca, 0x0c, - 0xb9, 0x14, 0xe3, 0x32, 0x02, 0x31, 0x6c, 0xd1, 0xe9, 0x4b, 0xd8, 0xdf, 0xfe, 0x00, 0xf4, 0xd5, - 0x26, 0x5a, 0xd8, 0xe5, 0x4c, 0x0d, 0xad, 0x02, 0x2d, 0xcf, 0x8b, 0x14, 0x84, 0xbe, 0xce, 0xf0, - 0x6c, 0x27, 0xc3, 0x1e, 0xd3, 0x1f, 0xad, 0x02, 0xed, 0x50, 0x7c, 0xd4, 0x9a, 0xd3, 0xdf, 0x4f, - 0xfc, 0x6f, 0x1c, 0x92, 0xe7, 0x7d, 0xeb, 0x35, 0xa6, 0x48, 0x85, 0xb4, 0x8f, 0x7f, 0x9e, 0x61, - 0xd7, 0xe2, 0xa3, 0x95, 0xcd, 0xb5, 0x8d, 0xbe, 0x81, 0xac, 0x4f, 0x66, 0x9e, 0x85, 0x7b, 0x61, - 0x4e, 0x91, 0xa3, 0xb8, 0x0a, 0x34, 0xc4, 0x73, 0x6c, 0x91, 0xba, 0x09, 0xdc, 0x3a, 0x27, 0x1e, - 0x45, 0xdf, 0x41, 0x5e, 0x70, 0x22, 0x33, 0x1b, 0x62, 0xa6, 0xf6, 0xf9, 0x2a, 0xd0, 0x8e, 0x76, - 0x7c, 0x05, 0xaf, 0x9b, 0x39, 0x0e, 0x44, 0xeb, 0xf6, 0x02, 0x0a, 0x36, 0xf6, 0xa9, 0xe3, 0xf6, - 0xd9, 0x5c, 0x58, 0x7e, 0x99, 0xc5, 0xf8, 0x62, 0x15, 0x68, 0x77, 0x79, 0x8c, 0xdb, 0x0a, 0xdd, - 0x3c, 0xd8, 0x82, 0x58, 0x25, 0x6d, 0xb8, 0xb3, 0xad, 0x8a, 0xca, 0x61, 0x63, 0xac, 0x95, 0x56, - 0x81, 0xa6, 0xbe, 0x1f, 0x6a, 0x5d, 0x13, 0xda, 0x42, 0xa3, 0xc2, 0x10, 0xc8, 0x76, 0x9f, 0xf6, - 0xd9, 0xb8, 0xf7, 0x4d, 0x76, 0x46, 0x3f, 0x42, 0x9e, 0x3a, 0x13, 0x4c, 0x66, 0xb4, 0x37, 0xc2, - 0xce, 0x70, 0x44, 0xd9, 0xc0, 0xb3, 0x3b, 0xfb, 0xce, 0x6f, 0xa2, 0xf9, 0x49, 0xe5, 0x8c, 0x29, - 0x6a, 0xf7, 0xc3, 0x65, 0xdd, 0xb4, 0x63, 0xd7, 0x5f, 0x37, 0x73, 0x02, 0xe0, 0x6a, 0x64, 0xc0, - 0x61, 0xa4, 0x08, 0x7f, 0x7d, 0xda, 0x9f, 0x4c, 0x95, 0x74, 0x38, 0xae, 0xda, 0xbd, 0x55, 0xa0, - 0x29, 0xbb, 0x41, 0xd6, 0x12, 0xdd, 0x2c, 0x08, 0xac, 0x1b, 0x41, 0x62, 0x03, 0xfe, 0x90, 0x20, - 0xcb, 0x37, 0x80, 0xfd, 0x67, 0xff, 0x87, 0xd5, 0xdb, 0xd9, 0xb4, 0xf8, 0xad, 0x4d, 0x8b, 0xba, - 0x2a, 0x6f, 0xba, 0x2a, 0x0a, 0x6d, 0xc3, 0xc1, 0xa9, 0xf5, 0xda, 0x25, 0x97, 0x63, 0x6c, 0x0f, - 0xf1, 0x04, 0xbb, 0x14, 0x29, 0x90, 0xf4, 0xb0, 0x3f, 0x1b, 0x53, 0xe5, 0x28, 0x94, 0x9f, 0xc5, - 0x4c, 0x61, 0xa3, 0x22, 0x24, 0xb0, 0xe7, 0x11, 0x4f, 0x29, 0x86, 0x35, 0x9d, 0xc5, 0x4c, 0x6e, - 0xd6, 0x00, 0xd2, 0x1e, 0xf6, 0xa7, 0xc4, 0xf5, 0xf1, 0xc3, 0x3f, 0x25, 0x48, 0x74, 0xc4, 0x05, - 0xa5, 0x75, 0xba, 0xa7, 0xdd, 0x66, 0xef, 0xa2, 0x65, 0xb4, 0x8c, 0xae, 0x71, 0xfa, 0xd2, 0x78, - 0xd5, 0x6c, 0xf4, 0x2e, 0x5a, 0x9d, 0xf3, 0x66, 0xdd, 0x78, 0x61, 0x34, 0x1b, 0x85, 0x98, 0x7a, - 0xb8, 0x58, 0x96, 0x73, 0x3b, 0x02, 0xa4, 0x00, 0x70, 0xbf, 0x10, 0x2c, 0x48, 0x6a, 0x7a, 0xb1, - 0x2c, 0xcb, 0xe1, 0x19, 0x95, 0x20, 0xc7, 0x99, 0xae, 0xf9, 0x43, 0xfb, 0xbc, 0xd9, 0x2a, 0xec, - 0xa9, 0xd9, 0xc5, 0xb2, 0x9c, 0x12, 0xe6, 0xc6, 0x93, 0x91, 0x71, 0xee, 0xc9, 0x98, 0x7b, 0xb0, - 0xcf, 0x99, 0xfa, 0xcb, 0x76, 0xa7, 0xd9, 0x28, 0xc8, 0x2a, 0x2c, 0x96, 0xe5, 0x24, 0xb7, 0x54, - 0xf9, 0xcd, 0x6f, 0xa5, 0xd8, 0xc3, 0x4b, 0x48, 0xb0, 0xbb, 0x12, 0x7d, 0x09, 0xc5, 0xb6, 0xd9, - 0x68, 0x9a, 0xbd, 0x56, 0xbb, 0xd5, 0xbc, 0x55, 0x2f, 0x0b, 0x19, 0xe2, 0x48, 0x87, 0x03, 0xae, - 0xba, 0x68, 0xb1, 0xdf, 0x66, 0xa3, 0x20, 0xa9, 0xb9, 0xc5, 0xb2, 0x9c, 0x59, 0x03, 0x61, 0xc1, - 0x5c, 0x13, 0x29, 0x44, 0xc1, 0xc2, 0xe4, 0x89, 0x6b, 0x9d, 0xb7, 0xd7, 0x25, 0xe9, 0xdd, 0x75, - 0x49, 0xfa, 0xfb, 0xba, 0x24, 0xfd, 0x72, 0x53, 0x8a, 0xbd, 0xbb, 0x29, 0xc5, 0xfe, 0xba, 0x29, - 0xc5, 0x5e, 0x7d, 0x3b, 0x74, 0xe8, 0x68, 0x36, 0xa8, 0x58, 0x64, 0x52, 0xb5, 0x88, 0x3f, 0x21, - 0x7e, 0xd5, 0x19, 0x58, 0x8f, 0x86, 0xa4, 0x3a, 0x7f, 0x5a, 0x9d, 0x10, 0x7b, 0x36, 0xc6, 0x3e, - 0x7f, 0x94, 0x1f, 0x3f, 0x7b, 0x14, 0xbd, 0xf2, 0xf4, 0x6a, 0x8a, 0xfd, 0x41, 0x92, 0xbd, 0xca, - 0x4f, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x31, 0x31, 0xe5, 0x06, 0x08, 0x00, 0x00, + // 925 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xcd, 0x8e, 0x1a, 0x47, + 0x10, 0x66, 0x60, 0xf8, 0x2b, 0x16, 0x96, 0x6d, 0x67, 0xf1, 0x64, 0x62, 0x33, 0x78, 0x94, 0xc3, + 0xca, 0x91, 0xc1, 0x6b, 0x5b, 0x89, 0xe2, 0x53, 0x96, 0x1f, 0x6b, 0x47, 0xb1, 0x60, 0x35, 0xb0, + 0x87, 0xf8, 0x42, 0x60, 0xa6, 0x03, 0x23, 0xc3, 0x34, 0x99, 0x69, 0x58, 0xed, 0x1b, 0x58, 0x5c, + 0x92, 0x17, 0x40, 0x8a, 0x14, 0x25, 0xaf, 0x90, 0x57, 0xf0, 0xd1, 0xc7, 0x9c, 0x50, 0xb4, 0x7b, + 0xc8, 0x9d, 0x17, 0x48, 0x34, 0xdd, 0x3d, 0xfc, 0xac, 0xad, 0x3d, 0x26, 0x17, 0x9f, 0xe8, 0xaa, + 0xef, 0xab, 0xaa, 0x6f, 0xaa, 0x8a, 0x56, 0xc3, 0x03, 0xa7, 0x6f, 0x55, 0x2c, 0xe2, 0xe1, 0x8a, + 0x35, 0xec, 0xb9, 0x2e, 0x1e, 0x55, 0x66, 0xc7, 0xe1, 0xb1, 0x3c, 0xf1, 0x08, 0x25, 0xe8, 0x8e, + 0xd3, 0xb7, 0xca, 0x01, 0xa5, 0x1c, 0xfa, 0x67, 0xc7, 0xea, 0x27, 0x03, 0x32, 0x20, 0x0c, 0xaf, + 0x04, 0x27, 0x4e, 0x55, 0xb5, 0x4d, 0xb6, 0x91, 0x83, 0x5d, 0xca, 0x92, 0xb1, 0x13, 0x27, 0xe8, + 0xbf, 0x45, 0x21, 0x59, 0xe3, 0x59, 0xd0, 0x63, 0x88, 0xfb, 0xb4, 0x47, 0xb1, 0x22, 0x95, 0xa4, + 0xa3, 0xdc, 0x13, 0xb5, 0xfc, 0x81, 0x3a, 0xe5, 0x76, 0xc0, 0x30, 0x39, 0x11, 0x7d, 0x09, 0x29, + 0xe2, 0xd9, 0xd8, 0x73, 0xdc, 0x81, 0x12, 0xbd, 0x25, 0xa8, 0x15, 0x90, 0xcc, 0x35, 0x17, 0x7d, + 0x0b, 0x7b, 0x16, 0x99, 0xba, 0x14, 0x7b, 0x93, 0x9e, 0x47, 0x2f, 0x95, 0x58, 0x49, 0x3a, 0xca, + 0x3c, 0x79, 0xf0, 0xc1, 0xd8, 0xda, 0x16, 0xb1, 0x2a, 0xbf, 0x5d, 0x6a, 0x11, 0x73, 0x27, 0x18, + 0xd5, 0x60, 0xdf, 0x22, 0xae, 0x8b, 0x2d, 0xea, 0x10, 0xb7, 0x3b, 0x24, 0x13, 0x5f, 0x91, 0x4b, + 0xb1, 0xa3, 0x74, 0x55, 0x5d, 0x2d, 0xb5, 0xc2, 0x65, 0x6f, 0x3c, 0x7a, 0xae, 0xdf, 0x20, 0xe8, + 0x66, 0x6e, 0xe3, 0x39, 0x25, 0x13, 0x1f, 0x29, 0x90, 0x9c, 0x61, 0xcf, 0x77, 0x88, 0xab, 0xc4, + 0x4b, 0xd2, 0x51, 0xda, 0x0c, 0xcd, 0xe7, 0xf2, 0x9b, 0x5f, 0xb4, 0x88, 0xfe, 0x77, 0x14, 0x0e, + 0x0c, 0x1b, 0xbb, 0xd4, 0xf9, 0xc1, 0xc1, 0xf6, 0xc7, 0x8e, 0xdd, 0xd2, 0x31, 0x74, 0x17, 0x92, + 0x13, 0xe2, 0xd1, 0xae, 0x63, 0x2b, 0x09, 0x86, 0x24, 0x02, 0xd3, 0xb0, 0xd1, 0x7d, 0x00, 0x21, + 0x33, 0xc0, 0x92, 0x0c, 0x4b, 0x0b, 0x8f, 0x61, 0x8b, 0x4e, 0x5f, 0xc0, 0xde, 0xf6, 0x07, 0xa0, + 0x2f, 0x36, 0xd9, 0x82, 0x2e, 0xa7, 0xab, 0x68, 0xb5, 0xd4, 0x72, 0x5c, 0xa4, 0x00, 0xf4, 0x75, + 0x85, 0x67, 0x3b, 0x15, 0xa2, 0x8c, 0x7f, 0xb8, 0x5a, 0x6a, 0x07, 0xe2, 0xa3, 0xd6, 0x98, 0xfe, + 0x7e, 0xe1, 0x7f, 0x62, 0x90, 0x38, 0xeb, 0x59, 0xaf, 0x31, 0x45, 0x2a, 0xa4, 0x7c, 0xfc, 0xe3, + 0x14, 0xbb, 0x16, 0x1f, 0xad, 0x6c, 0xae, 0x6d, 0xf4, 0x15, 0x64, 0x7c, 0x32, 0xf5, 0x2c, 0xdc, + 0x0d, 0x6a, 0x8a, 0x1a, 0x85, 0xd5, 0x52, 0x43, 0xbc, 0xc6, 0x16, 0xa8, 0x9b, 0xc0, 0xad, 0x33, + 0xe2, 0x51, 0xf4, 0x0d, 0xe4, 0x04, 0x26, 0x2a, 0xb3, 0x21, 0xa6, 0xab, 0x9f, 0xae, 0x96, 0xda, + 0xe1, 0x4e, 0xac, 0xc0, 0x75, 0x33, 0xcb, 0x1d, 0xe1, 0xba, 0xbd, 0x80, 0xbc, 0x8d, 0x7d, 0xea, + 0xb8, 0x3d, 0x36, 0x17, 0x56, 0x5f, 0x66, 0x39, 0x3e, 0x5b, 0x2d, 0xb5, 0xbb, 0x3c, 0xc7, 0x4d, + 0x86, 0x6e, 0xee, 0x6f, 0xb9, 0x98, 0x92, 0x16, 0xdc, 0xd9, 0x66, 0x85, 0x72, 0xd8, 0x18, 0xab, + 0xc5, 0xd5, 0x52, 0x53, 0xdf, 0x4f, 0xb5, 0xd6, 0x84, 0xb6, 0xbc, 0xa1, 0x30, 0x04, 0xb2, 0xdd, + 0xa3, 0x3d, 0x36, 0xee, 0x3d, 0x93, 0x9d, 0xd1, 0xf7, 0x90, 0xa3, 0xce, 0x18, 0x93, 0x29, 0xed, + 0x0e, 0xb1, 0x33, 0x18, 0x52, 0x36, 0xf0, 0xcc, 0xce, 0xbe, 0xf3, 0x9b, 0x68, 0x76, 0x5c, 0x3e, + 0x65, 0x8c, 0xea, 0xfd, 0x60, 0x59, 0x37, 0xed, 0xd8, 0x8d, 0xd7, 0xcd, 0xac, 0x70, 0x70, 0x36, + 0x32, 0xe0, 0x20, 0x64, 0x04, 0xbf, 0x3e, 0xed, 0x8d, 0x27, 0x4a, 0x2a, 0x18, 0x57, 0xf5, 0xde, + 0x6a, 0xa9, 0x29, 0xbb, 0x49, 0xd6, 0x14, 0xdd, 0xcc, 0x0b, 0x5f, 0x27, 0x74, 0x89, 0x0d, 0xf8, + 0x5d, 0x82, 0x0c, 0xdf, 0x00, 0xf6, 0x9f, 0xfd, 0x0f, 0x56, 0x6f, 0x67, 0xd3, 0x62, 0x37, 0x36, + 0x2d, 0xec, 0xaa, 0xbc, 0xe9, 0xaa, 0x10, 0xfa, 0x93, 0x04, 0x29, 0x2e, 0xd4, 0xb0, 0xff, 0x67, + 0x95, 0x42, 0x51, 0x0b, 0xf6, 0x4f, 0xac, 0xd7, 0x2e, 0xb9, 0x18, 0x61, 0x7b, 0x80, 0xc7, 0xd8, + 0xa5, 0x48, 0x81, 0x84, 0x87, 0xfd, 0xe9, 0x88, 0x2a, 0x87, 0xc1, 0x07, 0x9c, 0x46, 0x4c, 0x61, + 0xa3, 0x02, 0xc4, 0xb1, 0xe7, 0x11, 0x4f, 0x29, 0x04, 0xf5, 0x4f, 0x23, 0x26, 0x37, 0xab, 0x00, + 0x29, 0x0f, 0xfb, 0x13, 0xe2, 0xfa, 0xf8, 0xe1, 0x1f, 0x12, 0xc4, 0xdb, 0xe2, 0xca, 0xd4, 0xda, + 0x9d, 0x93, 0x4e, 0xa3, 0x7b, 0xde, 0x34, 0x9a, 0x46, 0xc7, 0x38, 0x79, 0x69, 0xbc, 0x6a, 0xd4, + 0xbb, 0xe7, 0xcd, 0xf6, 0x59, 0xa3, 0x66, 0xbc, 0x30, 0x1a, 0xf5, 0x7c, 0x44, 0x3d, 0x98, 0x2f, + 0x4a, 0xd9, 0x1d, 0x02, 0x52, 0x00, 0x78, 0x5c, 0xe0, 0xcc, 0x4b, 0x6a, 0x6a, 0xbe, 0x28, 0xc9, + 0xc1, 0x19, 0x15, 0x21, 0xcb, 0x91, 0x8e, 0xf9, 0x5d, 0xeb, 0xac, 0xd1, 0xcc, 0x47, 0xd5, 0xcc, + 0x7c, 0x51, 0x4a, 0x0a, 0x73, 0x13, 0xc9, 0xc0, 0x18, 0x8f, 0x64, 0xc8, 0x3d, 0xd8, 0xe3, 0x48, + 0xed, 0x65, 0xab, 0xdd, 0xa8, 0xe7, 0x65, 0x15, 0xe6, 0x8b, 0x52, 0x82, 0x5b, 0xaa, 0xfc, 0xe6, + 0xd7, 0x62, 0xe4, 0xe1, 0x05, 0xc4, 0xd9, 0xed, 0x8d, 0x3e, 0x87, 0x42, 0xcb, 0xac, 0x37, 0xcc, + 0x6e, 0xb3, 0xd5, 0x6c, 0xdc, 0xd0, 0xcb, 0x52, 0x06, 0x7e, 0xa4, 0xc3, 0x3e, 0x67, 0x9d, 0x37, + 0xd9, 0x6f, 0xa3, 0x9e, 0x97, 0xd4, 0xec, 0x7c, 0x51, 0x4a, 0xaf, 0x1d, 0x81, 0x60, 0xce, 0x09, + 0x19, 0x42, 0xb0, 0x30, 0x79, 0xe1, 0x6a, 0xfb, 0xed, 0x55, 0x51, 0x7a, 0x77, 0x55, 0x94, 0xfe, + 0xba, 0x2a, 0x4a, 0x3f, 0x5f, 0x17, 0x23, 0xef, 0xae, 0x8b, 0x91, 0x3f, 0xaf, 0x8b, 0x91, 0x57, + 0x5f, 0x0f, 0x1c, 0x3a, 0x9c, 0xf6, 0xcb, 0x16, 0x19, 0x57, 0x2c, 0xe2, 0x8f, 0x89, 0x5f, 0x71, + 0xfa, 0xd6, 0xa3, 0x01, 0xa9, 0xcc, 0x9e, 0x56, 0xc6, 0xc4, 0x9e, 0x8e, 0xb0, 0xcf, 0x9f, 0x09, + 0x8f, 0x9f, 0x3d, 0x0a, 0xdf, 0x1d, 0xf4, 0x72, 0x82, 0xfd, 0x7e, 0x82, 0xbd, 0x13, 0x9e, 0xfe, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0x47, 0xf5, 0x82, 0xa6, 0x98, 0x08, 0x00, 0x00, } func (m *Channel) Marshal() (dAtA []byte, err error) { @@ -811,6 +858,48 @@ func (m *PacketState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *PacketId) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PacketId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PacketId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sequence != 0 { + i = encodeVarintChannel(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x18 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintChannel(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x12 + } + if len(m.PortId) > 0 { + i -= len(m.PortId) + copy(dAtA[i:], m.PortId) + i = encodeVarintChannel(dAtA, i, uint64(len(m.PortId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *Acknowledgement) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1028,6 +1117,26 @@ func (m *PacketState) Size() (n int) { return n } +func (m *PacketId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.PortId) + if l > 0 { + n += 1 + l + sovChannel(uint64(l)) + } + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovChannel(uint64(l)) + } + if m.Sequence != 0 { + n += 1 + sovChannel(uint64(m.Sequence)) + } + return n +} + func (m *Acknowledgement) Size() (n int) { if m == nil { return 0 @@ -2067,6 +2176,139 @@ func (m *PacketState) Unmarshal(dAtA []byte) error { } return nil } +func (m *PacketId) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PacketId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PacketId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChannel + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthChannel + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthChannel + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequence", wireType) + } + m.Sequence = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowChannel + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Sequence |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipChannel(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthChannel + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Acknowledgement) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/modules/core/04-channel/types/events.go b/modules/core/04-channel/types/events.go index 4154b856c5d..e9f909a695d 100644 --- a/modules/core/04-channel/types/events.go +++ b/modules/core/04-channel/types/events.go @@ -11,6 +11,7 @@ const ( AttributeKeyConnectionID = "connection_id" AttributeKeyPortID = "port_id" AttributeKeyChannelID = "channel_id" + AttributeVersion = "version" AttributeCounterpartyPortID = "counterparty_port_id" AttributeCounterpartyChannelID = "counterparty_channel_id" diff --git a/modules/core/04-channel/types/packet.go b/modules/core/04-channel/types/packet.go index 0df4d8edd8d..dd59c8bfde9 100644 --- a/modules/core/04-channel/types/packet.go +++ b/modules/core/04-channel/types/packet.go @@ -111,3 +111,25 @@ func (p Packet) ValidateBasic() error { } return nil } + +// Validates a PacketId +func (p PacketId) Validate() error { + if err := host.PortIdentifierValidator(p.PortId); err != nil { + return sdkerrors.Wrap(err, "invalid source port ID") + } + + if err := host.ChannelIdentifierValidator(p.ChannelId); err != nil { + return sdkerrors.Wrap(err, "invalid source channel ID") + } + + if p.Sequence == 0 { + return sdkerrors.Wrap(ErrInvalidPacket, "packet sequence cannot be 0") + } + + return nil +} + +// NewPacketId returns a new instance of PacketId +func NewPacketId(portId, channelId string, seq uint64) PacketId { + return PacketId{PortId: portId, ChannelId: channelId, Sequence: seq} +} diff --git a/modules/core/04-channel/types/tx.pb.go b/modules/core/04-channel/types/tx.pb.go index 8f9ebe6ec63..fe6f344384d 100644 --- a/modules/core/04-channel/types/tx.pb.go +++ b/modules/core/04-channel/types/tx.pb.go @@ -105,6 +105,7 @@ var xxx_messageInfo_MsgChannelOpenInit proto.InternalMessageInfo // MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. type MsgChannelOpenInitResponse struct { ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` } func (m *MsgChannelOpenInitResponse) Reset() { *m = MsgChannelOpenInitResponse{} } @@ -147,6 +148,13 @@ func (m *MsgChannelOpenInitResponse) GetChannelId() string { return "" } +func (m *MsgChannelOpenInitResponse) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + // MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel // on Chain B. The version field within the Channel field has been deprecated. Its // value will be ignored by core IBC. @@ -198,6 +206,7 @@ var xxx_messageInfo_MsgChannelOpenTry proto.InternalMessageInfo // MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. type MsgChannelOpenTryResponse struct { + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` } func (m *MsgChannelOpenTryResponse) Reset() { *m = MsgChannelOpenTryResponse{} } @@ -233,6 +242,13 @@ func (m *MsgChannelOpenTryResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgChannelOpenTryResponse proto.InternalMessageInfo +func (m *MsgChannelOpenTryResponse) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. type MsgChannelOpenAck struct { @@ -902,87 +918,88 @@ func init() { func init() { proto.RegisterFile("ibc/core/channel/v1/tx.proto", fileDescriptor_bc4637e0ac3fc7b7) } var fileDescriptor_bc4637e0ac3fc7b7 = []byte{ - // 1275 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0xd6, 0x5f, 0x64, 0x67, 0xe4, 0xda, 0x32, 0x65, 0x3b, 0x32, 0x65, 0x8b, 0x2a, 0x0f, 0xb1, - 0xe1, 0xc2, 0x52, 0x6c, 0xa7, 0x28, 0x62, 0x14, 0x28, 0x2c, 0x55, 0x41, 0x8d, 0xd6, 0x3f, 0xa0, - 0xe4, 0x02, 0x75, 0x8b, 0x0a, 0x12, 0xb5, 0x91, 0x09, 0x49, 0x5c, 0x95, 0xa4, 0x94, 0xe8, 0x0d, - 0x02, 0x9f, 0x72, 0x0e, 0x60, 0x20, 0x45, 0x4f, 0x45, 0x0f, 0xe9, 0x63, 0xe4, 0x98, 0x53, 0x5b, - 0xf4, 0x20, 0x14, 0xf6, 0xa5, 0x67, 0x3d, 0x41, 0xc1, 0xe5, 0x92, 0xa2, 0x24, 0x12, 0xa6, 0x13, - 0xdb, 0xcd, 0x6d, 0x77, 0xe6, 0xdb, 0xd9, 0xd9, 0xef, 0x1b, 0xee, 0x0f, 0x61, 0x49, 0xaa, 0x88, - 0x19, 0x11, 0x2b, 0x28, 0x23, 0x9e, 0x94, 0x65, 0x19, 0x35, 0x32, 0x9d, 0x8d, 0x8c, 0xf6, 0x2c, - 0xdd, 0x52, 0xb0, 0x86, 0x99, 0x98, 0x54, 0x11, 0xd3, 0xba, 0x37, 0x4d, 0xbd, 0xe9, 0xce, 0x06, - 0x3b, 0x57, 0xc3, 0x35, 0x4c, 0xfc, 0x19, 0xbd, 0x65, 0x40, 0x59, 0x6e, 0x10, 0xa8, 0x21, 0x21, - 0x59, 0xd3, 0xe3, 0x18, 0x2d, 0x0a, 0xf8, 0xd8, 0x69, 0x26, 0x33, 0x2c, 0x81, 0xf0, 0x3f, 0xfb, - 0x81, 0xd9, 0x53, 0x6b, 0x39, 0xc3, 0x78, 0xd0, 0x42, 0xf2, 0xae, 0x2c, 0x69, 0xcc, 0x27, 0x30, - 0xd1, 0xc2, 0x8a, 0x56, 0x92, 0xaa, 0x71, 0x7f, 0xca, 0xbf, 0x7a, 0x37, 0xcb, 0xf4, 0x7b, 0xdc, - 0x74, 0xb7, 0xdc, 0x6c, 0x6c, 0xf3, 0xd4, 0xc1, 0x0b, 0x61, 0xbd, 0xb5, 0x5b, 0x65, 0x3e, 0x87, - 0x09, 0x1a, 0x34, 0x1e, 0x48, 0xf9, 0x57, 0x23, 0x9b, 0x4b, 0x69, 0x87, 0x45, 0xa4, 0xe9, 0x1c, - 0xd9, 0xd0, 0x9b, 0x1e, 0xe7, 0x13, 0xcc, 0x21, 0xcc, 0x02, 0x84, 0x55, 0xa9, 0x26, 0x23, 0x25, - 0x1e, 0xd4, 0x67, 0x12, 0x68, 0x6f, 0x7b, 0xf2, 0xf9, 0x2b, 0xce, 0xf7, 0xef, 0x2b, 0xce, 0xc7, - 0x0b, 0xc0, 0x8e, 0xa7, 0x28, 0x20, 0xb5, 0x85, 0x65, 0x15, 0x31, 0x0f, 0x01, 0x68, 0xa8, 0x41, - 0xb6, 0xf3, 0xfd, 0x1e, 0x37, 0x6b, 0x64, 0x3b, 0xf0, 0xf1, 0xc2, 0x5d, 0xda, 0xd9, 0xad, 0xf2, - 0x7f, 0x04, 0x61, 0x76, 0x38, 0x68, 0x51, 0xe9, 0x5e, 0x6d, 0xd9, 0xfb, 0x10, 0x6b, 0x29, 0xa8, - 0x23, 0xe1, 0xb6, 0x5a, 0xb2, 0x65, 0x10, 0x20, 0x03, 0x93, 0xfd, 0x1e, 0xc7, 0xd2, 0x81, 0xe3, - 0x20, 0x5e, 0x98, 0x35, 0xad, 0x39, 0x33, 0x25, 0x3b, 0x8d, 0xc1, 0xab, 0xd3, 0x28, 0xc0, 0x9c, - 0x88, 0xdb, 0xb2, 0x86, 0x94, 0x56, 0x59, 0xd1, 0xba, 0xa5, 0x0e, 0x52, 0x54, 0x09, 0xcb, 0xf1, - 0x10, 0x49, 0x87, 0xeb, 0xf7, 0xb8, 0x04, 0x25, 0xc4, 0x01, 0xc5, 0x0b, 0x31, 0xbb, 0xf9, 0x5b, - 0xc3, 0xaa, 0x53, 0xdb, 0x52, 0x30, 0x7e, 0x52, 0x92, 0x64, 0x49, 0x8b, 0xdf, 0x49, 0xf9, 0x57, - 0xa7, 0xec, 0xd4, 0x0e, 0x7c, 0xbc, 0x70, 0x97, 0x74, 0x48, 0xed, 0x1c, 0xc3, 0x94, 0xe1, 0x39, - 0x41, 0x52, 0xed, 0x44, 0x8b, 0x87, 0xc9, 0x62, 0x58, 0xdb, 0x62, 0x8c, 0x1a, 0xed, 0x6c, 0xa4, - 0xbf, 0x22, 0x88, 0x6c, 0x42, 0x5f, 0x4a, 0xbf, 0xc7, 0xc5, 0xec, 0x71, 0x8d, 0xd1, 0xbc, 0x10, - 0x21, 0x5d, 0x03, 0x69, 0x2b, 0x96, 0x09, 0x97, 0x62, 0x49, 0xc0, 0xe2, 0x98, 0xae, 0x66, 0xad, - 0xf0, 0x7f, 0x8e, 0xa9, 0xbe, 0x23, 0xd6, 0xaf, 0xa6, 0xfa, 0x70, 0xb9, 0x05, 0xbc, 0x95, 0x1b, - 0x73, 0x0c, 0xf7, 0x86, 0x78, 0xb7, 0x85, 0x20, 0x55, 0x9f, 0xe5, 0xfb, 0x3d, 0x2e, 0xe9, 0x20, - 0x90, 0x3d, 0xde, 0xbc, 0xdd, 0x33, 0xa8, 0x9b, 0x9b, 0x50, 0x7e, 0x03, 0x0c, 0x41, 0x4b, 0x9a, - 0xd2, 0xa5, 0xc2, 0xcf, 0xf5, 0x7b, 0x5c, 0xd4, 0x2e, 0x90, 0xa6, 0x74, 0x79, 0x61, 0x92, 0xb4, - 0xf5, 0x6f, 0xe7, 0x03, 0x93, 0x7d, 0x47, 0xac, 0x5b, 0xb2, 0xff, 0x16, 0x80, 0xf9, 0x61, 0x6f, - 0x0e, 0xcb, 0x4f, 0x24, 0xa5, 0x79, 0x1b, 0xd2, 0x5b, 0x54, 0x96, 0xc5, 0x3a, 0x11, 0xdb, 0x81, - 0xca, 0xb2, 0x58, 0x37, 0xa9, 0xd4, 0x0b, 0x72, 0x94, 0xca, 0xd0, 0x8d, 0x50, 0x79, 0xc7, 0x85, - 0x4a, 0x0e, 0x96, 0x1d, 0xc9, 0xb2, 0xe8, 0x7c, 0xe9, 0x87, 0xd8, 0x00, 0x91, 0x6b, 0x60, 0x15, - 0x5d, 0xfd, 0xd0, 0x78, 0x37, 0x32, 0x2f, 0x3f, 0x2c, 0x96, 0x21, 0xe1, 0x90, 0x9b, 0x95, 0xfb, - 0xeb, 0x00, 0x2c, 0x8c, 0xf8, 0x6f, 0xb1, 0x16, 0x86, 0x37, 0xd4, 0xe0, 0x3b, 0x6e, 0xa8, 0xb7, - 0x5b, 0x0e, 0x29, 0x48, 0x3a, 0x13, 0x66, 0x71, 0xfa, 0x22, 0x00, 0x1f, 0xed, 0xa9, 0x35, 0x01, - 0x89, 0x9d, 0xc3, 0xb2, 0x58, 0x47, 0x1a, 0xf3, 0x08, 0xc2, 0x2d, 0xd2, 0x22, 0x4c, 0x46, 0x36, - 0x13, 0x8e, 0x27, 0x99, 0x01, 0xa6, 0x07, 0x19, 0x1d, 0xc0, 0x3c, 0x86, 0xa8, 0x91, 0xae, 0x88, - 0x9b, 0x4d, 0x49, 0x6b, 0x22, 0x59, 0x23, 0xf4, 0x4e, 0x65, 0x13, 0xfd, 0x1e, 0x77, 0xcf, 0xbe, - 0xa0, 0x01, 0x82, 0x17, 0x66, 0x88, 0x29, 0x67, 0x59, 0xc6, 0x48, 0x0b, 0xde, 0x08, 0x69, 0x21, - 0x17, 0xd2, 0x7e, 0x24, 0x1b, 0xce, 0x80, 0x11, 0xeb, 0xb6, 0xf2, 0x05, 0x84, 0x15, 0xa4, 0xb6, - 0x1b, 0x06, 0x33, 0xd3, 0x9b, 0x2b, 0x8e, 0xcc, 0x98, 0x70, 0x81, 0x40, 0x8b, 0xdd, 0x16, 0x12, - 0xe8, 0xb0, 0xed, 0x90, 0x3e, 0x07, 0xff, 0x77, 0x00, 0x60, 0x4f, 0xad, 0x15, 0xa5, 0x26, 0xc2, - 0xed, 0xeb, 0xe1, 0xbb, 0x2d, 0x2b, 0x48, 0x44, 0x52, 0x07, 0x55, 0xdd, 0xf8, 0x1e, 0x20, 0x4c, - 0xbe, 0x8f, 0x2c, 0xcb, 0x8d, 0xf2, 0xfd, 0x35, 0x30, 0x32, 0x7a, 0xa6, 0x95, 0x54, 0xf4, 0x53, - 0x1b, 0xc9, 0x22, 0x2a, 0x29, 0x48, 0xec, 0x10, 0xee, 0x43, 0xd9, 0xe5, 0x7e, 0x8f, 0x5b, 0x34, - 0x22, 0x8c, 0x63, 0x78, 0x21, 0xaa, 0x1b, 0x0b, 0xd4, 0xa6, 0xeb, 0xe1, 0xa1, 0xe2, 0xbf, 0x27, - 0x57, 0x62, 0xca, 0xed, 0x75, 0x2b, 0xf7, 0xd2, 0xb8, 0x82, 0xd0, 0xe8, 0x07, 0x32, 0xf9, 0xa2, - 0x3e, 0x04, 0x01, 0x3f, 0x83, 0x08, 0xfd, 0xac, 0xf4, 0x8c, 0xe8, 0xe6, 0xb4, 0xd0, 0xef, 0x71, - 0xcc, 0xd0, 0x37, 0xa7, 0x3b, 0x79, 0xc1, 0xd8, 0xc6, 0x8c, 0xdc, 0x6f, 0x72, 0x7b, 0x72, 0x56, - 0xfe, 0xce, 0xfb, 0x2a, 0x1f, 0x76, 0x51, 0xbe, 0x42, 0x6e, 0x11, 0xc3, 0xda, 0x5c, 0x77, 0x01, - 0xfc, 0x1e, 0x20, 0xe5, 0xb5, 0x23, 0xd6, 0x65, 0xfc, 0xb4, 0x81, 0xaa, 0x35, 0x44, 0xf6, 0xab, - 0xf7, 0xa8, 0x80, 0x55, 0x98, 0x29, 0x0f, 0x47, 0x33, 0x0a, 0x40, 0x18, 0x35, 0x0f, 0x34, 0xd6, - 0x07, 0x56, 0xdd, 0x34, 0x26, 0x4e, 0x53, 0xe3, 0x1d, 0xbd, 0xf3, 0x3f, 0x1f, 0x41, 0x22, 0x79, - 0x00, 0x8e, 0x30, 0x76, 0xcd, 0xba, 0xac, 0xfd, 0xea, 0x07, 0x66, 0x1c, 0xc4, 0x7c, 0x0a, 0x29, - 0x21, 0x5f, 0x38, 0x3c, 0xd8, 0x2f, 0xe4, 0x4b, 0x42, 0xbe, 0x70, 0xf4, 0x4d, 0xb1, 0x54, 0xfc, - 0xee, 0x30, 0x5f, 0x3a, 0xda, 0x2f, 0x1c, 0xe6, 0x73, 0xbb, 0x8f, 0x77, 0xf3, 0x5f, 0x46, 0x7d, - 0xec, 0xcc, 0xe9, 0x59, 0x2a, 0x62, 0x33, 0x31, 0x2b, 0xb0, 0xe8, 0x38, 0x6c, 0xff, 0xe0, 0xe0, - 0x30, 0xea, 0x67, 0x27, 0x4f, 0xcf, 0x52, 0x21, 0xbd, 0xcd, 0xac, 0xc3, 0x92, 0x23, 0xb0, 0x70, - 0x94, 0xcb, 0xe5, 0x0b, 0x85, 0x68, 0x80, 0x8d, 0x9c, 0x9e, 0xa5, 0x26, 0x68, 0x97, 0x0d, 0x3d, - 0xff, 0x25, 0xe9, 0xdb, 0x7c, 0x3d, 0x09, 0xc1, 0x3d, 0xb5, 0xc6, 0xd4, 0x61, 0x66, 0xf4, 0xe5, - 0xee, 0xbc, 0xfa, 0xf1, 0xf7, 0x33, 0x9b, 0xf1, 0x08, 0xb4, 0x78, 0x3e, 0x81, 0xe9, 0x91, 0xe7, - 0xf2, 0x7d, 0x0f, 0x21, 0x8a, 0x4a, 0x97, 0x4d, 0x7b, 0xc3, 0xb9, 0xcc, 0xa4, 0xdf, 0x88, 0xbd, - 0xcc, 0xb4, 0x23, 0xd6, 0x3d, 0xcd, 0x64, 0x7b, 0x19, 0x30, 0x1a, 0x30, 0x0e, 0xaf, 0x82, 0x35, - 0x0f, 0x51, 0x28, 0x96, 0xdd, 0xf4, 0x8e, 0xb5, 0x66, 0x95, 0x21, 0x3a, 0x76, 0x79, 0x5e, 0xbd, - 0x24, 0x8e, 0x85, 0x64, 0x1f, 0x78, 0x45, 0x5a, 0xf3, 0x3d, 0x85, 0x98, 0xe3, 0x85, 0xd7, 0x4b, - 0x20, 0x73, 0x9d, 0x5b, 0x57, 0x00, 0x5b, 0x13, 0xff, 0x00, 0x60, 0xbb, 0x15, 0xf2, 0x6e, 0x21, - 0x06, 0x18, 0x76, 0xed, 0x72, 0x8c, 0x15, 0xbd, 0x00, 0x13, 0xe6, 0x05, 0x88, 0x73, 0x1b, 0x46, - 0x01, 0xec, 0xca, 0x25, 0x00, 0x7b, 0xed, 0x8d, 0x9c, 0xcd, 0xf7, 0x2f, 0x19, 0x4a, 0x71, 0xee, - 0xb5, 0xe7, 0x72, 0x9e, 0xd4, 0x61, 0x66, 0xf4, 0x10, 0x70, 0xcd, 0x72, 0x04, 0xe8, 0xfe, 0xf1, - 0xba, 0x6c, 0x92, 0xd9, 0xc2, 0x9b, 0xf3, 0xa4, 0xff, 0xed, 0x79, 0xd2, 0xff, 0xcf, 0x79, 0xd2, - 0xff, 0xe2, 0x22, 0xe9, 0x7b, 0x7b, 0x91, 0xf4, 0xfd, 0x75, 0x91, 0xf4, 0x1d, 0x3f, 0xaa, 0x49, - 0xda, 0x49, 0xbb, 0x92, 0x16, 0x71, 0x33, 0x23, 0x62, 0xb5, 0x89, 0xd5, 0x8c, 0x54, 0x11, 0xd7, - 0x6b, 0x38, 0xd3, 0xd9, 0xca, 0x34, 0x71, 0xb5, 0xdd, 0x40, 0xaa, 0xf1, 0x13, 0xf1, 0xc1, 0xc3, - 0x75, 0xf3, 0x3f, 0xa2, 0xd6, 0x6d, 0x21, 0xb5, 0x12, 0x26, 0xff, 0x10, 0xb7, 0xfe, 0x0b, 0x00, - 0x00, 0xff, 0xff, 0xec, 0xba, 0x10, 0x62, 0xd2, 0x14, 0x00, 0x00, + // 1294 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6f, 0xe2, 0x56, + 0x17, 0xc6, 0x40, 0x20, 0x39, 0xe4, 0x4d, 0x88, 0x49, 0x32, 0xc4, 0x24, 0x98, 0xd7, 0x8b, 0x49, + 0x94, 0x2a, 0x30, 0x49, 0x66, 0x54, 0x4d, 0x54, 0xa9, 0x0a, 0x94, 0x51, 0xa3, 0x36, 0x1f, 0x32, + 0xa4, 0x52, 0xd3, 0xaa, 0x08, 0xcc, 0x1d, 0x62, 0x01, 0x36, 0xb5, 0x0d, 0x33, 0xfc, 0x83, 0x51, + 0x56, 0xb3, 0x1e, 0x29, 0xd2, 0x54, 0x5d, 0x55, 0x5d, 0x4c, 0x7f, 0xc6, 0x2c, 0x67, 0xd5, 0x56, + 0x5d, 0xa0, 0x2a, 0xd9, 0x74, 0xcd, 0x2f, 0xa8, 0x7c, 0x7d, 0x6d, 0x0c, 0xd8, 0x8a, 0x33, 0x93, + 0x64, 0xba, 0xf3, 0xbd, 0xe7, 0xb9, 0xe7, 0x9c, 0xfb, 0x9c, 0xe7, 0x7e, 0x19, 0x96, 0xc5, 0x8a, + 0x90, 0x11, 0x64, 0x05, 0x65, 0x84, 0xd3, 0xb2, 0x24, 0xa1, 0x46, 0xa6, 0xb3, 0x99, 0xd1, 0x9e, + 0xa7, 0x5b, 0x8a, 0xac, 0xc9, 0x74, 0x4c, 0xac, 0x08, 0x69, 0xdd, 0x9a, 0x26, 0xd6, 0x74, 0x67, + 0x93, 0x99, 0xaf, 0xc9, 0x35, 0x19, 0xdb, 0x33, 0xfa, 0x97, 0x01, 0x65, 0xd8, 0x81, 0xa3, 0x86, + 0x88, 0x24, 0x4d, 0xf7, 0x63, 0x7c, 0x11, 0xc0, 0xff, 0x9d, 0x22, 0x99, 0x6e, 0x31, 0x84, 0xfb, + 0x89, 0x02, 0x7a, 0x5f, 0xad, 0xe5, 0x8c, 0xce, 0xc3, 0x16, 0x92, 0xf6, 0x24, 0x51, 0xa3, 0x3f, + 0x81, 0x70, 0x4b, 0x56, 0xb4, 0x92, 0x58, 0x8d, 0x53, 0x29, 0x6a, 0x6d, 0x2a, 0x4b, 0xf7, 0x7b, + 0xec, 0x4c, 0xb7, 0xdc, 0x6c, 0xec, 0x70, 0xc4, 0xc0, 0xf1, 0x21, 0xfd, 0x6b, 0xaf, 0x4a, 0x7f, + 0x06, 0x61, 0xe2, 0x34, 0xee, 0x4f, 0x51, 0x6b, 0x91, 0xad, 0xe5, 0xb4, 0xc3, 0x24, 0xd2, 0x24, + 0x46, 0x36, 0xf8, 0xb6, 0xc7, 0xfa, 0x78, 0x73, 0x08, 0xbd, 0x08, 0x21, 0x55, 0xac, 0x49, 0x48, + 0x89, 0x07, 0xf4, 0x48, 0x3c, 0x69, 0xed, 0x4c, 0xbe, 0x78, 0xcd, 0xfa, 0xfe, 0x79, 0xcd, 0xfa, + 0xb8, 0x06, 0x30, 0xe3, 0x29, 0xf2, 0x48, 0x6d, 0xc9, 0x92, 0x8a, 0xe8, 0x87, 0x00, 0xc4, 0xd5, + 0x20, 0xdb, 0x85, 0x7e, 0x8f, 0x9d, 0x33, 0xb2, 0x1d, 0xd8, 0x38, 0x7e, 0x8a, 0x34, 0xf6, 0xaa, + 0x74, 0x1c, 0xc2, 0x1d, 0xa4, 0xa8, 0xa2, 0x2c, 0xe1, 0x9c, 0xa7, 0x78, 0xb3, 0xc9, 0xfd, 0x1e, + 0x80, 0xb9, 0xe1, 0x70, 0x45, 0xa5, 0x7b, 0x3d, 0x42, 0x0e, 0x20, 0xd6, 0x52, 0x50, 0x47, 0x94, + 0xdb, 0x6a, 0xc9, 0x96, 0x1b, 0x0e, 0x94, 0x4d, 0xf6, 0x7b, 0x2c, 0x43, 0x06, 0x8e, 0x83, 0x38, + 0x7e, 0xce, 0xec, 0xcd, 0x59, 0xc9, 0xda, 0x08, 0x0e, 0x5c, 0x9f, 0x60, 0x1e, 0xe6, 0x05, 0xb9, + 0x2d, 0x69, 0x48, 0x69, 0x95, 0x15, 0xad, 0x5b, 0x32, 0xe7, 0x1d, 0xc4, 0xe9, 0xb0, 0xfd, 0x1e, + 0x9b, 0x20, 0x54, 0x39, 0xa0, 0x38, 0x3e, 0x66, 0xef, 0xfe, 0xc6, 0xe8, 0xd5, 0x49, 0x6f, 0x29, + 0xb2, 0xfc, 0xb4, 0x24, 0x4a, 0xa2, 0x16, 0x9f, 0x48, 0x51, 0x6b, 0xd3, 0x76, 0xd2, 0x07, 0x36, + 0x8e, 0x9f, 0xc2, 0x0d, 0xac, 0xaa, 0x13, 0x98, 0x36, 0x2c, 0xa7, 0x48, 0xac, 0x9d, 0x6a, 0xf1, + 0x10, 0x9e, 0x0c, 0x63, 0x9b, 0x8c, 0xa1, 0xde, 0xce, 0x66, 0xfa, 0x4b, 0x8c, 0xc8, 0x26, 0xf4, + 0xa9, 0xf4, 0x7b, 0x6c, 0xcc, 0xee, 0xd7, 0x18, 0xcd, 0xf1, 0x11, 0xdc, 0x34, 0x90, 0x36, 0x19, + 0x85, 0x5d, 0x64, 0xf4, 0x08, 0x96, 0xc6, 0xea, 0x6a, 0xa9, 0xc8, 0xa6, 0x07, 0x6a, 0x58, 0x0f, + 0x7f, 0x8c, 0xe9, 0x61, 0x57, 0xa8, 0x5f, 0x4f, 0x0f, 0xc3, 0x12, 0xf5, 0x7b, 0x94, 0xe8, 0x09, + 0xdc, 0x1b, 0xaa, 0x88, 0xcd, 0x05, 0x5e, 0x29, 0x59, 0xae, 0xdf, 0x63, 0x93, 0x0e, 0xa5, 0xb3, + 0xfb, 0x5b, 0xb0, 0x5b, 0x06, 0x8a, 0xba, 0x0d, 0x4d, 0x6c, 0x82, 0x51, 0xea, 0x92, 0xa6, 0x74, + 0x89, 0x24, 0xe6, 0xfb, 0x3d, 0x36, 0x6a, 0x2f, 0x9d, 0xa6, 0x74, 0x39, 0x7e, 0x12, 0x7f, 0xeb, + 0xab, 0xea, 0xe3, 0x0a, 0x22, 0x31, 0x2a, 0x88, 0x5d, 0xa1, 0x6e, 0x0a, 0x82, 0xfb, 0xd5, 0x0f, + 0x0b, 0xc3, 0xd6, 0x9c, 0x2c, 0x3d, 0x15, 0x95, 0xe6, 0x5d, 0x94, 0xde, 0xa2, 0xb2, 0x2c, 0xd4, + 0x71, 0xb1, 0x1d, 0xa8, 0x2c, 0x0b, 0x75, 0x93, 0x4a, 0x5d, 0x90, 0xa3, 0x54, 0x06, 0x6f, 0x85, + 0xca, 0x09, 0x17, 0x2a, 0x59, 0x58, 0x71, 0x24, 0xcb, 0xa2, 0xf3, 0x15, 0x05, 0xb1, 0x01, 0x22, + 0xd7, 0x90, 0x55, 0x74, 0xfd, 0x83, 0xe6, 0xfd, 0xc8, 0xbc, 0xfa, 0x80, 0x59, 0x81, 0x84, 0x43, + 0x6e, 0x56, 0xee, 0x6f, 0xfc, 0xb0, 0x38, 0x62, 0xbf, 0x43, 0x2d, 0x0c, 0x6f, 0xb5, 0x81, 0xf7, + 0xdc, 0x6a, 0xef, 0x56, 0x0e, 0x29, 0x48, 0x3a, 0x13, 0x66, 0x71, 0xfa, 0xd2, 0x0f, 0xff, 0xdb, + 0x57, 0x6b, 0x3c, 0x12, 0x3a, 0x47, 0x65, 0xa1, 0x8e, 0x34, 0xfa, 0x31, 0x84, 0x5a, 0xf8, 0x0b, + 0x33, 0x19, 0xd9, 0x4a, 0x38, 0x9e, 0x71, 0x06, 0x98, 0x1c, 0x71, 0x64, 0x00, 0xfd, 0x04, 0xa2, + 0x46, 0xba, 0x82, 0xdc, 0x6c, 0x8a, 0x5a, 0x13, 0x49, 0x1a, 0xa6, 0x77, 0x3a, 0x9b, 0xe8, 0xf7, + 0xd8, 0x7b, 0xf6, 0x09, 0x0d, 0x10, 0x1c, 0x3f, 0x8b, 0xbb, 0x72, 0x56, 0xcf, 0x18, 0x69, 0x81, + 0x5b, 0x21, 0x2d, 0xe8, 0x42, 0xda, 0x0f, 0x78, 0xc3, 0x19, 0x30, 0x62, 0x9d, 0x4d, 0x9f, 0x43, + 0x48, 0x41, 0x6a, 0xbb, 0x61, 0x30, 0x33, 0xb3, 0xb5, 0xea, 0xc8, 0x8c, 0x09, 0xe7, 0x31, 0xb4, + 0xd8, 0x6d, 0x21, 0x9e, 0x0c, 0xdb, 0x09, 0xea, 0x31, 0xb8, 0xbf, 0xfc, 0x00, 0xfb, 0x6a, 0xad, + 0x28, 0x36, 0x91, 0xdc, 0xbe, 0x19, 0xbe, 0xdb, 0x92, 0x82, 0x04, 0x24, 0x76, 0x50, 0xd5, 0x8d, + 0xef, 0x01, 0xc2, 0xe4, 0xfb, 0xd8, 0xea, 0xb9, 0x55, 0xbe, 0xbf, 0x02, 0x5a, 0x42, 0xcf, 0xb5, + 0x92, 0x8a, 0x7e, 0x6c, 0x23, 0x49, 0x40, 0x25, 0x05, 0x09, 0x1d, 0xcc, 0x7d, 0x30, 0xbb, 0xd2, + 0xef, 0xb1, 0x4b, 0x86, 0x87, 0x71, 0x0c, 0xc7, 0x47, 0xf5, 0xce, 0x02, 0xe9, 0xd3, 0xeb, 0xe1, + 0x41, 0xf1, 0xdf, 0xe1, 0x6b, 0x34, 0xe1, 0xf6, 0xa6, 0x2b, 0xf7, 0xca, 0xb8, 0x82, 0x10, 0xef, + 0x87, 0x12, 0x5e, 0x51, 0xff, 0x85, 0x02, 0x7e, 0x0a, 0x11, 0xb2, 0xac, 0xf4, 0x8c, 0xc8, 0xe6, + 0xb4, 0xd8, 0xef, 0xb1, 0xf4, 0xd0, 0x9a, 0xd3, 0x8d, 0x1c, 0x6f, 0x6c, 0x63, 0x46, 0xee, 0xb7, + 0xb9, 0x3d, 0x39, 0x57, 0x7e, 0xe2, 0x43, 0x2b, 0x1f, 0x72, 0xa9, 0x7c, 0x05, 0xdf, 0x22, 0x86, + 0x6b, 0x73, 0xd3, 0x02, 0xf8, 0xcd, 0x8f, 0xe5, 0xb5, 0x2b, 0xd4, 0x25, 0xf9, 0x59, 0x03, 0x55, + 0x6b, 0x08, 0xef, 0x57, 0x1f, 0xa0, 0x80, 0x35, 0x98, 0x2d, 0x0f, 0x7b, 0x33, 0x04, 0xc0, 0x8f, + 0x76, 0x0f, 0x6a, 0xac, 0x0f, 0xac, 0xba, 0xd5, 0x18, 0x1b, 0xcd, 0x1a, 0xef, 0xea, 0x8d, 0x8f, + 0x7c, 0x04, 0x09, 0xf8, 0xd1, 0x38, 0xc2, 0xd8, 0x0d, 0xd7, 0x65, 0xfd, 0x17, 0x0a, 0xe8, 0x71, + 0x10, 0xfd, 0x08, 0x52, 0x7c, 0xbe, 0x70, 0x74, 0x78, 0x50, 0xc8, 0x97, 0xf8, 0x7c, 0xe1, 0xf8, + 0xeb, 0x62, 0xa9, 0xf8, 0xed, 0x51, 0xbe, 0x74, 0x7c, 0x50, 0x38, 0xca, 0xe7, 0xf6, 0x9e, 0xec, + 0xe5, 0xbf, 0x88, 0xfa, 0x98, 0xd9, 0xb3, 0xf3, 0x54, 0xc4, 0xd6, 0x45, 0xaf, 0xc2, 0x92, 0xe3, + 0xb0, 0x83, 0xc3, 0xc3, 0xa3, 0x28, 0xc5, 0x4c, 0x9e, 0x9d, 0xa7, 0x82, 0xfa, 0x37, 0xbd, 0x01, + 0xcb, 0x8e, 0xc0, 0xc2, 0x71, 0x2e, 0x97, 0x2f, 0x14, 0xa2, 0x7e, 0x26, 0x72, 0x76, 0x9e, 0x0a, + 0x93, 0x26, 0x13, 0x7c, 0xf1, 0x73, 0xd2, 0xb7, 0xf5, 0x66, 0x12, 0x02, 0xfb, 0x6a, 0x8d, 0xae, + 0xc3, 0xec, 0xe8, 0x6b, 0xdf, 0x79, 0xf6, 0xe3, 0x6f, 0x6e, 0x26, 0xe3, 0x11, 0x68, 0xf1, 0x7c, + 0x0a, 0x33, 0x23, 0x0f, 0xe9, 0xfb, 0x1e, 0x5c, 0x14, 0x95, 0x2e, 0x93, 0xf6, 0x86, 0x73, 0x89, + 0xa4, 0xdf, 0x88, 0xbd, 0x44, 0xda, 0x15, 0xea, 0x9e, 0x22, 0xd9, 0x5e, 0x06, 0xb4, 0x06, 0xb4, + 0xc3, 0xab, 0x60, 0xdd, 0x83, 0x17, 0x82, 0x65, 0xb6, 0xbc, 0x63, 0xad, 0xa8, 0x12, 0x44, 0xc7, + 0x2e, 0xcf, 0x6b, 0x57, 0xf8, 0xb1, 0x90, 0xcc, 0x03, 0xaf, 0x48, 0x2b, 0xde, 0x33, 0x88, 0x39, + 0x5e, 0x78, 0xbd, 0x38, 0x32, 0xe7, 0xb9, 0x7d, 0x0d, 0xb0, 0x15, 0xf8, 0x7b, 0x00, 0xdb, 0xad, + 0x90, 0x73, 0x73, 0x31, 0xc0, 0x30, 0xeb, 0x57, 0x63, 0x2c, 0xef, 0x05, 0x08, 0x9b, 0x17, 0x20, + 0xd6, 0x6d, 0x18, 0x01, 0x30, 0xab, 0x57, 0x00, 0xec, 0xda, 0x1b, 0x39, 0x9b, 0xef, 0x5f, 0x31, + 0x94, 0xe0, 0xdc, 0xb5, 0xe7, 0x72, 0x9e, 0xd4, 0x61, 0x76, 0xf4, 0x10, 0x70, 0xcd, 0x72, 0x04, + 0xe8, 0xbe, 0x78, 0x5d, 0x36, 0xc9, 0x6c, 0xe1, 0xed, 0x45, 0x92, 0x7a, 0x77, 0x91, 0xa4, 0xfe, + 0xbe, 0x48, 0x52, 0x2f, 0x2f, 0x93, 0xbe, 0x77, 0x97, 0x49, 0xdf, 0x9f, 0x97, 0x49, 0xdf, 0xc9, + 0xe3, 0x9a, 0xa8, 0x9d, 0xb6, 0x2b, 0x69, 0x41, 0x6e, 0x66, 0x04, 0x59, 0x6d, 0xca, 0x6a, 0x46, + 0xac, 0x08, 0x1b, 0x35, 0x39, 0xd3, 0xd9, 0xce, 0x34, 0xe5, 0x6a, 0xbb, 0x81, 0x54, 0xe3, 0xc7, + 0xe3, 0x83, 0x87, 0x1b, 0xe6, 0xbf, 0x47, 0xad, 0xdb, 0x42, 0x6a, 0x25, 0x84, 0xff, 0x3b, 0x6e, + 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x51, 0x2e, 0xf7, 0xe5, 0x06, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1478,6 +1495,13 @@ func (m *MsgChannelOpenInitResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintTx(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x12 + } if len(m.ChannelId) > 0 { i -= len(m.ChannelId) copy(dAtA[i:], m.ChannelId) @@ -1586,6 +1610,13 @@ func (m *MsgChannelOpenTryResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro _ = i var l int _ = l + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintTx(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -2326,6 +2357,10 @@ func (m *MsgChannelOpenInitResponse) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2368,6 +2403,10 @@ func (m *MsgChannelOpenTryResponse) Size() (n int) { } var l int _ = l + l = len(m.Version) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2877,6 +2916,38 @@ func (m *MsgChannelOpenInitResponse) Unmarshal(dAtA []byte) error { } m.ChannelId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -3205,6 +3276,38 @@ func (m *MsgChannelOpenTryResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgChannelOpenTryResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/modules/core/04-channel/types/version.go b/modules/core/04-channel/types/version.go index 15477635e7f..a2696d291ed 100644 --- a/modules/core/04-channel/types/version.go +++ b/modules/core/04-channel/types/version.go @@ -4,7 +4,7 @@ import "strings" const ChannelVersionDelimiter = ":" -// SplitChannelVersion splits the channel version string +// SplitChannelVersion middleware version will split the channel version string // into the outermost middleware version and the underlying app version. // It will use the default delimiter `:` for middleware versions. // In case there's no delimeter, this function returns an empty string for the middleware version (first return argument), diff --git a/modules/core/05-port/types/module.go b/modules/core/05-port/types/module.go index 9f754fe0a3e..e6ba8f3449b 100644 --- a/modules/core/05-port/types/module.go +++ b/modules/core/05-port/types/module.go @@ -113,6 +113,12 @@ type ICS4Wrapper interface { packet exported.PacketI, ack exported.Acknowledgement, ) error + + GetAppVersion( + ctx sdk.Context, + portID, + channelID string, + ) (string, bool) } // Middleware must implement IBCModule to wrap communication from core IBC to underlying application diff --git a/modules/core/keeper/msg_server.go b/modules/core/keeper/msg_server.go index 4893f82dd66..c7a8e87dffe 100644 --- a/modules/core/keeper/msg_server.go +++ b/modules/core/keeper/msg_server.go @@ -196,6 +196,7 @@ func (k Keeper) ChannelOpenInit(goCtx context.Context, msg *channeltypes.MsgChan return &channeltypes.MsgChannelOpenInitResponse{ ChannelId: channelID, + Version: msg.Channel.Version, }, nil } @@ -234,7 +235,9 @@ func (k Keeper) ChannelOpenTry(goCtx context.Context, msg *channeltypes.MsgChann // Write channel into state k.ChannelKeeper.WriteOpenTryChannel(ctx, msg.PortId, channelID, msg.Channel.Ordering, msg.Channel.ConnectionHops, msg.Channel.Counterparty, version) - return &channeltypes.MsgChannelOpenTryResponse{}, nil + return &channeltypes.MsgChannelOpenTryResponse{ + Version: version, + }, nil } // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. diff --git a/proto/ibc/applications/fee/v1/ack.proto b/proto/ibc/applications/fee/v1/ack.proto new file mode 100644 index 00000000000..728c7536c6b --- /dev/null +++ b/proto/ibc/applications/fee/v1/ack.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; + +import "gogoproto/gogo.proto"; + +// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +message IncentivizedAcknowledgement { + // the underlying app acknowledgement result bytes + bytes result = 1; + // the relayer address which submits the recv packet message + string forward_relayer_address = 2 [(gogoproto.moretags) = "yaml:\"forward_relayer_address\""]; + // success flag of the base application callback + bool underlying_app_success = 3 [(gogoproto.moretags) = "yaml:\"underlying_app_successl\""]; +} diff --git a/proto/ibc/applications/fee/v1/fee.proto b/proto/ibc/applications/fee/v1/fee.proto new file mode 100644 index 00000000000..e7a1fa438df --- /dev/null +++ b/proto/ibc/applications/fee/v1/fee.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; + +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Fee defines the ICS29 receive, acknowledgement and timeout fees +message Fee { + // the packet receive fee + repeated cosmos.base.v1beta1.Coin recv_fee = 1 [ + (gogoproto.moretags) = "yaml:\"recv_fee\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // the packet acknowledgement fee + repeated cosmos.base.v1beta1.Coin ack_fee = 2 [ + (gogoproto.moretags) = "yaml:\"ack_fee\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // the packet timeout fee + repeated cosmos.base.v1beta1.Coin timeout_fee = 3 [ + (gogoproto.moretags) = "yaml:\"timeout_fee\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// PacketFee contains ICS29 relayer fees, refund address and optional list of permitted relayers +message PacketFee { + // fee encapsulates the recv, ack and timeout fees associated with an IBC packet + Fee fee = 1 [(gogoproto.nullable) = false]; + // the refund address for unspent fees + string refund_address = 2 [(gogoproto.moretags) = "yaml:\"refund_address\""]; + // optional list of relayers permitted to receive fees + repeated string relayers = 3; +} + +// PacketFees contains a list of type PacketFee +message PacketFees { + // list of packet fees + repeated PacketFee packet_fees = 1 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; +} + +// IdentifiedPacketFees contains a list of type PacketFee and associated PacketId +message IdentifiedPacketFees { + // unique packet identifier comprised of the channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 1 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; + // list of packet fees + repeated PacketFee packet_fees = 2 [(gogoproto.moretags) = "yaml:\"packet_fees\"", (gogoproto.nullable) = false]; +} diff --git a/proto/ibc/applications/fee/v1/genesis.proto b/proto/ibc/applications/fee/v1/genesis.proto new file mode 100644 index 00000000000..cae132239d6 --- /dev/null +++ b/proto/ibc/applications/fee/v1/genesis.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; + +import "gogoproto/gogo.proto"; +import "ibc/applications/fee/v1/fee.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// GenesisState defines the ICS29 fee middleware genesis state +message GenesisState { + // list of identified packet fees + repeated IdentifiedPacketFees identified_fees = 1 + [(gogoproto.moretags) = "yaml:\"identified_fees\"", (gogoproto.nullable) = false]; + // list of fee enabled channels + repeated FeeEnabledChannel fee_enabled_channels = 2 + [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; + // list of registered relayer addresses + repeated RegisteredRelayerAddress registered_relayers = 3 + [(gogoproto.moretags) = "yaml:\"registered_relayers\"", (gogoproto.nullable) = false]; + // list of forward relayer addresses + repeated ForwardRelayerAddress forward_relayers = 4 + [(gogoproto.moretags) = "yaml:\"forward_relayers\"", (gogoproto.nullable) = false]; +} + +// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +message FeeEnabledChannel { + // unique port identifier + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + // unique channel identifier + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; +} + +// RegisteredRelayerAddress contains the address and counterparty address for a specific relayer (for distributing fees) +message RegisteredRelayerAddress { + // the relayer address + string address = 1; + // the counterparty relayer address + string counterparty_address = 2 [(gogoproto.moretags) = "yaml:\"counterparty_address\""]; + // unique channel identifier + string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; +} + +// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements +message ForwardRelayerAddress { + // the forward relayer address + string address = 1; + // unique packet identifer comprised of the channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 2 + [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"packet_id\""]; +} diff --git a/proto/ibc/applications/fee/v1/metadata.proto b/proto/ibc/applications/fee/v1/metadata.proto new file mode 100644 index 00000000000..0afb3e09b2e --- /dev/null +++ b/proto/ibc/applications/fee/v1/metadata.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; + +import "gogoproto/gogo.proto"; + +// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring +// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning +message Metadata { + // fee_version defines the ICS29 fee version + string fee_version = 1 [(gogoproto.moretags) = "yaml:\"fee_version\""]; + // app_version defines the underlying application version, which may or may not be a JSON encoded bytestring + string app_version = 2 [(gogoproto.moretags) = "yaml:\"app_version\""]; +} diff --git a/proto/ibc/applications/fee/v1/query.proto b/proto/ibc/applications/fee/v1/query.proto new file mode 100644 index 00000000000..acab12f5161 --- /dev/null +++ b/proto/ibc/applications/fee/v1/query.proto @@ -0,0 +1,203 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "ibc/applications/fee/v1/fee.proto"; +import "ibc/applications/fee/v1/genesis.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Query defines the ICS29 gRPC querier service. +service Query { + // IncentivizedPackets returns all incentivized packets and their associated fees + rpc IncentivizedPackets(QueryIncentivizedPacketsRequest) returns (QueryIncentivizedPacketsResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/incentivized_packets"; + } + + // IncentivizedPacket returns all packet fees for a packet given its identifier + rpc IncentivizedPacket(QueryIncentivizedPacketRequest) returns (QueryIncentivizedPacketResponse) { + option (google.api.http).get = + "/ibc/apps/fee/v1/incentivized_packet/port/{packet_id.port_id}/channel/{packet_id.channel_id}/sequence/" + "{packet_id.sequence}"; + } + + // Gets all incentivized packets for a specific channel + rpc IncentivizedPacketsForChannel(QueryIncentivizedPacketsForChannelRequest) + returns (QueryIncentivizedPacketsForChannelResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/incentivized_packets/port/{port_id}/channel/{channel_id}"; + } + + // TotalRecvFees returns the total receive fees for a packet given its identifier + rpc TotalRecvFees(QueryTotalRecvFeesRequest) returns (QueryTotalRecvFeesResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/total_recv_fees/port/{packet_id.port_id}/channel/" + "{packet_id.channel_id}/sequence/{packet_id.sequence}"; + } + + // TotalAckFees returns the total acknowledgement fees for a packet given its identifier + rpc TotalAckFees(QueryTotalAckFeesRequest) returns (QueryTotalAckFeesResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/total_ack_fees/port/{packet_id.port_id}/channel/" + "{packet_id.channel_id}/sequence/{packet_id.sequence}"; + } + + // TotalTimeoutFees returns the total timeout fees for a packet given its identifier + rpc TotalTimeoutFees(QueryTotalTimeoutFeesRequest) returns (QueryTotalTimeoutFeesResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/total_timeout_fees/port/{packet_id.port_id}/channel/" + "{packet_id.channel_id}/sequence/{packet_id.sequence}"; + } + + // CounterpartyAddress returns the registered counterparty address for forward relaying + rpc CounterpartyAddress(QueryCounterpartyAddressRequest) returns (QueryCounterpartyAddressResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/counterparty_address/{relayer_address}/channel/{channel_id}"; + } + + // FeeEnabledChannels returns a list of all fee enabled channels + rpc FeeEnabledChannels(QueryFeeEnabledChannelsRequest) returns (QueryFeeEnabledChannelsResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/fee_enabled"; + } + + // FeeEnabledChannel returns true if the provided port and channel identifiers belong to a fee enabled channel + rpc FeeEnabledChannel(QueryFeeEnabledChannelRequest) returns (QueryFeeEnabledChannelResponse) { + option (google.api.http).get = "/ibc/apps/fee/v1/fee_enabled/port/{port_id}/channel/{channel_id}"; + } +} + +// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc +message QueryIncentivizedPacketsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + // block height at which to query + uint64 query_height = 2; +} + +// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc +message QueryIncentivizedPacketsResponse { + // list of identified fees for incentivized packets + repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1 [(gogoproto.nullable) = false]; +} + +// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +message QueryIncentivizedPacketRequest { + // unique packet identifier comprised of channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; + // block height at which to query + uint64 query_height = 2; +} + +// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc +message QueryIncentivizedPacketResponse { + // the identified fees for the incentivized packet + ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packet = 1 [(gogoproto.nullable) = false]; +} + +// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets +// for a specific channel +message QueryIncentivizedPacketsForChannelRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + string port_id = 2; + string channel_id = 3; + // Height to query at + uint64 query_height = 4; +} + +// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC +message QueryIncentivizedPacketsForChannelResponse { + // Map of all incentivized_packets + repeated ibc.applications.fee.v1.IdentifiedPacketFees incentivized_packets = 1; +} + +// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc +message QueryTotalRecvFeesRequest { + // the packet identifier for the associated fees + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; +} + +// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc +message QueryTotalRecvFeesResponse { + // the total packet receive fees + repeated cosmos.base.v1beta1.Coin recv_fees = 1 [ + (gogoproto.moretags) = "yaml:\"recv_fees\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc +message QueryTotalAckFeesRequest { + // the packet identifier for the associated fees + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; +} + +// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc +message QueryTotalAckFeesResponse { + // the total packet acknowledgement fees + repeated cosmos.base.v1beta1.Coin ack_fees = 1 [ + (gogoproto.moretags) = "yaml:\"ack_fees\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc +message QueryTotalTimeoutFeesRequest { + // the packet identifier for the associated fees + ibc.core.channel.v1.PacketId packet_id = 1 [(gogoproto.nullable) = false]; +} + +// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc +message QueryTotalTimeoutFeesResponse { + // the total packet timeout fees + repeated cosmos.base.v1beta1.Coin timeout_fees = 1 [ + (gogoproto.moretags) = "yaml:\"timeout_fees\"", + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +// QueryCounterpartyAddressRequest defines the request type for the CounterpartyAddress rpc +message QueryCounterpartyAddressRequest { + // unique channel identifier + string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + // the relayer address to which the counterparty is registered + string relayer_address = 2 [(gogoproto.moretags) = "yaml:\"relayer_address\""]; +} + +// QueryCounterpartyAddressResponse defines the response type for the CounterpartyAddress rpc +message QueryCounterpartyAddressResponse { + // the counterparty address used to compensate forward relaying + string counterparty_address = 1 [(gogoproto.moretags) = "yaml:\"counterparty_address\""]; +} + +// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc +message QueryFeeEnabledChannelsRequest { + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; + // block height at which to query + uint64 query_height = 2; +} + +// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc +message QueryFeeEnabledChannelsResponse { + // list of fee enabled channels + repeated ibc.applications.fee.v1.FeeEnabledChannel fee_enabled_channels = 1 + [(gogoproto.moretags) = "yaml:\"fee_enabled_channels\"", (gogoproto.nullable) = false]; +} + +// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc +message QueryFeeEnabledChannelRequest { + // unique port identifier + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + // unique channel identifier + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; +} + +// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc +message QueryFeeEnabledChannelResponse { + // boolean flag representing the fee enabled channel status + bool fee_enabled = 1 [(gogoproto.moretags) = "yaml:\"fee_enabled\""]; +} diff --git a/proto/ibc/applications/fee/v1/tx.proto b/proto/ibc/applications/fee/v1/tx.proto new file mode 100644 index 00000000000..7a0044cd363 --- /dev/null +++ b/proto/ibc/applications/fee/v1/tx.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; + +package ibc.applications.fee.v1; + +option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types"; + +import "gogoproto/gogo.proto"; +import "ibc/applications/fee/v1/fee.proto"; +import "ibc/core/channel/v1/channel.proto"; + +// Msg defines the ICS29 Msg service. +service Msg { + // RegisterCounterpartyAddress defines a rpc handler method for MsgRegisterCounterpartyAddress + // RegisterCounterpartyAddress is called by the relayer on each channelEnd and allows them to specify their + // counterparty address before relaying. This ensures they will be properly compensated for forward relaying since + // destination chain must send back relayer's source address (counterparty address) in acknowledgement. This function + // may be called more than once by a relayer, in which case, latest counterparty address is always used. + rpc RegisterCounterpartyAddress(MsgRegisterCounterpartyAddress) returns (MsgRegisterCounterpartyAddressResponse); + + // PayPacketFee defines a rpc handler method for MsgPayPacketFee + // PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of the packet at the next sequence + // NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows + // initiates the lifecycle of the incentivized packet + rpc PayPacketFee(MsgPayPacketFee) returns (MsgPayPacketFeeResponse); + + // PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync + // PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to + // incentivize the relaying of a known packet (i.e. at a particular sequence) + rpc PayPacketFeeAsync(MsgPayPacketFeeAsync) returns (MsgPayPacketFeeAsyncResponse); +} + +// MsgRegisterCounterpartyAddress defines the request type for the RegisterCounterpartyAddress rpc +message MsgRegisterCounterpartyAddress { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // the relayer address + string address = 1; + // the counterparty relayer address + string counterparty_address = 2 [(gogoproto.moretags) = "yaml:\"counterparty_address\""]; + // unique channel identifier + string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; +} + +// MsgRegisterCounterpartyAddressResponse defines the response type for the RegisterCounterpartyAddress rpc +message MsgRegisterCounterpartyAddressResponse {} + +// MsgPayPacketFee defines the request type for the PayPacketFee rpc +// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be +// paid for +message MsgPayPacketFee { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // fee encapsulates the recv, ack and timeout fees associated with an IBC packet + ibc.applications.fee.v1.Fee fee = 1 [(gogoproto.nullable) = false]; + // the source port unique identifier + string source_port_id = 2 [(gogoproto.moretags) = "yaml:\"source_port_id\""]; + // the source channel unique identifer + string source_channel_id = 3 [(gogoproto.moretags) = "yaml:\"source_channel_id\""]; + // account address to refund fee if necessary + string signer = 4; + // optional list of relayers permitted to the receive packet fees + repeated string relayers = 5; +} + +// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc +message MsgPayPacketFeeResponse {} + +// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc +// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) +message MsgPayPacketFeeAsync { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // unique packet identifier comprised of the channel ID, port ID and sequence + ibc.core.channel.v1.PacketId packet_id = 1 + [(gogoproto.moretags) = "yaml:\"packet_id\"", (gogoproto.nullable) = false]; + // the packet fee associated with a particular IBC packet + PacketFee packet_fee = 2 [(gogoproto.moretags) = "yaml:\"packet_fee\"", (gogoproto.nullable) = false]; +} + +// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc +message MsgPayPacketFeeAsyncResponse {} diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto index 68c6ec17b19..177f2c85fd1 100644 --- a/proto/ibc/core/channel/v1/channel.proto +++ b/proto/ibc/core/channel/v1/channel.proto @@ -132,6 +132,20 @@ message PacketState { bytes data = 4; } +// PacketId is an identifer for a unique Packet +// Source chains refer to packets by source port/channel +// Destination chains refer to packets by destination port/channel +message PacketId { + option (gogoproto.goproto_getters) = false; + + // channel port identifier + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; + // channel unique identifier + string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + // packet sequence + uint64 sequence = 3; +} + // Acknowledgement is the recommended acknowledgement format to be used by // app-specific protocols. // NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental diff --git a/proto/ibc/core/channel/v1/tx.proto b/proto/ibc/core/channel/v1/tx.proto index 15714173a1a..d34b00e9124 100644 --- a/proto/ibc/core/channel/v1/tx.proto +++ b/proto/ibc/core/channel/v1/tx.proto @@ -68,6 +68,7 @@ message MsgChannelOpenInit { // MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. message MsgChannelOpenInitResponse { string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; + string version = 2; } // MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel @@ -91,7 +92,9 @@ message MsgChannelOpenTry { } // MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -message MsgChannelOpenTryResponse {} +message MsgChannelOpenTryResponse { + string version = 1; +} // MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge // the change of channel state to TRYOPEN on Chain B. diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index efcfb36b30a..4736b47540b 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -31,7 +31,8 @@ buf protoc \ -I "third_party/proto" \ --doc_out=./docs/ibc \ --doc_opt=./docs/protodoc-markdown.tmpl,proto-docs.md \ - $(find "$(pwd)/proto" -maxdepth 5 -name '*.proto') + $(find "$(pwd)/proto" -maxdepth 7 -name '*.proto') +go mod tidy # move proto files to the right places cp -r github.com/cosmos/ibc-go/v*/modules/* modules/ diff --git a/testing/endpoint.go b/testing/endpoint.go index e466bd781e9..7c272d7847f 100644 --- a/testing/endpoint.go +++ b/testing/endpoint.go @@ -328,7 +328,14 @@ func (endpoint *Endpoint) ChanOpenAck() error { proof, height, endpoint.Chain.SenderAccount.GetAddress().String(), ) - return endpoint.Chain.sendMsgs(msg) + + if err = endpoint.Chain.sendMsgs(msg); err != nil { + return err + } + + endpoint.ChannelConfig.Version = endpoint.GetChannel().Version + + return nil } // ChanOpenConfirm will construct and execute a MsgChannelOpenConfirm on the associated endpoint. diff --git a/testing/simapp/app.go b/testing/simapp/app.go index ee148806852..738e29cdd59 100644 --- a/testing/simapp/app.go +++ b/testing/simapp/app.go @@ -89,6 +89,9 @@ import ( icahostkeeper "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" icahosttypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types" + ibcfee "github.com/cosmos/ibc-go/v3/modules/apps/29-fee" + ibcfeekeeper "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/keeper" + ibcfeetypes "github.com/cosmos/ibc-go/v3/modules/apps/29-fee/types" transfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer" ibctransferkeeper "github.com/cosmos/ibc-go/v3/modules/apps/transfer/keeper" ibctransfertypes "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" @@ -111,6 +114,11 @@ import ( const appName = "SimApp" +// IBC application testing ports +const ( + MockFeePort string = ibcmock.ModuleName + ibcfeetypes.ModuleName +) + var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string @@ -142,6 +150,7 @@ var ( ica.AppModuleBasic{}, authzmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, + ibcfee.AppModuleBasic{}, ) // module account permissions @@ -153,6 +162,7 @@ var ( stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + ibcfeetypes.ModuleName: nil, icatypes.ModuleName: nil, } ) @@ -192,6 +202,7 @@ type SimApp struct { ParamsKeeper paramskeeper.Keeper AuthzKeeper authzkeeper.Keeper IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + IBCFeeKeeper ibcfeekeeper.Keeper ICAControllerKeeper icacontrollerkeeper.Keeper ICAHostKeeper icahostkeeper.Keeper EvidenceKeeper evidencekeeper.Keeper @@ -201,6 +212,8 @@ type SimApp struct { // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper ScopedTransferKeeper capabilitykeeper.ScopedKeeper + ScopedIBCFeeKeeper capabilitykeeper.ScopedKeeper + ScopedFeeMockKeeper capabilitykeeper.ScopedKeeper ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper ScopedIBCMockKeeper capabilitykeeper.ScopedKeeper @@ -209,6 +222,7 @@ type SimApp struct { // make IBC modules public for test purposes // these modules are never directly routed to by the IBC Router ICAAuthModule ibcmock.IBCModule + FeeMockModule ibcmock.IBCModule // the module manager mm *module.Manager @@ -235,7 +249,6 @@ func NewSimApp( homePath string, invCheckPeriod uint, encodingConfig simappparams.EncodingConfig, appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), ) *SimApp { - appCodec := encodingConfig.Marshaler legacyAmino := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry @@ -250,7 +263,7 @@ func NewSimApp( minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, icacontrollertypes.StoreKey, icahosttypes.StoreKey, capabilitytypes.StoreKey, - authzkeeper.StoreKey, + authzkeeper.StoreKey, ibcfeetypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -281,6 +294,7 @@ func NewSimApp( // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do // not replicate if you do not need to test core IBC or light clients. scopedIBCMockKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.ModuleName) + scopedFeeMockKeeper := app.CapabilityKeeper.ScopeToModule(MockFeePort) scopedICAMockKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.ModuleName + icacontrollertypes.SubModuleName) // seal capability keeper after scoping modules @@ -339,18 +353,35 @@ func NewSimApp( &stakingKeeper, govRouter, ) - // Create Transfer Keepers + app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(appCodec, keys[ibcfeetypes.StoreKey], app.GetSubspace(ibcfeetypes.ModuleName), + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, + ) + + // Create Transfer Keeper and pass IBCFeeKeeper as expected Channel and PortKeeper + // since fee middleware will wrap the IBCKeeper for underlying application. app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.IBCFeeKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, ) transferModule := transfer.NewAppModule(app.TransferKeeper) transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) + // create fee-wrapped transfer module + feeTransferModule := ibcfee.NewIBCModule(app.IBCFeeKeeper, transferIBCModule) + + feeModule := ibcfee.NewAppModule(app.IBCFeeKeeper) + // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do // not replicate if you do not need to test core IBC or light clients. mockModule := ibcmock.NewAppModule(&app.IBCKeeper.PortKeeper) + + // create fee wrapped mock module + feeMockModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewMockIBCApp(MockFeePort, scopedFeeMockKeeper)) + app.FeeMockModule = feeMockModule + + feeWithMockModule := ibcfee.NewIBCModule(app.IBCFeeKeeper, feeMockModule) + mockIBCModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewMockIBCApp(ibcmock.ModuleName, scopedIBCMockKeeper)) app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( @@ -376,12 +407,15 @@ func NewSimApp( icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) // Create static IBC router, add app routes, then set and seal it + // pass in top-level (fully-wrapped) IBCModules to IBC Router ibcRouter := porttypes.NewRouter() ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerIBCModule). // ica with mock auth module stack route to ica (top level of middleware stack) - AddRoute(ibctransfertypes.ModuleName, transferIBCModule). - AddRoute(ibcmock.ModuleName, mockIBCModule) + AddRoute(ibctransfertypes.ModuleName, feeTransferModule). + AddRoute(ibcmock.ModuleName, mockIBCModule). + AddRoute(MockFeePort, feeWithMockModule) + app.IBCKeeper.SetRouter(ibcRouter) // create evidence keeper with router @@ -421,6 +455,7 @@ func NewSimApp( params.NewAppModule(app.ParamsKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), transferModule, + feeModule, icaModule, mockModule, ) @@ -434,13 +469,13 @@ func NewSimApp( upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, ibctransfertypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, govtypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, authz.ModuleName, feegrant.ModuleName, - paramstypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcmock.ModuleName, + paramstypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, ) app.mm.SetOrderEndBlockers( crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, ibctransfertypes.ModuleName, capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, minttypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, - upgradetypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcmock.ModuleName, + upgradetypes.ModuleName, vestingtypes.ModuleName, icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -452,7 +487,7 @@ func NewSimApp( capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName, ibctransfertypes.ModuleName, - icatypes.ModuleName, ibcmock.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, + icatypes.ModuleName, ibcfeetypes.ModuleName, ibcmock.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, ) app.mm.RegisterInvariants(&app.CrisisKeeper) @@ -529,6 +564,7 @@ func NewSimApp( // note replicate if you do not need to test core IBC or light clients. app.ScopedIBCMockKeeper = scopedIBCMockKeeper app.ScopedICAMockKeeper = scopedICAMockKeeper + app.ScopedFeeMockKeeper = scopedFeeMockKeeper return app } diff --git a/testing/values.go b/testing/values.go index 6bdf782c65a..655a4731a74 100644 --- a/testing/values.go +++ b/testing/values.go @@ -14,6 +14,7 @@ import ( commitmenttypes "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types" ibctmtypes "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types" "github.com/cosmos/ibc-go/v3/testing/mock" + "github.com/cosmos/ibc-go/v3/testing/simapp" ) const ( @@ -33,6 +34,7 @@ const ( // Application Ports TransferPort = ibctransfertypes.ModuleName MockPort = mock.ModuleName + MockFeePort = simapp.MockFeePort // used for testing proposals Title = "title"