diff --git a/docs/ibc/proto-docs.md b/docs/ibc/proto-docs.md index cae068cf68c..5e242070c9d 100644 --- a/docs/ibc/proto-docs.md +++ b/docs/ibc/proto-docs.md @@ -4,6 +4,25 @@ ## Table of Contents +- [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) + - [GenesisState](#ibc.applications.interchain_accounts.v1.GenesisState) + +- [ibc/applications/interchain_accounts/v1/query.proto](#ibc/applications/interchain_accounts/v1/query.proto) + - [QueryInterchainAccountAddressRequest](#ibc.applications.interchain_accounts.v1.QueryInterchainAccountAddressRequest) + - [QueryInterchainAccountAddressResponse](#ibc.applications.interchain_accounts.v1.QueryInterchainAccountAddressResponse) + + - [Query](#ibc.applications.interchain_accounts.v1.Query) + +- [ibc/applications/interchain_accounts/v1/types.proto](#ibc/applications/interchain_accounts/v1/types.proto) + - [IBCAccountPacketData](#ibc.applications.interchain_accounts.v1.IBCAccountPacketData) + - [IBCTxBody](#ibc.applications.interchain_accounts.v1.IBCTxBody) + - [IBCTxRaw](#ibc.applications.interchain_accounts.v1.IBCTxRaw) + + - [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) - [FungibleTokenPacketData](#ibc.applications.transfer.v1.FungibleTokenPacketData) @@ -246,6 +265,201 @@ + +
+ +## 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 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `base_account` | [cosmos.auth.v1beta1.BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | +| `account_owner` | [string](#string) | | | + + + + + + + + + + + + + + + + + + +## ibc/applications/interchain_accounts/v1/genesis.proto + + + + + +### GenesisState +GenesisState defines the interchain_account genesis state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `port_id` | [string](#string) | | | + + + + + + + + + + + + + + + + + + +## ibc/applications/interchain_accounts/v1/query.proto + + + + + +### QueryInterchainAccountAddressRequest +Query request for an interchain account address + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `owner_address` | [string](#string) | | Owner address is the owner of the interchain account on the controller chain | +| `connection_id` | [string](#string) | | | + + + + + + + + +### QueryInterchainAccountAddressResponse +Query response for an interchain account address + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `interchain_account_address` | [string](#string) | | The corresponding interchain account address on the host chain | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `InterchainAccountAddress` | [QueryInterchainAccountAddressRequest](#ibc.applications.interchain_accounts.v1.QueryInterchainAccountAddressRequest) | [QueryInterchainAccountAddressResponse](#ibc.applications.interchain_accounts.v1.QueryInterchainAccountAddressResponse) | Query to get the address of an interchain account | | + + + + + + + + +## ibc/applications/interchain_accounts/v1/types.proto + + + + + +### IBCAccountPacketData +Packet data is comprised of raw transaction & type of transaction + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `type` | [Type](#ibc.applications.interchain_accounts.v1.Type) | | | +| `data` | [bytes](#bytes) | | | + + + + + + + + +### IBCTxBody +Body of a tx for an ics27 IBC packet + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | + + + + + + + + +### IBCTxRaw +Raw tx body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `body_bytes` | [bytes](#bytes) | | | + + + + + + + + + + +### Type +The different types of interchain account transactions +EXECUTE_TX is used when sending a TX from the controller side to the host side. The host side will execute the tx on +behalf of the interchain account. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TYPE_EXECUTE_TX_UNSPECIFIED | 0 | Execute message type | + + + + + + + + + + diff --git a/modules/apps/27-interchain-accounts/client/cli/query.go b/modules/apps/27-interchain-accounts/client/cli/query.go index 73f4389fa58..9945d79bab8 100644 --- a/modules/apps/27-interchain-accounts/client/cli/query.go +++ b/modules/apps/27-interchain-accounts/client/cli/query.go @@ -19,12 +19,12 @@ func GetQueryCmd() *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(GetIBCAccountCmd()) + cmd.AddCommand(GetInterchainAccountCmd()) return cmd } -func GetIBCAccountCmd() *cobra.Command { +func GetInterchainAccountCmd() *cobra.Command { cmd := &cobra.Command{ Use: "address [address] [connection-id]", RunE: func(cmd *cobra.Command, args []string) error { @@ -33,11 +33,11 @@ func GetIBCAccountCmd() *cobra.Command { return err } - address := args[0] + ownerAddress := args[0] connectionId := args[1] queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.IBCAccount(context.Background(), &types.QueryIBCAccountRequest{Address: address, ConnectionId: connectionId}) + res, err := queryClient.InterchainAccountAddress(context.Background(), &types.QueryInterchainAccountAddressRequest{OwnerAddress: ownerAddress, ConnectionId: connectionId}) if err != nil { return err } diff --git a/modules/apps/27-interchain-accounts/keeper/account.go b/modules/apps/27-interchain-accounts/keeper/account.go index 167e3d9e26f..6bad42a1133 100644 --- a/modules/apps/27-interchain-accounts/keeper/account.go +++ b/modules/apps/27-interchain-accounts/keeper/account.go @@ -41,7 +41,7 @@ func (k Keeper) InitInterchainAccount(ctx sdk.Context, connectionId, owner strin } // Register interchain account if it has not already been created -func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, portId string) (types.IBCAccountI, error) { +func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, portId string) (types.InterchainAccountI, error) { address := k.GenerateAddress(portId) account := k.accountKeeper.GetAccount(ctx, address) @@ -49,7 +49,7 @@ func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, portId string) (types return nil, sdkerrors.Wrap(types.ErrAccountAlreadyExist, account.String()) } - interchainAccount := types.NewIBCAccount( + interchainAccount := types.NewInterchainAccount( authtypes.NewBaseAccountWithAddress(address), portId, ) @@ -71,7 +71,7 @@ func (k Keeper) GetInterchainAccountAddress(ctx sdk.Context, portId string) (str store := ctx.KVStore(k.storeKey) key := types.KeyOwnerAccount(portId) if !store.Has(key) { - return "", sdkerrors.Wrap(types.ErrIBCAccountNotFound, portId) + return "", sdkerrors.Wrap(types.ErrInterchainAccountNotFound, portId) } interchainAccountAddr := string(store.Get(key)) @@ -83,15 +83,15 @@ func (k Keeper) GenerateAddress(identifier string) []byte { return tmhash.SumTruncated(append([]byte(identifier))) } -func (k Keeper) GetIBCAccount(ctx sdk.Context, addr sdk.AccAddress) (types.IBCAccount, error) { +func (k Keeper) GetInterchainAccount(ctx sdk.Context, addr sdk.AccAddress) (types.InterchainAccount, error) { acc := k.accountKeeper.GetAccount(ctx, addr) if acc == nil { - return types.IBCAccount{}, sdkerrors.Wrap(types.ErrIBCAccountNotFound, "there is no account") + return types.InterchainAccount{}, sdkerrors.Wrap(types.ErrInterchainAccountNotFound, "there is no account") } - ibcAcc, ok := acc.(*types.IBCAccount) + interchainAccount, ok := acc.(*types.InterchainAccount) if !ok { - return types.IBCAccount{}, sdkerrors.Wrap(types.ErrIBCAccountNotFound, "account is not an IBC account") + return types.InterchainAccount{}, sdkerrors.Wrap(types.ErrInterchainAccountNotFound, "account is not an interchain account") } - return *ibcAcc, nil + return *interchainAccount, nil } diff --git a/modules/apps/27-interchain-accounts/keeper/grpc_query.go b/modules/apps/27-interchain-accounts/keeper/grpc_query.go index 7f54be0f80a..9b072d28ef0 100644 --- a/modules/apps/27-interchain-accounts/keeper/grpc_query.go +++ b/modules/apps/27-interchain-accounts/keeper/grpc_query.go @@ -13,23 +13,23 @@ import ( var _ types.QueryServer = Keeper{} -// IBCAccount implements the Query/IBCAccount gRPC method -func (k Keeper) IBCAccount(ctx context.Context, req *types.QueryIBCAccountRequest) (*types.QueryIBCAccountResponse, error) { +// InterchainAccount implements the Query/InterchainAccount gRPC method +func (k Keeper) InterchainAccountAddress(ctx context.Context, req *types.QueryInterchainAccountAddressRequest) (*types.QueryInterchainAccountAddressResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } - if req.Address == "" { + if req.OwnerAddress == "" { return nil, status.Error(codes.InvalidArgument, "address cannot be empty") } sdkCtx := sdk.UnwrapSDKContext(ctx) - portId := k.GeneratePortId(req.Address, req.ConnectionId) + portId := k.GeneratePortId(req.OwnerAddress, req.ConnectionId) - address, err := k.GetInterchainAccountAddress(sdkCtx, portId) + interchainAccountAddress, err := k.GetInterchainAccountAddress(sdkCtx, portId) if err != nil { return nil, err } - return &types.QueryIBCAccountResponse{AccountAddress: address}, nil + return &types.QueryInterchainAccountAddressResponse{InterchainAccountAddress: interchainAccountAddress}, nil } diff --git a/modules/apps/27-interchain-accounts/keeper/relay.go b/modules/apps/27-interchain-accounts/keeper/relay.go index daefcc8754a..757a08fe7c3 100644 --- a/modules/apps/27-interchain-accounts/keeper/relay.go +++ b/modules/apps/27-interchain-accounts/keeper/relay.go @@ -72,7 +72,7 @@ func (k Keeper) createOutgoingPacket( } packetData := types.IBCAccountPacketData{ - Type: types.Type_RUNTX, + Type: types.EXECUTE_TX, Data: txBytes, } @@ -206,7 +206,7 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet) error } switch data.Type { - case types.Type_RUNTX: + case types.EXECUTE_TX: msgs, err := k.DeserializeTx(ctx, data.Data) if err != nil { return err diff --git a/modules/apps/27-interchain-accounts/types/account.go b/modules/apps/27-interchain-accounts/types/account.go index eed5f4c46e8..ebba17dc756 100644 --- a/modules/apps/27-interchain-accounts/types/account.go +++ b/modules/apps/27-interchain-accounts/types/account.go @@ -15,33 +15,33 @@ const ( IcaPrefix string = "ics27-1-" ) -type IBCAccountI interface { +type InterchainAccountI interface { authtypes.AccountI } var ( - _ authtypes.GenesisAccount = (*IBCAccount)(nil) - _ IBCAccountI = (*IBCAccount)(nil) + _ authtypes.GenesisAccount = (*InterchainAccount)(nil) + _ InterchainAccountI = (*InterchainAccount)(nil) ) -func NewIBCAccount(ba *authtypes.BaseAccount, accountOwner string) *IBCAccount { - return &IBCAccount{ +func NewInterchainAccount(ba *authtypes.BaseAccount, accountOwner string) *InterchainAccount { + return &InterchainAccount{ BaseAccount: ba, AccountOwner: accountOwner, } } // SetPubKey - Implements AccountI -func (IBCAccount) SetPubKey(pubKey crypto.PubKey) error { +func (InterchainAccount) SetPubKey(pubKey crypto.PubKey) error { return fmt.Errorf("not supported for interchain accounts") } // SetSequence - Implements AccountI -func (IBCAccount) SetSequence(seq uint64) error { +func (InterchainAccount) SetSequence(seq uint64) error { return fmt.Errorf("not supported for interchain accounts") } -func (ia IBCAccount) Validate() error { +func (ia InterchainAccount) Validate() error { return ia.BaseAccount.Validate() } @@ -53,13 +53,13 @@ type ibcAccountPretty struct { AccountOwner string `json:"address" yaml:"account_owner"` } -func (ia IBCAccount) String() string { +func (ia InterchainAccount) String() string { out, _ := ia.MarshalYAML() return out.(string) } -// MarshalYAML returns the YAML representation of a IBCAccount. -func (ia IBCAccount) MarshalYAML() (interface{}, error) { +// MarshalYAML returns the YAML representation of a InterchainAccount. +func (ia InterchainAccount) MarshalYAML() (interface{}, error) { accAddr, err := sdk.AccAddressFromBech32(ia.Address) if err != nil { return nil, err @@ -80,8 +80,8 @@ func (ia IBCAccount) MarshalYAML() (interface{}, error) { return string(bs), nil } -// MarshalJSON returns the JSON representation of a IBCAccount. -func (ia IBCAccount) MarshalJSON() ([]byte, error) { +// MarshalJSON returns the JSON representation of a InterchainAccount. +func (ia InterchainAccount) MarshalJSON() ([]byte, error) { accAddr, err := sdk.AccAddressFromBech32(ia.Address) if err != nil { return nil, err @@ -97,7 +97,7 @@ func (ia IBCAccount) MarshalJSON() ([]byte, error) { } // UnmarshalJSON unmarshals raw JSON bytes into a ModuleAccount. -func (ia *IBCAccount) UnmarshalJSON(bz []byte) error { +func (ia *InterchainAccount) UnmarshalJSON(bz []byte) error { var alias ibcAccountPretty if err := json.Unmarshal(bz, &alias); err != nil { return err diff --git a/modules/apps/27-interchain-accounts/types/account.pb.go b/modules/apps/27-interchain-accounts/types/account.pb.go index 85774b081af..4518d7581a9 100644 --- a/modules/apps/27-interchain-accounts/types/account.pb.go +++ b/modules/apps/27-interchain-accounts/types/account.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/account/account.proto +// source: ibc/applications/interchain_accounts/v1/account.proto package types @@ -25,23 +25,23 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// IBCAccount defines an account to which other chains have privileges -type IBCAccount struct { +// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +type InterchainAccount struct { *types.BaseAccount `protobuf:"bytes,1,opt,name=base_account,json=baseAccount,proto3,embedded=base_account" json:"base_account,omitempty" yaml:"base_account"` - AccountOwner string `protobuf:"bytes,2,opt,name=accountOwner,proto3" json:"accountOwner,omitempty"` + AccountOwner string `protobuf:"bytes,2,opt,name=account_owner,json=accountOwner,proto3" json:"account_owner,omitempty" yaml:"account_owner"` } -func (m *IBCAccount) Reset() { *m = IBCAccount{} } -func (*IBCAccount) ProtoMessage() {} -func (*IBCAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_be5ed7ee65e0e021, []int{0} +func (m *InterchainAccount) Reset() { *m = InterchainAccount{} } +func (*InterchainAccount) ProtoMessage() {} +func (*InterchainAccount) Descriptor() ([]byte, []int) { + return fileDescriptor_5561bd92625bf7da, []int{0} } -func (m *IBCAccount) XXX_Unmarshal(b []byte) error { +func (m *InterchainAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *IBCAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *InterchainAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_IBCAccount.Marshal(b, m, deterministic) + return xxx_messageInfo_InterchainAccount.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -51,47 +51,53 @@ func (m *IBCAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *IBCAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_IBCAccount.Merge(m, src) +func (m *InterchainAccount) XXX_Merge(src proto.Message) { + xxx_messageInfo_InterchainAccount.Merge(m, src) } -func (m *IBCAccount) XXX_Size() int { +func (m *InterchainAccount) XXX_Size() int { return m.Size() } -func (m *IBCAccount) XXX_DiscardUnknown() { - xxx_messageInfo_IBCAccount.DiscardUnknown(m) +func (m *InterchainAccount) XXX_DiscardUnknown() { + xxx_messageInfo_InterchainAccount.DiscardUnknown(m) } -var xxx_messageInfo_IBCAccount proto.InternalMessageInfo +var xxx_messageInfo_InterchainAccount proto.InternalMessageInfo func init() { - proto.RegisterType((*IBCAccount)(nil), "ibc.account.IBCAccount") + proto.RegisterType((*InterchainAccount)(nil), "ibc.applications.interchain_accounts.v1.InterchainAccount") } -func init() { proto.RegisterFile("ibc/account/account.proto", fileDescriptor_be5ed7ee65e0e021) } +func init() { + proto.RegisterFile("ibc/applications/interchain_accounts/v1/account.proto", fileDescriptor_5561bd92625bf7da) +} -var fileDescriptor_be5ed7ee65e0e021 = []byte{ - // 283 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x4c, 0x4a, 0xd6, - 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x81, 0xd1, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, - 0xdc, 0x99, 0x49, 0xc9, 0x7a, 0x50, 0x21, 0x29, 0xc9, 0xe4, 0xfc, 0xe2, 0xdc, 0xfc, 0xe2, 0x78, - 0xb0, 0x94, 0x3e, 0x84, 0x03, 0x51, 0x27, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x11, 0x07, 0xb1, - 0xa0, 0xa2, 0x72, 0x10, 0x35, 0xfa, 0x89, 0xa5, 0x25, 0x19, 0xfa, 0x65, 0x86, 0x49, 0xa9, 0x25, - 0x89, 0x86, 0x60, 0x0e, 0x44, 0x5e, 0x69, 0x35, 0x23, 0x17, 0x97, 0xa7, 0x93, 0xb3, 0x23, 0xc4, - 0x7c, 0xa1, 0x04, 0x2e, 0x9e, 0xa4, 0xc4, 0xe2, 0xd4, 0x78, 0xa8, 0x7d, 0x12, 0x8c, 0x0a, 0x8c, - 0x1a, 0xdc, 0x46, 0x0a, 0x7a, 0x50, 0x9b, 0xc0, 0x1a, 0xa1, 0xa6, 0xe8, 0x39, 0x25, 0x16, 0xa7, - 0x42, 0xf5, 0x39, 0x49, 0x5f, 0xb8, 0x27, 0xcf, 0xf8, 0xe9, 0x9e, 0xbc, 0x70, 0x65, 0x62, 0x6e, - 0x8e, 0x95, 0x12, 0xb2, 0x19, 0x4a, 0x41, 0xdc, 0x49, 0x08, 0x95, 0x42, 0x4a, 0x5c, 0x3c, 0x50, - 0x09, 0xff, 0xf2, 0xbc, 0xd4, 0x22, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x14, 0x31, 0x2b, - 0xf1, 0x8e, 0x05, 0xf2, 0x0c, 0x33, 0x16, 0xc8, 0x33, 0x5c, 0xda, 0xa2, 0xcb, 0x8d, 0x70, 0x9d, - 0xa7, 0x53, 0xf0, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, - 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa6, 0x67, - 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0x42, 0x83, 0x45, 0x3f, 0x33, 0xaf, 0x24, 0xb5, - 0x28, 0x39, 0x23, 0x31, 0x33, 0x4f, 0x17, 0x6a, 0x7a, 0xb1, 0x7e, 0x85, 0x7e, 0x66, 0x52, 0x32, - 0x8c, 0xab, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x09, 0x63, 0x40, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x32, 0x59, 0x01, 0x7a, 0x84, 0x01, 0x00, 0x00, +var fileDescriptor_5561bd92625bf7da = []byte{ + // 338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xcd, 0x4c, 0x4a, 0xd6, + 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0xcf, 0xcc, 0x2b, + 0x49, 0x2d, 0x4a, 0xce, 0x48, 0xcc, 0xcc, 0x8b, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, + 0xd6, 0x2f, 0x33, 0xd4, 0x87, 0xb2, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xd4, 0x33, 0x93, + 0x92, 0xf5, 0x90, 0xb5, 0xe9, 0x61, 0xd1, 0xa6, 0x57, 0x66, 0x28, 0x25, 0x99, 0x9c, 0x5f, 0x9c, + 0x9b, 0x5f, 0x1c, 0x0f, 0xd6, 0xa6, 0x0f, 0xe1, 0x40, 0xcc, 0x90, 0x12, 0x49, 0xcf, 0x4f, 0xcf, + 0x87, 0x88, 0x83, 0x58, 0x50, 0x51, 0x39, 0x88, 0x1a, 0xfd, 0xc4, 0xd2, 0x92, 0x0c, 0xfd, 0x32, + 0xc3, 0xa4, 0xd4, 0x92, 0x44, 0x43, 0x30, 0x07, 0x22, 0xaf, 0x74, 0x85, 0x91, 0x4b, 0xd0, 0x13, + 0x6e, 0x97, 0x23, 0xc4, 0x2a, 0xa1, 0x04, 0x2e, 0x9e, 0xa4, 0xc4, 0xe2, 0x54, 0x98, 0xd5, 0x12, + 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x0a, 0x7a, 0x50, 0x0b, 0xc1, 0xfa, 0xa1, 0x86, 0xe9, 0x39, + 0x25, 0x16, 0xa7, 0x42, 0xf5, 0x39, 0x49, 0x5f, 0xb8, 0x27, 0xcf, 0xf8, 0xe9, 0x9e, 0xbc, 0x70, + 0x65, 0x62, 0x6e, 0x8e, 0x95, 0x12, 0xb2, 0x19, 0x4a, 0x41, 0xdc, 0x49, 0x08, 0x95, 0x42, 0xb6, + 0x5c, 0xbc, 0x50, 0x89, 0xf8, 0xfc, 0xf2, 0xbc, 0xd4, 0x22, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x4e, + 0x27, 0x89, 0x4f, 0xf7, 0xe4, 0x45, 0x20, 0x9a, 0x51, 0xa4, 0x95, 0x82, 0x78, 0xa0, 0x7c, 0x7f, + 0x10, 0xd7, 0x4a, 0xae, 0x63, 0x81, 0x3c, 0xc3, 0x8c, 0x05, 0xf2, 0x0c, 0x97, 0xb6, 0xe8, 0x0a, + 0x61, 0xb8, 0xdf, 0xd3, 0x29, 0xe6, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, + 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, + 0x9c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xa1, 0xe1, 0xa7, 0x9f, 0x99, + 0x94, 0xac, 0x9b, 0x9e, 0xaf, 0x9f, 0x9b, 0x9f, 0x52, 0x9a, 0x93, 0x5a, 0x0c, 0x8a, 0xbe, 0x62, + 0x7d, 0x23, 0x73, 0x5d, 0x44, 0x14, 0xe8, 0xc2, 0x63, 0xae, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, + 0x0d, 0x1c, 0x76, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x46, 0x61, 0xdb, 0x7e, 0xee, 0x01, + 0x00, 0x00, } -func (m *IBCAccount) Marshal() (dAtA []byte, err error) { +func (m *InterchainAccount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -101,12 +107,12 @@ func (m *IBCAccount) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *IBCAccount) MarshalTo(dAtA []byte) (int, error) { +func (m *InterchainAccount) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *IBCAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *InterchainAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -144,7 +150,7 @@ func encodeVarintAccount(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *IBCAccount) Size() (n int) { +func (m *InterchainAccount) Size() (n int) { if m == nil { return 0 } @@ -167,7 +173,7 @@ func sovAccount(x uint64) (n int) { func sozAccount(x uint64) (n int) { return sovAccount(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *IBCAccount) Unmarshal(dAtA []byte) error { +func (m *InterchainAccount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -190,10 +196,10 @@ func (m *IBCAccount) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: IBCAccount: wiretype end group for non-group") + return fmt.Errorf("proto: InterchainAccount: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: IBCAccount: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InterchainAccount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/modules/apps/27-interchain-accounts/types/codec.go b/modules/apps/27-interchain-accounts/types/codec.go index 72b907dae61..c46946deaa2 100644 --- a/modules/apps/27-interchain-accounts/types/codec.go +++ b/modules/apps/27-interchain-accounts/types/codec.go @@ -9,14 +9,14 @@ import ( // RegisterLegacyAminoCodec registers the account interfaces and concrete types on the // provided LegacyAmino codec. These types are used for Amino JSON serialization func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterInterface((*IBCAccountI)(nil), nil) - cdc.RegisterConcrete(&IBCAccount{}, "27-interchain-accounts/IBCAccount", nil) + cdc.RegisterInterface((*InterchainAccountI)(nil), nil) + cdc.RegisterConcrete(&InterchainAccount{}, "27-interchain-accounts/InterchainAccount", nil) } // RegisterInterface associates protoName with AccountI interface // and creates a registry of it's concrete implementations func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - registry.RegisterImplementations((*authtypes.AccountI)(nil), &IBCAccount{}) + registry.RegisterImplementations((*authtypes.AccountI)(nil), &InterchainAccount{}) } var ( diff --git a/modules/apps/27-interchain-accounts/types/errors.go b/modules/apps/27-interchain-accounts/types/errors.go index 8854c1df4e7..f05d8bc0a3d 100644 --- a/modules/apps/27-interchain-accounts/types/errors.go +++ b/modules/apps/27-interchain-accounts/types/errors.go @@ -5,13 +5,13 @@ import ( ) var ( - ErrUnknownPacketData = sdkerrors.Register(ModuleName, 1, "Unknown packet data") - ErrAccountAlreadyExist = sdkerrors.Register(ModuleName, 2, "Account already exist") - ErrPortAlreadyBound = sdkerrors.Register(ModuleName, 3, "Port is already bound for address") - ErrUnsupportedChain = sdkerrors.Register(ModuleName, 4, "Unsupported chain") - ErrInvalidOutgoingData = sdkerrors.Register(ModuleName, 5, "Invalid outgoing data") - ErrInvalidRoute = sdkerrors.Register(ModuleName, 6, "Invalid route") - ErrIBCAccountNotFound = sdkerrors.Register(ModuleName, 7, "Ibc account not found") - ErrIBCAccountAlreadySet = sdkerrors.Register(ModuleName, 8, "Interchain Account is already set") - ErrActiveChannelNotFound = sdkerrors.Register(ModuleName, 9, "No active channel for this owner") + ErrUnknownPacketData = sdkerrors.Register(ModuleName, 1, "Unknown packet data") + ErrAccountAlreadyExist = sdkerrors.Register(ModuleName, 2, "Account already exist") + ErrPortAlreadyBound = sdkerrors.Register(ModuleName, 3, "Port is already bound for address") + ErrUnsupportedChain = sdkerrors.Register(ModuleName, 4, "Unsupported chain") + ErrInvalidOutgoingData = sdkerrors.Register(ModuleName, 5, "Invalid outgoing data") + ErrInvalidRoute = sdkerrors.Register(ModuleName, 6, "Invalid route") + ErrInterchainAccountNotFound = sdkerrors.Register(ModuleName, 7, "Interchain account not found") + ErrInterchainAccountAlreadySet = sdkerrors.Register(ModuleName, 8, "Interchain Account is already set") + ErrActiveChannelNotFound = sdkerrors.Register(ModuleName, 9, "No active channel for this owner") ) diff --git a/modules/apps/27-interchain-accounts/types/genesis.pb.go b/modules/apps/27-interchain-accounts/types/genesis.pb.go index fddc8377b68..9e32a1c8abc 100644 --- a/modules/apps/27-interchain-accounts/types/genesis.pb.go +++ b/modules/apps/27-interchain-accounts/types/genesis.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/account/genesis.proto +// source: ibc/applications/interchain_accounts/v1/genesis.proto package types @@ -23,7 +23,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// GenesisState defines the ibc-account genesis state +// GenesisState defines the interchain_account genesis state type GenesisState struct { PortId string `protobuf:"bytes,1,opt,name=port_id,json=portId,proto3" json:"port_id,omitempty" yaml:"port_id"` } @@ -32,7 +32,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_c5549b69e3eeb3e4, []int{0} + return fileDescriptor_629b3ced0911516b, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -69,26 +69,31 @@ func (m *GenesisState) GetPortId() string { } func init() { - proto.RegisterType((*GenesisState)(nil), "ibc.account.GenesisState") + proto.RegisterType((*GenesisState)(nil), "ibc.applications.interchain_accounts.v1.GenesisState") } -func init() { proto.RegisterFile("ibc/account/genesis.proto", fileDescriptor_c5549b69e3eeb3e4) } +func init() { + proto.RegisterFile("ibc/applications/interchain_accounts/v1/genesis.proto", fileDescriptor_629b3ced0911516b) +} -var fileDescriptor_c5549b69e3eeb3e4 = []byte{ - // 202 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x4c, 0x4a, 0xd6, - 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xce, 0x4c, 0x4a, 0xd6, 0x83, 0x4a, 0x49, 0x89, 0xa4, - 0xe7, 0xa7, 0xe7, 0x83, 0xc5, 0xf5, 0x41, 0x2c, 0x88, 0x12, 0x25, 0x6b, 0x2e, 0x1e, 0x77, 0x88, - 0x9e, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x6d, 0x2e, 0xf6, 0x82, 0xfc, 0xa2, 0x92, 0xf8, 0xcc, - 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0xa1, 0x4f, 0xf7, 0xe4, 0xf9, 0x2a, 0x13, 0x73, - 0x73, 0xac, 0x94, 0xa0, 0x12, 0x4a, 0x41, 0x6c, 0x20, 0x96, 0x67, 0x8a, 0x53, 0xf0, 0x89, 0x47, - 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, - 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x59, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, - 0x25, 0xe7, 0xe7, 0xea, 0x27, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xeb, 0x67, 0xe6, 0x95, 0xa4, 0x16, - 0x25, 0x67, 0x24, 0x66, 0xe6, 0xe9, 0x42, 0x9d, 0x54, 0xac, 0x5f, 0xa1, 0x9f, 0x99, 0x94, 0x0c, - 0xe3, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x66, 0x0c, 0x08, 0x00, 0x00, - 0xff, 0xff, 0x01, 0x11, 0x9a, 0xe3, 0xd8, 0x00, 0x00, 0x00, +var fileDescriptor_629b3ced0911516b = []byte{ + // 241 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0xcd, 0x4c, 0x4a, 0xd6, + 0x4f, 0x2c, 0x28, 0xc8, 0xc9, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0xcf, 0xcc, 0x2b, + 0x49, 0x2d, 0x4a, 0xce, 0x48, 0xcc, 0xcc, 0x8b, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, + 0xd6, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x52, 0xcf, 0x4c, 0x4a, 0xd6, 0x43, 0xd6, 0xa6, 0x87, 0x45, 0x9b, 0x5e, 0x99, 0xa1, + 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x58, 0x8f, 0x3e, 0x88, 0x05, 0xd1, 0xae, 0x64, 0xcd, 0xc5, + 0xe3, 0x0e, 0x31, 0x2f, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0x48, 0x9b, 0x8b, 0xbd, 0x20, 0xbf, 0xa8, + 0x24, 0x3e, 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0xd3, 0x49, 0xe8, 0xd3, 0x3d, 0x79, 0xbe, + 0xca, 0xc4, 0xdc, 0x1c, 0x2b, 0x25, 0xa8, 0x84, 0x52, 0x10, 0x1b, 0x88, 0xe5, 0x99, 0xe2, 0x14, + 0x73, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, + 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x4e, 0xe9, 0x99, 0x25, 0x19, + 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0xfa, 0x99, 0x49, + 0xc9, 0xba, 0xe9, 0xf9, 0xfa, 0xb9, 0xf9, 0x29, 0xa5, 0x39, 0xa9, 0xc5, 0x20, 0x9f, 0x16, 0xeb, + 0x1b, 0x99, 0xeb, 0x22, 0x5c, 0xab, 0x0b, 0xf7, 0x64, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, + 0xd8, 0x85, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x89, 0x2b, 0x4e, 0x7c, 0x19, 0x01, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/modules/apps/27-interchain-accounts/types/query.pb.go b/modules/apps/27-interchain-accounts/types/query.pb.go index eb7b28b6b77..56108e7f743 100644 --- a/modules/apps/27-interchain-accounts/types/query.pb.go +++ b/modules/apps/27-interchain-accounts/types/query.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/account/query.proto +// source: ibc/applications/interchain_accounts/v1/query.proto package types @@ -29,24 +29,25 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type QueryIBCAccountRequest struct { - // address is the address to query. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +// Query request for an interchain account address +type QueryInterchainAccountAddressRequest struct { + // Owner address is the owner of the interchain account on the controller chain + OwnerAddress string `protobuf:"bytes,1,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty"` ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"` } -func (m *QueryIBCAccountRequest) Reset() { *m = QueryIBCAccountRequest{} } -func (m *QueryIBCAccountRequest) String() string { return proto.CompactTextString(m) } -func (*QueryIBCAccountRequest) ProtoMessage() {} -func (*QueryIBCAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5738b2fac406b004, []int{0} +func (m *QueryInterchainAccountAddressRequest) Reset() { *m = QueryInterchainAccountAddressRequest{} } +func (m *QueryInterchainAccountAddressRequest) String() string { return proto.CompactTextString(m) } +func (*QueryInterchainAccountAddressRequest) ProtoMessage() {} +func (*QueryInterchainAccountAddressRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_72a16b57c3343764, []int{0} } -func (m *QueryIBCAccountRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryInterchainAccountAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryIBCAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryInterchainAccountAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryIBCAccountRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryInterchainAccountAddressRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -56,35 +57,36 @@ func (m *QueryIBCAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryIBCAccountRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIBCAccountRequest.Merge(m, src) +func (m *QueryInterchainAccountAddressRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryInterchainAccountAddressRequest.Merge(m, src) } -func (m *QueryIBCAccountRequest) XXX_Size() int { +func (m *QueryInterchainAccountAddressRequest) XXX_Size() int { return m.Size() } -func (m *QueryIBCAccountRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIBCAccountRequest.DiscardUnknown(m) +func (m *QueryInterchainAccountAddressRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryInterchainAccountAddressRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryIBCAccountRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryInterchainAccountAddressRequest proto.InternalMessageInfo -type QueryIBCAccountResponse struct { - // account defines the account of the corresponding address. - AccountAddress string `protobuf:"bytes,1,opt,name=account_address,json=accountAddress,proto3" json:"account_address,omitempty"` +// Query response for an interchain account address +type QueryInterchainAccountAddressResponse struct { + // The corresponding interchain account address on the host chain + InterchainAccountAddress string `protobuf:"bytes,1,opt,name=interchain_account_address,json=interchainAccountAddress,proto3" json:"interchain_account_address,omitempty"` } -func (m *QueryIBCAccountResponse) Reset() { *m = QueryIBCAccountResponse{} } -func (m *QueryIBCAccountResponse) String() string { return proto.CompactTextString(m) } -func (*QueryIBCAccountResponse) ProtoMessage() {} -func (*QueryIBCAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5738b2fac406b004, []int{1} +func (m *QueryInterchainAccountAddressResponse) Reset() { *m = QueryInterchainAccountAddressResponse{} } +func (m *QueryInterchainAccountAddressResponse) String() string { return proto.CompactTextString(m) } +func (*QueryInterchainAccountAddressResponse) ProtoMessage() {} +func (*QueryInterchainAccountAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_72a16b57c3343764, []int{1} } -func (m *QueryIBCAccountResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryInterchainAccountAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryIBCAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryInterchainAccountAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryIBCAccountResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryInterchainAccountAddressResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -94,54 +96,59 @@ func (m *QueryIBCAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryIBCAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryIBCAccountResponse.Merge(m, src) +func (m *QueryInterchainAccountAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryInterchainAccountAddressResponse.Merge(m, src) } -func (m *QueryIBCAccountResponse) XXX_Size() int { +func (m *QueryInterchainAccountAddressResponse) XXX_Size() int { return m.Size() } -func (m *QueryIBCAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryIBCAccountResponse.DiscardUnknown(m) +func (m *QueryInterchainAccountAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryInterchainAccountAddressResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryIBCAccountResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryInterchainAccountAddressResponse proto.InternalMessageInfo -func (m *QueryIBCAccountResponse) GetAccountAddress() string { +func (m *QueryInterchainAccountAddressResponse) GetInterchainAccountAddress() string { if m != nil { - return m.AccountAddress + return m.InterchainAccountAddress } return "" } func init() { - proto.RegisterType((*QueryIBCAccountRequest)(nil), "ibc.account.QueryIBCAccountRequest") - proto.RegisterType((*QueryIBCAccountResponse)(nil), "ibc.account.QueryIBCAccountResponse") -} - -func init() { proto.RegisterFile("ibc/account/query.proto", fileDescriptor_5738b2fac406b004) } - -var fileDescriptor_5738b2fac406b004 = []byte{ - // 312 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcf, 0x4a, 0x03, 0x31, - 0x10, 0xc6, 0xb3, 0x82, 0xff, 0xe2, 0x3f, 0x08, 0x62, 0x6b, 0x91, 0x54, 0x5a, 0x41, 0x2f, 0x6e, - 0x40, 0x4f, 0x7a, 0x6b, 0x3d, 0xf5, 0x68, 0x3d, 0xe9, 0xa5, 0x24, 0xd9, 0xb0, 0x0d, 0xd8, 0xcc, - 0x76, 0x93, 0x05, 0xfb, 0x06, 0x1e, 0x7d, 0x84, 0x3e, 0x8e, 0xc7, 0x1e, 0x3d, 0x4a, 0xf7, 0xe2, - 0x63, 0xc8, 0xee, 0xa6, 0xb4, 0xa2, 0x78, 0x4a, 0xe6, 0xfb, 0x0d, 0xdf, 0x37, 0x33, 0xb8, 0xa6, - 0x85, 0x64, 0x5c, 0x4a, 0xc8, 0x8c, 0x63, 0xe3, 0x4c, 0xa5, 0x93, 0x30, 0x49, 0xc1, 0x01, 0xd9, - 0xd1, 0x42, 0x86, 0x1e, 0x34, 0x0e, 0x63, 0x88, 0xa1, 0xd4, 0x59, 0xf1, 0xab, 0x5a, 0x1a, 0x27, - 0x31, 0x40, 0xfc, 0xac, 0x18, 0x4f, 0x34, 0xe3, 0xc6, 0x80, 0xe3, 0x4e, 0x83, 0xb1, 0x9e, 0x1e, - 0xaf, 0x3a, 0xfb, 0xb7, 0x42, 0x2d, 0x8e, 0x8f, 0xee, 0x8b, 0xa8, 0x5e, 0xf7, 0xae, 0x53, 0x81, - 0xbe, 0x1a, 0x67, 0xca, 0x3a, 0x52, 0xc7, 0x9b, 0x3c, 0x8a, 0x52, 0x65, 0x6d, 0x3d, 0x38, 0x0d, - 0x2e, 0xb6, 0xfb, 0x8b, 0x92, 0xb4, 0xf1, 0x9e, 0x04, 0x63, 0x94, 0x2c, 0x32, 0x06, 0x3a, 0xaa, - 0xaf, 0x95, 0x7c, 0x77, 0x29, 0xf6, 0xa2, 0xdb, 0xad, 0xd7, 0x69, 0x13, 0x7d, 0x4d, 0x9b, 0xa8, - 0xd5, 0xc5, 0xb5, 0x5f, 0x11, 0x36, 0x01, 0x63, 0x15, 0x39, 0xc7, 0x07, 0x7e, 0x9c, 0xc1, 0xcf, - 0xac, 0x7d, 0x2f, 0x77, 0x2a, 0xf5, 0x4a, 0xe0, 0xf5, 0xd2, 0x83, 0x3c, 0x62, 0xbc, 0xf4, 0x21, - 0xed, 0x70, 0xe5, 0x34, 0xe1, 0xdf, 0x8b, 0x34, 0xce, 0xfe, 0x6f, 0xaa, 0x46, 0x69, 0xa1, 0xee, - 0xc3, 0xfb, 0x9c, 0x06, 0xb3, 0x39, 0x0d, 0x3e, 0xe7, 0x34, 0x78, 0xcb, 0x29, 0x9a, 0xe5, 0x14, - 0x7d, 0xe4, 0x14, 0x3d, 0xdd, 0xc4, 0xda, 0x0d, 0x33, 0x11, 0x4a, 0x18, 0x31, 0x09, 0x76, 0x04, - 0x96, 0x69, 0xe3, 0x54, 0x2a, 0x87, 0x5c, 0x9b, 0x4b, 0xef, 0x6c, 0xd9, 0x0b, 0xd3, 0x42, 0x2e, - 0x4a, 0xe6, 0x26, 0x89, 0xb2, 0x62, 0xa3, 0x3c, 0xf3, 0xf5, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x90, 0xc3, 0xe9, 0x06, 0xdd, 0x01, 0x00, 0x00, + proto.RegisterType((*QueryInterchainAccountAddressRequest)(nil), "ibc.applications.interchain_accounts.v1.QueryInterchainAccountAddressRequest") + proto.RegisterType((*QueryInterchainAccountAddressResponse)(nil), "ibc.applications.interchain_accounts.v1.QueryInterchainAccountAddressResponse") +} + +func init() { + proto.RegisterFile("ibc/applications/interchain_accounts/v1/query.proto", fileDescriptor_72a16b57c3343764) +} + +var fileDescriptor_72a16b57c3343764 = []byte{ + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x31, 0x4b, 0x33, 0x41, + 0x10, 0xbd, 0xfd, 0xe0, 0x13, 0x5d, 0xb4, 0x39, 0x2c, 0x8e, 0x43, 0x2e, 0x12, 0x15, 0x6d, 0xb2, + 0x4b, 0x12, 0x44, 0x10, 0x9b, 0xa4, 0x4b, 0xa1, 0x60, 0x4a, 0x11, 0xc2, 0xde, 0xde, 0x72, 0x59, + 0x48, 0x76, 0x2e, 0xb7, 0x7b, 0x91, 0xf8, 0x0b, 0x2c, 0xfd, 0x09, 0xf9, 0x1f, 0xd6, 0x82, 0x65, + 0x4a, 0x4b, 0x49, 0x1a, 0x7f, 0x86, 0xdc, 0x6d, 0x48, 0x44, 0x0d, 0xa6, 0xb0, 0x1b, 0x66, 0xde, + 0x9b, 0xf7, 0x76, 0xf6, 0xe1, 0xba, 0x0c, 0x39, 0x65, 0x49, 0xd2, 0x93, 0x9c, 0x19, 0x09, 0x4a, + 0x53, 0xa9, 0x8c, 0x48, 0x79, 0x97, 0x49, 0xd5, 0x61, 0x9c, 0x43, 0xa6, 0x8c, 0xa6, 0xc3, 0x2a, + 0x1d, 0x64, 0x22, 0x1d, 0x91, 0x24, 0x05, 0x03, 0xee, 0xb1, 0x0c, 0x39, 0xf9, 0x4c, 0x22, 0x3f, + 0x90, 0xc8, 0xb0, 0xea, 0xef, 0xc6, 0x10, 0x43, 0xc1, 0xa1, 0x79, 0x65, 0xe9, 0xfe, 0x5e, 0x0c, + 0x10, 0xf7, 0x04, 0x65, 0x89, 0xa4, 0x4c, 0x29, 0x30, 0xf3, 0x25, 0x76, 0x7a, 0xba, 0xae, 0xa3, + 0x79, 0x6d, 0x69, 0xe5, 0x7b, 0x7c, 0x78, 0x9d, 0x5b, 0x6c, 0x2d, 0xc0, 0x0d, 0x3b, 0x6f, 0x44, + 0x51, 0x2a, 0xb4, 0x6e, 0x8b, 0x41, 0x26, 0xb4, 0x71, 0x0f, 0xf0, 0x0e, 0xdc, 0x29, 0x91, 0x76, + 0x98, 0xed, 0x7b, 0x68, 0x1f, 0x9d, 0x6c, 0xb5, 0xb7, 0x8b, 0xe6, 0x1c, 0x9b, 0x83, 0x38, 0x28, + 0x25, 0x78, 0x6e, 0xa0, 0x23, 0x23, 0xef, 0x9f, 0x05, 0x2d, 0x9b, 0xad, 0xe8, 0x7c, 0xf3, 0x61, + 0x5c, 0x72, 0xde, 0xc7, 0x25, 0xa7, 0x2c, 0xf0, 0xd1, 0x2f, 0xda, 0x3a, 0x01, 0xa5, 0x85, 0x7b, + 0x81, 0xfd, 0xef, 0x8f, 0xf9, 0xe2, 0xc4, 0x93, 0x2b, 0xb6, 0xd4, 0x9e, 0x11, 0xfe, 0x5f, 0xe8, + 0xb8, 0x4f, 0x08, 0x7b, 0xab, 0xc4, 0xdc, 0x4b, 0xb2, 0xe6, 0xf7, 0x90, 0x75, 0x0e, 0xe6, 0x5f, + 0xfd, 0xd5, 0x3a, 0x7b, 0x83, 0xb2, 0xd3, 0xbc, 0x7d, 0x99, 0x06, 0x68, 0x32, 0x0d, 0xd0, 0xdb, + 0x34, 0x40, 0x8f, 0xb3, 0xc0, 0x99, 0xcc, 0x02, 0xe7, 0x75, 0x16, 0x38, 0x37, 0xcd, 0x58, 0x9a, + 0x6e, 0x16, 0x12, 0x0e, 0x7d, 0xca, 0x41, 0xf7, 0x41, 0x53, 0x19, 0xf2, 0x4a, 0x0c, 0xb4, 0x0f, + 0x51, 0xd6, 0x13, 0x3a, 0x0f, 0x86, 0xa6, 0xb5, 0xb3, 0xca, 0xd2, 0x42, 0x65, 0x91, 0x09, 0x33, + 0x4a, 0x84, 0x0e, 0x37, 0x8a, 0x3c, 0xd4, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x93, 0x84, + 0xc3, 0xda, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -156,7 +163,8 @@ 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 QueryClient interface { - IBCAccount(ctx context.Context, in *QueryIBCAccountRequest, opts ...grpc.CallOption) (*QueryIBCAccountResponse, error) + // Query to get the address of an interchain account + InterchainAccountAddress(ctx context.Context, in *QueryInterchainAccountAddressRequest, opts ...grpc.CallOption) (*QueryInterchainAccountAddressResponse, error) } type queryClient struct { @@ -167,9 +175,9 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) IBCAccount(ctx context.Context, in *QueryIBCAccountRequest, opts ...grpc.CallOption) (*QueryIBCAccountResponse, error) { - out := new(QueryIBCAccountResponse) - err := c.cc.Invoke(ctx, "/ibc.account.Query/IBCAccount", in, out, opts...) +func (c *queryClient) InterchainAccountAddress(ctx context.Context, in *QueryInterchainAccountAddressRequest, opts ...grpc.CallOption) (*QueryInterchainAccountAddressResponse, error) { + out := new(QueryInterchainAccountAddressResponse) + err := c.cc.Invoke(ctx, "/ibc.applications.interchain_accounts.v1.Query/InterchainAccountAddress", in, out, opts...) if err != nil { return nil, err } @@ -178,53 +186,54 @@ func (c *queryClient) IBCAccount(ctx context.Context, in *QueryIBCAccountRequest // QueryServer is the server API for Query service. type QueryServer interface { - IBCAccount(context.Context, *QueryIBCAccountRequest) (*QueryIBCAccountResponse, error) + // Query to get the address of an interchain account + InterchainAccountAddress(context.Context, *QueryInterchainAccountAddressRequest) (*QueryInterchainAccountAddressResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) IBCAccount(ctx context.Context, req *QueryIBCAccountRequest) (*QueryIBCAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IBCAccount not implemented") +func (*UnimplementedQueryServer) InterchainAccountAddress(ctx context.Context, req *QueryInterchainAccountAddressRequest) (*QueryInterchainAccountAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InterchainAccountAddress not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_IBCAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryIBCAccountRequest) +func _Query_InterchainAccountAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryInterchainAccountAddressRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).IBCAccount(ctx, in) + return srv.(QueryServer).InterchainAccountAddress(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ibc.account.Query/IBCAccount", + FullMethod: "/ibc.applications.interchain_accounts.v1.Query/InterchainAccountAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).IBCAccount(ctx, req.(*QueryIBCAccountRequest)) + return srv.(QueryServer).InterchainAccountAddress(ctx, req.(*QueryInterchainAccountAddressRequest)) } return interceptor(ctx, in, info, handler) } var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "ibc.account.Query", + ServiceName: "ibc.applications.interchain_accounts.v1.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "IBCAccount", - Handler: _Query_IBCAccount_Handler, + MethodName: "InterchainAccountAddress", + Handler: _Query_InterchainAccountAddress_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "ibc/account/query.proto", + Metadata: "ibc/applications/interchain_accounts/v1/query.proto", } -func (m *QueryIBCAccountRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryInterchainAccountAddressRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -234,12 +243,12 @@ func (m *QueryIBCAccountRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryIBCAccountRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryInterchainAccountAddressRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryIBCAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryInterchainAccountAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -251,17 +260,17 @@ func (m *QueryIBCAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x12 } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OwnerAddress))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryIBCAccountResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryInterchainAccountAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -271,20 +280,20 @@ func (m *QueryIBCAccountResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryIBCAccountResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryInterchainAccountAddressResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryIBCAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryInterchainAccountAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.AccountAddress) > 0 { - i -= len(m.AccountAddress) - copy(dAtA[i:], m.AccountAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountAddress))) + if len(m.InterchainAccountAddress) > 0 { + i -= len(m.InterchainAccountAddress) + copy(dAtA[i:], m.InterchainAccountAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.InterchainAccountAddress))) i-- dAtA[i] = 0xa } @@ -302,13 +311,13 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryIBCAccountRequest) Size() (n int) { +func (m *QueryInterchainAccountAddressRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Address) + l = len(m.OwnerAddress) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -319,13 +328,13 @@ func (m *QueryIBCAccountRequest) Size() (n int) { return n } -func (m *QueryIBCAccountResponse) Size() (n int) { +func (m *QueryInterchainAccountAddressResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.AccountAddress) + l = len(m.InterchainAccountAddress) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -338,7 +347,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryIBCAccountRequest) Unmarshal(dAtA []byte) error { +func (m *QueryInterchainAccountAddressRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -361,15 +370,15 @@ func (m *QueryIBCAccountRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryIBCAccountRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryInterchainAccountAddressRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIBCAccountRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryInterchainAccountAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -397,7 +406,7 @@ func (m *QueryIBCAccountRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.OwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -452,7 +461,7 @@ func (m *QueryIBCAccountRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryIBCAccountResponse) Unmarshal(dAtA []byte) error { +func (m *QueryInterchainAccountAddressResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -475,15 +484,15 @@ func (m *QueryIBCAccountResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryIBCAccountResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryInterchainAccountAddressResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryIBCAccountResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryInterchainAccountAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AccountAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field InterchainAccountAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -511,7 +520,7 @@ func (m *QueryIBCAccountResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AccountAddress = string(dAtA[iNdEx:postIndex]) + m.InterchainAccountAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/modules/apps/27-interchain-accounts/types/types.pb.go b/modules/apps/27-interchain-accounts/types/types.pb.go index d2eaf2455d8..62324b0be0a 100644 --- a/modules/apps/27-interchain-accounts/types/types.pb.go +++ b/modules/apps/27-interchain-accounts/types/types.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ibc/account/types.proto +// source: ibc/applications/interchain_accounts/v1/types.proto package types import ( fmt "fmt" types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -23,21 +24,22 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// The different types of interchain account transactions +// EXECUTE_TX is used when sending a TX from the controller side to the host side. The host side will execute the tx on +// behalf of the interchain account. type Type int32 const ( - Type_REGISTER Type = 0 - Type_RUNTX Type = 1 + // Execute message type + EXECUTE_TX Type = 0 ) var Type_name = map[int32]string{ - 0: "REGISTER", - 1: "RUNTX", + 0: "TYPE_EXECUTE_TX_UNSPECIFIED", } var Type_value = map[string]int32{ - "REGISTER": 0, - "RUNTX": 1, + "TYPE_EXECUTE_TX_UNSPECIFIED": 0, } func (x Type) String() string { @@ -45,18 +47,19 @@ func (x Type) String() string { } func (Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_0902a1528b05ff0d, []int{0} + return fileDescriptor_39bab93e18d89799, []int{0} } +// Raw tx body type IBCTxRaw struct { - BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` + BodyBytes []byte `protobuf:"bytes,1,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty" yaml:"body_bytes"` } func (m *IBCTxRaw) Reset() { *m = IBCTxRaw{} } func (m *IBCTxRaw) String() string { return proto.CompactTextString(m) } func (*IBCTxRaw) ProtoMessage() {} func (*IBCTxRaw) Descriptor() ([]byte, []int) { - return fileDescriptor_0902a1528b05ff0d, []int{0} + return fileDescriptor_39bab93e18d89799, []int{0} } func (m *IBCTxRaw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -92,6 +95,7 @@ func (m *IBCTxRaw) GetBodyBytes() []byte { return nil } +// Body of a tx for an ics27 IBC packet type IBCTxBody struct { Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` } @@ -100,7 +104,7 @@ func (m *IBCTxBody) Reset() { *m = IBCTxBody{} } func (m *IBCTxBody) String() string { return proto.CompactTextString(m) } func (*IBCTxBody) ProtoMessage() {} func (*IBCTxBody) Descriptor() ([]byte, []int) { - return fileDescriptor_0902a1528b05ff0d, []int{1} + return fileDescriptor_39bab93e18d89799, []int{1} } func (m *IBCTxBody) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -136,8 +140,9 @@ func (m *IBCTxBody) GetMessages() []*types.Any { return nil } +// Packet data is comprised of raw transaction & type of transaction type IBCAccountPacketData struct { - Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=ibc.account.Type" json:"type,omitempty"` + Type Type `protobuf:"varint,1,opt,name=type,proto3,enum=ibc.applications.interchain_accounts.v1.Type" json:"type,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } @@ -145,7 +150,7 @@ func (m *IBCAccountPacketData) Reset() { *m = IBCAccountPacketData{} } func (m *IBCAccountPacketData) String() string { return proto.CompactTextString(m) } func (*IBCAccountPacketData) ProtoMessage() {} func (*IBCAccountPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_0902a1528b05ff0d, []int{2} + return fileDescriptor_39bab93e18d89799, []int{2} } func (m *IBCAccountPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -178,7 +183,7 @@ func (m *IBCAccountPacketData) GetType() Type { if m != nil { return m.Type } - return Type_REGISTER + return EXECUTE_TX } func (m *IBCAccountPacketData) GetData() []byte { @@ -188,84 +193,45 @@ func (m *IBCAccountPacketData) GetData() []byte { return nil } -type AccountAddress struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` -} - -func (m *AccountAddress) Reset() { *m = AccountAddress{} } -func (m *AccountAddress) String() string { return proto.CompactTextString(m) } -func (*AccountAddress) ProtoMessage() {} -func (*AccountAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_0902a1528b05ff0d, []int{3} -} -func (m *AccountAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AccountAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AccountAddress.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 *AccountAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_AccountAddress.Merge(m, src) -} -func (m *AccountAddress) XXX_Size() int { - return m.Size() -} -func (m *AccountAddress) XXX_DiscardUnknown() { - xxx_messageInfo_AccountAddress.DiscardUnknown(m) -} - -var xxx_messageInfo_AccountAddress proto.InternalMessageInfo - -func (m *AccountAddress) GetAddress() string { - if m != nil { - return m.Address - } - return "" +func init() { + proto.RegisterEnum("ibc.applications.interchain_accounts.v1.Type", Type_name, Type_value) + proto.RegisterType((*IBCTxRaw)(nil), "ibc.applications.interchain_accounts.v1.IBCTxRaw") + proto.RegisterType((*IBCTxBody)(nil), "ibc.applications.interchain_accounts.v1.IBCTxBody") + proto.RegisterType((*IBCAccountPacketData)(nil), "ibc.applications.interchain_accounts.v1.IBCAccountPacketData") } func init() { - proto.RegisterEnum("ibc.account.Type", Type_name, Type_value) - proto.RegisterType((*IBCTxRaw)(nil), "ibc.account.IBCTxRaw") - proto.RegisterType((*IBCTxBody)(nil), "ibc.account.IBCTxBody") - proto.RegisterType((*IBCAccountPacketData)(nil), "ibc.account.IBCAccountPacketData") - proto.RegisterType((*AccountAddress)(nil), "ibc.account.AccountAddress") -} - -func init() { proto.RegisterFile("ibc/account/types.proto", fileDescriptor_0902a1528b05ff0d) } - -var fileDescriptor_0902a1528b05ff0d = []byte{ - // 340 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x91, 0xc1, 0x4a, 0x2b, 0x31, - 0x18, 0x85, 0x67, 0xee, 0xed, 0xbd, 0xb7, 0x93, 0x96, 0xd2, 0x1b, 0x0a, 0x56, 0xc1, 0x51, 0x06, - 0x84, 0x5a, 0x68, 0x22, 0x75, 0xe5, 0xc2, 0x45, 0xa7, 0x16, 0xe9, 0x46, 0x34, 0x1d, 0x41, 0xdc, - 0x48, 0x92, 0x89, 0xd3, 0x41, 0x3b, 0x29, 0x4d, 0x8a, 0xcd, 0x5b, 0xf8, 0x58, 0x2e, 0xbb, 0x74, - 0x29, 0xed, 0x8b, 0xc8, 0x64, 0x5a, 0xd1, 0xdd, 0x9f, 0xff, 0x1c, 0xce, 0xf9, 0xc8, 0x0f, 0x76, - 0x52, 0xc6, 0x31, 0xe5, 0x5c, 0xce, 0x33, 0x8d, 0xb5, 0x99, 0x0a, 0x85, 0xa6, 0x33, 0xa9, 0x25, - 0xac, 0xa4, 0x8c, 0xa3, 0x8d, 0xb0, 0xb7, 0x9b, 0x48, 0x99, 0x3c, 0x0b, 0x6c, 0x25, 0x36, 0x7f, - 0xc4, 0x34, 0x33, 0x85, 0x2f, 0x38, 0x06, 0xe5, 0x61, 0xd8, 0x8f, 0x16, 0x84, 0xbe, 0xc0, 0x7d, - 0x00, 0x98, 0x8c, 0xcd, 0x03, 0x33, 0x5a, 0xa8, 0xa6, 0x7b, 0xe8, 0xb6, 0xaa, 0xc4, 0xcb, 0x37, - 0x61, 0xbe, 0x08, 0xce, 0x81, 0x67, 0xad, 0xa1, 0x8c, 0x0d, 0x3c, 0x01, 0xe5, 0x89, 0x50, 0x8a, - 0x26, 0xd6, 0xf9, 0xbb, 0x55, 0xe9, 0x36, 0x50, 0xd1, 0x82, 0xb6, 0x2d, 0xa8, 0x97, 0x19, 0xf2, - 0xe5, 0x0a, 0x6e, 0x40, 0x63, 0x18, 0xf6, 0x7b, 0x05, 0xd2, 0x35, 0xe5, 0x4f, 0x42, 0x5f, 0x50, - 0x4d, 0xe1, 0x11, 0x28, 0xe5, 0xe0, 0xb6, 0xaf, 0xd6, 0xfd, 0x8f, 0xbe, 0x81, 0xa3, 0xc8, 0x4c, - 0x05, 0xb1, 0x32, 0x84, 0xa0, 0x14, 0x53, 0x4d, 0x9b, 0xbf, 0x2c, 0x96, 0x9d, 0x83, 0x36, 0xa8, - 0x6d, 0xf2, 0x7a, 0x71, 0x3c, 0x13, 0x4a, 0xc1, 0x26, 0xf8, 0x47, 0x8b, 0xd1, 0xe6, 0x79, 0x64, - 0xfb, 0x6c, 0x1f, 0x80, 0x52, 0x9e, 0x06, 0xab, 0xa0, 0x4c, 0x06, 0x97, 0xc3, 0x51, 0x34, 0x20, - 0x75, 0x07, 0x7a, 0xe0, 0x0f, 0xb9, 0xbd, 0x8a, 0xee, 0xea, 0x6e, 0x38, 0x7a, 0x5b, 0xf9, 0xee, - 0x72, 0xe5, 0xbb, 0x1f, 0x2b, 0xdf, 0x7d, 0x5d, 0xfb, 0xce, 0x72, 0xed, 0x3b, 0xef, 0x6b, 0xdf, - 0xb9, 0x3f, 0x4b, 0x52, 0x3d, 0x9e, 0x33, 0xc4, 0xe5, 0x04, 0x73, 0xa9, 0x26, 0x52, 0xe1, 0x34, - 0xd3, 0x62, 0xc6, 0xc7, 0x34, 0xcd, 0x3a, 0x1b, 0x56, 0x85, 0x17, 0x38, 0x65, 0xbc, 0xf3, 0xe3, - 0x18, 0xec, 0xaf, 0xfd, 0x8c, 0xd3, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x92, 0xef, 0xa7, 0x30, - 0xa8, 0x01, 0x00, 0x00, + proto.RegisterFile("ibc/applications/interchain_accounts/v1/types.proto", fileDescriptor_39bab93e18d89799) +} + +var fileDescriptor_39bab93e18d89799 = []byte{ + // 405 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0x41, 0x6b, 0xd4, 0x40, + 0x18, 0x4d, 0x34, 0x48, 0x3b, 0x4a, 0xd1, 0xb0, 0x42, 0x8d, 0x10, 0x4b, 0x2e, 0x16, 0x21, 0x33, + 0x76, 0x2b, 0x08, 0x42, 0xc1, 0x4d, 0x1a, 0x21, 0x17, 0x59, 0x62, 0x0a, 0x55, 0x84, 0x30, 0x33, + 0x19, 0xd3, 0xc1, 0x24, 0x13, 0x3a, 0x93, 0xd5, 0xf9, 0x07, 0xe2, 0xc9, 0x3f, 0xe0, 0xc9, 0x3f, + 0xe3, 0x71, 0x8f, 0x9e, 0x44, 0x76, 0xff, 0x81, 0xbf, 0x40, 0x32, 0xc1, 0x5d, 0x0f, 0x1e, 0x7a, + 0x7b, 0x33, 0xdf, 0xf7, 0x1e, 0xef, 0x7b, 0x0f, 0x1c, 0x73, 0x42, 0x11, 0xee, 0xba, 0x9a, 0x53, + 0xac, 0xb8, 0x68, 0x25, 0xe2, 0xad, 0x62, 0x97, 0xf4, 0x02, 0xf3, 0xb6, 0xc0, 0x94, 0x8a, 0xbe, + 0x55, 0x12, 0x2d, 0x8e, 0x90, 0xd2, 0x1d, 0x93, 0xb0, 0xbb, 0x14, 0x4a, 0xb8, 0x0f, 0x39, 0xa1, + 0xf0, 0x5f, 0x12, 0xfc, 0x0f, 0x09, 0x2e, 0x8e, 0xbc, 0x7b, 0x95, 0x10, 0x55, 0xcd, 0x90, 0xa1, + 0x91, 0xfe, 0x1d, 0xc2, 0xad, 0x1e, 0x35, 0xbc, 0x49, 0x25, 0x2a, 0x61, 0x20, 0x1a, 0xd0, 0xf8, + 0x1b, 0x3c, 0x07, 0x3b, 0x69, 0x14, 0xe7, 0x1f, 0x33, 0xfc, 0xc1, 0x7d, 0x02, 0x00, 0x11, 0xa5, + 0x2e, 0x88, 0x56, 0x4c, 0xee, 0xdb, 0x07, 0xf6, 0xe1, 0xad, 0xe8, 0xee, 0xef, 0x9f, 0x0f, 0xee, + 0x68, 0xdc, 0xd4, 0xcf, 0x82, 0xed, 0x2c, 0xc8, 0x76, 0x87, 0x47, 0x64, 0xf0, 0x09, 0xd8, 0x35, + 0x0a, 0x91, 0x28, 0xb5, 0xfb, 0x18, 0xec, 0x34, 0x4c, 0x4a, 0x5c, 0x19, 0x81, 0xeb, 0x87, 0x37, + 0xa7, 0x13, 0x38, 0x5a, 0x82, 0x7f, 0x2d, 0xc1, 0x59, 0xab, 0xb3, 0xcd, 0x56, 0xd0, 0x80, 0x49, + 0x1a, 0xc5, 0xb3, 0xf1, 0x86, 0x39, 0xa6, 0xef, 0x99, 0x3a, 0xc5, 0x0a, 0xbb, 0x33, 0xe0, 0x0c, + 0x09, 0x18, 0x1b, 0x7b, 0xd3, 0x10, 0x5e, 0x31, 0x01, 0x98, 0xeb, 0x8e, 0x65, 0x86, 0xea, 0xba, + 0xc0, 0x29, 0xb1, 0xc2, 0xfb, 0xd7, 0x86, 0x4b, 0x32, 0x83, 0x1f, 0x9d, 0x00, 0x67, 0xd8, 0x70, + 0x11, 0xb8, 0x9f, 0xbf, 0x9e, 0x27, 0x45, 0x72, 0x9e, 0xc4, 0x67, 0x79, 0x52, 0xe4, 0xe7, 0xc5, + 0xd9, 0xcb, 0x57, 0xf3, 0x24, 0x4e, 0x5f, 0xa4, 0xc9, 0xe9, 0x6d, 0xcb, 0xdb, 0xfb, 0xfc, 0xf5, + 0x00, 0x6c, 0xa7, 0x9e, 0xf3, 0xe9, 0x9b, 0x6f, 0x45, 0x6f, 0xbf, 0xaf, 0x7c, 0x7b, 0xb9, 0xf2, + 0xed, 0x5f, 0x2b, 0xdf, 0xfe, 0xb2, 0xf6, 0xad, 0xe5, 0xda, 0xb7, 0x7e, 0xac, 0x7d, 0xeb, 0x4d, + 0x54, 0x71, 0x75, 0xd1, 0x13, 0x48, 0x45, 0x83, 0xa8, 0x90, 0x8d, 0x90, 0x88, 0x13, 0x1a, 0x56, + 0x02, 0x35, 0xa2, 0xec, 0x6b, 0x26, 0x87, 0xd2, 0x25, 0x9a, 0x3e, 0x0d, 0xb7, 0xc6, 0xc3, 0x4d, + 0xdf, 0xa6, 0x6c, 0x72, 0xc3, 0x64, 0x74, 0xfc, 0x27, 0x00, 0x00, 0xff, 0xff, 0x70, 0xa3, 0x00, + 0x15, 0x24, 0x02, 0x00, 0x00, } func (m *IBCTxRaw) Marshal() (dAtA []byte, err error) { @@ -370,36 +336,6 @@ func (m *IBCAccountPacketData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AccountAddress) 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 *AccountAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AccountAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { offset -= sovTypes(v) base := offset @@ -455,19 +391,6 @@ func (m *IBCAccountPacketData) Size() (n int) { return n } -func (m *AccountAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - func sovTypes(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -745,88 +668,6 @@ func (m *IBCAccountPacketData) Unmarshal(dAtA []byte) error { } return nil } -func (m *AccountAddress) 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 ErrIntOverflowTypes - } - 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: AccountAddress: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AccountAddress: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipTypes(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/proto/ibc/applications/interchain_accounts/v1/account.proto b/proto/ibc/applications/interchain_accounts/v1/account.proto new file mode 100644 index 00000000000..b63aec16133 --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/v1/account.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package ibc.applications.interchain_accounts.v1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types"; + +// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +message InterchainAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "InterchainAccountI"; + + cosmos.auth.v1beta1.BaseAccount base_account = 1 + [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; + string account_owner = 2 [(gogoproto.moretags) = "yaml:\"account_owner\""]; +} diff --git a/proto/ibc/applications/interchain_accounts/v1/genesis.proto b/proto/ibc/applications/interchain_accounts/v1/genesis.proto new file mode 100644 index 00000000000..3afb804eb69 --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/v1/genesis.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; +package ibc.applications.interchain_accounts.v1; + +option go_package = "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types"; + +import "gogoproto/gogo.proto"; + +// GenesisState defines the interchain_account genesis state +message GenesisState { + string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; +} diff --git a/proto/ibc/applications/interchain_accounts/v1/query.proto b/proto/ibc/applications/interchain_accounts/v1/query.proto new file mode 100644 index 00000000000..1787614df32 --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/v1/query.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package ibc.applications.interchain_accounts.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "ibc/applications/interchain_accounts/v1/account.proto"; + +option go_package = "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types"; + +// Query defines the gRPC querier service. +service Query { + // Query to get the address of an interchain account + rpc InterchainAccountAddress(QueryInterchainAccountAddressRequest) returns (QueryInterchainAccountAddressResponse) {} +} + +// Query request for an interchain account address +message QueryInterchainAccountAddressRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // Owner address is the owner of the interchain account on the controller chain + string owner_address = 1; + string connection_id = 2; +} + +// Query response for an interchain account address +message QueryInterchainAccountAddressResponse { + // The corresponding interchain account address on the host chain + string interchain_account_address = 1; +} diff --git a/proto/ibc/applications/interchain_accounts/v1/types.proto b/proto/ibc/applications/interchain_accounts/v1/types.proto new file mode 100644 index 00000000000..dc817a44963 --- /dev/null +++ b/proto/ibc/applications/interchain_accounts/v1/types.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package ibc.applications.interchain_accounts.v1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +option go_package = "github.com/cosmos/ibc-go/modules/apps/27-interchain-accounts/types"; + +// Raw tx body +message IBCTxRaw { + bytes body_bytes = 1 [(gogoproto.moretags) = "yaml:\"body_bytes\""]; +} + +// Body of a tx for an ics27 IBC packet +message IBCTxBody { + repeated google.protobuf.Any messages = 1; +} + +// The different types of interchain account transactions +// EXECUTE_TX is used when sending a TX from the controller side to the host side. The host side will execute the tx on +// behalf of the interchain account. +enum Type { + option (gogoproto.goproto_enum_prefix) = false; + // Execute message type + TYPE_EXECUTE_TX_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "EXECUTE_TX"]; +} + +// Packet data is comprised of raw transaction & type of transaction +message IBCAccountPacketData { + Type type = 1; + bytes data = 2; +} diff --git a/third_party/proto/cosmos/auth/v1beta1/auth.proto b/third_party/proto/cosmos/auth/v1beta1/auth.proto new file mode 100644 index 00000000000..79071456f6e --- /dev/null +++ b/third_party/proto/cosmos/auth/v1beta1/auth.proto @@ -0,0 +1,51 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// BaseAccount defines a base account type. It contains all the necessary fields +// for basic account functionality. Any custom account type should extend this +// type for additional functionality (e.g. vesting). +message BaseAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (gogoproto.equal) = false; + + option (cosmos_proto.implements_interface) = "AccountI"; + + string address = 1; + google.protobuf.Any pub_key = 2 + [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; + uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""]; + uint64 sequence = 4; +} + +// ModuleAccount defines an account for modules that holds coins on a pool. +message ModuleAccount { + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos_proto.implements_interface) = "ModuleAccountI"; + + BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; + string name = 2; + repeated string permissions = 3; +} + +// Params defines the parameters for the auth module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + uint64 max_memo_characters = 1 [(gogoproto.moretags) = "yaml:\"max_memo_characters\""]; + uint64 tx_sig_limit = 2 [(gogoproto.moretags) = "yaml:\"tx_sig_limit\""]; + uint64 tx_size_cost_per_byte = 3 [(gogoproto.moretags) = "yaml:\"tx_size_cost_per_byte\""]; + uint64 sig_verify_cost_ed25519 = 4 + [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; + uint64 sig_verify_cost_secp256k1 = 5 + [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; +} + diff --git a/third_party/proto/cosmos/auth/v1beta1/genesis.proto b/third_party/proto/cosmos/auth/v1beta1/genesis.proto new file mode 100644 index 00000000000..5d6823e6b35 --- /dev/null +++ b/third_party/proto/cosmos/auth/v1beta1/genesis.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/auth/v1beta1/auth.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// GenesisState defines the auth module's genesis state. +message GenesisState { + // params defines all the paramaters of the module. + Params params = 1 [(gogoproto.nullable) = false]; + + // accounts are the accounts present at genesis. + repeated google.protobuf.Any accounts = 2; +} + diff --git a/third_party/proto/cosmos/auth/v1beta1/query.proto b/third_party/proto/cosmos/auth/v1beta1/query.proto new file mode 100644 index 00000000000..2c438c7b5ed --- /dev/null +++ b/third_party/proto/cosmos/auth/v1beta1/query.proto @@ -0,0 +1,48 @@ +syntax = "proto3"; +package cosmos.auth.v1beta1; + +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/api/annotations.proto"; +import "cosmos/auth/v1beta1/auth.proto"; +import "cosmos_proto/cosmos.proto"; + +option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; + +// Query defines the gRPC querier service. +service Query { + // Account returns account details based on address. + rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; + } + + // Params queries all parameters. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmos/auth/v1beta1/params"; + } +} + +// QueryAccountRequest is the request type for the Query/Account RPC method. +message QueryAccountRequest { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + // address defines the address to query for. + string address = 1; +} + +// QueryAccountResponse is the response type for the Query/Account RPC method. +message QueryAccountResponse { + // account defines the account of the corresponding address. + google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; +} + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + diff --git a/third_party/proto/cosmos_proto/cosmos.proto b/third_party/proto/cosmos_proto/cosmos.proto new file mode 100644 index 00000000000..167b170757b --- /dev/null +++ b/third_party/proto/cosmos_proto/cosmos.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package cosmos_proto; + +import "google/protobuf/descriptor.proto"; + +option go_package = "github.com/regen-network/cosmos-proto"; + +extend google.protobuf.MessageOptions { + string interface_type = 93001; + + string implements_interface = 93002; +} + +extend google.protobuf.FieldOptions { + string accepts_interface = 93001; +}