From f0eb4d125cfd12350535e61929e42190ee8c6068 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 22 Aug 2022 16:15:59 +0200 Subject: [PATCH 1/4] adding new controller msg service, register account types, register interfaces and boilerplate --- docs/ibc/proto-docs.md | 59 ++ .../controller/keeper/msg_server.go | 14 + .../controller/types/codec.go | 11 + .../controller/types/msgs.go | 24 + .../controller/types/tx.pb.go | 618 ++++++++++++++++++ modules/apps/27-interchain-accounts/module.go | 1 + .../27-interchain-accounts/types/codec.go | 8 +- .../controller/v1/tx.proto | 26 + 8 files changed, 759 insertions(+), 2 deletions(-) create mode 100644 modules/apps/27-interchain-accounts/controller/keeper/msg_server.go create mode 100644 modules/apps/27-interchain-accounts/controller/types/codec.go create mode 100644 modules/apps/27-interchain-accounts/controller/types/msgs.go create mode 100644 modules/apps/27-interchain-accounts/controller/types/tx.pb.go create mode 100644 proto/ibc/applications/interchain_accounts/controller/v1/tx.proto diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 48219f3d66b..64ceaeaf06e 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/controller/v1/tx.proto](#ibc/applications/interchain_accounts/controller/v1/tx.proto) + - [MsgRegisterAccount](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount) + - [MsgRegisterAccountResponse](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse) + + - [Msg](#ibc.applications.interchain_accounts.controller.v1.Msg) + - [ibc/applications/interchain_accounts/host/v1/host.proto](#ibc/applications/interchain_accounts/host/v1/host.proto) - [Params](#ibc.applications.interchain_accounts.host.v1.Params) @@ -1511,6 +1517,59 @@ Query provides defines the gRPC querier service. + +

Top

+ +## ibc/applications/interchain_accounts/controller/v1/tx.proto + + + + + +### MsgRegisterAccount +MsgRegisterAccount defines the payload for Msg/RegisterAccount + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `connection_id` | [string](#string) | | | +| `owner` | [string](#string) | | | +| `version` | [string](#string) | | | + + + + + + + + +### MsgRegisterAccountResponse +MsgRegisterAccountResponse defines the response for Msg/RegisterAccount + + + + + + + + + + + + + + +### Msg +Msg defines the 27-interchain-accounts/controller Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `RegisterAccount` | [MsgRegisterAccount](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount) | [MsgRegisterAccountResponse](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse) | Register defines a rpc handler for MsgRegisterAccount. | | + + + + +

Top

diff --git a/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go b/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go new file mode 100644 index 00000000000..e9d6adca3c6 --- /dev/null +++ b/modules/apps/27-interchain-accounts/controller/keeper/msg_server.go @@ -0,0 +1,14 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/ibc-go/v5/modules/apps/27-interchain-accounts/controller/types" +) + +var _ types.MsgServer = Keeper{} + +// RegisterAccount defines a rpc handler for MsgRegisterAccount +func (k Keeper) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAccount) (*types.MsgRegisterAccountResponse, error) { + return &types.MsgRegisterAccountResponse{}, nil +} diff --git a/modules/apps/27-interchain-accounts/controller/types/codec.go b/modules/apps/27-interchain-accounts/controller/types/codec.go new file mode 100644 index 00000000000..70f6abcdb5e --- /dev/null +++ b/modules/apps/27-interchain-accounts/controller/types/codec.go @@ -0,0 +1,11 @@ +package types + +import ( + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// RegisterInterfaces registers the interchain accounts controller message types using the provided InterfaceRegistry +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRegisterAccount{}) +} diff --git a/modules/apps/27-interchain-accounts/controller/types/msgs.go b/modules/apps/27-interchain-accounts/controller/types/msgs.go new file mode 100644 index 00000000000..de6b0881c8a --- /dev/null +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -0,0 +1,24 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// NewMsgRegisterPayee creates a new instance of MsgRegisterPayee +func NewMsgRegisterPayee(connectionID, owner, version string) *MsgRegisterAccount { + return &MsgRegisterAccount{ + ConnectionId: connectionID, + Owner: owner, + Version: version, + } +} + +// ValidateBasic implements sdk.Msg +func (msg MsgRegisterAccount) ValidateBasic() error { + return nil +} + +// GetSigners implements sdk.Msg +func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{} +} diff --git a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go new file mode 100644 index 00000000000..b72ca776b54 --- /dev/null +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -0,0 +1,618 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ibc/applications/interchain_accounts/controller/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgRegisterAccount defines the payload for Msg/RegisterAccount +type MsgRegisterAccount struct { + ConnectionId string `protobuf:"bytes,1,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` +} + +func (m *MsgRegisterAccount) Reset() { *m = MsgRegisterAccount{} } +func (m *MsgRegisterAccount) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterAccount) ProtoMessage() {} +func (*MsgRegisterAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_7def041328c84a30, []int{0} +} +func (m *MsgRegisterAccount) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterAccount.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 *MsgRegisterAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterAccount.Merge(m, src) +} +func (m *MsgRegisterAccount) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterAccount) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterAccount.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterAccount proto.InternalMessageInfo + +// MsgRegisterAccountResponse defines the response for Msg/RegisterAccount +type MsgRegisterAccountResponse struct { +} + +func (m *MsgRegisterAccountResponse) Reset() { *m = MsgRegisterAccountResponse{} } +func (m *MsgRegisterAccountResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterAccountResponse) ProtoMessage() {} +func (*MsgRegisterAccountResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7def041328c84a30, []int{1} +} +func (m *MsgRegisterAccountResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterAccountResponse.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 *MsgRegisterAccountResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterAccountResponse.Merge(m, src) +} +func (m *MsgRegisterAccountResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterAccountResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterAccountResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterAccountResponse 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") +} + +func init() { + proto.RegisterFile("ibc/applications/interchain_accounts/controller/v1/tx.proto", fileDescriptor_7def041328c84a30) +} + +var fileDescriptor_7def041328c84a30 = []byte{ + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x3f, 0x4b, 0x33, 0x31, + 0x1c, 0xc7, 0x2f, 0x4f, 0x79, 0xfc, 0x13, 0x14, 0xe1, 0xe8, 0x70, 0x14, 0xb9, 0xca, 0x4d, 0x2e, + 0x4d, 0x68, 0x45, 0x84, 0x8a, 0x83, 0x1d, 0x04, 0x87, 0x8a, 0xdc, 0xe8, 0x52, 0xee, 0xd2, 0x90, + 0x46, 0xee, 0xf2, 0x3b, 0x92, 0xf4, 0xb4, 0xef, 0xc0, 0x45, 0xf0, 0x25, 0x74, 0x75, 0xf4, 0x5d, + 0x38, 0x76, 0x74, 0x12, 0x69, 0x17, 0x67, 0x5f, 0x81, 0x5c, 0x4b, 0xa9, 0xda, 0x2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 0xf2, 0x5d, 0x95, 0x8b, 0xbf, 0xe9, 0x99, 0x3b, 0xb7, 0xae, 0x9f, 0xc7, + 0x3e, 0x1a, 0x8d, 0x7d, 0xf4, 0x36, 0xf6, 0xd1, 0xc3, 0xc4, 0x77, 0x46, 0x13, 0xdf, 0x79, 0x99, + 0xf8, 0xce, 0xd5, 0xa5, 0x90, 0xb6, 0xd7, 0x8f, 0x09, 0x83, 0x94, 0x32, 0x30, 0x29, 0x18, 0x2a, + 0x63, 0x56, 0x13, 0x40, 0xf3, 0x43, 0x9a, 0x42, 0xb7, 0x9f, 0x70, 0x53, 0x8c, 0x88, 0xa1, 0x8d, + 0xa3, 0xda, 0xc2, 0xa1, 0xb6, 0x6a, 0x3a, 0xec, 0x20, 0xe3, 0x26, 0x5e, 0x9b, 0x7e, 0xea, 0xc1, + 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x90, 0xf0, 0xb9, 0xb6, 0x5d, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // Register defines a rpc handler for MsgRegisterAccount. + RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) { + out := new(MsgRegisterAccountResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.interchain_accounts.controller.v1.Msg/RegisterAccount", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // Register defines a rpc handler for MsgRegisterAccount. + RegisterAccount(context.Context, *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) RegisterAccount(ctx context.Context, req *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterAccount not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_RegisterAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterAccount) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ibc.applications.interchain_accounts.controller.v1.Msg/RegisterAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterAccount(ctx, req.(*MsgRegisterAccount)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ibc.applications.interchain_accounts.controller.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RegisterAccount", + Handler: _Msg_RegisterAccount_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ibc/applications/interchain_accounts/controller/v1/tx.proto", +} + +func (m *MsgRegisterAccount) 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 *MsgRegisterAccount) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintTx(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0x1a + } + 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] = 0x12 + } + 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] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterAccountResponse) 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 *MsgRegisterAccountResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterAccountResponse) 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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgRegisterAccount) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ConnectionId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Version) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRegisterAccountResponse) 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 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgRegisterAccount) 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: MsgRegisterAccount: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterAccount: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 2: + 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 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", 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.Version = string(dAtA[iNdEx:postIndex]) + 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 *MsgRegisterAccountResponse) 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: MsgRegisterAccountResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterAccountResponse: 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index bb3a7f9b793..18c52693313 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -144,6 +144,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // RegisterServices registers module services func (am AppModule) RegisterServices(cfg module.Configurator) { + controllertypes.RegisterMsgServer(cfg.MsgServer(), am.controllerKeeper) controllertypes.RegisterQueryServer(cfg.QueryServer(), am.controllerKeeper) hosttypes.RegisterQueryServer(cfg.QueryServer(), am.hostKeeper) } diff --git a/modules/apps/27-interchain-accounts/types/codec.go b/modules/apps/27-interchain-accounts/types/codec.go index 033c264f9e7..f2400d3d1b7 100644 --- a/modules/apps/27-interchain-accounts/types/codec.go +++ b/modules/apps/27-interchain-accounts/types/codec.go @@ -6,6 +6,8 @@ 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 @@ -15,9 +17,11 @@ import ( // defined at the application level. var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) -// RegisterInterfaces registers the concrete InterchainAccount implementation against the associated -// x/auth AccountI and GenesisAccount interfaces +// 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/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto new file mode 100644 index 00000000000..0613749067b --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +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"; + +// Msg defines the 27-interchain-accounts/controller Msg service. +service Msg { + // Register defines a rpc handler for MsgRegisterAccount. + rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse); +} + +// MsgRegisterAccount defines the payload for Msg/RegisterAccount +message MsgRegisterAccount { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; + string owner = 2; + string version = 3; +} + +// MsgRegisterAccountResponse defines the response for Msg/RegisterAccount +message MsgRegisterAccountResponse {} From 08496250e6b19b8d4297d3c4f23f4740b6c8e240 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 22 Aug 2022 16:18:42 +0200 Subject: [PATCH 2/4] fixing typo --- 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 de6b0881c8a..9033df4bc3c 100644 --- a/modules/apps/27-interchain-accounts/controller/types/msgs.go +++ b/modules/apps/27-interchain-accounts/controller/types/msgs.go @@ -4,8 +4,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -// NewMsgRegisterPayee creates a new instance of MsgRegisterPayee -func NewMsgRegisterPayee(connectionID, owner, version string) *MsgRegisterAccount { +// NewMsgRegisterAccount creates a new instance of MsgRegisterAccount +func NewMsgRegisterAccount(connectionID, owner, version string) *MsgRegisterAccount { return &MsgRegisterAccount{ ConnectionId: connectionID, Owner: owner, From 1723c7435f699e2e0218523252c44f2635c1d0d6 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 22 Aug 2022 16:27:33 +0200 Subject: [PATCH 3/4] fixing protodoc and regenerate godocs --- docs/ibc/proto-docs.md | 2 +- modules/apps/27-interchain-accounts/controller/types/tx.pb.go | 4 ++-- .../applications/interchain_accounts/controller/v1/tx.proto | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 64ceaeaf06e..93ab3ff48bf 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1564,7 +1564,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) | Register defines a rpc handler for MsgRegisterAccount. | | +| `RegisterAccount` | [MsgRegisterAccount](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount) | [MsgRegisterAccountResponse](#ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse) | RegisterAccount defines a rpc handler for MsgRegisterAccount. | | 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 b72ca776b54..ce1fb30e96a 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -152,7 +152,7 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { - // Register defines a rpc handler for MsgRegisterAccount. + // RegisterAccount defines a rpc handler for MsgRegisterAccount. RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) } @@ -175,7 +175,7 @@ func (c *msgClient) RegisterAccount(ctx context.Context, in *MsgRegisterAccount, // MsgServer is the server API for Msg service. type MsgServer interface { - // Register defines a rpc handler for MsgRegisterAccount. + // RegisterAccount defines a rpc handler for MsgRegisterAccount. RegisterAccount(context.Context, *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) } diff --git a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto index 0613749067b..85bb74a8152 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -8,7 +8,7 @@ import "gogoproto/gogo.proto"; // Msg defines the 27-interchain-accounts/controller Msg service. service Msg { - // Register defines a rpc handler for MsgRegisterAccount. + // RegisterAccount defines a rpc handler for MsgRegisterAccount. rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse); } From bf4a52122a1fa3b7c8248eca59804990b8cf90f2 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 22 Aug 2022 17:25:50 +0200 Subject: [PATCH 4/4] adding channel id to MsgRegisterAccountResponse --- docs/ibc/proto-docs.md | 5 + .../controller/types/tx.pb.go | 99 ++++++++++++++----- .../controller/v1/tx.proto | 4 +- 3 files changed, 84 insertions(+), 24 deletions(-) diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index 93ab3ff48bf..21d874ccdf2 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -1547,6 +1547,11 @@ MsgRegisterAccount defines the payload for Msg/RegisterAccount MsgRegisterAccountResponse defines the response for Msg/RegisterAccount +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `channel_id` | [string](#string) | | | + + 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 ce1fb30e96a..12540ab7d39 100644 --- a/modules/apps/27-interchain-accounts/controller/types/tx.pb.go +++ b/modules/apps/27-interchain-accounts/controller/types/tx.pb.go @@ -70,6 +70,7 @@ var xxx_messageInfo_MsgRegisterAccount proto.InternalMessageInfo // MsgRegisterAccountResponse defines the response for Msg/RegisterAccount type MsgRegisterAccountResponse struct { + ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty" yaml:"channel_id"` } func (m *MsgRegisterAccountResponse) Reset() { *m = MsgRegisterAccountResponse{} } @@ -105,6 +106,13 @@ func (m *MsgRegisterAccountResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRegisterAccountResponse proto.InternalMessageInfo +func (m *MsgRegisterAccountResponse) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + func init() { proto.RegisterType((*MsgRegisterAccount)(nil), "ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccount") proto.RegisterType((*MsgRegisterAccountResponse)(nil), "ibc.applications.interchain_accounts.controller.v1.MsgRegisterAccountResponse") @@ -115,29 +123,31 @@ func init() { } var fileDescriptor_7def041328c84a30 = []byte{ - // 350 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x3f, 0x4b, 0x33, 0x31, - 0x1c, 0xc7, 0x2f, 0x4f, 0x79, 0xfc, 0x13, 0x14, 0xe1, 0xe8, 0x70, 0x14, 0xb9, 0xca, 0x4d, 0x2e, - 0x4d, 0x68, 0x45, 0x84, 0x8a, 0x83, 0x1d, 0x04, 0x87, 0x8a, 0xdc, 0xe8, 0x52, 0xee, 0xd2, 0x90, - 0x46, 0xee, 0xf2, 0x3b, 0x92, 0xf4, 0xb4, 0xef, 0xc0, 0x45, 0xf0, 0x25, 0x74, 0x75, 0xf4, 0x5d, - 0x38, 0x76, 0x74, 0x12, 0x69, 0x17, 0x67, 0x5f, 0x81, 0x5c, 0x4b, 0xa9, 0xda, 0x2e, 0x82, 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x5d, 0x95, 0x8b, 0xbf, 0xe9, 0x99, 0x3b, 0xb7, 0xae, 0x9f, 0xc7, - 0x3e, 0x1a, 0x8d, 0x7d, 0xf4, 0x36, 0xf6, 0xd1, 0xc3, 0xc4, 0x77, 0x46, 0x13, 0xdf, 0x79, 0x99, - 0xf8, 0xce, 0xd5, 0xa5, 0x90, 0xb6, 0xd7, 0x8f, 0x09, 0x83, 0x94, 0x32, 0x30, 0x29, 0x18, 0x2a, - 0x63, 0x56, 0x13, 0x40, 0xf3, 0x43, 0x9a, 0x42, 0xb7, 0x9f, 0x70, 0x53, 0x8c, 0x88, 0xa1, 0x8d, - 0xa3, 0xda, 0xc2, 0xa1, 0xb6, 0x6a, 0x3a, 0xec, 0x20, 0xe3, 0x26, 0x5e, 0x9b, 0x7e, 0xea, 0xc1, - 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x90, 0xf0, 0xb9, 0xb6, 0x5d, 0x02, 0x00, 0x00, + // 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, 0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6c, + 0xdd, 0x20, 0x5c, 0xe9, 0xa9, 0xc8, 0xbc, 0x46, 0xf8, 0xfb, 0xeb, 0x45, 0x0f, 0xc9, 0xdb, 0x4f, + 0x49, 0xb6, 0x13, 0xd6, 0x8f, 0xde, 0xc7, 0x67, 0xb3, 0x69, 0xe7, 0xf4, 0x76, 0x66, 0xa3, 0xc9, + 0xcc, 0x46, 0xf7, 0x33, 0x1b, 0x5d, 0xcd, 0x6d, 0x63, 0x32, 0xb7, 0x8d, 0xbb, 0xb9, 0x6d, 0x9c, + 0x1c, 0x47, 0x42, 0x0f, 0x86, 0x01, 0x61, 0x90, 0x50, 0x06, 0x2a, 0x01, 0x45, 0x45, 0xc0, 0x1a, + 0x11, 0xd0, 0xfc, 0x1f, 0x4d, 0x20, 0x1c, 0xc6, 0x5c, 0x15, 0xc5, 0x52, 0xb4, 0xf5, 0xbf, 0x51, + 0x66, 0x68, 0xec, 0xea, 0x94, 0x1e, 0xa5, 0x5c, 0x05, 0x9f, 0x96, 0x55, 0xf8, 0xf3, 0x18, 0x00, + 0x00, 0xff, 0xff, 0x48, 0x33, 0x66, 0x3d, 0x93, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -286,6 +296,13 @@ func (m *MsgRegisterAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintTx(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -327,6 +344,10 @@ func (m *MsgRegisterAccountResponse) Size() (n int) { } var l int _ = l + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -511,6 +532,38 @@ func (m *MsgRegisterAccountResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgRegisterAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", 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.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex 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 85bb74a8152..b72a69ae631 100644 --- a/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto +++ b/proto/ibc/applications/interchain_accounts/controller/v1/tx.proto @@ -23,4 +23,6 @@ message MsgRegisterAccount { } // MsgRegisterAccountResponse defines the response for Msg/RegisterAccount -message MsgRegisterAccountResponse {} +message MsgRegisterAccountResponse { + string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; +}