Skip to content

Commit

Permalink
chore: adding basic Msg service and RegisterAccount rpc boilerpla…
Browse files Browse the repository at this point in the history
…te (#2068) (#2109)

* adding new controller msg service, register account types, register interfaces and boilerplate

* fixing typo

* fixing protodoc and regenerate godocs

* adding channel id to MsgRegisterAccountResponse

(cherry picked from commit 5765fe7)

Co-authored-by: Damian Nolan <[email protected]>
  • Loading branch information
mergify[bot] and damiannolan authored Aug 25, 2022
1 parent d8d0a7e commit 2acc05b
Show file tree
Hide file tree
Showing 8 changed files with 819 additions and 2 deletions.
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 @@ -1504,6 +1510,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

0 comments on commit 2acc05b

Please sign in to comment.