From 9f6078bd2310a179345b079a03108554e0d48a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 21 Jul 2021 13:08:12 +0200 Subject: [PATCH 1/2] rename ibc-account -> interchain-accounts --- .../client/cli/query.go | 6 +++--- .../genesis.go | 4 ++-- .../keeper/account.go | 2 +- .../keeper/grpc_query.go | 2 +- .../keeper/handshake.go | 0 .../keeper/handshake_test.go | 0 .../keeper/keeper.go | 6 +++--- .../keeper/relay.go | 2 +- .../module.go | 8 +++---- .../spec/03_types.md | 0 .../spec/04_keeper.md | 0 .../spec/05_packets.md | 0 .../27-interchain-accounts/spec/README.md | 21 +++++++++++++++++++ .../types/account.go | 4 ++-- .../types/account.pb.go | 0 .../types/codec.go | 2 +- .../types/encoder.go | 0 .../types/errors.go | 0 .../types/expected_keepers.go | 0 .../types/genesis.go | 0 .../types/genesis.pb.go | 0 .../types/hook.go | 0 .../types/keys.go | 0 .../types/packet.go | 0 .../types/querier.go | 0 .../types/query.pb.go | 0 .../types/types.pb.go | 0 modules/apps/ibc-account/spec/README.md | 21 ------------------- 28 files changed, 39 insertions(+), 39 deletions(-) rename modules/apps/{ibc-account => 27-interchain-accounts}/client/cli/query.go (82%) rename modules/apps/{ibc-account => 27-interchain-accounts}/genesis.go (80%) rename modules/apps/{ibc-account => 27-interchain-accounts}/keeper/account.go (98%) rename modules/apps/{ibc-account => 27-interchain-accounts}/keeper/grpc_query.go (92%) rename modules/apps/{ibc-account => 27-interchain-accounts}/keeper/handshake.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/keeper/handshake_test.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/keeper/keeper.go (95%) rename modules/apps/{ibc-account => 27-interchain-accounts}/keeper/relay.go (98%) rename modules/apps/{ibc-account => 27-interchain-accounts}/module.go (96%) rename modules/apps/{ibc-account => 27-interchain-accounts}/spec/03_types.md (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/spec/04_keeper.md (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/spec/05_packets.md (100%) create mode 100644 modules/apps/27-interchain-accounts/spec/README.md rename modules/apps/{ibc-account => 27-interchain-accounts}/types/account.go (95%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/account.pb.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/codec.go (90%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/encoder.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/errors.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/expected_keepers.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/genesis.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/genesis.pb.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/hook.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/keys.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/packet.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/querier.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/query.pb.go (100%) rename modules/apps/{ibc-account => 27-interchain-accounts}/types/types.pb.go (100%) delete mode 100644 modules/apps/ibc-account/spec/README.md diff --git a/modules/apps/ibc-account/client/cli/query.go b/modules/apps/27-interchain-accounts/client/cli/query.go similarity index 82% rename from modules/apps/ibc-account/client/cli/query.go rename to modules/apps/27-interchain-accounts/client/cli/query.go index 35f10bc04f4..73f4389fa58 100644 --- a/modules/apps/ibc-account/client/cli/query.go +++ b/modules/apps/27-interchain-accounts/client/cli/query.go @@ -7,13 +7,13 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/types" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types" ) func GetQueryCmd() *cobra.Command { cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the ibc account module", + Use: "interchain-accounts", + Short: "Querying commands for the interchain accounts module", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, diff --git a/modules/apps/ibc-account/genesis.go b/modules/apps/27-interchain-accounts/genesis.go similarity index 80% rename from modules/apps/ibc-account/genesis.go rename to modules/apps/27-interchain-accounts/genesis.go index 1bffea2b5c4..5a9569b54e6 100644 --- a/modules/apps/ibc-account/genesis.go +++ b/modules/apps/27-interchain-accounts/genesis.go @@ -4,8 +4,8 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/keeper" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/types" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/keeper" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types" ) func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, state types.GenesisState) { diff --git a/modules/apps/ibc-account/keeper/account.go b/modules/apps/27-interchain-accounts/keeper/account.go similarity index 98% rename from modules/apps/ibc-account/keeper/account.go rename to modules/apps/27-interchain-accounts/keeper/account.go index e165eea4773..714b2258125 100644 --- a/modules/apps/ibc-account/keeper/account.go +++ b/modules/apps/27-interchain-accounts/keeper/account.go @@ -6,7 +6,7 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" channeltypes "github.com/cosmos/ibc-go/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/modules/core/24-host" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/types" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types" "github.com/tendermint/tendermint/crypto/tmhash" ) diff --git a/modules/apps/ibc-account/keeper/grpc_query.go b/modules/apps/27-interchain-accounts/keeper/grpc_query.go similarity index 92% rename from modules/apps/ibc-account/keeper/grpc_query.go rename to modules/apps/27-interchain-accounts/keeper/grpc_query.go index 512134cd40a..7f54be0f80a 100644 --- a/modules/apps/ibc-account/keeper/grpc_query.go +++ b/modules/apps/27-interchain-accounts/keeper/grpc_query.go @@ -8,7 +8,7 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/types" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types" ) var _ types.QueryServer = Keeper{} diff --git a/modules/apps/ibc-account/keeper/handshake.go b/modules/apps/27-interchain-accounts/keeper/handshake.go similarity index 100% rename from modules/apps/ibc-account/keeper/handshake.go rename to modules/apps/27-interchain-accounts/keeper/handshake.go diff --git a/modules/apps/ibc-account/keeper/handshake_test.go b/modules/apps/27-interchain-accounts/keeper/handshake_test.go similarity index 100% rename from modules/apps/ibc-account/keeper/handshake_test.go rename to modules/apps/27-interchain-accounts/keeper/handshake_test.go diff --git a/modules/apps/ibc-account/keeper/keeper.go b/modules/apps/27-interchain-accounts/keeper/keeper.go similarity index 95% rename from modules/apps/ibc-account/keeper/keeper.go rename to modules/apps/27-interchain-accounts/keeper/keeper.go index 4958645e367..39751e48ab1 100644 --- a/modules/apps/ibc-account/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/keeper/keeper.go @@ -14,7 +14,7 @@ import ( host "github.com/cosmos/ibc-go/modules/core/24-host" "github.com/tendermint/tendermint/libs/log" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/types" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types" ) // Keeper defines the IBC transfer keeper @@ -34,7 +34,7 @@ type Keeper struct { memKey sdk.StoreKey } -// NewKeeper creates a new IBC account Keeper instance +// NewKeeper creates a new interchain account Keeper instance func NewKeeper( memKey sdk.StoreKey, cdc codec.BinaryCodec, key sdk.StoreKey, @@ -112,7 +112,7 @@ func (k Keeper) BindPort(ctx sdk.Context, portID string) error { return k.ClaimCapability(ctx, cap, host.PortPath(portID)) } -// GetPort returns the portID for the ibc account module. Used in ExportGenesis +// GetPort returns the portID for the interchain accounts module. Used in ExportGenesis func (k Keeper) GetPort(ctx sdk.Context) string { store := ctx.KVStore(k.storeKey) return string(store.Get([]byte(types.PortKey))) diff --git a/modules/apps/ibc-account/keeper/relay.go b/modules/apps/27-interchain-accounts/keeper/relay.go similarity index 98% rename from modules/apps/ibc-account/keeper/relay.go rename to modules/apps/27-interchain-accounts/keeper/relay.go index 09e616b0ec0..d434fcfac9e 100644 --- a/modules/apps/ibc-account/keeper/relay.go +++ b/modules/apps/27-interchain-accounts/keeper/relay.go @@ -8,7 +8,7 @@ import ( clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/modules/core/24-host" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/types" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types" "github.com/tendermint/tendermint/crypto/tmhash" ) diff --git a/modules/apps/ibc-account/module.go b/modules/apps/27-interchain-accounts/module.go similarity index 96% rename from modules/apps/ibc-account/module.go rename to modules/apps/27-interchain-accounts/module.go index 6c3b93ba995..9ba760952c8 100644 --- a/modules/apps/ibc-account/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -17,9 +17,9 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" abci "github.com/tendermint/tendermint/abci/types" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/client/cli" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/keeper" - "github.com/cosmos/ibc-go/modules/apps/ibc-account/types" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/client/cli" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/keeper" + "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types" channeltypes "github.com/cosmos/ibc-go/modules/core/04-channel/types" porttypes "github.com/cosmos/ibc-go/modules/core/05-port/types" ibcexported "github.com/cosmos/ibc-go/modules/core/exported" @@ -68,7 +68,7 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) types.RegisterInterfaces(registry) } -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc-account module. +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the interchain accounts module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { } diff --git a/modules/apps/ibc-account/spec/03_types.md b/modules/apps/27-interchain-accounts/spec/03_types.md similarity index 100% rename from modules/apps/ibc-account/spec/03_types.md rename to modules/apps/27-interchain-accounts/spec/03_types.md diff --git a/modules/apps/ibc-account/spec/04_keeper.md b/modules/apps/27-interchain-accounts/spec/04_keeper.md similarity index 100% rename from modules/apps/ibc-account/spec/04_keeper.md rename to modules/apps/27-interchain-accounts/spec/04_keeper.md diff --git a/modules/apps/ibc-account/spec/05_packets.md b/modules/apps/27-interchain-accounts/spec/05_packets.md similarity index 100% rename from modules/apps/ibc-account/spec/05_packets.md rename to modules/apps/27-interchain-accounts/spec/05_packets.md diff --git a/modules/apps/27-interchain-accounts/spec/README.md b/modules/apps/27-interchain-accounts/spec/README.md new file mode 100644 index 00000000000..abd08ea7d40 --- /dev/null +++ b/modules/apps/27-interchain-accounts/spec/README.md @@ -0,0 +1,21 @@ + + +# Interchain Account + +## Abstract + +This document specifies the ICS 27 Interchain Account module for the Cosmos SDK. + +The Interchain Accounts module manages the creation of Interchain Accounts. This module is built based on the [ICS27 specification](https://github.com/cosmos/ibc/tree/master/spec/app/ics-027-interchain-accounts). Interchain Accounts allow a remote, IBC-connected **controller blockchain** to request an arbitrary transaction to be executed on the **host blockchain**(the chain which hosts the IBC account) via the interchain account. It should be noted that an interchain account has similar properties to a user account, and are bound to the same restrictions (unbonding periods, redelegation rules, etc). + +The current implementation allows the same interchain account module on the destination chain to run any of the domiciling blockchain's native transactions that a user account is able to request(i.e. same module can handle 'send', 'stake', 'vote', etc), but the controlling chain/source chain must implement its own logic for controlling the interchain account. + +## Contents +1. **[Types](03_types.md)** +2. **[Keeper](04_keeper.md)** +3. **[Packets](05_packets.md)** diff --git a/modules/apps/ibc-account/types/account.go b/modules/apps/27-interchain-accounts/types/account.go similarity index 95% rename from modules/apps/ibc-account/types/account.go rename to modules/apps/27-interchain-accounts/types/account.go index eaf8f65e590..eed5f4c46e8 100644 --- a/modules/apps/ibc-account/types/account.go +++ b/modules/apps/27-interchain-accounts/types/account.go @@ -33,12 +33,12 @@ func NewIBCAccount(ba *authtypes.BaseAccount, accountOwner string) *IBCAccount { // SetPubKey - Implements AccountI func (IBCAccount) SetPubKey(pubKey crypto.PubKey) error { - return fmt.Errorf("not supported for ibc accounts") + return fmt.Errorf("not supported for interchain accounts") } // SetSequence - Implements AccountI func (IBCAccount) SetSequence(seq uint64) error { - return fmt.Errorf("not supported for ibc accounts") + return fmt.Errorf("not supported for interchain accounts") } func (ia IBCAccount) Validate() error { diff --git a/modules/apps/ibc-account/types/account.pb.go b/modules/apps/27-interchain-accounts/types/account.pb.go similarity index 100% rename from modules/apps/ibc-account/types/account.pb.go rename to modules/apps/27-interchain-accounts/types/account.pb.go diff --git a/modules/apps/ibc-account/types/codec.go b/modules/apps/27-interchain-accounts/types/codec.go similarity index 90% rename from modules/apps/ibc-account/types/codec.go rename to modules/apps/27-interchain-accounts/types/codec.go index e00ea354452..72b907dae61 100644 --- a/modules/apps/ibc-account/types/codec.go +++ b/modules/apps/27-interchain-accounts/types/codec.go @@ -10,7 +10,7 @@ import ( // provided LegacyAmino codec. These types are used for Amino JSON serialization func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterInterface((*IBCAccountI)(nil), nil) - cdc.RegisterConcrete(&IBCAccount{}, "ibc-account/IBCAccount", nil) + cdc.RegisterConcrete(&IBCAccount{}, "27-interchain-accounts/IBCAccount", nil) } // RegisterInterface associates protoName with AccountI interface diff --git a/modules/apps/ibc-account/types/encoder.go b/modules/apps/27-interchain-accounts/types/encoder.go similarity index 100% rename from modules/apps/ibc-account/types/encoder.go rename to modules/apps/27-interchain-accounts/types/encoder.go diff --git a/modules/apps/ibc-account/types/errors.go b/modules/apps/27-interchain-accounts/types/errors.go similarity index 100% rename from modules/apps/ibc-account/types/errors.go rename to modules/apps/27-interchain-accounts/types/errors.go diff --git a/modules/apps/ibc-account/types/expected_keepers.go b/modules/apps/27-interchain-accounts/types/expected_keepers.go similarity index 100% rename from modules/apps/ibc-account/types/expected_keepers.go rename to modules/apps/27-interchain-accounts/types/expected_keepers.go diff --git a/modules/apps/ibc-account/types/genesis.go b/modules/apps/27-interchain-accounts/types/genesis.go similarity index 100% rename from modules/apps/ibc-account/types/genesis.go rename to modules/apps/27-interchain-accounts/types/genesis.go diff --git a/modules/apps/ibc-account/types/genesis.pb.go b/modules/apps/27-interchain-accounts/types/genesis.pb.go similarity index 100% rename from modules/apps/ibc-account/types/genesis.pb.go rename to modules/apps/27-interchain-accounts/types/genesis.pb.go diff --git a/modules/apps/ibc-account/types/hook.go b/modules/apps/27-interchain-accounts/types/hook.go similarity index 100% rename from modules/apps/ibc-account/types/hook.go rename to modules/apps/27-interchain-accounts/types/hook.go diff --git a/modules/apps/ibc-account/types/keys.go b/modules/apps/27-interchain-accounts/types/keys.go similarity index 100% rename from modules/apps/ibc-account/types/keys.go rename to modules/apps/27-interchain-accounts/types/keys.go diff --git a/modules/apps/ibc-account/types/packet.go b/modules/apps/27-interchain-accounts/types/packet.go similarity index 100% rename from modules/apps/ibc-account/types/packet.go rename to modules/apps/27-interchain-accounts/types/packet.go diff --git a/modules/apps/ibc-account/types/querier.go b/modules/apps/27-interchain-accounts/types/querier.go similarity index 100% rename from modules/apps/ibc-account/types/querier.go rename to modules/apps/27-interchain-accounts/types/querier.go diff --git a/modules/apps/ibc-account/types/query.pb.go b/modules/apps/27-interchain-accounts/types/query.pb.go similarity index 100% rename from modules/apps/ibc-account/types/query.pb.go rename to modules/apps/27-interchain-accounts/types/query.pb.go diff --git a/modules/apps/ibc-account/types/types.pb.go b/modules/apps/27-interchain-accounts/types/types.pb.go similarity index 100% rename from modules/apps/ibc-account/types/types.pb.go rename to modules/apps/27-interchain-accounts/types/types.pb.go diff --git a/modules/apps/ibc-account/spec/README.md b/modules/apps/ibc-account/spec/README.md deleted file mode 100644 index 88b4a45e658..00000000000 --- a/modules/apps/ibc-account/spec/README.md +++ /dev/null @@ -1,21 +0,0 @@ - - -# IBC Account - -## Abstract - -This document specifies the IBC account module for the Cosmos SDK. - -The IBCAccount module manages the creation of IBC Accounts and ICS20 packet handling for the IBC accounts. This module is built based on the [ICS27 specification](https://github.com/cosmos/ics/tree/master/spec/ics-027-interchain-accounts). IBC Accounts allow a remote, IBC-connected **source blockchain** to request an arbitrary transaction to be executed on the **destination blockchain**(the chain which hosts the IBC account) via the IBC account. It should be noted that an IBC account has similar properties to a user account, and are bound to the same restrictions (unbonding periods, redelegation rules, etc). - -The current implementation allows the same IBCAccount module on the destination chain to run any of the domiciling blockchain's native transactions that a user account is able to request(i.e. same module can handle 'send', 'stake', 'vote', etc), but the controlling chain/source chain must implement its own logic for controlling the IBC account from its own IBCAccount logic. - -## Contents -1. **[Types](03_types.md)** -2. **[Keeper](04_keeper.md)** -3. **[Packets](05_packets.md)** From eb0d32463ccd8b0fca293c23509025c4bf7e296d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20Axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Wed, 21 Jul 2021 15:58:31 +0200 Subject: [PATCH 2/2] fix codeowner file --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3ea5f422078..cdb6284df09 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ # CODEOWNERS for interchain-accounts module -*/modules/apps/ibc-account @seantking @colin-axner @AdityaSripal +*/modules/apps/27-interchain-accounts @seantking @colin-axner @AdityaSripal