From d20f2d29839cba75fc501373a7b50e97bef3204d Mon Sep 17 00:00:00 2001 From: Charly Date: Tue, 23 Aug 2022 13:58:05 +0200 Subject: [PATCH 01/20] add protos/rpcs, boilerplate --- docs/ibc/proto-docs.md | 31 ++ .../controller/keeper/msg_server.go | 5 + .../controller/types/codec.go | 1 + .../controller/types/msgs.go | 21 + .../controller/types/tx.pb.go | 523 +++++++++++++++++- .../controller/v1/tx.proto | 17 + 6 files changed, 573 insertions(+), 25 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 21d874ccdf2..d81c7c0a9fe 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -92,6 +92,8 @@ - [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) @@ -1555,6 +1557,34 @@ 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` | [string](#string) | | | +| `msg` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | + + + + + + + + +### MsgSubmitTxResponse +MsgSubmitTxResponse defines the response for MsgSubmitTx + + + + + @@ -1570,6 +1600,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. | | 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 e9d6adca3c6..25b27eb7523 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go @@ -12,3 +12,8 @@ var _ types.MsgServer = Keeper{} func (k Keeper) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAccount) (*types.MsgRegisterAccountResponse, error) { return &types.MsgRegisterAccountResponse{}, nil } + +// SubmitTx defines a rpc handler for MsgSendTx +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..41e43b9635f 100644 --- a/modules/apps/27-interchain-accounts/controller/types/codec.go +++ b/modules/apps/27-interchain-accounts/controller/types/codec.go @@ -8,4 +8,5 @@ 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), &MsgSubmitTx{}) } diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index 9033df4bc3c..64d1128e8b3 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -1,6 +1,7 @@ package types import ( + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -22,3 +23,23 @@ func (msg MsgRegisterAccount) ValidateBasic() error { func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{} } + +// NewMsgSendTx creates a new instance of MsgSendTx +func NewMsgSubmitTx(connectionID, owner, timeout string, msg []*codectypes.Any) *MsgSubmitTx { + return &MsgSubmitTx{ + ConnectionId: connectionID, + Owner: owner, + Timeout: timeout, + Msg: msg, + } +} + +// 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..c8337df7879 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,7 @@ package types import ( context "context" fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" @@ -113,9 +114,89 @@ 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 string `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` + Msg []*types.Any `protobuf:"bytes,4,rep,name=msg,proto3" json:"msg,omitempty"` +} + +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 { +} + +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 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 +204,38 @@ 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, 0xdf, 0xe1, 0xdc, 0xcb, 0xc1, 0x7b, 0x22, 0x60, 0xd4, - 0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xc8, 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, + // 484 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x31, 0x6f, 0xd3, 0x40, + 0x18, 0xf5, 0x25, 0x40, 0xdb, 0x2b, 0x08, 0x61, 0x52, 0xc9, 0x78, 0x70, 0x2a, 0x0f, 0xa8, 0x4b, + 0xee, 0xd4, 0x00, 0x42, 0x2a, 0x42, 0xa8, 0x1d, 0x40, 0x1d, 0x82, 0x90, 0x61, 0x62, 0xa9, 0xec, + 0xcb, 0x71, 0x39, 0x64, 0xdf, 0x67, 0xf9, 0xce, 0xa1, 0xf9, 0x07, 0x2c, 0x48, 0x0c, 0xfc, 0x80, + 0xae, 0x2c, 0xfc, 0x8e, 0x8e, 0x1d, 0x99, 0x2a, 0x94, 0x2c, 0xcc, 0xfd, 0x05, 0xc8, 0x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xa0, 0xe3, 0x47, 0x34, 0x81, 0x61, 0x1e, + 0x73, 0x5d, 0x5c, 0x69, 0x4d, 0xfb, 0x8f, 0x7b, 0xf5, 0xe1, 0xbd, 0xcb, 0x6e, 0xb3, 0x99, 0xa4, + 0x5c, 0x47, 0x37, 0xe6, 0x55, 0x3f, 0xf8, 0x15, 0x00, 0x00, 0xff, 0xff, 0x05, 0xbd, 0x27, 0xe0, + 0x0d, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -164,6 +252,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 +273,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 +297,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 +323,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 +349,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 +432,87 @@ 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 + if len(m.Msg) > 0 { + for iNdEx := len(m.Msg) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Msg[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Timeout) > 0 { + i -= len(m.Timeout) + copy(dAtA[i:], m.Timeout) + i = encodeVarintTx(dAtA, i, uint64(len(m.Timeout))) + 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 + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -351,6 +558,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 = len(m.Timeout) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Msg) > 0 { + for _, e := range m.Msg { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgSubmitTxResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -585,6 +828,236 @@ 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 Timeout", 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.Timeout = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", 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 + } + m.Msg = append(m.Msg, &types.Any{}) + if err := m.Msg[len(m.Msg)-1].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 { + 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..d1c12324d6d 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -5,11 +5,14 @@ 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 "google/protobuf/any.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 +29,17 @@ 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\""]; + string timeout = 3; + repeated google.protobuf.Any msg = 4; +} + +// MsgSubmitTxResponse defines the response for MsgSubmitTx +message MsgSubmitTxResponse {} \ No newline at end of file From 48e44b6573916b03d8d104e6649a3bbeec051364 Mon Sep 17 00:00:00 2001 From: Charly Date: Tue, 23 Aug 2022 13:59:58 +0200 Subject: [PATCH 02/20] typo --- .../apps/27-interchain-accounts/controller/keeper/msg_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 25b27eb7523..4c3d442a4ef 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go @@ -13,7 +13,7 @@ func (k Keeper) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAcc return &types.MsgRegisterAccountResponse{}, nil } -// SubmitTx defines a rpc handler for MsgSendTx +// SubmitTx defines a rpc handler for MsgSubmitTx func (k Keeper) SubmitTx(goCtx context.Context, msg *types.MsgSubmitTx) (*types.MsgSubmitTxResponse, error) { return &types.MsgSubmitTxResponse{}, nil } From 3cacc48fc93e175fbc30628d0193b8d888e6db57 Mon Sep 17 00:00:00 2001 From: Charly Date: Tue, 23 Aug 2022 14:01:03 +0200 Subject: [PATCH 03/20] typo --- modules/apps/27-interchain-accounts/controller/types/msgs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index 64d1128e8b3..ea15763de1f 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -24,7 +24,7 @@ func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{} } -// NewMsgSendTx creates a new instance of MsgSendTx +// NewMsgSubmitTx creates a new instance of MsgSubmitTx func NewMsgSubmitTx(connectionID, owner, timeout string, msg []*codectypes.Any) *MsgSubmitTx { return &MsgSubmitTx{ ConnectionId: connectionID, From 5eb8eb2c04458a204dab0ad90cff9b07af8374ca Mon Sep 17 00:00:00 2001 From: Charly Date: Wed, 24 Aug 2022 15:44:39 +0200 Subject: [PATCH 04/20] update re comments --- docs/ibc/proto-docs.md | 3 +- .../controller/types/tx.pb.go | 148 +++++++++++------- .../controller/v1/tx.proto | 15 +- 3 files changed, 107 insertions(+), 59 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index d81c7c0a9fe..26080ead777 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1568,7 +1568,8 @@ MsgSubmitTx defines the payload for MsgSubmitTx | ----- | ---- | ----- | ----------- | | `owner` | [string](#string) | | | | `connection_id` | [string](#string) | | | -| `timeout` | [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. | | `msg` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | 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 c8337df7879..9fc3fa896f4 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -6,7 +6,8 @@ package types import ( context "context" fmt "fmt" - types "github.com/cosmos/cosmos-sdk/codec/types" + types1 "github.com/cosmos/cosmos-sdk/codec/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" @@ -116,10 +117,15 @@ func (m *MsgRegisterAccountResponse) GetChannelId() string { // 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 string `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` - Msg []*types.Any `protobuf:"bytes,4,rep,name=msg,proto3" json:"msg,omitempty"` + 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"` + Msg []*types1.Any `protobuf:"bytes,5,rep,name=msg,proto3" json:"msg,omitempty"` } func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } @@ -204,38 +210,43 @@ func init() { } var fileDescriptor_7def041328c84a30 = []byte{ - // 484 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x31, 0x6f, 0xd3, 0x40, - 0x18, 0xf5, 0x25, 0x40, 0xdb, 0x2b, 0x08, 0x61, 0x52, 0xc9, 0x78, 0x70, 0x2a, 0x0f, 0xa8, 0x4b, - 0xee, 0xd4, 0x00, 0x42, 0x2a, 0x42, 0xa8, 0x1d, 0x40, 0x1d, 0x82, 0x90, 0x61, 0x62, 0xa9, 0xec, - 0xcb, 0x71, 0x39, 0x64, 0xdf, 0x67, 0xf9, 0xce, 0xa1, 0xf9, 0x07, 0x2c, 0x48, 0x0c, 0xfc, 0x80, - 0xae, 0x2c, 0xfc, 0x8e, 0x8e, 0x1d, 0x99, 0x2a, 0x94, 0x2c, 0xcc, 0xfd, 0x05, 0xc8, 0x71, 0x1c, - 0x1b, 0xd2, 0xa5, 0xc0, 0xe6, 0xe7, 0xcf, 0xef, 0xdd, 0x7b, 0xdf, 0xf3, 0xe1, 0x27, 0x32, 0x62, - 0x34, 0x4c, 0xd3, 0x58, 0xb2, 0xd0, 0x48, 0x50, 0x9a, 0x4a, 0x65, 0x78, 0xc6, 0x46, 0xa1, 0x54, - 0x47, 0x21, 0x63, 0x90, 0x2b, 0xa3, 0x29, 0x03, 0x65, 0x32, 0x88, 0x63, 0x9e, 0xd1, 0xf1, 0x2e, - 0x35, 0xc7, 0x24, 0xcd, 0xc0, 0x80, 0xdd, 0x97, 0x11, 0x23, 0x4d, 0x32, 0xb9, 0x84, 0x4c, 0x6a, - 0x32, 0x19, 0xef, 0xba, 0x1d, 0x01, 0x02, 0xe6, 0x74, 0x5a, 0x3c, 0x95, 0x4a, 0xee, 0x3d, 0x01, - 0x20, 0x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6, 0xd5, 0x24, 0x28, 0x3e, 0x68, 0x2c, 0x61, 0x0b, 0xdf, - 0x6d, 0xf8, 0xad, 0xd2, 0xf7, 0x4f, 0x5b, 0xb8, 0x3d, 0xd0, 0xc2, 0xfe, 0x8a, 0xf0, 0xed, 0x3f, - 0x0b, 0x7b, 0x4e, 0xae, 0xfe, 0xb7, 0x90, 0xd5, 0x4d, 0xbb, 0x2f, 0xff, 0x8f, 0xce, 0xb2, 0xb1, - 0x2f, 0x08, 0xaf, 0x2f, 0x17, 0xff, 0xec, 0x2f, 0xc5, 0x2b, 0x01, 0xf7, 0xc5, 0x3f, 0x0a, 0x54, - 0xb6, 0x0e, 0xde, 0x9f, 0x4e, 0x3d, 0x74, 0x36, 0xf5, 0xd0, 0x8f, 0xa9, 0x87, 0x3e, 0xcf, 0x3c, - 0xeb, 0x6c, 0xe6, 0x59, 0xdf, 0x67, 0x9e, 0xf5, 0xf6, 0x95, 0x90, 0x66, 0x94, 0x47, 0x84, 0x41, - 0x42, 0x19, 0xe8, 0x04, 0x34, 0x95, 0x11, 0xeb, 0x09, 0xa0, 0xe3, 0x47, 0x34, 0x81, 0x61, 0x1e, - 0x73, 0x5d, 0x5c, 0x69, 0x4d, 0xfb, 0x8f, 0x7b, 0xf5, 0xe1, 0xbd, 0xcb, 0x6e, 0xb3, 0x99, 0xa4, - 0x5c, 0x47, 0x37, 0xe6, 0x55, 0x3f, 0xf8, 0x15, 0x00, 0x00, 0xff, 0xff, 0x05, 0xbd, 0x27, 0xe0, - 0x0d, 0x04, 0x00, 0x00, + // 576 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x3f, 0x6f, 0xd3, 0x4e, + 0x18, 0xb6, 0x93, 0xf6, 0xf7, 0x6b, 0xaf, 0x14, 0xa8, 0x49, 0x25, 0x63, 0x81, 0x5d, 0x79, 0x40, + 0x5d, 0x7a, 0xa7, 0x06, 0x10, 0x52, 0x11, 0x42, 0xcd, 0x00, 0x74, 0x08, 0x42, 0xa6, 0x13, 0x4b, + 0xb0, 0x2f, 0xc7, 0xe5, 0x90, 0x7d, 0x67, 0xf9, 0xce, 0xa1, 0xf9, 0x06, 0x2c, 0x48, 0x0c, 0x7c, + 0x80, 0xae, 0x7c, 0x0c, 0xb6, 0x8c, 0x1d, 0x99, 0x22, 0x94, 0x2c, 0xcc, 0xf9, 0x04, 0xc8, 0xff, + 0xf2, 0x87, 0x74, 0x29, 0x30, 0xd9, 0xef, 0x7b, 0xef, 0xf3, 0xdc, 0x73, 0xf7, 0x3c, 0x3a, 0xf0, + 0x98, 0x05, 0x18, 0xf9, 0x71, 0x1c, 0x32, 0xec, 0x2b, 0x26, 0xb8, 0x44, 0x8c, 0x2b, 0x92, 0xe0, + 0x9e, 0xcf, 0x78, 0xc7, 0xc7, 0x58, 0xa4, 0x5c, 0x49, 0x84, 0x05, 0x57, 0x89, 0x08, 0x43, 0x92, + 0xa0, 0xfe, 0x21, 0x52, 0x67, 0x30, 0x4e, 0x84, 0x12, 0x46, 0x93, 0x05, 0x18, 0x2e, 0x82, 0xe1, + 0x25, 0x60, 0x38, 0x07, 0xc3, 0xfe, 0xa1, 0xd5, 0xa0, 0x82, 0x8a, 0x1c, 0x8e, 0xb2, 0xbf, 0x82, + 0xc9, 0xba, 0x4d, 0x85, 0xa0, 0x21, 0x41, 0x79, 0x15, 0xa4, 0xef, 0x90, 0xcf, 0x07, 0xe5, 0x92, + 0x93, 0x29, 0xc4, 0x22, 0x21, 0x08, 0x87, 0x8c, 0x70, 0x95, 0x29, 0x28, 0xfe, 0x8a, 0x01, 0xf7, + 0x93, 0x0e, 0x8c, 0xb6, 0xa4, 0x1e, 0xa1, 0x4c, 0x2a, 0x92, 0x1c, 0x17, 0xfb, 0x1a, 0x4f, 0xc0, + 0x36, 0x16, 0x9c, 0x13, 0x9c, 0x29, 0xeb, 0xb0, 0xae, 0xa9, 0xef, 0xe9, 0xf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x8e, 0xb9, 0x4c, 0x32, 0x1b, 0x71, 0xbd, 0x9b, 0x65, 0xef, 0xb4, 0x6a, 0x19, 0xf7, 0x40, + 0x3d, 0x92, 0xd4, 0x5c, 0xdf, 0xab, 0xef, 0x6f, 0x35, 0x1b, 0xb0, 0xc8, 0x0f, 0xac, 0xf2, 0x03, + 0x8f, 0xf9, 0xc0, 0xcb, 0x06, 0x16, 0x7c, 0xd9, 0x05, 0xb7, 0x16, 0xae, 0xb0, 0x32, 0xa4, 0x39, + 0xac, 0x81, 0x7a, 0x5b, 0x52, 0xe3, 0xab, 0x0e, 0x6e, 0xfc, 0x9e, 0xa1, 0x67, 0xf0, 0xea, 0x09, + 0x87, 0xab, 0xe6, 0x5b, 0x2f, 0xff, 0x0d, 0xcf, 0x2c, 0x44, 0x5f, 0x74, 0xb0, 0x31, 0xcb, 0xc2, + 0xd3, 0x3f, 0x24, 0xaf, 0x08, 0xac, 0xe7, 0x7f, 0x49, 0x50, 0xc9, 0x6a, 0xbd, 0x1f, 0x8e, 0x6d, + 0xfd, 0x62, 0x6c, 0xeb, 0x3f, 0xc6, 0xb6, 0xfe, 0x79, 0x62, 0x6b, 0x17, 0x13, 0x5b, 0xfb, 0x3e, + 0xb1, 0xb5, 0x37, 0xaf, 0x28, 0x53, 0xbd, 0x34, 0x80, 0x58, 0x44, 0x08, 0x0b, 0x19, 0x09, 0x89, + 0x58, 0x80, 0x0f, 0xa8, 0x40, 0xfd, 0x87, 0x28, 0x12, 0xdd, 0x34, 0x24, 0x32, 0x7b, 0x86, 0x24, + 0x6a, 0x3e, 0x3a, 0x98, 0x6f, 0x7e, 0x70, 0xd9, 0x0b, 0xa4, 0x06, 0x31, 0x91, 0xc1, 0x7f, 0xb9, + 0xd5, 0xf7, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x26, 0x0b, 0x59, 0xe2, 0xc1, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -463,16 +474,24 @@ func (m *MsgSubmitTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } } - if len(m.Timeout) > 0 { - i -= len(m.Timeout) - copy(dAtA[i:], m.Timeout) - i = encodeVarintTx(dAtA, i, uint64(len(m.Timeout))) + if m.TimeoutTimestamp != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) i-- - dAtA[i] = 0x1a + 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) @@ -572,9 +591,10 @@ func (m *MsgSubmitTx) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Timeout) - 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)) } if len(m.Msg) > 0 { for _, e := range m.Msg { @@ -923,9 +943,9 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TimeoutHeight", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -935,25 +955,45 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Timeout = string(dAtA[iNdEx:postIndex]) + 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 Msg", wireType) } @@ -982,7 +1022,7 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Msg = append(m.Msg, &types.Any{}) + m.Msg = append(m.Msg, &types1.Any{}) if err := m.Msg[len(m.Msg)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index d1c12324d6d..4897423167f 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -6,6 +6,7 @@ option go_package = "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-acco import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; +import "ibc/core/client/v1/client.proto"; // Msg defines the 27-interchain-accounts/controller Msg service. service Msg { @@ -35,10 +36,16 @@ message MsgSubmitTx { option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; - string owner = 1; - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string timeout = 3; - repeated google.protobuf.Any msg = 4; + 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\""]; + repeated google.protobuf.Any msg = 5; } // MsgSubmitTxResponse defines the response for MsgSubmitTx From 1748c3a1804809a28dcc7dcc76c7ded4c02f5854 Mon Sep 17 00:00:00 2001 From: Charly Date: Wed, 24 Aug 2022 15:55:27 +0200 Subject: [PATCH 05/20] update msg --- .../27-interchain-accounts/controller/types/msgs.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index ea15763de1f..352465d55b0 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -3,6 +3,8 @@ package types import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + + clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" ) // NewMsgRegisterAccount creates a new instance of MsgRegisterAccount @@ -25,12 +27,13 @@ func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { } // NewMsgSubmitTx creates a new instance of MsgSubmitTx -func NewMsgSubmitTx(connectionID, owner, timeout string, msg []*codectypes.Any) *MsgSubmitTx { +func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, msgs []*codectypes.Any) *MsgSubmitTx { return &MsgSubmitTx{ - ConnectionId: connectionID, - Owner: owner, - Timeout: timeout, - Msg: msg, + ConnectionId: connectionID, + Owner: owner, + TimeoutHeight: timeoutHeight, + TimeoutTimestamp: timeoutTimestamp, + Msg: msgs, } } From aa6ce1684da948b4f7c313d42d3a45b2c70eb3a3 Mon Sep 17 00:00:00 2001 From: Charly Date: Wed, 24 Aug 2022 15:58:44 +0200 Subject: [PATCH 06/20] merge main --- .../controller/types/msgs.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index 2b33591c1c2..e2b212394e5 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -1,7 +1,14 @@ package types import ( + "strings" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + clienttypes "github.com/cosmos/ibc-go/v5/modules/core/02-client/types" + host "github.com/cosmos/ibc-go/v5/modules/core/24-host" ) var _ sdk.Msg = &MsgRegisterAccount{} @@ -34,5 +41,31 @@ func (msg MsgRegisterAccount) ValidateBasic() error { // GetSigners implements sdk.Msg func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { + accAddr, err := sdk.AccAddressFromBech32(msg.Owner) + if err != nil { + panic(err) + } + + return []sdk.AccAddress{accAddr} +} + +// NewMsgSubmitTx creates a new instance of MsgSubmitTx +func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, msgs []*codectypes.Any) *MsgSubmitTx { + return &MsgSubmitTx{ + ConnectionId: connectionID, + Owner: owner, + TimeoutHeight: timeoutHeight, + TimeoutTimestamp: timeoutTimestamp, + Msg: msgs, + } +} + +// ValidateBasic implements sdk.Msg +func (msg MsgSubmitTx) ValidateBasic() error { + return nil +} + +// GetSigners implements sdk.Msg +func (msg MsgSubmitTx) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{} } From a4a7708a5a855b7f6df958ff03eb3e37aba45662 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Fri, 26 Aug 2022 12:26:46 +0200 Subject: [PATCH 07/20] initial commit, adding all types --- docs/ibc/proto-docs.md | 160 ++++----- .../{ => genesis}/types/genesis.go | 7 +- .../{ => genesis}/types/genesis.pb.go | 114 +++---- .../genesis/types/genesis_test.go | 307 ++++++++++++++++++ .../host/keeper/genesis.go | 7 +- .../host/keeper/genesis_test.go | 7 +- .../host/keeper/keeper.go | 13 +- .../host/keeper/keeper_test.go | 5 +- modules/apps/27-interchain-accounts/module.go | 14 +- .../27-interchain-accounts/types/codec.go | 4 - .../types/genesis_test.go | 307 ------------------ .../{ => genesis}/v1/genesis.proto | 4 +- 12 files changed, 476 insertions(+), 473 deletions(-) rename modules/apps/27-interchain-accounts/{ => genesis}/types/genesis.go (93%) rename modules/apps/27-interchain-accounts/{ => genesis}/types/genesis.pb.go (89%) create mode 100644 modules/apps/27-interchain-accounts/genesis/types/genesis_test.go delete mode 100644 modules/apps/27-interchain-accounts/types/genesis_test.go rename proto/ibc/applications/interchain_accounts/{ => genesis}/v1/genesis.proto (96%) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 21d874ccdf2..ee2d23577e6 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -98,6 +98,13 @@ - [ibc/applications/interchain_accounts/host/v1/host.proto](#ibc/applications/interchain_accounts/host/v1/host.proto) - [Params](#ibc.applications.interchain_accounts.host.v1.Params) +- [ibc/applications/interchain_accounts/genesis/v1/genesis.proto](#ibc/applications/interchain_accounts/genesis/v1/genesis.proto) + - [ActiveChannel](#ibc.applications.interchain_accounts.genesis.v1.ActiveChannel) + - [ControllerGenesisState](#ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState) + - [GenesisState](#ibc.applications.interchain_accounts.genesis.v1.GenesisState) + - [HostGenesisState](#ibc.applications.interchain_accounts.genesis.v1.HostGenesisState) + - [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount) + - [ibc/applications/interchain_accounts/host/v1/query.proto](#ibc/applications/interchain_accounts/host/v1/query.proto) - [QueryParamsRequest](#ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) - [QueryParamsResponse](#ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) @@ -107,13 +114,6 @@ - [ibc/applications/interchain_accounts/v1/account.proto](#ibc/applications/interchain_accounts/v1/account.proto) - [InterchainAccount](#ibc.applications.interchain_accounts.v1.InterchainAccount) -- [ibc/applications/interchain_accounts/v1/genesis.proto](#ibc/applications/interchain_accounts/v1/genesis.proto) - - [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) - - [ControllerGenesisState](#ibc.applications.interchain_accounts.v1.ControllerGenesisState) - - [GenesisState](#ibc.applications.interchain_accounts.v1.GenesisState) - - [HostGenesisState](#ibc.applications.interchain_accounts.v1.HostGenesisState) - - [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) - - [ibc/applications/interchain_accounts/v1/metadata.proto](#ibc/applications/interchain_accounts/v1/metadata.proto) - [Metadata](#ibc.applications.interchain_accounts.v1.Metadata) @@ -1608,74 +1608,93 @@ The following parameters may be used to disable the host submodule. - +

Top

-## ibc/applications/interchain_accounts/host/v1/query.proto +## ibc/applications/interchain_accounts/genesis/v1/genesis.proto - + -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. +### ActiveChannel +ActiveChannel contains a connection ID, port ID and associated active channel ID +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `connection_id` | [string](#string) | | | +| `port_id` | [string](#string) | | | +| `channel_id` | [string](#string) | | | - -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. + + + +### ControllerGenesisState +ControllerGenesisState defines the interchain accounts controller genesis state | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#ibc.applications.interchain_accounts.host.v1.Params) | | params defines the parameters of the module. | +| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.genesis.v1.ActiveChannel) | repeated | | +| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount) | repeated | | +| `ports` | [string](#string) | repeated | | +| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | | - - + - +### GenesisState +GenesisState defines the interchain accounts genesis state - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `controller_genesis_state` | [ControllerGenesisState](#ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState) | | | +| `host_genesis_state` | [HostGenesisState](#ibc.applications.interchain_accounts.genesis.v1.HostGenesisState) | | | -### Query -Query provides defines the gRPC querier service. -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Params` | [QueryParamsRequest](#ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) | [QueryParamsResponse](#ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) | Params queries all parameters of the ICA host submodule. | GET|/ibc/apps/interchain_accounts/host/v1/params| - - -

Top

+ -## ibc/applications/interchain_accounts/v1/account.proto +### HostGenesisState +HostGenesisState defines the interchain accounts host genesis state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.genesis.v1.ActiveChannel) | repeated | | +| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount) | repeated | | +| `port` | [string](#string) | | | +| `params` | [ibc.applications.interchain_accounts.host.v1.Params](#ibc.applications.interchain_accounts.host.v1.Params) | | | - -### InterchainAccount -An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain + + + + +### RegisteredInterchainAccount +RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | -| `account_owner` | [string](#string) | | | +| `connection_id` | [string](#string) | | | +| `port_id` | [string](#string) | | | +| `account_address` | [string](#string) | | | @@ -1691,93 +1710,74 @@ An InterchainAccount is defined as a BaseAccount & the address of the account ow - +

Top

-## ibc/applications/interchain_accounts/v1/genesis.proto - - +## ibc/applications/interchain_accounts/host/v1/query.proto - -### ActiveChannel -ActiveChannel contains a connection ID, port ID and associated active channel ID + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `connection_id` | [string](#string) | | | -| `port_id` | [string](#string) | | | -| `channel_id` | [string](#string) | | | +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. - + -### ControllerGenesisState -ControllerGenesisState defines the interchain accounts controller genesis state +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | | -| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | | -| `ports` | [string](#string) | repeated | | -| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | | - - - +| `params` | [Params](#ibc.applications.interchain_accounts.host.v1.Params) | | params defines the parameters of the module. | - -### GenesisState -GenesisState defines the interchain accounts genesis state - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `controller_genesis_state` | [ControllerGenesisState](#ibc.applications.interchain_accounts.v1.ControllerGenesisState) | | | -| `host_genesis_state` | [HostGenesisState](#ibc.applications.interchain_accounts.v1.HostGenesisState) | | | + + + + - +### Query +Query provides defines the gRPC querier service. -### HostGenesisState -HostGenesisState defines the interchain accounts host genesis state +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Params` | [QueryParamsRequest](#ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) | [QueryParamsResponse](#ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) | Params queries all parameters of the ICA host submodule. | GET|/ibc/apps/interchain_accounts/host/v1/params| + -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | | -| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | | -| `port` | [string](#string) | | | -| `params` | [ibc.applications.interchain_accounts.host.v1.Params](#ibc.applications.interchain_accounts.host.v1.Params) | | | + +

Top

+## ibc/applications/interchain_accounts/v1/account.proto - + -### RegisteredInterchainAccount -RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address +### InterchainAccount +An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `connection_id` | [string](#string) | | | -| `port_id` | [string](#string) | | | -| `account_address` | [string](#string) | | | +| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | +| `account_owner` | [string](#string) | | | diff --git a/modules/apps/27-interchain-accounts/types/genesis.go b/modules/apps/27-interchain-accounts/genesis/types/genesis.go similarity index 93% rename from modules/apps/27-interchain-accounts/types/genesis.go rename to modules/apps/27-interchain-accounts/genesis/types/genesis.go index 38929c664b0..7d6be8f6502 100644 --- a/modules/apps/27-interchain-accounts/types/genesis.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis.go @@ -3,6 +3,7 @@ package types import ( controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" hosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" ) @@ -69,7 +70,7 @@ func (gs ControllerGenesisState) Validate() error { return err } - if err := ValidateAccountAddress(acc.AccountAddress); err != nil { + if err := icatypes.ValidateAccountAddress(acc.AccountAddress); err != nil { return err } } @@ -90,7 +91,7 @@ func (gs ControllerGenesisState) Validate() error { // DefaultHostGenesis creates and returns the default interchain accounts HostGenesisState func DefaultHostGenesis() HostGenesisState { return HostGenesisState{ - Port: PortID, + Port: icatypes.PortID, Params: hosttypes.DefaultParams(), } } @@ -122,7 +123,7 @@ func (gs HostGenesisState) Validate() error { return err } - if err := ValidateAccountAddress(acc.AccountAddress); err != nil { + if err := icatypes.ValidateAccountAddress(acc.AccountAddress); err != nil { return err } } diff --git a/modules/apps/27-interchain-accounts/types/genesis.pb.go b/modules/apps/27-interchain-accounts/genesis/types/genesis.pb.go similarity index 89% rename from modules/apps/27-interchain-accounts/types/genesis.pb.go rename to modules/apps/27-interchain-accounts/genesis/types/genesis.pb.go index 7bac7e84f53..fb0a9bd7b5e 100644 --- a/modules/apps/27-interchain-accounts/types/genesis.pb.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/applications/interchain_accounts/v1/genesis.proto +// source: ibc/applications/interchain_accounts/genesis/v1/genesis.proto package types @@ -35,7 +35,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_629b3ced0911516b, []int{0} + return fileDescriptor_d4aa48c8e29a1947, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -90,7 +90,7 @@ func (m *ControllerGenesisState) Reset() { *m = ControllerGenesisState{} func (m *ControllerGenesisState) String() string { return proto.CompactTextString(m) } func (*ControllerGenesisState) ProtoMessage() {} func (*ControllerGenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_629b3ced0911516b, []int{1} + return fileDescriptor_d4aa48c8e29a1947, []int{1} } func (m *ControllerGenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -159,7 +159,7 @@ func (m *HostGenesisState) Reset() { *m = HostGenesisState{} } func (m *HostGenesisState) String() string { return proto.CompactTextString(m) } func (*HostGenesisState) ProtoMessage() {} func (*HostGenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_629b3ced0911516b, []int{2} + return fileDescriptor_d4aa48c8e29a1947, []int{2} } func (m *HostGenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -227,7 +227,7 @@ func (m *ActiveChannel) Reset() { *m = ActiveChannel{} } func (m *ActiveChannel) String() string { return proto.CompactTextString(m) } func (*ActiveChannel) ProtoMessage() {} func (*ActiveChannel) Descriptor() ([]byte, []int) { - return fileDescriptor_629b3ced0911516b, []int{3} + return fileDescriptor_d4aa48c8e29a1947, []int{3} } func (m *ActiveChannel) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -288,7 +288,7 @@ func (m *RegisteredInterchainAccount) Reset() { *m = RegisteredInterchai func (m *RegisteredInterchainAccount) String() string { return proto.CompactTextString(m) } func (*RegisteredInterchainAccount) ProtoMessage() {} func (*RegisteredInterchainAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_629b3ced0911516b, []int{4} + return fileDescriptor_d4aa48c8e29a1947, []int{4} } func (m *RegisteredInterchainAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -339,60 +339,60 @@ func (m *RegisteredInterchainAccount) GetAccountAddress() string { } func init() { - proto.RegisterType((*GenesisState)(nil), "ibc.applications.interchain_accounts.v1.GenesisState") - proto.RegisterType((*ControllerGenesisState)(nil), "ibc.applications.interchain_accounts.v1.ControllerGenesisState") - proto.RegisterType((*HostGenesisState)(nil), "ibc.applications.interchain_accounts.v1.HostGenesisState") - proto.RegisterType((*ActiveChannel)(nil), "ibc.applications.interchain_accounts.v1.ActiveChannel") - proto.RegisterType((*RegisteredInterchainAccount)(nil), "ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount") + proto.RegisterType((*GenesisState)(nil), "ibc.applications.interchain_accounts.genesis.v1.GenesisState") + proto.RegisterType((*ControllerGenesisState)(nil), "ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState") + proto.RegisterType((*HostGenesisState)(nil), "ibc.applications.interchain_accounts.genesis.v1.HostGenesisState") + proto.RegisterType((*ActiveChannel)(nil), "ibc.applications.interchain_accounts.genesis.v1.ActiveChannel") + proto.RegisterType((*RegisteredInterchainAccount)(nil), "ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount") } func init() { - proto.RegisterFile("ibc/applications/interchain_accounts/v1/genesis.proto", fileDescriptor_629b3ced0911516b) -} - -var fileDescriptor_629b3ced0911516b = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x3f, 0x6f, 0x13, 0x3f, - 0x18, 0xc7, 0xe3, 0xa4, 0xbf, 0xfe, 0x14, 0xf7, 0x0f, 0xc5, 0x94, 0xea, 0x08, 0xd2, 0x25, 0x78, - 0x69, 0x24, 0xd4, 0x3b, 0xb5, 0xb4, 0x54, 0x54, 0x42, 0xa8, 0x17, 0x10, 0x64, 0x43, 0x66, 0x41, - 0x2c, 0x27, 0xc7, 0x67, 0x25, 0x96, 0x92, 0x73, 0x74, 0x76, 0x23, 0x75, 0x62, 0x67, 0x62, 0x43, - 0xac, 0x48, 0xbc, 0x00, 0xde, 0x01, 0x63, 0x27, 0xd4, 0x91, 0x29, 0x42, 0xed, 0x3b, 0xc8, 0x2b, - 0x40, 0xf6, 0x9d, 0x92, 0xf4, 0x48, 0xab, 0x9b, 0x98, 0x98, 0x62, 0xdf, 0xe3, 0xef, 0xf7, 0xf9, - 0x3c, 0x7e, 0x1c, 0x1b, 0x1e, 0x88, 0x0e, 0xf3, 0xe9, 0x70, 0xd8, 0x17, 0x8c, 0x6a, 0x21, 0x63, - 0xe5, 0x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8, - 0xbf, 0x81, 0x35, 0xc2, 0xb2, 0x15, 0xa2, 0xc9, 0xb8, 0xbe, 0x9e, 0x0a, 0xb3, 0x00, 0x26, 0xcb, - 0x66, 0xd4, 0x8e, 0xd0, 0x3e, 0x84, 0x59, 0x7b, 0xcc, 0x7a, 0x5b, 0x6b, 0x70, 0x77, 0x32, 0xae, - 0xdf, 0xce, 0x12, 0x4d, 0x63, 0x98, 0x54, 0xb3, 0x49, 0x3b, 0xc2, 0x3f, 0x00, 0xbc, 0x7f, 0xc3, - 0x9e, 0xff, 0xd5, 0x0a, 0x5a, 0xe6, 0x10, 0xdb, 0xb4, 0x21, 0x8d, 0xa2, 0x84, 0x2b, 0x95, 0x95, - 0x51, 0x9b, 0x3f, 0x88, 0x57, 0x16, 0xd8, 0x83, 0x68, 0xbf, 0x1c, 0xa7, 0x1f, 0x82, 0xf0, 0xec, - 0xc2, 0x05, 0xe7, 0x17, 0x2e, 0xf8, 0x75, 0xe1, 0x82, 0x8f, 0x97, 0x6e, 0xe9, 0xfc, 0xd2, 0x2d, - 0xfd, 0xbc, 0x74, 0x4b, 0xef, 0x5e, 0x74, 0x85, 0xee, 0x9d, 0x74, 0x3c, 0x26, 0x07, 0x3e, 0x93, - 0x6a, 0x20, 0x95, 0x2f, 0x3a, 0x6c, 0xa7, 0x2b, 0xfd, 0xd1, 0x81, 0x3f, 0x90, 0xd1, 0x49, 0x9f, - 0x2b, 0xf3, 0xf8, 0x28, 0x7f, 0xef, 0x70, 0x67, 0xd6, 0xfc, 0x9d, 0xe9, 0xbb, 0xa3, 0x4f, 0x87, - 0x5c, 0x75, 0x96, 0xed, 0x8b, 0xf3, 0xe8, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x2b, 0x9a, - 0xce, 0x67, 0x07, 0x00, 0x00, + proto.RegisterFile("ibc/applications/interchain_accounts/genesis/v1/genesis.proto", fileDescriptor_d4aa48c8e29a1947) +} + +var fileDescriptor_d4aa48c8e29a1947 = []byte{ + // 648 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x4d, 0x6b, 0x13, 0x41, + 0x18, 0xc7, 0x33, 0x49, 0xad, 0x64, 0xfa, 0x62, 0x1d, 0x6b, 0x59, 0x23, 0x6c, 0xe2, 0x5c, 0x0c, + 0x48, 0x77, 0x69, 0xad, 0x14, 0x0a, 0x15, 0xb2, 0x39, 0xd4, 0x80, 0x82, 0x8c, 0x17, 0xf1, 0x12, + 0x26, 0xb3, 0xc3, 0x66, 0x20, 0xd9, 0x09, 0x3b, 0xd3, 0x40, 0x3f, 0x81, 0x57, 0xf1, 0x1b, 0x78, + 0x13, 0x6f, 0x5e, 0xfc, 0x0c, 0x3d, 0x49, 0x8f, 0x9e, 0x82, 0xb4, 0xdf, 0x20, 0x9f, 0x40, 0x66, + 0x76, 0x9b, 0xb7, 0xa6, 0x92, 0x5c, 0x3c, 0x79, 0xca, 0xcc, 0xce, 0xf3, 0xff, 0x3f, 0xbf, 0x67, + 0x9e, 0xc9, 0x0c, 0x3c, 0x16, 0x2d, 0xe6, 0xd3, 0x5e, 0xaf, 0x23, 0x18, 0xd5, 0x42, 0xc6, 0xca, + 0x17, 0xb1, 0xe6, 0x09, 0x6b, 0x53, 0x11, 0x37, 0x29, 0x63, 0xf2, 0x34, 0xd6, 0xca, 0x8f, 0x78, + 0xcc, 0x95, 0x50, 0x7e, 0x7f, 0xef, 0x7a, 0xe8, 0xf5, 0x12, 0xa9, 0x25, 0xf2, 0x45, 0x8b, 0x79, + 0x93, 0x72, 0x6f, 0x8e, 0xdc, 0xbb, 0xd6, 0xf4, 0xf7, 0x4a, 0xdb, 0x91, 0x8c, 0xa4, 0xd5, 0xfa, + 0x66, 0x94, 0xda, 0x94, 0xea, 0x0b, 0x51, 0x30, 0x19, 0xeb, 0x44, 0x76, 0x3a, 0x3c, 0x31, 0x20, + 0xe3, 0x59, 0x66, 0x72,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0xa9, 0xac, 0x8c, 0xd2, 0xe4, 0x81, 0x9c, 0x0a, 0xb0, 0x07, 0xd2, 0x7e, 0xa9, 0xa5, + 0x1f, 0x82, 0xe8, 0xfc, 0xd2, 0x05, 0x17, 0x97, 0x2e, 0xf8, 0x7d, 0xe9, 0x82, 0x4f, 0x57, 0x6e, + 0xee, 0xe2, 0xca, 0xcd, 0xfd, 0xba, 0x72, 0x73, 0x1f, 0xde, 0x44, 0x42, 0xb7, 0x4f, 0x5b, 0x1e, + 0x93, 0x5d, 0x9f, 0x49, 0xd5, 0x95, 0xca, 0x3c, 0x96, 0xbb, 0x91, 0xf4, 0xfb, 0x2f, 0xfc, 0xae, + 0x0c, 0x4f, 0x3b, 0x5c, 0x99, 0xe7, 0x4a, 0xf9, 0xfb, 0x87, 0xbb, 0xe3, 0xe6, 0xef, 0xde, 0x78, + 0x74, 0xf5, 0x59, 0x8f, 0xab, 0xd6, 0xaa, 0x7d, 0xab, 0x9e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, + 0x1d, 0xb1, 0x33, 0x63, 0xb1, 0x07, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go new file mode 100644 index 00000000000..ee85dde229c --- /dev/null +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go @@ -0,0 +1,307 @@ +package types_test + +// import ( +// controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" +// hosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" +// "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" +// ibctesting "github.com/cosmos/ibc-go/v5/testing" +// ) + +// func (suite *TypesTestSuite) TestValidateGenesisState() { +// var genesisState types.GenesisState + +// testCases := []struct { +// name string +// malleate func() +// expPass bool +// }{ +// { +// "success", +// func() {}, +// true, +// }, +// { +// "failed to validate - empty value", +// func() { +// genesisState = types.GenesisState{} +// }, +// false, +// }, +// { +// "failed to validate - invalid controller genesis", +// func() { +// genesisState = *types.NewGenesisState(types.ControllerGenesisState{Ports: []string{"invalid|port"}}, types.DefaultHostGenesis()) +// }, +// false, +// }, +// { +// "failed to validate - invalid host genesis", +// func() { +// genesisState = *types.NewGenesisState(types.DefaultControllerGenesis(), types.HostGenesisState{}) +// }, +// false, +// }, +// } + +// for _, tc := range testCases { +// suite.Run(tc.name, func() { +// genesisState = *types.DefaultGenesis() + +// tc.malleate() // malleate mutates test data + +// err := genesisState.Validate() + +// if tc.expPass { +// suite.Require().NoError(err, tc.name) +// } else { +// suite.Require().Error(err, tc.name) +// } +// }) +// } +// } + +// func (suite *TypesTestSuite) TestValidateControllerGenesisState() { +// var genesisState types.ControllerGenesisState + +// testCases := []struct { +// name string +// malleate func() +// expPass bool +// }{ +// { +// "success", +// func() {}, +// true, +// }, +// { +// "failed to validate active channel - invalid port identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: "invalid|port", +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// genesisState = types.NewControllerGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate active channel - invalid channel identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: "invalid|channel", +// }, +// } + +// genesisState = types.NewControllerGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate registered account - invalid port identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// registeredAccounts := []types.RegisteredInterchainAccount{ +// { +// PortId: "invalid|port", +// AccountAddress: TestOwnerAddress, +// }, +// } + +// genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate registered account - invalid owner address", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// registeredAccounts := []types.RegisteredInterchainAccount{ +// { +// PortId: TestPortID, +// AccountAddress: "", +// }, +// } + +// genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate controller ports - invalid port identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// registeredAccounts := []types.RegisteredInterchainAccount{ +// { +// PortId: TestPortID, +// AccountAddress: TestOwnerAddress, +// }, +// } + +// genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{"invalid|port"}, controllertypes.DefaultParams()) +// }, +// false, +// }, +// } + +// for _, tc := range testCases { +// suite.Run(tc.name, func() { +// genesisState = types.DefaultControllerGenesis() + +// tc.malleate() // malleate mutates test data + +// err := genesisState.Validate() + +// if tc.expPass { +// suite.Require().NoError(err, tc.name) +// } else { +// suite.Require().Error(err, tc.name) +// } +// }) +// } +// } + +// func (suite *TypesTestSuite) TestValidateHostGenesisState() { +// var genesisState types.HostGenesisState + +// testCases := []struct { +// name string +// malleate func() +// expPass bool +// }{ +// { +// "success", +// func() {}, +// true, +// }, +// { +// "failed to validate active channel - invalid port identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: "invalid|port", +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// genesisState = types.NewHostGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, types.PortID, hosttypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate active channel - invalid channel identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: "invalid|channel", +// }, +// } + +// genesisState = types.NewHostGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, types.PortID, hosttypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate registered account - invalid port identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// registeredAccounts := []types.RegisteredInterchainAccount{ +// { +// PortId: "invalid|port", +// AccountAddress: TestOwnerAddress, +// }, +// } + +// genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, types.PortID, hosttypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate registered account - invalid owner address", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// registeredAccounts := []types.RegisteredInterchainAccount{ +// { +// PortId: TestPortID, +// AccountAddress: "", +// }, +// } + +// genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, types.PortID, hosttypes.DefaultParams()) +// }, +// false, +// }, +// { +// "failed to validate controller ports - invalid port identifier", +// func() { +// activeChannels := []types.ActiveChannel{ +// { +// PortId: TestPortID, +// ChannelId: ibctesting.FirstChannelID, +// }, +// } + +// registeredAccounts := []types.RegisteredInterchainAccount{ +// { +// PortId: TestPortID, +// AccountAddress: TestOwnerAddress, +// }, +// } + +// genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, "invalid|port", hosttypes.DefaultParams()) +// }, +// false, +// }, +// } + +// for _, tc := range testCases { +// suite.Run(tc.name, func() { +// genesisState = types.DefaultHostGenesis() + +// tc.malleate() // malleate mutates test data + +// err := genesisState.Validate() + +// if tc.expPass { +// suite.Require().NoError(err, tc.name) +// } else { +// suite.Require().Error(err, tc.name) +// } +// }) +// } +// } diff --git a/modules/apps/27-interchain-accounts/host/keeper/genesis.go b/modules/apps/27-interchain-accounts/host/keeper/genesis.go index c4c66e88414..03a714804bf 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/genesis.go +++ b/modules/apps/27-interchain-accounts/host/keeper/genesis.go @@ -5,12 +5,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" ) // InitGenesis initializes the interchain accounts host application state from a provided genesis state -func InitGenesis(ctx sdk.Context, keeper Keeper, state icatypes.HostGenesisState) { +func InitGenesis(ctx sdk.Context, keeper Keeper, state genesistypes.HostGenesisState) { if !keeper.IsBound(ctx, state.Port) { cap := keeper.BindPort(ctx, state.Port) if err := keeper.ClaimCapability(ctx, cap, host.PortPath(state.Port)); err != nil { @@ -30,8 +31,8 @@ func InitGenesis(ctx sdk.Context, keeper Keeper, state icatypes.HostGenesisState } // ExportGenesis returns the interchain accounts host exported genesis -func ExportGenesis(ctx sdk.Context, keeper Keeper) icatypes.HostGenesisState { - return icatypes.NewHostGenesisState( +func ExportGenesis(ctx sdk.Context, keeper Keeper) genesistypes.HostGenesisState { + return genesistypes.NewHostGenesisState( keeper.GetAllActiveChannels(ctx), keeper.GetAllInterchainAccounts(ctx), icatypes.PortID, diff --git a/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go b/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go index 9a39befbaee..d9c3cfa8091 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/keeper" "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" @@ -10,15 +11,15 @@ import ( func (suite *KeeperTestSuite) TestInitGenesis() { suite.SetupTest() - genesisState := icatypes.HostGenesisState{ - ActiveChannels: []icatypes.ActiveChannel{ + genesisState := genesistypes.HostGenesisState{ + ActiveChannels: []genesistypes.ActiveChannel{ { ConnectionId: ibctesting.FirstConnectionID, PortId: TestPortID, ChannelId: ibctesting.FirstChannelID, }, }, - InterchainAccounts: []icatypes.RegisteredInterchainAccount{ + InterchainAccounts: []genesistypes.RegisteredInterchainAccount{ { ConnectionId: ibctesting.FirstConnectionID, PortId: TestPortID, diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper.go b/modules/apps/27-interchain-accounts/host/keeper/keeper.go index acad2ea4622..693df6fcd67 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper.go @@ -11,6 +11,7 @@ import ( paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/libs/log" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" @@ -118,16 +119,16 @@ func (k Keeper) GetOpenActiveChannel(ctx sdk.Context, connectionID, portID strin } // GetAllActiveChannels returns a list of all active interchain accounts host channels and their associated connection and port identifiers -func (k Keeper) GetAllActiveChannels(ctx sdk.Context) []icatypes.ActiveChannel { +func (k Keeper) GetAllActiveChannels(ctx sdk.Context) []genesistypes.ActiveChannel { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte(icatypes.ActiveChannelKeyPrefix)) defer iterator.Close() - var activeChannels []icatypes.ActiveChannel + var activeChannels []genesistypes.ActiveChannel for ; iterator.Valid(); iterator.Next() { keySplit := strings.Split(string(iterator.Key()), "/") - ch := icatypes.ActiveChannel{ + ch := genesistypes.ActiveChannel{ ConnectionId: keySplit[2], PortId: keySplit[1], ChannelId: string(iterator.Value()), @@ -164,15 +165,15 @@ func (k Keeper) GetInterchainAccountAddress(ctx sdk.Context, connectionID, portI } // GetAllInterchainAccounts returns a list of all registered interchain account addresses and their associated connection and controller port identifiers -func (k Keeper) GetAllInterchainAccounts(ctx sdk.Context) []icatypes.RegisteredInterchainAccount { +func (k Keeper) GetAllInterchainAccounts(ctx sdk.Context) []genesistypes.RegisteredInterchainAccount { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte(icatypes.OwnerKeyPrefix)) - var interchainAccounts []icatypes.RegisteredInterchainAccount + var interchainAccounts []genesistypes.RegisteredInterchainAccount for ; iterator.Valid(); iterator.Next() { keySplit := strings.Split(string(iterator.Key()), "/") - acc := icatypes.RegisteredInterchainAccount{ + acc := genesistypes.RegisteredInterchainAccount{ ConnectionId: keySplit[2], PortId: keySplit[1], AccountAddress: string(iterator.Value()), diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go index eb475cea6c8..25a01f66ea9 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/tendermint/tendermint/crypto" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" ibctesting "github.com/cosmos/ibc-go/v5/testing" @@ -163,7 +164,7 @@ func (suite *KeeperTestSuite) TestGetAllActiveChannels() { suite.chainB.GetSimApp().ICAHostKeeper.SetActiveChannelID(suite.chainB.GetContext(), ibctesting.FirstConnectionID, expectedPortID, expectedChannelID) - expectedChannels := []icatypes.ActiveChannel{ + expectedChannels := []genesistypes.ActiveChannel{ { ConnectionId: ibctesting.FirstConnectionID, PortId: path.EndpointA.ChannelConfig.PortID, @@ -197,7 +198,7 @@ func (suite *KeeperTestSuite) TestGetAllInterchainAccounts() { suite.chainB.GetSimApp().ICAHostKeeper.SetInterchainAccountAddress(suite.chainB.GetContext(), ibctesting.FirstConnectionID, expectedPortID, expectedAccAddr) - expectedAccounts := []icatypes.RegisteredInterchainAccount{ + expectedAccounts := []genesistypes.RegisteredInterchainAccount{ { ConnectionId: ibctesting.FirstConnectionID, PortId: TestPortID, diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index 18c52693313..778053333ab 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -17,6 +17,7 @@ import ( "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/client/cli" controllerkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper" controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host" hostkeeper "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/keeper" hosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" @@ -45,18 +46,19 @@ func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} // RegisterInterfaces registers module concrete types into protobuf Any func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + controllertypes.RegisterInterfaces(registry) types.RegisterInterfaces(registry) } // DefaultGenesis returns default genesis state as raw bytes for the IBC // interchain accounts module func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) + return cdc.MustMarshalJSON(genesistypes.DefaultGenesis()) } // ValidateGenesis performs genesis state validation for the IBC interchain acounts module func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var gs types.GenesisState + var gs genesistypes.GenesisState if err := cdc.UnmarshalJSON(bz, &gs); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) } @@ -152,7 +154,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the interchain accounts module. // It returns no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState + var genesisState genesistypes.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) if am.controllerKeeper != nil { @@ -169,8 +171,8 @@ func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json. // ExportGenesis returns the exported genesis state as raw bytes for the interchain accounts module func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { var ( - controllerGenesisState = types.DefaultControllerGenesis() - hostGenesisState = types.DefaultHostGenesis() + controllerGenesisState = genesistypes.DefaultControllerGenesis() + hostGenesisState = genesistypes.DefaultHostGenesis() ) if am.controllerKeeper != nil { @@ -181,7 +183,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw hostGenesisState = hostkeeper.ExportGenesis(ctx, *am.hostKeeper) } - gs := types.NewGenesisState(controllerGenesisState, hostGenesisState) + gs := genesistypes.NewGenesisState(controllerGenesisState, hostGenesisState) return cdc.MustMarshalJSON(gs) } diff --git a/modules/apps/27-interchain-accounts/types/codec.go b/modules/apps/27-interchain-accounts/types/codec.go index f2400d3d1b7..4c9fdea401d 100644 --- a/modules/apps/27-interchain-accounts/types/codec.go +++ b/modules/apps/27-interchain-accounts/types/codec.go @@ -6,8 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - - controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" ) // ModuleCdc references the global interchain accounts module codec. Note, the codec @@ -20,8 +18,6 @@ var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) // RegisterInterfaces registers the interchain accounts controller types and the concrete InterchainAccount implementation // against the associated x/auth AccountI and GenesisAccount interfaces. func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - controllertypes.RegisterInterfaces(registry) - registry.RegisterImplementations((*authtypes.AccountI)(nil), &InterchainAccount{}) registry.RegisterImplementations((*authtypes.GenesisAccount)(nil), &InterchainAccount{}) } diff --git a/modules/apps/27-interchain-accounts/types/genesis_test.go b/modules/apps/27-interchain-accounts/types/genesis_test.go deleted file mode 100644 index 9adc1469564..00000000000 --- a/modules/apps/27-interchain-accounts/types/genesis_test.go +++ /dev/null @@ -1,307 +0,0 @@ -package types_test - -import ( - controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" - hosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" - "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" - ibctesting "github.com/cosmos/ibc-go/v5/testing" -) - -func (suite *TypesTestSuite) TestValidateGenesisState() { - var genesisState types.GenesisState - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "success", - func() {}, - true, - }, - { - "failed to validate - empty value", - func() { - genesisState = types.GenesisState{} - }, - false, - }, - { - "failed to validate - invalid controller genesis", - func() { - genesisState = *types.NewGenesisState(types.ControllerGenesisState{Ports: []string{"invalid|port"}}, types.DefaultHostGenesis()) - }, - false, - }, - { - "failed to validate - invalid host genesis", - func() { - genesisState = *types.NewGenesisState(types.DefaultControllerGenesis(), types.HostGenesisState{}) - }, - false, - }, - } - - for _, tc := range testCases { - suite.Run(tc.name, func() { - genesisState = *types.DefaultGenesis() - - tc.malleate() // malleate mutates test data - - err := genesisState.Validate() - - if tc.expPass { - suite.Require().NoError(err, tc.name) - } else { - suite.Require().Error(err, tc.name) - } - }) - } -} - -func (suite *TypesTestSuite) TestValidateControllerGenesisState() { - var genesisState types.ControllerGenesisState - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "success", - func() {}, - true, - }, - { - "failed to validate active channel - invalid port identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: "invalid|port", - ChannelId: ibctesting.FirstChannelID, - }, - } - - genesisState = types.NewControllerGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) - }, - false, - }, - { - "failed to validate active channel - invalid channel identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: "invalid|channel", - }, - } - - genesisState = types.NewControllerGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) - }, - false, - }, - { - "failed to validate registered account - invalid port identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: ibctesting.FirstChannelID, - }, - } - - registeredAccounts := []types.RegisteredInterchainAccount{ - { - PortId: "invalid|port", - AccountAddress: TestOwnerAddress, - }, - } - - genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) - }, - false, - }, - { - "failed to validate registered account - invalid owner address", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: ibctesting.FirstChannelID, - }, - } - - registeredAccounts := []types.RegisteredInterchainAccount{ - { - PortId: TestPortID, - AccountAddress: "", - }, - } - - genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) - }, - false, - }, - { - "failed to validate controller ports - invalid port identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: ibctesting.FirstChannelID, - }, - } - - registeredAccounts := []types.RegisteredInterchainAccount{ - { - PortId: TestPortID, - AccountAddress: TestOwnerAddress, - }, - } - - genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{"invalid|port"}, controllertypes.DefaultParams()) - }, - false, - }, - } - - for _, tc := range testCases { - suite.Run(tc.name, func() { - genesisState = types.DefaultControllerGenesis() - - tc.malleate() // malleate mutates test data - - err := genesisState.Validate() - - if tc.expPass { - suite.Require().NoError(err, tc.name) - } else { - suite.Require().Error(err, tc.name) - } - }) - } -} - -func (suite *TypesTestSuite) TestValidateHostGenesisState() { - var genesisState types.HostGenesisState - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "success", - func() {}, - true, - }, - { - "failed to validate active channel - invalid port identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: "invalid|port", - ChannelId: ibctesting.FirstChannelID, - }, - } - - genesisState = types.NewHostGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, types.PortID, hosttypes.DefaultParams()) - }, - false, - }, - { - "failed to validate active channel - invalid channel identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: "invalid|channel", - }, - } - - genesisState = types.NewHostGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, types.PortID, hosttypes.DefaultParams()) - }, - false, - }, - { - "failed to validate registered account - invalid port identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: ibctesting.FirstChannelID, - }, - } - - registeredAccounts := []types.RegisteredInterchainAccount{ - { - PortId: "invalid|port", - AccountAddress: TestOwnerAddress, - }, - } - - genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, types.PortID, hosttypes.DefaultParams()) - }, - false, - }, - { - "failed to validate registered account - invalid owner address", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: ibctesting.FirstChannelID, - }, - } - - registeredAccounts := []types.RegisteredInterchainAccount{ - { - PortId: TestPortID, - AccountAddress: "", - }, - } - - genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, types.PortID, hosttypes.DefaultParams()) - }, - false, - }, - { - "failed to validate controller ports - invalid port identifier", - func() { - activeChannels := []types.ActiveChannel{ - { - PortId: TestPortID, - ChannelId: ibctesting.FirstChannelID, - }, - } - - registeredAccounts := []types.RegisteredInterchainAccount{ - { - PortId: TestPortID, - AccountAddress: TestOwnerAddress, - }, - } - - genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, "invalid|port", hosttypes.DefaultParams()) - }, - false, - }, - } - - for _, tc := range testCases { - suite.Run(tc.name, func() { - genesisState = types.DefaultHostGenesis() - - tc.malleate() // malleate mutates test data - - err := genesisState.Validate() - - if tc.expPass { - suite.Require().NoError(err, tc.name) - } else { - suite.Require().Error(err, tc.name) - } - }) - } -} diff --git a/proto/ibc/applications/interchain_accounts/v1/genesis.proto b/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto similarity index 96% rename from proto/ibc/applications/interchain_accounts/v1/genesis.proto rename to proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto index 0687003195f..58870b8cd7c 100644 --- a/proto/ibc/applications/interchain_accounts/v1/genesis.proto +++ b/proto/ibc/applications/interchain_accounts/genesis/v1/genesis.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package ibc.applications.interchain_accounts.v1; +package ibc.applications.interchain_accounts.genesis.v1; -option go_package = "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types"; +option go_package = "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types"; import "gogoproto/gogo.proto"; import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; From 81d74fdc0711313be558b8ecd98f3c476f261a53 Mon Sep 17 00:00:00 2001 From: Charly Date: Fri, 26 Aug 2022 13:01:38 +0200 Subject: [PATCH 08/20] finish up correcting compile errors --- .../controller/keeper/genesis.go | 8 +- .../controller/keeper/genesis_test.go | 8 +- .../controller/keeper/keeper.go | 13 +- .../controller/keeper/keeper_test.go | 5 +- .../genesis/types/genesis_test.go | 624 +++++++++--------- 5 files changed, 337 insertions(+), 321 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/keeper/genesis.go b/modules/apps/27-interchain-accounts/controller/keeper/genesis.go index 25acfc74a8a..ebf63a7ca3f 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/genesis.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/genesis.go @@ -5,12 +5,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" ) // InitGenesis initializes the interchain accounts controller application state from a provided genesis state -func InitGenesis(ctx sdk.Context, keeper Keeper, state icatypes.ControllerGenesisState) { +func InitGenesis(ctx sdk.Context, keeper Keeper, state genesistypes.ControllerGenesisState) { for _, portID := range state.Ports { if !keeper.IsBound(ctx, portID) { cap := keeper.BindPort(ctx, portID) @@ -32,8 +32,8 @@ func InitGenesis(ctx sdk.Context, keeper Keeper, state icatypes.ControllerGenesi } // ExportGenesis returns the interchain accounts controller exported genesis -func ExportGenesis(ctx sdk.Context, keeper Keeper) icatypes.ControllerGenesisState { - return icatypes.NewControllerGenesisState( +func ExportGenesis(ctx sdk.Context, keeper Keeper) genesistypes.ControllerGenesisState { + return genesistypes.NewControllerGenesisState( keeper.GetAllActiveChannels(ctx), keeper.GetAllInterchainAccounts(ctx), keeper.GetAllPorts(ctx), diff --git a/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go b/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go index ac4698cbc7f..a787c52c03b 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/genesis_test.go @@ -3,22 +3,22 @@ package keeper_test import ( "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/keeper" "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" - icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" ibctesting "github.com/cosmos/ibc-go/v5/testing" ) func (suite *KeeperTestSuite) TestInitGenesis() { suite.SetupTest() - genesisState := icatypes.ControllerGenesisState{ - ActiveChannels: []icatypes.ActiveChannel{ + genesisState := genesistypes.ControllerGenesisState{ + ActiveChannels: []genesistypes.ActiveChannel{ { ConnectionId: ibctesting.FirstConnectionID, PortId: TestPortID, ChannelId: ibctesting.FirstChannelID, }, }, - InterchainAccounts: []icatypes.RegisteredInterchainAccount{ + InterchainAccounts: []genesistypes.RegisteredInterchainAccount{ { ConnectionId: ibctesting.FirstConnectionID, PortId: TestPortID, diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go index 2b281e93a45..9ccd4abc6a4 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go @@ -12,6 +12,7 @@ import ( "github.com/tendermint/tendermint/libs/log" "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" host "github.com/cosmos/ibc-go/v5/modules/core/24-host" @@ -134,16 +135,16 @@ func (k Keeper) GetOpenActiveChannel(ctx sdk.Context, connectionID, portID strin } // GetAllActiveChannels returns a list of all active interchain accounts controller channels and their associated connection and port identifiers -func (k Keeper) GetAllActiveChannels(ctx sdk.Context) []icatypes.ActiveChannel { +func (k Keeper) GetAllActiveChannels(ctx sdk.Context) []genesistypes.ActiveChannel { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte(icatypes.ActiveChannelKeyPrefix)) defer iterator.Close() - var activeChannels []icatypes.ActiveChannel + var activeChannels []genesistypes.ActiveChannel for ; iterator.Valid(); iterator.Next() { keySplit := strings.Split(string(iterator.Key()), "/") - ch := icatypes.ActiveChannel{ + ch := genesistypes.ActiveChannel{ ConnectionId: keySplit[2], PortId: keySplit[1], ChannelId: string(iterator.Value()), @@ -180,15 +181,15 @@ func (k Keeper) GetInterchainAccountAddress(ctx sdk.Context, connectionID, portI } // GetAllInterchainAccounts returns a list of all registered interchain account addresses and their associated connection and controller port identifiers -func (k Keeper) GetAllInterchainAccounts(ctx sdk.Context) []icatypes.RegisteredInterchainAccount { +func (k Keeper) GetAllInterchainAccounts(ctx sdk.Context) []genesistypes.RegisteredInterchainAccount { store := ctx.KVStore(k.storeKey) iterator := sdk.KVStorePrefixIterator(store, []byte(icatypes.OwnerKeyPrefix)) - var interchainAccounts []icatypes.RegisteredInterchainAccount + var interchainAccounts []genesistypes.RegisteredInterchainAccount for ; iterator.Valid(); iterator.Next() { keySplit := strings.Split(string(iterator.Key()), "/") - acc := icatypes.RegisteredInterchainAccount{ + acc := genesistypes.RegisteredInterchainAccount{ ConnectionId: keySplit[2], PortId: keySplit[1], AccountAddress: string(iterator.Value()), diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go index 21d58f0762c..18d9860e66a 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/suite" "github.com/tendermint/tendermint/crypto" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" channeltypes "github.com/cosmos/ibc-go/v5/modules/core/04-channel/types" ibctesting "github.com/cosmos/ibc-go/v5/testing" @@ -179,7 +180,7 @@ func (suite *KeeperTestSuite) TestGetAllActiveChannels() { suite.chainA.GetSimApp().ICAControllerKeeper.SetActiveChannelID(suite.chainA.GetContext(), ibctesting.FirstConnectionID, expectedPortID, expectedChannelID) - expectedChannels := []icatypes.ActiveChannel{ + expectedChannels := []genesistypes.ActiveChannel{ { ConnectionId: ibctesting.FirstConnectionID, PortId: TestPortID, @@ -213,7 +214,7 @@ func (suite *KeeperTestSuite) TestGetAllInterchainAccounts() { suite.chainA.GetSimApp().ICAControllerKeeper.SetInterchainAccountAddress(suite.chainA.GetContext(), ibctesting.FirstConnectionID, expectedPortID, expectedAccAddr) - expectedAccounts := []icatypes.RegisteredInterchainAccount{ + expectedAccounts := []genesistypes.RegisteredInterchainAccount{ { ConnectionId: ibctesting.FirstConnectionID, PortId: TestPortID, diff --git a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go index ee85dde229c..3e8673a89e8 100644 --- a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go @@ -1,307 +1,321 @@ package types_test -// import ( -// controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" -// hosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" -// "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" -// ibctesting "github.com/cosmos/ibc-go/v5/testing" -// ) - -// func (suite *TypesTestSuite) TestValidateGenesisState() { -// var genesisState types.GenesisState - -// testCases := []struct { -// name string -// malleate func() -// expPass bool -// }{ -// { -// "success", -// func() {}, -// true, -// }, -// { -// "failed to validate - empty value", -// func() { -// genesisState = types.GenesisState{} -// }, -// false, -// }, -// { -// "failed to validate - invalid controller genesis", -// func() { -// genesisState = *types.NewGenesisState(types.ControllerGenesisState{Ports: []string{"invalid|port"}}, types.DefaultHostGenesis()) -// }, -// false, -// }, -// { -// "failed to validate - invalid host genesis", -// func() { -// genesisState = *types.NewGenesisState(types.DefaultControllerGenesis(), types.HostGenesisState{}) -// }, -// false, -// }, -// } - -// for _, tc := range testCases { -// suite.Run(tc.name, func() { -// genesisState = *types.DefaultGenesis() - -// tc.malleate() // malleate mutates test data - -// err := genesisState.Validate() - -// if tc.expPass { -// suite.Require().NoError(err, tc.name) -// } else { -// suite.Require().Error(err, tc.name) -// } -// }) -// } -// } - -// func (suite *TypesTestSuite) TestValidateControllerGenesisState() { -// var genesisState types.ControllerGenesisState - -// testCases := []struct { -// name string -// malleate func() -// expPass bool -// }{ -// { -// "success", -// func() {}, -// true, -// }, -// { -// "failed to validate active channel - invalid port identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: "invalid|port", -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// genesisState = types.NewControllerGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate active channel - invalid channel identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: "invalid|channel", -// }, -// } - -// genesisState = types.NewControllerGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate registered account - invalid port identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// registeredAccounts := []types.RegisteredInterchainAccount{ -// { -// PortId: "invalid|port", -// AccountAddress: TestOwnerAddress, -// }, -// } - -// genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate registered account - invalid owner address", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// registeredAccounts := []types.RegisteredInterchainAccount{ -// { -// PortId: TestPortID, -// AccountAddress: "", -// }, -// } - -// genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate controller ports - invalid port identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// registeredAccounts := []types.RegisteredInterchainAccount{ -// { -// PortId: TestPortID, -// AccountAddress: TestOwnerAddress, -// }, -// } - -// genesisState = types.NewControllerGenesisState(activeChannels, registeredAccounts, []string{"invalid|port"}, controllertypes.DefaultParams()) -// }, -// false, -// }, -// } - -// for _, tc := range testCases { -// suite.Run(tc.name, func() { -// genesisState = types.DefaultControllerGenesis() - -// tc.malleate() // malleate mutates test data - -// err := genesisState.Validate() - -// if tc.expPass { -// suite.Require().NoError(err, tc.name) -// } else { -// suite.Require().Error(err, tc.name) -// } -// }) -// } -// } - -// func (suite *TypesTestSuite) TestValidateHostGenesisState() { -// var genesisState types.HostGenesisState - -// testCases := []struct { -// name string -// malleate func() -// expPass bool -// }{ -// { -// "success", -// func() {}, -// true, -// }, -// { -// "failed to validate active channel - invalid port identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: "invalid|port", -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// genesisState = types.NewHostGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, types.PortID, hosttypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate active channel - invalid channel identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: "invalid|channel", -// }, -// } - -// genesisState = types.NewHostGenesisState(activeChannels, []types.RegisteredInterchainAccount{}, types.PortID, hosttypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate registered account - invalid port identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// registeredAccounts := []types.RegisteredInterchainAccount{ -// { -// PortId: "invalid|port", -// AccountAddress: TestOwnerAddress, -// }, -// } - -// genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, types.PortID, hosttypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate registered account - invalid owner address", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// registeredAccounts := []types.RegisteredInterchainAccount{ -// { -// PortId: TestPortID, -// AccountAddress: "", -// }, -// } - -// genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, types.PortID, hosttypes.DefaultParams()) -// }, -// false, -// }, -// { -// "failed to validate controller ports - invalid port identifier", -// func() { -// activeChannels := []types.ActiveChannel{ -// { -// PortId: TestPortID, -// ChannelId: ibctesting.FirstChannelID, -// }, -// } - -// registeredAccounts := []types.RegisteredInterchainAccount{ -// { -// PortId: TestPortID, -// AccountAddress: TestOwnerAddress, -// }, -// } - -// genesisState = types.NewHostGenesisState(activeChannels, registeredAccounts, "invalid|port", hosttypes.DefaultParams()) -// }, -// false, -// }, -// } - -// for _, tc := range testCases { -// suite.Run(tc.name, func() { -// genesisState = types.DefaultHostGenesis() - -// tc.malleate() // malleate mutates test data - -// err := genesisState.Validate() - -// if tc.expPass { -// suite.Require().NoError(err, tc.name) -// } else { -// suite.Require().Error(err, tc.name) -// } -// }) -// } -// } +import ( + controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" + genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" + hosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" + ibctesting "github.com/cosmos/ibc-go/v5/testing" + "github.com/stretchr/testify/suite" +) + +var ( + // TestOwnerAddress defines a reusable bech32 address for testing purposes + TestOwnerAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs" + + // TestPortID defines a reusable port identifier for testing purposes + TestPortID, _ = icatypes.NewControllerPortID(TestOwnerAddress) +) + +type GenesisTypesTestSuite struct { + suite.Suite +} + +func (suite *GenesisTypesTestSuite) TestValidateGenesisState() { + var genesisState genesistypes.GenesisState + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "failed to validate - empty value", + func() { + genesisState = genesistypes.GenesisState{} + }, + false, + }, + { + "failed to validate - invalid controller genesis", + func() { + genesisState = *genesistypes.NewGenesisState(genesistypes.ControllerGenesisState{Ports: []string{"invalid|port"}}, genesistypes.DefaultHostGenesis()) + }, + false, + }, + { + "failed to validate - invalid host genesis", + func() { + genesisState = *genesistypes.NewGenesisState(genesistypes.DefaultControllerGenesis(), genesistypes.HostGenesisState{}) + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + genesisState = *genesistypes.DefaultGenesis() + + tc.malleate() // malleate mutates test data + + err := genesisState.Validate() + + if tc.expPass { + suite.Require().NoError(err, tc.name) + } else { + suite.Require().Error(err, tc.name) + } + }) + } +} + +func (suite *GenesisTypesTestSuite) TestValidateControllerGenesisState() { + var genesisState genesistypes.ControllerGenesisState + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "failed to validate active channel - invalid port identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: "invalid|port", + ChannelId: ibctesting.FirstChannelID, + }, + } + + genesisState = genesistypes.NewControllerGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) + }, + false, + }, + { + "failed to validate active channel - invalid channel identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: "invalid|channel", + }, + } + + genesisState = genesistypes.NewControllerGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, []string{}, controllertypes.DefaultParams()) + }, + false, + }, + { + "failed to validate registered account - invalid port identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: ibctesting.FirstChannelID, + }, + } + + registeredAccounts := []genesistypes.RegisteredInterchainAccount{ + { + PortId: "invalid|port", + AccountAddress: TestOwnerAddress, + }, + } + + genesisState = genesistypes.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) + }, + false, + }, + { + "failed to validate registered account - invalid owner address", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: ibctesting.FirstChannelID, + }, + } + + registeredAccounts := []genesistypes.RegisteredInterchainAccount{ + { + PortId: TestPortID, + AccountAddress: "", + }, + } + + genesisState = genesistypes.NewControllerGenesisState(activeChannels, registeredAccounts, []string{}, controllertypes.DefaultParams()) + }, + false, + }, + { + "failed to validate controller ports - invalid port identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: ibctesting.FirstChannelID, + }, + } + + registeredAccounts := []genesistypes.RegisteredInterchainAccount{ + { + PortId: TestPortID, + AccountAddress: TestOwnerAddress, + }, + } + + genesisState = genesistypes.NewControllerGenesisState(activeChannels, registeredAccounts, []string{"invalid|port"}, controllertypes.DefaultParams()) + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + genesisState = genesistypes.DefaultControllerGenesis() + + tc.malleate() // malleate mutates test data + + err := genesisState.Validate() + + if tc.expPass { + suite.Require().NoError(err, tc.name) + } else { + suite.Require().Error(err, tc.name) + } + }) + } +} + +func (suite *GenesisTypesTestSuite) TestValidateHostGenesisState() { + var genesisState genesistypes.HostGenesisState + + testCases := []struct { + name string + malleate func() + expPass bool + }{ + { + "success", + func() {}, + true, + }, + { + "failed to validate active channel - invalid port identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: "invalid|port", + ChannelId: ibctesting.FirstChannelID, + }, + } + + genesisState = genesistypes.NewHostGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, icatypes.PortID, hosttypes.DefaultParams()) + }, + false, + }, + { + "failed to validate active channel - invalid channel identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: "invalid|channel", + }, + } + + genesisState = genesistypes.NewHostGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, icatypes.PortID, hosttypes.DefaultParams()) + }, + false, + }, + { + "failed to validate registered account - invalid port identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: ibctesting.FirstChannelID, + }, + } + + registeredAccounts := []genesistypes.RegisteredInterchainAccount{ + { + PortId: "invalid|port", + AccountAddress: TestOwnerAddress, + }, + } + + genesisState = genesistypes.NewHostGenesisState(activeChannels, registeredAccounts, icatypes.PortID, hosttypes.DefaultParams()) + }, + false, + }, + { + "failed to validate registered account - invalid owner address", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: ibctesting.FirstChannelID, + }, + } + + registeredAccounts := []genesistypes.RegisteredInterchainAccount{ + { + PortId: TestPortID, + AccountAddress: "", + }, + } + + genesisState = genesistypes.NewHostGenesisState(activeChannels, registeredAccounts, icatypes.PortID, hosttypes.DefaultParams()) + }, + false, + }, + { + "failed to validate controller ports - invalid port identifier", + func() { + activeChannels := []genesistypes.ActiveChannel{ + { + PortId: TestPortID, + ChannelId: ibctesting.FirstChannelID, + }, + } + + registeredAccounts := []genesistypes.RegisteredInterchainAccount{ + { + PortId: TestPortID, + AccountAddress: TestOwnerAddress, + }, + } + + genesisState = genesistypes.NewHostGenesisState(activeChannels, registeredAccounts, "invalid|port", hosttypes.DefaultParams()) + }, + false, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + genesisState = genesistypes.DefaultHostGenesis() + + tc.malleate() // malleate mutates test data + + err := genesisState.Validate() + + if tc.expPass { + suite.Require().NoError(err, tc.name) + } else { + suite.Require().Error(err, tc.name) + } + }) + } +} From bd25b556ff83f02e420588362fd7ee24be581712 Mon Sep 17 00:00:00 2001 From: Charly Date: Fri, 26 Aug 2022 15:23:19 +0200 Subject: [PATCH 09/20] goformat --- .../apps/27-interchain-accounts/genesis/types/genesis_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go index 3e8673a89e8..9f3a9c7be45 100644 --- a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go @@ -1,12 +1,13 @@ package types_test import ( + "github.com/stretchr/testify/suite" + controllertypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" genesistypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/genesis/types" hosttypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/host/types" icatypes "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/types" ibctesting "github.com/cosmos/ibc-go/v5/testing" - "github.com/stretchr/testify/suite" ) var ( From fee8080b980975736ba5c5f9415f28a5e4d94331 Mon Sep 17 00:00:00 2001 From: Charly Date: Fri, 26 Aug 2022 15:37:09 +0200 Subject: [PATCH 10/20] update to new proto --- docs/ibc/proto-docs.md | 136 +++++++++--------- .../controller/types/msgs.go | 6 +- .../controller/types/tx.pb.go | 97 ++++++------- .../controller/v1/tx.proto | 6 +- 4 files changed, 123 insertions(+), 122 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 13a51eb0804..f31bde1f3ae 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -89,6 +89,12 @@ - [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) @@ -119,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) @@ -1519,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

@@ -1570,7 +1631,7 @@ MsgSubmitTx defines the payload for MsgSubmitTx | `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. | -| `msg` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `msgs` | [ibc.applications.interchain_accounts.v1.InterchainAccountPacketData](#ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) | repeated | | @@ -1862,67 +1923,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/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index e2b212394e5..c1fbbbb6573 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -3,10 +3,10 @@ package types import ( "strings" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" 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" ) @@ -50,13 +50,13 @@ func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { } // NewMsgSubmitTx creates a new instance of MsgSubmitTx -func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, msgs []*codectypes.Any) *MsgSubmitTx { +func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, msgs []*icatypes.InterchainAccountPacketData) *MsgSubmitTx { return &MsgSubmitTx{ ConnectionId: connectionID, Owner: owner, TimeoutHeight: timeoutHeight, TimeoutTimestamp: timeoutTimestamp, - Msg: msgs, + Msgs: msgs, } } 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 9fc3fa896f4..e3305950f2f 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - types1 "github.com/cosmos/cosmos-sdk/codec/types" + 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" @@ -124,8 +124,8 @@ type MsgSubmitTx struct { 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"` - Msg []*types1.Any `protobuf:"bytes,5,rep,name=msg,proto3" json:"msg,omitempty"` + TimeoutTimestamp uint64 `protobuf:"varint,4,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"` + Msgs []*types1.InterchainAccountPacketData `protobuf:"bytes,5,rep,name=msgs,proto3" json:"msgs,omitempty"` } func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } @@ -210,43 +210,44 @@ func init() { } var fileDescriptor_7def041328c84a30 = []byte{ - // 576 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x3f, 0x6f, 0xd3, 0x4e, - 0x18, 0xb6, 0x93, 0xf6, 0xf7, 0x6b, 0xaf, 0x14, 0xa8, 0x49, 0x25, 0x63, 0x81, 0x5d, 0x79, 0x40, - 0x5d, 0x7a, 0xa7, 0x06, 0x10, 0x52, 0x11, 0x42, 0xcd, 0x00, 0x74, 0x08, 0x42, 0xa6, 0x13, 0x4b, - 0xb0, 0x2f, 0xc7, 0xe5, 0x90, 0x7d, 0x67, 0xf9, 0xce, 0xa1, 0xf9, 0x06, 0x2c, 0x48, 0x0c, 0x7c, - 0x80, 0xae, 0x7c, 0x0c, 0xb6, 0x8c, 0x1d, 0x99, 0x22, 0x94, 0x2c, 0xcc, 0xf9, 0x04, 0xc8, 0xff, - 0xf2, 0x87, 0x74, 0x29, 0x30, 0xd9, 0xef, 0x7b, 0xef, 0xf3, 0xdc, 0x73, 0xf7, 0x3c, 0x3a, 0xf0, - 0x98, 0x05, 0x18, 0xf9, 0x71, 0x1c, 0x32, 0xec, 0x2b, 0x26, 0xb8, 0x44, 0x8c, 0x2b, 0x92, 0xe0, - 0x9e, 0xcf, 0x78, 0xc7, 0xc7, 0x58, 0xa4, 0x5c, 0x49, 0x84, 0x05, 0x57, 0x89, 0x08, 0x43, 0x92, - 0xa0, 0xfe, 0x21, 0x52, 0x67, 0x30, 0x4e, 0x84, 0x12, 0x46, 0x93, 0x05, 0x18, 0x2e, 0x82, 0xe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, 0x6b, 0x17, 0x13, 0x5b, 0xfb, 0x3e, - 0xb1, 0xb5, 0x37, 0xaf, 0x28, 0x53, 0xbd, 0x34, 0x80, 0x58, 0x44, 0x08, 0x0b, 0x19, 0x09, 0x89, - 0x58, 0x80, 0x0f, 0xa8, 0x40, 0xfd, 0x87, 0x28, 0x12, 0xdd, 0x34, 0x24, 0x32, 0x7b, 0x86, 0x24, - 0x6a, 0x3e, 0x3a, 0x98, 0x6f, 0x7e, 0x70, 0xd9, 0x0b, 0xa4, 0x06, 0x31, 0x91, 0xc1, 0x7f, 0xb9, - 0xd5, 0xf7, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x26, 0x0b, 0x59, 0xe2, 0xc1, 0x04, 0x00, 0x00, + // 583 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0xb5, 0xd3, 0xf6, 0xfb, 0xda, 0x29, 0x05, 0x6a, 0x5a, 0xc9, 0xb2, 0xc0, 0x8e, 0xbc, 0xca, + 0x26, 0x33, 0x4a, 0x28, 0x42, 0x2a, 0x42, 0x88, 0xa8, 0x02, 0xb2, 0x08, 0xaa, 0x4c, 0x17, 0x88, + 0x4d, 0xb0, 0x27, 0x23, 0x67, 0xc0, 0x9e, 0xb1, 0x3c, 0x13, 0xd3, 0xbe, 0x01, 0x1b, 0x24, 0x16, + 0x3c, 0x40, 0xb7, 0xbc, 0x49, 0x96, 0x5d, 0xb2, 0x8a, 0x50, 0xb2, 0x61, 0x1d, 0x5e, 0x00, 0xf9, + 0x2f, 0x3f, 0xa4, 0x8b, 0x16, 0x58, 0x65, 0xee, 0x9d, 0x73, 0xce, 0x9c, 0xc9, 0x3d, 0x1e, 0xf0, + 0x88, 0x7a, 0x18, 0xb9, 0x51, 0x14, 0x50, 0xec, 0x4a, 0xca, 0x99, 0x40, 0x94, 0x49, 0x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 0x8d, 0xce, 0x2c, 0x76, + 0x5f, 0x54, 0xb0, 0x39, 0x4b, 0xcf, 0x93, 0x3f, 0x14, 0x2f, 0x05, 0x8c, 0xe7, 0x7f, 0x29, 0x50, + 0xda, 0x6a, 0xbd, 0x1b, 0x8e, 0x4d, 0xf5, 0x62, 0x6c, 0xaa, 0xdf, 0xc7, 0xa6, 0xfa, 0x79, 0x62, + 0x2a, 0x17, 0x13, 0x53, 0xf9, 0x36, 0x31, 0x95, 0x37, 0xc7, 0x3e, 0x95, 0xfd, 0x81, 0x07, 0x31, + 0x0f, 0x11, 0xe6, 0x22, 0xe4, 0x02, 0x51, 0x0f, 0xd7, 0x7d, 0x8e, 0x92, 0x07, 0x28, 0xe4, 0xbd, + 0x41, 0x40, 0x44, 0xfa, 0x56, 0x08, 0xd4, 0x7c, 0x58, 0x9f, 0x1f, 0x5e, 0xbf, 0xec, 0x39, 0x93, + 0x67, 0x11, 0x11, 0xde, 0x7f, 0xd9, 0x73, 0x71, 0xff, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, + 0xec, 0x03, 0x36, 0x0e, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -463,10 +464,10 @@ func (m *MsgSubmitTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Msg) > 0 { - for iNdEx := len(m.Msg) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Msgs) > 0 { + for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Msg[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -596,8 +597,8 @@ func (m *MsgSubmitTx) Size() (n int) { if m.TimeoutTimestamp != 0 { n += 1 + sovTx(uint64(m.TimeoutTimestamp)) } - if len(m.Msg) > 0 { - for _, e := range m.Msg { + if len(m.Msgs) > 0 { + for _, e := range m.Msgs { l = e.Size() n += 1 + l + sovTx(uint64(l)) } @@ -995,7 +996,7 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { } case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1022,8 +1023,8 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Msg = append(m.Msg, &types1.Any{}) - if err := m.Msg[len(m.Msg)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Msgs = append(m.Msgs, &types1.InterchainAccountPacketData{}) + if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index 4897423167f..b84e3282ad3 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -5,8 +5,8 @@ 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 "google/protobuf/any.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 { @@ -44,8 +44,8 @@ message MsgSubmitTx { [(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\""]; - repeated google.protobuf.Any msg = 5; + uint64 timeout_timestamp = 4 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + repeated ibc.applications.interchain_accounts.v1.InterchainAccountPacketData msgs = 5; } // MsgSubmitTxResponse defines the response for MsgSubmitTx From a605ba6477f37d390b5315de03f499840310f12d Mon Sep 17 00:00:00 2001 From: Charly Date: Mon, 29 Aug 2022 16:32:38 +0200 Subject: [PATCH 11/20] update proto --- docs/ibc/proto-docs.md | 2 +- .../controller/types/msgs.go | 4 +- .../controller/types/tx.pb.go | 116 +++++++++--------- .../controller/v1/tx.proto | 4 +- 4 files changed, 62 insertions(+), 64 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index f31bde1f3ae..e6ce70add1a 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1631,7 +1631,7 @@ MsgSubmitTx defines the payload for MsgSubmitTx | `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. | -| `msgs` | [ibc.applications.interchain_accounts.v1.InterchainAccountPacketData](#ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) | repeated | | +| `packet_data` | [ibc.applications.interchain_accounts.v1.InterchainAccountPacketData](#ibc.applications.interchain_accounts.v1.InterchainAccountPacketData) | | | diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index c1fbbbb6573..b5ff783a4eb 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -50,13 +50,13 @@ func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { } // NewMsgSubmitTx creates a new instance of MsgSubmitTx -func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, msgs []*icatypes.InterchainAccountPacketData) *MsgSubmitTx { +func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, packetData *icatypes.InterchainAccountPacketData) *MsgSubmitTx { return &MsgSubmitTx{ ConnectionId: connectionID, Owner: owner, TimeoutHeight: timeoutHeight, TimeoutTimestamp: timeoutTimestamp, - Msgs: msgs, + PacketData: packetData, } } 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 e3305950f2f..9f2f71bcc19 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -124,8 +124,8 @@ type MsgSubmitTx struct { 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"` - Msgs []*types1.InterchainAccountPacketData `protobuf:"bytes,5,rep,name=msgs,proto3" json:"msgs,omitempty"` + 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,omitempty"` } func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } @@ -210,44 +210,44 @@ func init() { } var fileDescriptor_7def041328c84a30 = []byte{ - // 583 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0xb5, 0xd3, 0xf6, 0xfb, 0xda, 0x29, 0x05, 0x6a, 0x5a, 0xc9, 0xb2, 0xc0, 0x8e, 0xbc, 0xca, - 0x26, 0x33, 0x4a, 0x28, 0x42, 0x2a, 0x42, 0x88, 0xa8, 0x02, 0xb2, 0x08, 0xaa, 0x4c, 0x17, 0x88, - 0x4d, 0xb0, 0x27, 0x23, 0x67, 0xc0, 0x9e, 0xb1, 0x3c, 0x13, 0xd3, 0xbe, 0x01, 0x1b, 0x24, 0x16, - 0x3c, 0x40, 0xb7, 0xbc, 0x49, 0x96, 0x5d, 0xb2, 0x8a, 0x50, 0xb2, 0x61, 0x1d, 0x5e, 0x00, 0xf9, - 0x2f, 0x3f, 0xa4, 0x8b, 0x16, 0x58, 0x65, 0xee, 0x9d, 0x73, 0xce, 0x9c, 0xc9, 0x3d, 0x1e, 0xf0, - 0x88, 0x7a, 0x18, 0xb9, 0x51, 0x14, 0x50, 0xec, 0x4a, 0xca, 0x99, 0x40, 0x94, 0x49, 0x12, 0xe3, - 0xbe, 0x4b, 0x59, 0xd7, 0xc5, 0x98, 0x0f, 0x98, 0x14, 0x08, 0x73, 0x26, 0x63, 0x1e, 0x04, 0x24, - 0x46, 0x49, 0x03, 0xc9, 0x53, 0x18, 0xc5, 0x5c, 0x72, 0xad, 0x49, 0x3d, 0x0c, 0x17, 0xc9, 0xf0, - 0x12, 0x32, 0x9c, 0x93, 0x61, 0xd2, 0x30, 0xf6, 0x7c, 0xee, 0xf3, 0x8c, 0x8e, 0xd2, 0x55, 0xae, - 0x64, 0x58, 0xa9, 0x0d, 0xcc, 0x63, 0x82, 0x70, 0x40, 0x09, 0x93, 0xe9, 0x31, 0xf9, 0xaa, 0x00, - 0x1c, 0x5c, 0xc9, 0x67, 0xd2, 0x40, 0x91, 0x8b, 0xdf, 0x93, 0x82, 0x65, 0x7f, 0x52, 0x81, 0xd6, - 0x11, 0xbe, 0x43, 0x7c, 0x2a, 0x24, 0x89, 0x9f, 0xe6, 0x38, 0xed, 0x31, 0xd8, 0xc1, 0x9c, 0x31, - 0x82, 0x53, 0xa5, 0x2e, 0xed, 0xe9, 0x6a, 0x55, 0xad, 0x6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, - 0x32, 0x83, 0xd8, 0xce, 0xed, 0xa2, 0x77, 0x52, 0xb6, 0xb4, 0xd7, 0x60, 0x3d, 0x14, 0xbe, 0xd0, - 0x37, 0xaa, 0x6b, 0xb5, 0xed, 0xe6, 0x11, 0xbc, 0x52, 0x4a, 0x93, 0x06, 0x6c, 0xcf, 0xda, 0xc5, - 0x64, 0x8e, 0xb3, 0x2c, 0x1d, 0xb9, 0xd2, 0x75, 0x32, 0xc5, 0x85, 0x49, 0xee, 0x83, 0x3b, 0x0b, - 0x7f, 0x7a, 0x39, 0xc2, 0xe6, 0xb0, 0x02, 0xd6, 0x3a, 0xc2, 0xd7, 0xbe, 0xaa, 0xe0, 0xd6, 0xef, - 0xa9, 0x7b, 0x06, 0xaf, 0xff, 0xb9, 0xc0, 0xd5, 0xb8, 0x18, 0x2f, 0xff, 0x8d, 0xce, 0x2c, 0x76, - 0x5f, 0x54, 0xb0, 0x39, 0x4b, 0xcf, 0x93, 0x3f, 0x14, 0x2f, 0x05, 0x8c, 0xe7, 0x7f, 0x29, 0x50, - 0xda, 0x6a, 0xbd, 0x1b, 0x8e, 0x4d, 0xf5, 0x62, 0x6c, 0xaa, 0xdf, 0xc7, 0xa6, 0xfa, 0x79, 0x62, - 0x2a, 0x17, 0x13, 0x53, 0xf9, 0x36, 0x31, 0x95, 0x37, 0xc7, 0x3e, 0x95, 0xfd, 0x81, 0x07, 0x31, - 0x0f, 0x11, 0xe6, 0x22, 0xe4, 0x02, 0x51, 0x0f, 0xd7, 0x7d, 0x8e, 0x92, 0x07, 0x28, 0xe4, 0xbd, - 0x41, 0x40, 0x44, 0xfa, 0x56, 0x08, 0xd4, 0x7c, 0x58, 0x9f, 0x1f, 0x5e, 0xbf, 0xec, 0x39, 0x93, - 0x67, 0x11, 0x11, 0xde, 0x7f, 0xd9, 0x73, 0x71, 0xff, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x16, - 0xec, 0x03, 0x36, 0x0e, 0x05, 0x00, 0x00, + // 580 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x3f, 0x6f, 0xd3, 0x40, + 0x1c, 0xb5, 0xfb, 0x07, 0xda, 0x2b, 0x05, 0x6a, 0x5a, 0xc9, 0xb2, 0xc0, 0xae, 0x3c, 0x75, 0xe9, + 0x9d, 0x12, 0x8a, 0x90, 0x8a, 0x10, 0x22, 0xaa, 0x80, 0x0c, 0x45, 0x95, 0xe9, 0xc4, 0x12, 0xce, + 0x97, 0x93, 0x73, 0x60, 0xdf, 0x59, 0xbe, 0x8b, 0x69, 0x37, 0x46, 0x16, 0x24, 0x06, 0x3e, 0x40, + 0x57, 0xbe, 0x49, 0xc7, 0x8e, 0x4c, 0x11, 0x4a, 0x16, 0xe6, 0x7c, 0x02, 0xe4, 0xbf, 0x49, 0x48, + 0x87, 0x16, 0x98, 0x7c, 0xbf, 0xdf, 0xfd, 0xde, 0xbb, 0x77, 0x7a, 0xcf, 0x07, 0x9e, 0x30, 0x9f, + 0x20, 0x1c, 0xc7, 0x21, 0x23, 0x58, 0x31, 0xc1, 0x25, 0x62, 0x5c, 0xd1, 0x84, 0xf4, 0x30, 0xe3, + 0x1d, 0x4c, 0x88, 0xe8, 0x73, 0x25, 0x11, 0x11, 0x5c, 0x25, 0x22, 0x0c, 0x69, 0x82, 0xd2, 0x06, + 0x52, 0x27, 0x30, 0x4e, 0x84, 0x12, 0x46, 0x93, 0xf9, 0x04, 0x4e, 0x83, 0xe1, 0x25, 0x60, 0x38, + 0x01, 0xc3, 0xb4, 0x61, 0x6d, 0x06, 0x22, 0x10, 0x39, 0x1c, 0x65, 0xab, 0x82, 0xc9, 0x72, 0x32, + 0x19, 0x44, 0x24, 0x14, 0x91, 0x90, 0x51, 0xae, 0xb2, 0x63, 0x8a, 0x55, 0x39, 0xb0, 0x77, 0x25, + 0x9d, 0x69, 0x03, 0xc5, 0x98, 0x7c, 0xa0, 0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0x0e, 0x89, 0x9a, 0x8f, 0x77, 0x27, 0x87, 0xef, 0x5e, 0xf6, 0xb6, 0xa9, 0xd3, 0x98, + 0x4a, 0xff, 0x46, 0xfe, 0x76, 0x3c, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x20, 0xf8, 0xbd, 0x5c, + 0x1b, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -464,19 +464,17 @@ func (m *MsgSubmitTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.Msgs) > 0 { - for iNdEx := len(m.Msgs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Msgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + if m.PacketData != nil { + { + size, err := m.PacketData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x2a + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a } if m.TimeoutTimestamp != 0 { i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) @@ -597,11 +595,9 @@ func (m *MsgSubmitTx) Size() (n int) { if m.TimeoutTimestamp != 0 { n += 1 + sovTx(uint64(m.TimeoutTimestamp)) } - if len(m.Msgs) > 0 { - for _, e := range m.Msgs { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } + if m.PacketData != nil { + l = m.PacketData.Size() + n += 1 + l + sovTx(uint64(l)) } return n } @@ -996,7 +992,7 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { } case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msgs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PacketData", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1023,8 +1019,10 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Msgs = append(m.Msgs, &types1.InterchainAccountPacketData{}) - if err := m.Msgs[len(m.Msgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.PacketData == nil { + m.PacketData = &types1.InterchainAccountPacketData{} + } + if err := m.PacketData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index b84e3282ad3..e1ddb3fd62b 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -44,8 +44,8 @@ message MsgSubmitTx { [(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\""]; - repeated ibc.applications.interchain_accounts.v1.InterchainAccountPacketData msgs = 5; + uint64 timeout_timestamp = 4 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; + ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 5; } // MsgSubmitTxResponse defines the response for MsgSubmitTx From a0a21ffe049d525fbc00eeef9add3f6e2a239a9a Mon Sep 17 00:00:00 2001 From: Charly Date: Mon, 29 Aug 2022 16:46:31 +0200 Subject: [PATCH 12/20] register interfaces update --- .../apps/27-interchain-accounts/controller/types/codec.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/types/codec.go b/modules/apps/27-interchain-accounts/controller/types/codec.go index 41e43b9635f..a1b5d7fd56a 100644 --- a/modules/apps/27-interchain-accounts/controller/types/codec.go +++ b/modules/apps/27-interchain-accounts/controller/types/codec.go @@ -7,6 +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), &MsgSubmitTx{}) + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgRegisterAccount{}, + &MsgSubmitTx{}, + ) } From a9e44a11a10f9b88d1ad13e016529f0d0aa3f451 Mon Sep 17 00:00:00 2001 From: Charly Date: Mon, 29 Aug 2022 16:59:02 +0200 Subject: [PATCH 13/20] format --- modules/apps/27-interchain-accounts/controller/types/msgs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index b5ff783a4eb..b866d429472 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -50,13 +50,13 @@ func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { } // NewMsgSubmitTx creates a new instance of MsgSubmitTx -func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, packetData *icatypes.InterchainAccountPacketData) *MsgSubmitTx { +func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, packetData *icatypes.InterchainAccountPacketData) *MsgSubmitTx { return &MsgSubmitTx{ ConnectionId: connectionID, Owner: owner, TimeoutHeight: timeoutHeight, TimeoutTimestamp: timeoutTimestamp, - PacketData: packetData, + PacketData: packetData, } } From c897d0b83bef46e4f97e766ef3a7cd765cb1df95 Mon Sep 17 00:00:00 2001 From: Charly Date: Mon, 29 Aug 2022 17:12:43 +0200 Subject: [PATCH 14/20] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae3378bfe46..6bd9b6f4a24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) generates genesis protos in a separate directory to avoid circular import errors * (linting) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) Fix linting errors, resulting compatiblity with go1.18 linting style, golangci-lint 1.46.2 and the revivie linter. This caused breaking changes in core/04-channel, core/ante, and the testing library. * (modules/light-clients/07-tendermint) [\#1713](https://github.com/cosmos/ibc-go/pull/1713) Allow client upgrade proposals to update `TrustingPeriod`. See ADR-026 for context. * (modules/core/02-client) [\#1188](https://github.com/cosmos/ibc-go/pull/1188/files) Routing `MsgSubmitMisbehaviour` to `UpdateClient` keeper function. Deprecating `SubmitMisbehaviour` endpoint. From 656ca38e378fadbe6756a7ead005afce88ece005 Mon Sep 17 00:00:00 2001 From: Charly Date: Mon, 29 Aug 2022 17:35:55 +0200 Subject: [PATCH 15/20] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bd9b6f4a24..dafccccb5ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements -* (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) generates genesis protos in a separate directory to avoid circular import errors +* (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) Generates genesis protos in a separate directory to avoid circular import errors. The protobuf package name has changed for the genesis types. * (linting) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) Fix linting errors, resulting compatiblity with go1.18 linting style, golangci-lint 1.46.2 and the revivie linter. This caused breaking changes in core/04-channel, core/ante, and the testing library. * (modules/light-clients/07-tendermint) [\#1713](https://github.com/cosmos/ibc-go/pull/1713) Allow client upgrade proposals to update `TrustingPeriod`. See ADR-026 for context. * (modules/core/02-client) [\#1188](https://github.com/cosmos/ibc-go/pull/1188/files) Routing `MsgSubmitMisbehaviour` to `UpdateClient` keeper function. Deprecating `SubmitMisbehaviour` endpoint. From 4eec1dce915c1159c7fab6dd377ee80718e5d861 Mon Sep 17 00:00:00 2001 From: Charly Date: Mon, 29 Aug 2022 17:55:32 +0200 Subject: [PATCH 16/20] update msgSubmitTxResp --- docs/ibc/proto-docs.md | 5 + .../controller/types/tx.pb.go | 112 ++++++++++++------ .../controller/v1/tx.proto | 4 +- 3 files changed, 82 insertions(+), 39 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index e6ce70add1a..d88d3fd001c 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1644,6 +1644,11 @@ MsgSubmitTx defines the payload for MsgSubmitTx MsgSubmitTxResponse defines the response for MsgSubmitTx +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequence` | [uint64](#uint64) | | | + + 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 9f2f71bcc19..24e05139941 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -163,6 +163,7 @@ 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{} } @@ -198,6 +199,13 @@ func (m *MsgSubmitTxResponse) XXX_DiscardUnknown() { 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") @@ -210,44 +218,45 @@ func init() { } var fileDescriptor_7def041328c84a30 = []byte{ - // 580 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x3f, 0x6f, 0xd3, 0x40, - 0x1c, 0xb5, 0xfb, 0x07, 0xda, 0x2b, 0x05, 0x6a, 0x5a, 0xc9, 0xb2, 0xc0, 0xae, 0x3c, 0x75, 0xe9, - 0x9d, 0x12, 0x8a, 0x90, 0x8a, 0x10, 0x22, 0xaa, 0x80, 0x0c, 0x45, 0x95, 0xe9, 0xc4, 0x12, 0xce, - 0x97, 0x93, 0x73, 0x60, 0xdf, 0x59, 0xbe, 0x8b, 0x69, 0x37, 0x46, 0x16, 0x24, 0x06, 0x3e, 0x40, - 0x57, 0xbe, 0x49, 0xc7, 0x8e, 0x4c, 0x11, 0x4a, 0x16, 0xe6, 0x7c, 0x02, 0xe4, 0xbf, 0x49, 0x48, - 0x87, 0x16, 0x98, 0x7c, 0xbf, 0xdf, 0xfd, 0xde, 0xbb, 0x77, 0x7a, 0xcf, 0x07, 0x9e, 0x30, 0x9f, - 0x20, 0x1c, 0xc7, 0x21, 0x23, 0x58, 0x31, 0xc1, 0x25, 0x62, 0x5c, 0xd1, 0x84, 0xf4, 0x30, 0xe3, - 0x1d, 0x4c, 0x88, 0xe8, 0x73, 0x25, 0x11, 0x11, 0x5c, 0x25, 0x22, 0x0c, 0x69, 0x82, 0xd2, 0x06, - 0x52, 0x27, 0x30, 0x4e, 0x84, 0x12, 0x46, 0x93, 0xf9, 0x04, 0x4e, 0x83, 0xe1, 0x25, 0x60, 0x38, - 0x01, 0xc3, 0xb4, 0x61, 0x6d, 0x06, 0x22, 0x10, 0x39, 0x1c, 0x65, 0xab, 0x82, 0xc9, 0x72, 0x32, - 0x19, 0x44, 0x24, 0x14, 0x91, 0x90, 0x51, 0xae, 0xb2,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f3, 0xc9, 0x6e, 0x20, 0x50, 0xfa, 0x08, 0x45, 0xa2, 0xdb, 0x0f, 0xa9, - 0xcc, 0x1e, 0x0e, 0x89, 0x9a, 0x8f, 0x77, 0x27, 0x87, 0xef, 0x5e, 0xf6, 0xb6, 0xa9, 0xd3, 0x98, - 0x4a, 0xff, 0x46, 0xfe, 0x76, 0x3c, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x20, 0xf8, 0xbd, 0x5c, - 0x1b, 0x05, 0x00, 0x00, + // 596 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbd, 0x6e, 0xd4, 0x4c, + 0x14, 0xb5, 0xf3, 0xf3, 0x7d, 0xc9, 0x84, 0x00, 0x31, 0x89, 0x64, 0x59, 0x60, 0x47, 0xae, 0xd2, + 0x64, 0x46, 0x5e, 0x82, 0x90, 0x82, 0x10, 0x62, 0x15, 0x01, 0x5b, 0x04, 0x45, 0x26, 0x15, 0xcd, + 0x32, 0x9e, 0x1d, 0x79, 0x07, 0xec, 0x19, 0xe3, 0x19, 0x9b, 0xa4, 0xa3, 0xa4, 0x41, 0xa2, 0xe0, + 0x01, 0xd2, 0xf2, 0x26, 0x29, 0x53, 0x52, 0xad, 0x50, 0xd2, 0x50, 0xef, 0x13, 0x20, 0xff, 0xac, + 0x77, 0x97, 0x4d, 0x91, 0x00, 0x95, 0xe7, 0xde, 0xb9, 0xe7, 0xcc, 0xb9, 0x3a, 0xd7, 0x17, 0x3c, + 0x62, 0x01, 0x41, 0x38, 0x49, 0x22, 0x46, 0xb0, 0x62, 0x82, 0x4b, 0xc4, 0xb8, 0xa2, 0x29, 0xe9, + 0x63, 0xc6, 0xbb, 0x98, 0x10, 0x91, 0x71, 0x25, 0x11, 0x11, 0x5c, 0xa5, 0x22, 0x8a, 0x68, 0x8a, + 0x72, 0x0f, 0xa9, 0x23, 0x98, 0xa4, 0x42, 0x09, 0xa3, 0xc5, 0x02, 0x02, 0x27, 0xc1, 0xf0, 0x12, + 0x30, 0x1c, 0x83, 0x61, 0xee, 0x59, 0xeb, 0xa1, 0x08, 0x45, 0x09, 0x47, 0xc5, 0xa9, 0x62, 0xb2, + 0x9c, 0x42, 0x06, 0x11, 0x29, 0x45, 0x24, 0x62, 0x94, 0xab, 0xe2, 0x99, 0xea, 0x54, 0x17, 0xec, + 0x5c, 0x49, 0x67, 0xee, 0xa1, 0x04, 0x93, 0x77, 0xb4, 0x46, 0xb9, 0x9f, 0x75, 0x60, 0xec, 0xcb, + 0xd0, 0xa7, 0x21, 0x93, 0x8a, 0xa6, 0x4f, 0xab, 0x3a, 0xe3, 0x31, 0x58, 0x25, 0x82, 0x73, 0x4a, + 0x0a, 0xa6, 0x2e, 0xeb, 0x99, 0xfa, 0xa6, 0xbe, 0xb5, 0xdc, 0x36, 0x87, 0x03, 0x67, 0xfd, 0x18, + 0xc7, 0xd1, 0xae, 0x3b, 0x75, 0xed, 0xfa, 0x37, 0xc6, 0x71, 0xa7, 0x67, 0xac, 0x83, 0x45, 0xf1, + 0x81, 0xd3, 0xd4, 0x9c, 0x2b, 0x60, 0x7e, 0x15, 0x18, 0x26, 0xf8, 0x3f, 0xa7, 0xa9, 0x64, 0x82, + 0x9b, 0xf3, 0x65, 0x7e, 0x14, 0xee, 0x2e, 0x7d, 0x3a, 0x71, 0xb4, 0x9f, 0x27, 0x8e, 0xe6, 0xfa, + 0xc0, 0x9a, 0x95, 0xe3, 0x53, 0x99, 0x08, 0x2e, 0xa9, 0xb1, 0x03, 0x00, 0xe9, 0x63, 0xce, 0x69, + 0x34, 0xd6, 0xb4, 0x31, 0x1c, 0x38, 0x6b, 0xb5, 0xa6, 0xe6, 0xce, 0xf5, 0x97, 0xeb, 0xa0, 0xd3, + 0x73, 0x3f, 0xce, 0x83, 0x95, 0x7d, 0x19, 0xbe, 0xca, 0x82, 0x98, 0xa9, 0xc3, 0xa3, 0xb1, 0x3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fe, 0x90, 0x7c, 0x44, 0x60, 0x3d, 0xff, 0x4b, 0x82, 0x91, 0xac, 0xf6, 0xdb, + 0xd3, 0x73, 0x5b, 0x3f, 0x3b, 0xb7, 0xf5, 0x1f, 0xe7, 0xb6, 0xfe, 0xe5, 0xc2, 0xd6, 0xce, 0x2e, + 0x6c, 0xed, 0xfb, 0x85, 0xad, 0xbd, 0x3e, 0x08, 0x99, 0xea, 0x67, 0x01, 0x24, 0x22, 0x46, 0x44, + 0xc8, 0x58, 0x48, 0xc4, 0x02, 0xb2, 0x1d, 0x0a, 0x94, 0x3f, 0x40, 0xb1, 0xe8, 0x65, 0x11, 0x95, + 0xc5, 0x52, 0x91, 0xa8, 0xf5, 0x70, 0x7b, 0xfc, 0xf8, 0xf6, 0x65, 0x7b, 0x4f, 0x1d, 0x27, 0x54, + 0x06, 0xff, 0x95, 0x7b, 0xe5, 0xfe, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x4f, 0xa1, 0x61, + 0x37, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -528,6 +537,11 @@ func (m *MsgSubmitTxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = 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 } @@ -608,6 +622,9 @@ func (m *MsgSubmitTxResponse) Size() (n int) { } var l int _ = l + if m.Sequence != 0 { + n += 1 + sovTx(uint64(m.Sequence)) + } return n } @@ -1076,6 +1093,25 @@ func (m *MsgSubmitTxResponse) Unmarshal(dAtA []byte) error { 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:]) diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index e1ddb3fd62b..92423b4bdc8 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -49,4 +49,6 @@ message MsgSubmitTx { } // MsgSubmitTxResponse defines the response for MsgSubmitTx -message MsgSubmitTxResponse {} \ No newline at end of file +message MsgSubmitTxResponse { + uint64 sequence = 1; +} \ No newline at end of file From 864cbfb4a0074e23410fac67746a7b2dff0d04c9 Mon Sep 17 00:00:00 2001 From: Charly Date: Tue, 30 Aug 2022 11:05:50 +0200 Subject: [PATCH 17/20] merge --- docs/ibc/proto-docs.md | 260 +++++++++++++++++++---------------------- 1 file changed, 121 insertions(+), 139 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index f0eb4c1de08..d88d3fd001c 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1519,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,18 +1616,14 @@ MsgRegisterAccountResponse defines the response for Msg/RegisterAccount - -

Top

-## ibc/applications/interchain_accounts/genesis/v1/genesis.proto - +### MsgSubmitTx +MsgSubmitTx defines the payload for MsgSubmitTx -### ActiveChannel -ActiveChannel contains a connection ID, port ID and associated active channel ID | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | @@ -1576,34 +1633,26 @@ ActiveChannel contains a connection ID, port ID and associated active channel ID | `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) | | | -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `connection_id` | [string](#string) | | | -| `port_id` | [string](#string) | | | -| `channel_id` | [string](#string) | | | + - - -### ControllerGenesisState -ControllerGenesisState defines the interchain accounts controller genesis state +### MsgSubmitTxResponse +MsgSubmitTxResponse defines the response for MsgSubmitTx | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.genesis.v1.ActiveChannel) | repeated | | -| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount) | repeated | | -| `ports` | [string](#string) | repeated | | -| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | | +| `sequence` | [uint64](#uint64) | | | + @@ -1618,7 +1667,9 @@ 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. | | + @@ -1655,56 +1706,69 @@ The following parameters may be used to disable the host submodule. - +

Top

-## ibc/applications/interchain_accounts/host/v1/query.proto +## ibc/applications/interchain_accounts/genesis/v1/genesis.proto ->>>>>>> main - + -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. +### ActiveChannel +ActiveChannel contains a connection ID, port ID and associated active channel ID +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `connection_id` | [string](#string) | | | +| `port_id` | [string](#string) | | | +| `channel_id` | [string](#string) | | | - -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. + + + +### ControllerGenesisState +ControllerGenesisState defines the interchain accounts controller genesis state | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#ibc.applications.interchain_accounts.host.v1.Params) | | params defines the parameters of the module. | +| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.genesis.v1.ActiveChannel) | repeated | | +| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.genesis.v1.RegisteredInterchainAccount) | repeated | | +| `ports` | [string](#string) | repeated | | +| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | | ->>>>>>> main - - + - +### GenesisState +GenesisState defines the interchain accounts genesis state - +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `controller_genesis_state` | [ControllerGenesisState](#ibc.applications.interchain_accounts.genesis.v1.ControllerGenesisState) | | | +| `host_genesis_state` | [HostGenesisState](#ibc.applications.interchain_accounts.genesis.v1.HostGenesisState) | | | -### Query -Query provides defines the gRPC querier service. -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Params` | [QueryParamsRequest](#ibc.applications.interchain_accounts.host.v1.QueryParamsRequest) | [QueryParamsResponse](#ibc.applications.interchain_accounts.host.v1.QueryParamsResponse) | Params queries all parameters of the ICA host submodule. | GET|/ibc/apps/interchain_accounts/host/v1/params| - + + + + + +### HostGenesisState +HostGenesisState defines the interchain accounts host genesis state + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | @@ -1714,23 +1778,21 @@ Query provides defines the gRPC querier service. | `params` | [ibc.applications.interchain_accounts.host.v1.Params](#ibc.applications.interchain_accounts.host.v1.Params) | | | - -

Top

-## ibc/applications/interchain_accounts/v1/account.proto - + -### InterchainAccount -An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +### RegisteredInterchainAccount +RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | -| `account_owner` | [string](#string) | | | +| `connection_id` | [string](#string) | | | +| `port_id` | [string](#string) | | | +| `account_address` | [string](#string) | | | @@ -1749,61 +1811,42 @@ An InterchainAccount is defined as a BaseAccount & the address of the account ow

Top

-## ibc/applications/interchain_accounts/v1/genesis.proto +## ibc/applications/interchain_accounts/host/v1/query.proto - + -### ActiveChannel -ActiveChannel contains a connection ID, port ID and associated active channel ID +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `connection_id` | [string](#string) | | | -| `port_id` | [string](#string) | | | -| `channel_id` | [string](#string) | | | - - - -### ControllerGenesisState -ControllerGenesisState defines the interchain accounts controller genesis state +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `active_channels` | [ActiveChannel](#ibc.applications.interchain_accounts.v1.ActiveChannel) | repeated | | -| `interchain_accounts` | [RegisteredInterchainAccount](#ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount) | repeated | | -| `ports` | [string](#string) | repeated | | -| `params` | [ibc.applications.interchain_accounts.controller.v1.Params](#ibc.applications.interchain_accounts.controller.v1.Params) | | | - - - - +| `params` | [Params](#ibc.applications.interchain_accounts.host.v1.Params) | | params defines the parameters of the module. | - -### GenesisState -GenesisState defines the interchain accounts genesis state -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `controller_genesis_state` | [ControllerGenesisState](#ibc.applications.interchain_accounts.v1.ControllerGenesisState) | | | -| `host_genesis_state` | [HostGenesisState](#ibc.applications.interchain_accounts.v1.HostGenesisState) | | | - + + + + ### Query Query provides defines the gRPC querier service. @@ -1885,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

From 1f0828aa5d687122f2a1cc50b06ada2fbf73930b Mon Sep 17 00:00:00 2001 From: Charly Date: Tue, 30 Aug 2022 11:46:42 +0200 Subject: [PATCH 18/20] update proto --- .../applications/interchain_accounts/controller/v1/tx.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index 92423b4bdc8..5c4ecb8bd55 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -44,8 +44,8 @@ message MsgSubmitTx { [(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; + uint64 timeout_timestamp = 4 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\"", (gogoproto.nullable) = false]; + ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 5 [(gogoproto.moretags) = "yaml:\"packet_data\"", (gogoproto.nullable) = false]; } // MsgSubmitTxResponse defines the response for MsgSubmitTx From 679d47c261b25f435ec4dc41cb3f85f13316f315 Mon Sep 17 00:00:00 2001 From: Charly Date: Tue, 30 Aug 2022 11:50:49 +0200 Subject: [PATCH 19/20] update proto --- .../controller/types/tx.pb.go | 109 ++++++++---------- .../controller/v1/tx.proto | 5 +- 2 files changed, 54 insertions(+), 60 deletions(-) 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 24e05139941..cae572e1533 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -124,8 +124,8 @@ type MsgSubmitTx struct { 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,omitempty"` + 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{} } @@ -218,45 +218,45 @@ func init() { } var fileDescriptor_7def041328c84a30 = []byte{ - // 596 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbd, 0x6e, 0xd4, 0x4c, - 0x14, 0xb5, 0xf3, 0xf3, 0x7d, 0xc9, 0x84, 0x00, 0x31, 0x89, 0x64, 0x59, 0x60, 0x47, 0xae, 0xd2, - 0x64, 0x46, 0x5e, 0x82, 0x90, 0x82, 0x10, 0x62, 0x15, 0x01, 0x5b, 0x04, 0x45, 0x26, 0x15, 0xcd, - 0x32, 0x9e, 0x1d, 0x79, 0x07, 0xec, 0x19, 0xe3, 0x19, 0x9b, 0xa4, 0xa3, 0xa4, 0x41, 0xa2, 0xe0, - 0x01, 0xd2, 0xf2, 0x26, 0x29, 0x53, 0x52, 0xad, 0x50, 0xd2, 0x50, 0xef, 0x13, 0x20, 0xff, 0xac, - 0x77, 0x97, 0x4d, 0x91, 0x00, 0x95, 0xe7, 0xde, 0xb9, 0xe7, 0xcc, 0xb9, 0x3a, 0xd7, 0x17, 0x3c, - 0x62, 0x01, 0x41, 0x38, 0x49, 0x22, 0x46, 0xb0, 0x62, 0x82, 0x4b, 0xc4, 0xb8, 0xa2, 0x29, 0xe9, - 0x63, 0xc6, 0xbb, 0x98, 0x10, 0x91, 0x71, 0x25, 0x11, 0x11, 0x5c, 0xa5, 0x22, 0x8a, 0x68, 0x8a, - 0x72, 0x0f, 0xa9, 0x23, 0x98, 0xa4, 0x42, 0x09, 0xa3, 0xc5, 0x02, 0x02, 0x27, 0xc1, 0xf0, 0x12, - 0x30, 0x1c, 0x83, 0x61, 0xee, 0x59, 0xeb, 0xa1, 0x08, 0x45, 0x09, 0x47, 0xc5, 0xa9, 0x62, 0xb2, - 0x9c, 0x42, 0x06, 0x11, 0x29, 0x45, 0x24, 0x62, 0x94, 0xab, 0xe2, 0x99, 0xea, 0x54, 0x17, 0xec, - 0x5c, 0x49, 0x67, 0xee, 0xa1, 0x04, 0x93, 0x77, 0xb4, 0x46, 0xb9, 0x9f, 0x75, 0x60, 0xec, 0xcb, - 0xd0, 0xa7, 0x21, 0x93, 0x8a, 0xa6, 0x4f, 0xab, 0x3a, 0xe3, 0x31, 0x58, 0x25, 0x82, 0x73, 0x4a, - 0x0a, 0xa6, 0x2e, 0xeb, 0x99, 0xfa, 0xa6, 0xbe, 0xb5, 0xdc, 0x36, 0x87, 0x03, 0x67, 0xfd, 0x18, - 0xc7, 0xd1, 0xae, 0x3b, 0x75, 0xed, 0xfa, 0x37, 0xc6, 0x71, 0xa7, 0x67, 0xac, 0x83, 0x45, 0xf1, - 0x81, 0xd3, 0xd4, 0x9c, 0x2b, 0x60, 0x7e, 0x15, 0x18, 0x26, 0xf8, 0x3f, 0xa7, 0xa9, 0x64, 0x82, - 0x9b, 0xf3, 0x65, 0x7e, 0x14, 0xee, 0x2e, 0x7d, 0x3a, 0x71, 0xb4, 0x9f, 0x27, 0x8e, 0xe6, 0xfa, - 0xc0, 0x9a, 0x95, 0xe3, 0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0x13, 0x5a, 0x9a, 0xb1, 0xe0, 0x37, 0x71, - 0xeb, 0x74, 0x0e, 0xcc, 0xef, 0xcb, 0xd0, 0xf8, 0xa6, 0x83, 0x5b, 0xbf, 0x8f, 0xe7, 0x33, 0x78, - 0xfd, 0xff, 0x0a, 0xce, 0xce, 0x95, 0xf5, 0xf2, 0xdf, 0xf0, 0x34, 0xfd, 0x7c, 0xd5, 0xc1, 0x52, - 0x33, 0x66, 0x4f, 0xfe, 0x90, 0x7c, 0x44, 0x60, 0x3d, 0xff, 0x4b, 0x82, 0x91, 0xac, 0xf6, 0xdb, - 0xd3, 0x73, 0x5b, 0x3f, 0x3b, 0xb7, 0xf5, 0x1f, 0xe7, 0xb6, 0xfe, 0xe5, 0xc2, 0xd6, 0xce, 0x2e, - 0x6c, 0xed, 0xfb, 0x85, 0xad, 0xbd, 0x3e, 0x08, 0x99, 0xea, 0x67, 0x01, 0x24, 0x22, 0x46, 0x44, - 0xc8, 0x58, 0x48, 0xc4, 0x02, 0xb2, 0x1d, 0x0a, 0x94, 0x3f, 0x40, 0xb1, 0xe8, 0x65, 0x11, 0x95, - 0xc5, 0x52, 0x91, 0xa8, 0xf5, 0x70, 0x7b, 0xfc, 0xf8, 0xf6, 0x65, 0x7b, 0x4f, 0x1d, 0x27, 0x54, - 0x06, 0xff, 0x95, 0x7b, 0xe5, 0xfe, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe7, 0x4f, 0xa1, 0x61, - 0x37, 0x05, 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, 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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. @@ -473,18 +473,16 @@ func (m *MsgSubmitTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.PacketData != nil { - { - size, err := m.PacketData.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) + { + size, err := m.PacketData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x2a + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a if m.TimeoutTimestamp != 0 { i = encodeVarintTx(dAtA, i, uint64(m.TimeoutTimestamp)) i-- @@ -609,10 +607,8 @@ func (m *MsgSubmitTx) Size() (n int) { if m.TimeoutTimestamp != 0 { n += 1 + sovTx(uint64(m.TimeoutTimestamp)) } - if m.PacketData != nil { - l = m.PacketData.Size() - n += 1 + l + sovTx(uint64(l)) - } + l = m.PacketData.Size() + n += 1 + l + sovTx(uint64(l)) return n } @@ -1036,9 +1032,6 @@ func (m *MsgSubmitTx) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.PacketData == nil { - m.PacketData = &types1.InterchainAccountPacketData{} - } if err := m.PacketData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index 5c4ecb8bd55..51c30fa0c0e 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -44,8 +44,9 @@ message MsgSubmitTx { [(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\"", (gogoproto.nullable) = false]; - ibc.applications.interchain_accounts.v1.InterchainAccountPacketData packet_data = 5 [(gogoproto.moretags) = "yaml:\"packet_data\"", (gogoproto.nullable) = false]; + 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 From 26b6d6f9358c73ab67374802b65c21ba61d74433 Mon Sep 17 00:00:00 2001 From: Charly Date: Tue, 30 Aug 2022 12:06:42 +0200 Subject: [PATCH 20/20] update ordering --- modules/apps/27-interchain-accounts/controller/types/msgs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go index b866d429472..0b0dfce1922 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -50,7 +50,7 @@ func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { } // NewMsgSubmitTx creates a new instance of MsgSubmitTx -func NewMsgSubmitTx(connectionID, owner string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, packetData *icatypes.InterchainAccountPacketData) *MsgSubmitTx { +func NewMsgSubmitTx(owner, connectionID string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, packetData icatypes.InterchainAccountPacketData) *MsgSubmitTx { return &MsgSubmitTx{ ConnectionId: connectionID, Owner: owner,