Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adding basic Msg service and RegisterAccount rpc boilerplate #2068

Merged
merged 7 commits into from
Aug 23, 2022
64 changes: 64 additions & 0 deletions docs/ibc/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@

- [Query](#ibc.applications.interchain_accounts.controller.v1.Query)

- [ibc/applications/interchain_accounts/controller/v1/tx.proto](#ibc/applications/interchain_accounts/controller/v1/tx.proto)
- [MsgRegisterAccount](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount)
- [MsgRegisterAccountResponse](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse)

- [Msg](#ibc.applications.interchain_accounts.controller.v1.Msg)

- [ibc/applications/interchain_accounts/host/v1/host.proto](#ibc/applications/interchain_accounts/host/v1/host.proto)
- [Params](#ibc.applications.interchain_accounts.host.v1.Params)

Expand Down Expand Up @@ -1511,6 +1517,64 @@ Query provides defines the gRPC querier service.



<a name="ibc/applications/interchain_accounts/controller/v1/tx.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## ibc/applications/interchain_accounts/controller/v1/tx.proto



<a name="ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount"></a>

### MsgRegisterAccount
MsgRegisterAccount defines the payload for Msg/RegisterAccount


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `connection_id` | [string](#string) | | |
| `owner` | [string](#string) | | |
| `version` | [string](#string) | | |






<a name="ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse"></a>

### MsgRegisterAccountResponse
MsgRegisterAccountResponse defines the response for Msg/RegisterAccount


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `channel_id` | [string](#string) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->


<a name="ibc.applications.interchain_accounts.controller.v1.Msg"></a>

### Msg
Msg defines the 27-interchain-accounts/controller Msg service.

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `RegisterAccount` | [MsgRegisterAccount](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount) | [MsgRegisterAccountResponse](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse) | RegisterAccount defines a rpc handler for MsgRegisterAccount. | |

<!-- end services -->



<a name="ibc/applications/interchain_accounts/host/v1/host.proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package keeper

import (
"context"

"github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types"
)

var _ types.MsgServer = Keeper{}

// RegisterAccount defines a rpc handler for MsgRegisterAccount
func (k Keeper) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAccount) (*types.MsgRegisterAccountResponse, error) {
return &types.MsgRegisterAccountResponse{}, nil
}
11 changes: 11 additions & 0 deletions modules/apps/27-interchain-accounts/controller/types/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package types

import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

// RegisterInterfaces registers the interchain accounts controller message types using the provided InterfaceRegistry
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRegisterAccount{})
}
24 changes: 24 additions & 0 deletions modules/apps/27-interchain-accounts/controller/types/msgs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package types

import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// NewMsgRegisterAccount creates a new instance of MsgRegisterAccount
func NewMsgRegisterAccount(connectionID, owner, version string) *MsgRegisterAccount {
return &MsgRegisterAccount{
ConnectionId: connectionID,
Owner: owner,
Version: version,
}
}

// ValidateBasic implements sdk.Msg
func (msg MsgRegisterAccount) ValidateBasic() error {
return nil
}

// GetSigners implements sdk.Msg
func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{}
}
Loading