forked from cosmos/ibc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v6.2.x' of github.com:cosmos/ibc-go into releas…
…e/v6.2.0
- Loading branch information
Showing
36 changed files
with
1,717 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,10 @@ jobs: | |
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
go-version: 1.19 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: latest | ||
version: v1.51.2 | ||
args: --timeout 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ jobs: | |
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
go-version: 1.19 | ||
- name: Display go version | ||
run: go version | ||
- name: install tparse | ||
|
@@ -41,7 +41,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
go-version: 1.19 | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
|
@@ -52,6 +52,13 @@ jobs: | |
- name: Build | ||
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build | ||
|
||
docker-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Docker Build | ||
run: docker build . --no-cache --build-arg IBC_GO_VERSION=v6.1.0 | ||
|
||
split-test-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -89,7 +96,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
go-version: 1.19 | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# `TransferAuthorization` | ||
|
||
`TransferAuthorization` implements the `Authorization` interface for `ibc.applications.transfer.v1.MsgTransfer`. It allows a granter to grant a grantee the privilege to submit `MsgTransfer` on its behalf. Please see the [Cosmos SDK docs](https://docs.cosmos.network/v0.47/modules/authz) for more details on granting privileges via the `x/authz` module. | ||
|
||
More specifically, the granter allows the grantee to transfer funds that belong to the granter over a specified channel. | ||
|
||
For the specified channel, the granter must be able to specify a spend limit of a specific denomination they wish to allow the grantee to be able to transfer. | ||
|
||
The granter may be able to specify the list of addresses that they allow to receive funds. If empty, then all addresses are allowed. | ||
|
||
|
||
It takes: | ||
|
||
- a `SourcePort` and a `SourceChannel` which together comprise the unique transfer channel identifier over which authorized funds can be transferred. | ||
|
||
- a `SpendLimit` that specifies the maximum amount of tokens the grantee can transfer. The `SpendLimit` is updated as the tokens are transfered, unless the sentinel value of the maximum value for a 256-bit unsigned integer (i.e. 2^256 - 1) is used for the amount, in which case the `SpendLimit` will not be updated (please be aware that using this sentinel value will grant the grantee the privilege to transfer **all** the tokens of a given denomination available at the granter's account). The helper function `UnboundedSpendLimit` in the `types` package of the `transfer` module provides the sentinel value that can be used. This `SpendLimit` may also be updated to increase or decrease the limit as the granter wishes. | ||
|
||
- an `AllowList` list that specifies the list of addresses that are allowed to receive funds. If this list is empty, then all addresses are allowed to receive funds from the `TransferAuthorization`. | ||
|
||
Setting a `TransferAuthorization` is expected to fail if: | ||
- the spend limit is nil | ||
- the denomination of the spend limit is an invalid coin type | ||
- the source port ID is invalid | ||
- the source channel ID is invalid | ||
- there are duplicate entries in the `AllowList` | ||
|
||
Below is the `TransferAuthorization` message: | ||
|
||
```golang | ||
func NewTransferAuthorization(allocations ...Allocation) *TransferAuthorization { | ||
return &TransferAuthorization{ | ||
Allocations: allocations, | ||
} | ||
} | ||
|
||
type Allocation struct { | ||
// the port on which the packet will be sent | ||
SourcePort string | ||
// the channel by which the packet will be sent | ||
SourceChannel string | ||
// spend limitation on the channel | ||
SpendLimit sdk.Coins | ||
// allow list of receivers, an empty allow list permits any receiver address | ||
AllowList []string | ||
} | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.