diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index ee2d23577e6..d88d3fd001c 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -89,9 +89,17 @@ - [Query](#ibc.applications.interchain_accounts.controller.v1.Query) +- [ibc/applications/interchain_accounts/v1/packet.proto](#ibc/applications/interchain_accounts/v1/packet.proto) + - [CosmosTx](#ibc.applications.interchain_accounts.v1.CosmosTx) + - [InterchainAccountPacketData](#ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) + + - [Type](#ibc.applications.interchain_accounts.v1.Type) + - [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) + - [MsgSubmitTx](#ibc.applications.interchain_accounts.controller.v1.MsgSubmitTx) + - [MsgSubmitTxResponse](#ibc.applications.interchain_accounts.controller.v1.MsgSubmitTxResponse) - [Msg](#ibc.applications.interchain_accounts.controller.v1.Msg) @@ -117,12 +125,6 @@ - [ibc/applications/interchain_accounts/v1/metadata.proto](#ibc/applications/interchain_accounts/v1/metadata.proto) - [Metadata](#ibc.applications.interchain_accounts.v1.Metadata) -- [ibc/applications/interchain_accounts/v1/packet.proto](#ibc/applications/interchain_accounts/v1/packet.proto) - - [CosmosTx](#ibc.applications.interchain_accounts.v1.CosmosTx) - - [InterchainAccountPacketData](#ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) - - - [Type](#ibc.applications.interchain_accounts.v1.Type) - - [ibc/applications/transfer/v1/transfer.proto](#ibc/applications/transfer/v1/transfer.proto) - [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) - [Params](#ibc.applications.transfer.v1.Params) @@ -1517,6 +1519,67 @@ Query provides defines the gRPC querier service. + +

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

@@ -1555,6 +1618,40 @@ MsgRegisterAccountResponse defines the response for Msg/RegisterAccount + + + +### MsgSubmitTx +MsgSubmitTx defines the payload for MsgSubmitTx + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `owner` | [string](#string) | | | +| `connection_id` | [string](#string) | | | +| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. | +| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp in absolute nanoseconds since unix epoch. The timeout is disabled when set to 0. | +| `packet_data` | [ibc.applications.interchain_accounts.v1.InterchainAccountPacketData](#ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) | | | + + + + + + + + +### MsgSubmitTxResponse +MsgSubmitTxResponse defines the response for MsgSubmitTx + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | | + + + + + @@ -1570,6 +1667,7 @@ 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. | | +| `SubmitTx` | [MsgSubmitTx](#ibc.applications.interchain_accounts.controller.v1.MsgSubmitTx) | [MsgSubmitTxResponse](#ibc.applications.interchain_accounts.controller.v1.MsgSubmitTxResponse) | SubmitTx defines a rpc handler for MsgSubmitTx. | | @@ -1830,67 +1928,6 @@ See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel- - -

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

diff --git a/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go b/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go index 206ef9e6660..aaf50bcb930 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go @@ -23,3 +23,8 @@ func (k Keeper) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAcc ChannelId: channelID, }, nil } + +// SubmitTx defines a rpc handler for MsgSubmitTx +func (k Keeper) SubmitTx(goCtx context.Context, msg *types.MsgSubmitTx) (*types.MsgSubmitTxResponse, error) { + return &types.MsgSubmitTxResponse{}, nil +} diff --git a/modules/apps/27-interchain-accounts/controller/types/codec.go b/modules/apps/27-interchain-accounts/controller/types/codec.go index 70f6abcdb5e..a1b5d7fd56a 100644 --- a/modules/apps/27-interchain-accounts/controller/types/codec.go +++ b/modules/apps/27-interchain-accounts/controller/types/codec.go @@ -7,5 +7,9 @@ import ( // RegisterInterfaces registers the interchain accounts controller message types using the provided InterfaceRegistry func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRegisterAccount{}) + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgRegisterAccount{}, + &MsgSubmitTx{}, + ) } diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index fec761e2123..0b0dfce1922 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -6,6 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" + clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" ) @@ -46,3 +48,24 @@ func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{accAddr} } + +// NewMsgSubmitTx creates a new instance of MsgSubmitTx +func NewMsgSubmitTx(owner, connectionID string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, packetData icatypes.InterchainAccountPacketData) *MsgSubmitTx { + return &MsgSubmitTx{ + ConnectionId: connectionID, + Owner: owner, + TimeoutHeight: timeoutHeight, + TimeoutTimestamp: timeoutTimestamp, + PacketData: packetData, + } +} + +// ValidateBasic implements sdk.Msg +func (msg MsgSubmitTx) ValidateBasic() error { + return nil +} + +// GetSigners implements sdk.Msg +func (msg MsgSubmitTx) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{} +} diff --git a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go index 12540ab7d39..cae572e1533 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -6,6 +6,8 @@ package types import ( context "context" fmt "fmt" + types1 "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" + types "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -113,9 +115,102 @@ func (m *MsgRegisterAccountResponse) GetChannelId() string { return "" } +// MsgSubmitTx defines the payload for MsgSubmitTx +type MsgSubmitTx struct { + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + TimeoutHeight types.Height `protobuf:"bytes,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height" yaml:"timeout_height"` + // Timeout timestamp in absolute nanoseconds since unix epoch. + // The timeout is disabled when set to 0. + TimeoutTimestamp uint64 `protobuf:"varint,4,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` + PacketData types1.InterchainAccountPacketData `protobuf:"bytes,5,opt,name=packet_data,json=packetData,proto3" json:"packet_data" yaml:"packet_data"` +} + +func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } +func (m *MsgSubmitTx) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitTx) ProtoMessage() {} +func (*MsgSubmitTx) Descriptor() ([]byte, []int) { + return fileDescriptor_7def041328c84a30, []int{2} +} +func (m *MsgSubmitTx) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitTx.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 *MsgSubmitTx) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitTx.Merge(m, src) +} +func (m *MsgSubmitTx) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitTx) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitTx.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitTx proto.InternalMessageInfo + +// MsgSubmitTxResponse defines the response for MsgSubmitTx +type MsgSubmitTxResponse struct { + Sequence uint64 `protobuf:"varint,1,opt,name=sequence,proto3" json:"sequence,omitempty"` +} + +func (m *MsgSubmitTxResponse) Reset() { *m = MsgSubmitTxResponse{} } +func (m *MsgSubmitTxResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitTxResponse) ProtoMessage() {} +func (*MsgSubmitTxResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7def041328c84a30, []int{3} +} +func (m *MsgSubmitTxResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitTxResponse.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 *MsgSubmitTxResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitTxResponse.Merge(m, src) +} +func (m *MsgSubmitTxResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitTxResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitTxResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitTxResponse proto.InternalMessageInfo + +func (m *MsgSubmitTxResponse) GetSequence() uint64 { + if m != nil { + return m.Sequence + } + return 0 +} + func init() { proto.RegisterType((*MsgRegisterAccount)(nil), "ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount") proto.RegisterType((*MsgRegisterAccountResponse)(nil), "ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse") + proto.RegisterType((*MsgSubmitTx)(nil), "ibc.applications.interchain_accounts.controller.v1.MsgSubmitTx") + proto.RegisterType((*MsgSubmitTxResponse)(nil), "ibc.applications.interchain_accounts.controller.v1.MsgSubmitTxResponse") } func init() { @@ -123,31 +218,45 @@ func init() { } var fileDescriptor_7def041328c84a30 = []byte{ - // 379 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xbd, 0x6a, 0xe3, 0x40, - 0x14, 0x85, 0x35, 0x6b, 0xf6, 0xc7, 0xc3, 0x2e, 0xcb, 0x0a, 0x2f, 0x08, 0x17, 0xd2, 0xa2, 0x6a, - 0x1b, 0xcf, 0x60, 0xef, 0x2e, 0x0b, 0x0e, 0x29, 0xe2, 0x22, 0xe0, 0xc2, 0x21, 0xa8, 0x4c, 0x63, - 0xa4, 0xd1, 0x20, 0x4f, 0x90, 0xe6, 0x0a, 0xcd, 0x58, 0x89, 0xdf, 0x20, 0x4d, 0x20, 0x8f, 0xe0, - 0x36, 0x65, 0xde, 0x22, 0xa5, 0xcb, 0x54, 0x26, 0xd8, 0x4d, 0x6a, 0x3f, 0x41, 0x90, 0x7f, 0xa2, - 0x24, 0x76, 0x13, 0x48, 0x37, 0x67, 0x2e, 0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 0xae, 0x45, 0x37, 0x6c, - 0xdd, 0x20, 0x5c, 0xe9, 0xa9, 0xc8, 0xbc, 0x46, 0xf8, 0xfb, 0xeb, 0x45, 0x0f, 0xc9, 0xdb, 0x4f, - 0x49, 0xb6, 0x13, 0xd6, 0x8f, 0xde, 0xc7, 0x67, 0xb3, 0x69, 0xe7, 0xf4, 0x76, 0x66, 0xa3, 0xc9, - 0xcc, 0x46, 0xf7, 0x33, 0x1b, 0x5d, 0xcd, 0x6d, 0x63, 0x32, 0xb7, 0x8d, 0xbb, 0xb9, 0x6d, 0x9c, - 0x1c, 0x47, 0x42, 0x0f, 0x86, 0x01, 0x61, 0x90, 0x50, 0x06, 0x2a, 0x01, 0x45, 0x45, 0xc0, 0x1a, - 0x11, 0xd0, 0xfc, 0x1f, 0x4d, 0x20, 0x1c, 0xc6, 0x5c, 0x15, 0xc5, 0x52, 0xb4, 0xf5, 0xbf, 0x51, - 0x66, 0x68, 0xec, 0xea, 0x94, 0x1e, 0xa5, 0x5c, 0x05, 0x9f, 0x96, 0x55, 0xf8, 0xf3, 0x18, 0x00, - 0x00, 0xff, 0xff, 0x48, 0x33, 0x66, 0x3d, 0x93, 0x02, 0x00, 0x00, + // 605 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbf, 0x6f, 0xd3, 0x40, + 0x18, 0xb5, 0xfb, 0x03, 0xda, 0x2b, 0x05, 0x6a, 0x5a, 0xc9, 0xb2, 0xc0, 0xae, 0x3c, 0x75, 0xe9, + 0x9d, 0x1c, 0x8a, 0x90, 0x8a, 0x10, 0x22, 0xaa, 0x80, 0x0c, 0x45, 0x95, 0xe9, 0xc4, 0x12, 0xce, + 0x97, 0x93, 0x73, 0x60, 0xdf, 0x19, 0xdf, 0xd9, 0xb4, 0x23, 0x1b, 0x0b, 0x12, 0x03, 0x2b, 0x52, + 0x57, 0xfe, 0x93, 0x8e, 0x1d, 0x99, 0x22, 0xd4, 0x2e, 0xcc, 0xf9, 0x0b, 0x90, 0x7f, 0xc4, 0x49, + 0x49, 0x87, 0x16, 0x98, 0xe2, 0xef, 0xbb, 0xf7, 0xde, 0xbd, 0x4f, 0xef, 0xcb, 0x81, 0x47, 0x2c, + 0x20, 0x08, 0x27, 0x49, 0xc4, 0x08, 0x56, 0x4c, 0x70, 0x89, 0x18, 0x57, 0x34, 0x25, 0x7d, 0xcc, + 0x78, 0x17, 0x13, 0x22, 0x32, 0xae, 0x24, 0x22, 0x82, 0xab, 0x54, 0x44, 0x11, 0x4d, 0x51, 0xee, + 0x21, 0x75, 0x00, 0x93, 0x54, 0x28, 0x61, 0xb4, 0x58, 0x40, 0xe0, 0x24, 0x19, 0x5e, 0x40, 0x86, + 0x63, 0x32, 0xcc, 0x3d, 0x6b, 0x35, 0x14, 0xa1, 0x28, 0xe9, 0xa8, 0xf8, 0xaa, 0x94, 0x2c, 0xa7, + 0xb0, 0x41, 0x44, 0x4a, 0x11, 0x89, 0x18, 0xe5, 0xaa, 0xb8, 0xa6, 0xfa, 0xaa, 0x01, 0x5b, 0x97, + 0xf2, 0x99, 0x7b, 0x28, 0xc1, 0xe4, 0x1d, 0xad, 0x59, 0xee, 0x67, 0x1d, 0x18, 0xbb, 0x32, 0xf4, + 0x69, 0xc8, 0xa4, 0xa2, 0xe9, 0xd3, 0x0a, 0x67, 0x3c, 0x06, 0xcb, 0x44, 0x70, 0x4e, 0x49, 0xa1, + 0xd4, 0x65, 0x3d, 0x53, 0x5f, 0xd7, 0x37, 0x16, 0xdb, 0xe6, 0x70, 0xe0, 0xac, 0x1e, 0xe2, 0x38, + 0xda, 0x76, 0xcf, 0x1d, 0xbb, 0xfe, 0x8d, 0x71, 0xdd, 0xe9, 0x19, 0xab, 0x60, 0x5e, 0x7c, 0xe0, + 0x34, 0x35, 0x67, 0x0a, 0x9a, 0x5f, 0x15, 0x86, 0x09, 0xae, 0xe7, 0x34, 0x95, 0x4c, 0x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b, 0xdc, 0xb6, 0xea, 0xa1, 0x8c, 0xca, 0xcf, 0xc4, 0x35, 0xae, 0x0f, + 0x92, 0x06, 0x37, 0x91, 0xb9, 0x07, 0xee, 0x4c, 0xc4, 0xd3, 0x84, 0x6d, 0x81, 0x05, 0x49, 0xdf, + 0x67, 0x94, 0x13, 0x5a, 0x26, 0x35, 0xe7, 0x37, 0x75, 0xeb, 0x78, 0x06, 0xcc, 0xee, 0xca, 0xd0, + 0xf8, 0xae, 0x83, 0x5b, 0x7f, 0xee, 0xee, 0x33, 0x78, 0xf5, 0x3f, 0x1d, 0x9c, 0x5e, 0x3a, 0xeb, + 0xe5, 0xff, 0xd1, 0x69, 0xe6, 0xf9, 0xaa, 0x83, 0x85, 0x66, 0x07, 0x9f, 0xfc, 0xa5, 0xf8, 0x48, + 0xc0, 0x7a, 0xfe, 0x8f, 0x02, 0x23, 0x5b, 0xed, 0xb7, 0xc7, 0xa7, 0xb6, 0x7e, 0x72, 0x6a, 0xeb, + 0x3f, 0x4f, 0x6d, 0xfd, 0xcb, 0x99, 0xad, 0x9d, 0x9c, 0xd9, 0xda, 0x8f, 0x33, 0x5b, 0x7b, 0xbd, + 0x17, 0x32, 0xd5, 0xcf, 0x02, 0x48, 0x44, 0x8c, 0x88, 0x90, 0xb1, 0x90, 0x88, 0x05, 0x64, 0x33, + 0x14, 0x28, 0x7f, 0x80, 0x62, 0xd1, 0xcb, 0x22, 0x2a, 0x8b, 0x17, 0x47, 0xa2, 0xd6, 0xc3, 0xcd, + 0xf1, 0xe5, 0x9b, 0x17, 0x3d, 0x8a, 0xea, 0x30, 0xa1, 0x32, 0xb8, 0x56, 0x3e, 0x3a, 0xf7, 0x7f, + 0x07, 0x00, 0x00, 0xff, 0xff, 0xca, 0xfa, 0x92, 0xae, 0x54, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -164,6 +273,8 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // RegisterAccount defines a rpc handler for MsgRegisterAccount. RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) + // SubmitTx defines a rpc handler for MsgSubmitTx. + SubmitTx(ctx context.Context, in *MsgSubmitTx, opts ...grpc.CallOption) (*MsgSubmitTxResponse, error) } type msgClient struct { @@ -183,10 +294,21 @@ func (c *msgClient) RegisterAccount(ctx context.Context, in *MsgRegisterAccount, return out, nil } +func (c *msgClient) SubmitTx(ctx context.Context, in *MsgSubmitTx, opts ...grpc.CallOption) (*MsgSubmitTxResponse, error) { + out := new(MsgSubmitTxResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.interchain_accounts.controller.v1.Msg/SubmitTx", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // RegisterAccount defines a rpc handler for MsgRegisterAccount. RegisterAccount(context.Context, *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) + // SubmitTx defines a rpc handler for MsgSubmitTx. + SubmitTx(context.Context, *MsgSubmitTx) (*MsgSubmitTxResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -196,6 +318,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) RegisterAccount(ctx context.Context, req *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterAccount not implemented") } +func (*UnimplementedMsgServer) SubmitTx(ctx context.Context, req *MsgSubmitTx) (*MsgSubmitTxResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitTx not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -219,6 +344,24 @@ func _Msg_RegisterAccount_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Msg_SubmitTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitTx) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitTx(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.interchain_accounts.controller.v1.Msg/SubmitTx", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitTx(ctx, req.(*MsgSubmitTx)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "ibc.applications.interchain_accounts.controller.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -227,6 +370,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RegisterAccount", Handler: _Msg_RegisterAccount_Handler, }, + { + MethodName: "SubmitTx", + Handler: _Msg_SubmitTx_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "ibc/applications/interchain_accounts/controller/v1/tx.proto", @@ -306,6 +453,96 @@ func (m *MsgRegisterAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgSubmitTx) 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 *MsgSubmitTx) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PacketData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.TimeoutTimestamp != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) + i-- + dAtA[i] = 0x20 + } + { + size, err := m.TimeoutHeight.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.ConnectionId) > 0 { + i -= len(m.ConnectionId) + copy(dAtA[i:], m.ConnectionId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitTxResponse) 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 *MsgSubmitTxResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sequence != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Sequence)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -351,6 +588,42 @@ func (m *MsgRegisterAccountResponse) Size() (n int) { return n } +func (m *MsgSubmitTx) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.TimeoutHeight.Size() + n += 1 + l + sovTx(uint64(l)) + if m.TimeoutTimestamp != 0 { + n += 1 + sovTx(uint64(m.TimeoutTimestamp)) + } + l = m.PacketData.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgSubmitTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sequence != 0 { + n += 1 + sovTx(uint64(m.Sequence)) + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -585,6 +858,274 @@ func (m *MsgRegisterAccountResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSubmitTx) 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: MsgSubmitTx: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitTx: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", 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.ConnectionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", 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.TimeoutHeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutTimestamp", wireType) + } + m.TimeoutTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TimeoutTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketData", 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.PacketData.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 *MsgSubmitTxResponse) 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: MsgSubmitTxResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitTxResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowTx + } + 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 := 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 diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index b72a69ae631..51c30fa0c0e 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -5,11 +5,15 @@ package ibc.applications.interchain_accounts.controller.v1; option go_package = "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types"; import "gogoproto/gogo.proto"; +import "ibc/core/client/v1/client.proto"; +import "ibc/applications/interchain_accounts/v1/packet.proto"; // Msg defines the 27-interchain-accounts/controller Msg service. service Msg { // RegisterAccount defines a rpc handler for MsgRegisterAccount. rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse); + // SubmitTx defines a rpc handler for MsgSubmitTx. + rpc SubmitTx(MsgSubmitTx) returns (MsgSubmitTxResponse); } // MsgRegisterAccount defines the payload for Msg/RegisterAccount @@ -26,3 +30,26 @@ message MsgRegisterAccount { message MsgRegisterAccountResponse { string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; } + +// MsgSubmitTx defines the payload for MsgSubmitTx +message MsgSubmitTx { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string owner = 1; + string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + // Timeout height relative to the current block height. + // The timeout is disabled when set to 0. + ibc.core.client.v1.Height timeout_height = 3 + [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; + // Timeout timestamp in absolute nanoseconds since unix epoch. + // The timeout is disabled when set to 0. + uint64 timeout_timestamp = 4 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 5 + [(gogoproto.moretags) = "yaml:\"packet_data\"", (gogoproto.nullable) = false]; +} + +// MsgSubmitTxResponse defines the response for MsgSubmitTx +message MsgSubmitTxResponse { + uint64 sequence = 1; +} \ No newline at end of file