From 2f29bc871ea30f25f9341b982378c3e13bf9923e Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Apr 2024 18:46:22 +0530 Subject: [PATCH 1/8] added token-balances api and cli query --- app/app.go | 2 +- proto/umee/ugov/v1/query.proto | 37 ++ x/ugov/client/cli/query.go | 31 ++ x/ugov/keeper/keeper.go | 23 +- x/ugov/keeper/query_server.go | 28 ++ x/ugov/query.pb.go | 851 +++++++++++++++++++++++++++++++-- x/ugov/query.pb.gw.go | 83 ++++ 7 files changed, 993 insertions(+), 62 deletions(-) diff --git a/app/app.go b/app/app.go index a831cb20a2..ea2643617a 100644 --- a/app/app.go +++ b/app/app.go @@ -465,7 +465,7 @@ func New( app.NFTKeeper = nftkeeper.NewKeeper(keys[nftkeeper.StoreKey], appCodec, app.AccountKeeper, app.BankKeeper) - app.UGovKeeperB = ugovkeeper.NewBuilder(appCodec, keys[ugov.ModuleName]) + app.UGovKeeperB = ugovkeeper.NewBuilder(appCodec, keys[ugov.ModuleName], app.BankKeeper) app.OracleKeeper = oraclekeeper.NewKeeper( appCodec, diff --git a/proto/umee/ugov/v1/query.proto b/proto/umee/ugov/v1/query.proto index 6470524160..4a2747688a 100644 --- a/proto/umee/ugov/v1/query.proto +++ b/proto/umee/ugov/v1/query.proto @@ -6,6 +6,8 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "amino/amino.proto"; import "umee/ugov/v1/ugov.proto"; @@ -34,6 +36,41 @@ service Query { rpc InflationCycleEnd(QueryInflationCycleEnd) returns (QueryInflationCycleEndResponse) { option (google.api.http).get = "/umee/ugov/v1/inflation_cycle_end"; } + + // Token Balances queries for all account addresses that own a particular token + // denomination. + rpc TokenBalances(QueryTokenBalances) returns (QueryTokenBalancesResponse){ + option (google.api.http).get = "/umee/ugov/v1/token_balances"; + } +} + +// which queries for a paginated set of all account holders of a particular +// denomination. +message QueryTokenBalances{ + // denom defines the coin denomination to query all account holders for. + string denom = 1; + int64 height = 2; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 3; +} + +// QueryDenomOwnersResponse defines the RPC response of a TokenBalances RPC query. +message QueryTokenBalancesResponse { + repeated DenomOwner denom_owners = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +// +message DenomOwner { + // address defines the address that owns a particular denomination. + string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // balance is the balance of the denominated coin for an account. + cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; } // QueryMinGasPrice is a request type. diff --git a/x/ugov/client/cli/query.go b/x/ugov/client/cli/query.go index 43dec209b6..37c4e865c3 100644 --- a/x/ugov/client/cli/query.go +++ b/x/ugov/client/cli/query.go @@ -25,6 +25,7 @@ func GetQueryCmd() *cobra.Command { QueryInflationParams(), QueryInflationCyleEnd(), QueryEmergencyGroup(), + QueryTokenBalances(), ) return cmd @@ -121,3 +122,33 @@ func QueryInflationCyleEnd() *cobra.Command { return cmd } + +// QueryTokenBalances creates the Query/TokenBalances CLI. +func QueryTokenBalances() *cobra.Command { + cmd := &cobra.Command{ + Use: "token-balances [denom]", + Args: cobra.ExactArgs(1), + Short: "Queries for all account addresses that own a particular token denomination.", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := ugov.NewQueryClient(clientCtx) + resp, err := queryClient.TokenBalances(cmd.Context(), &ugov.QueryTokenBalances{ + Denom: args[0], + Pagination: pageReq, + }) + return cli.PrintOrErr(resp, err, clientCtx) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "token-balances") + + return cmd +} diff --git a/x/ugov/keeper/keeper.go b/x/ugov/keeper/keeper.go index af69ab95dd..8ff100fe50 100644 --- a/x/ugov/keeper/keeper.go +++ b/x/ugov/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/umee-network/umee/v6/x/ugov" ) @@ -11,23 +12,26 @@ var _ ugov.Keeper = Keeper{} // Builder constructs Keeper by perparing all related dependencies (notably the store). type Builder struct { - storeKey storetypes.StoreKey - Cdc codec.BinaryCodec + storeKey storetypes.StoreKey + Cdc codec.BinaryCodec + BankKeeper keeper.BaseKeeper } func NewBuilder( - cdc codec.BinaryCodec, key storetypes.StoreKey, + cdc codec.BinaryCodec, key storetypes.StoreKey, bk keeper.BaseKeeper, ) Builder { return Builder{ - Cdc: cdc, - storeKey: key, + Cdc: cdc, + storeKey: key, + BankKeeper: bk, } } func (kb Builder) Keeper(ctx *sdk.Context) ugov.Keeper { return Keeper{ - store: ctx.KVStore(kb.storeKey), - cdc: kb.Cdc, + store: ctx.KVStore(kb.storeKey), + cdc: kb.Cdc, + BankKeeper: kb.BankKeeper, } } @@ -38,6 +42,7 @@ func (kb Builder) EmergencyGroup(ctx *sdk.Context) ugov.WithEmergencyGroup { ret // Keeper provides a light interface for module data access and transformation type Keeper struct { - store sdk.KVStore - cdc codec.BinaryCodec + store sdk.KVStore + cdc codec.BinaryCodec + BankKeeper keeper.BaseKeeper } diff --git a/x/ugov/keeper/query_server.go b/x/ugov/keeper/query_server.go index 1f66927bff..844f91b9a7 100644 --- a/x/ugov/keeper/query_server.go +++ b/x/ugov/keeper/query_server.go @@ -4,6 +4,8 @@ import ( context "context" sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/umee-network/umee/v6/x/ugov" ) @@ -49,3 +51,29 @@ func (q Querier) InflationCycleEnd(ctx context.Context, _ *ugov.QueryInflationCy cycleEndTime := q.Keeper(&sdkCtx).InflationCycleEnd() return &ugov.QueryInflationCycleEndResponse{End: &cycleEndTime}, nil } + +// TokenBalances implements ugov.QueryServer. +func (q Querier) TokenBalances(ctx context.Context, req *ugov.QueryTokenBalances) (*ugov.QueryTokenBalancesResponse, + error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if req.Height != 0 { + sdkCtx = sdkCtx.WithBlockHeight(req.Height) + } + resp, err := q.BankKeeper.DenomOwners(sdk.WrapSDKContext(sdkCtx), &banktypes.QueryDenomOwnersRequest{ + Denom: req.Denom, + Pagination: req.Pagination, + }) + if err != nil { + return nil, err + } + + denomsOwners := make([]*ugov.DenomOwner, 0) + for _, v := range resp.DenomOwners { + denomsOwners = append(denomsOwners, &ugov.DenomOwner{ + Address: v.Address, + Balance: v.Balance, + }) + } + + return &ugov.QueryTokenBalancesResponse{Pagination: resp.Pagination, DenomOwners: denomsOwners}, nil +} diff --git a/x/ugov/query.pb.go b/x/ugov/query.pb.go index df7406236a..f250a343f5 100644 --- a/x/ugov/query.pb.go +++ b/x/ugov/query.pb.go @@ -8,6 +8,8 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -35,6 +37,132 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// which queries for a paginated set of all account holders of a particular +// denomination. +type QueryTokenBalances struct { + // denom defines the coin denomination to query all account holders for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTokenBalances) Reset() { *m = QueryTokenBalances{} } +func (m *QueryTokenBalances) String() string { return proto.CompactTextString(m) } +func (*QueryTokenBalances) ProtoMessage() {} +func (*QueryTokenBalances) Descriptor() ([]byte, []int) { + return fileDescriptor_25fa04679024a47d, []int{0} +} +func (m *QueryTokenBalances) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenBalances) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenBalances.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 *QueryTokenBalances) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenBalances.Merge(m, src) +} +func (m *QueryTokenBalances) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenBalances) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenBalances.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenBalances proto.InternalMessageInfo + +// QueryDenomOwnersResponse defines the RPC response of a TokenBalances RPC query. +type QueryTokenBalancesResponse struct { + DenomOwners []*DenomOwner `protobuf:"bytes,1,rep,name=denom_owners,json=denomOwners,proto3" json:"denom_owners,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTokenBalancesResponse) Reset() { *m = QueryTokenBalancesResponse{} } +func (m *QueryTokenBalancesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTokenBalancesResponse) ProtoMessage() {} +func (*QueryTokenBalancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_25fa04679024a47d, []int{1} +} +func (m *QueryTokenBalancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenBalancesResponse.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 *QueryTokenBalancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenBalancesResponse.Merge(m, src) +} +func (m *QueryTokenBalancesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenBalancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenBalancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenBalancesResponse proto.InternalMessageInfo + +// DenomOwner defines structure representing an account that owns or holds a +// particular denominated token. It contains the account address and account +// balance of the denominated token. +type DenomOwner struct { + // address defines the address that owns a particular denomination. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // balance is the balance of the denominated coin for an account. + Balance types.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` +} + +func (m *DenomOwner) Reset() { *m = DenomOwner{} } +func (m *DenomOwner) String() string { return proto.CompactTextString(m) } +func (*DenomOwner) ProtoMessage() {} +func (*DenomOwner) Descriptor() ([]byte, []int) { + return fileDescriptor_25fa04679024a47d, []int{2} +} +func (m *DenomOwner) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DenomOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DenomOwner.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 *DenomOwner) XXX_Merge(src proto.Message) { + xxx_messageInfo_DenomOwner.Merge(m, src) +} +func (m *DenomOwner) XXX_Size() int { + return m.Size() +} +func (m *DenomOwner) XXX_DiscardUnknown() { + xxx_messageInfo_DenomOwner.DiscardUnknown(m) +} + +var xxx_messageInfo_DenomOwner proto.InternalMessageInfo + // QueryMinGasPrice is a request type. type QueryMinGasPrice struct { } @@ -43,7 +171,7 @@ func (m *QueryMinGasPrice) Reset() { *m = QueryMinGasPrice{} } func (m *QueryMinGasPrice) String() string { return proto.CompactTextString(m) } func (*QueryMinGasPrice) ProtoMessage() {} func (*QueryMinGasPrice) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{0} + return fileDescriptor_25fa04679024a47d, []int{3} } func (m *QueryMinGasPrice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -81,7 +209,7 @@ func (m *QueryMinGasPriceResponse) Reset() { *m = QueryMinGasPriceRespon func (m *QueryMinGasPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryMinGasPriceResponse) ProtoMessage() {} func (*QueryMinGasPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{1} + return fileDescriptor_25fa04679024a47d, []int{4} } func (m *QueryMinGasPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -118,7 +246,7 @@ func (m *QueryEmergencyGroup) Reset() { *m = QueryEmergencyGroup{} } func (m *QueryEmergencyGroup) String() string { return proto.CompactTextString(m) } func (*QueryEmergencyGroup) ProtoMessage() {} func (*QueryEmergencyGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{2} + return fileDescriptor_25fa04679024a47d, []int{5} } func (m *QueryEmergencyGroup) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,7 +284,7 @@ func (m *QueryEmergencyGroupResponse) Reset() { *m = QueryEmergencyGroup func (m *QueryEmergencyGroupResponse) String() string { return proto.CompactTextString(m) } func (*QueryEmergencyGroupResponse) ProtoMessage() {} func (*QueryEmergencyGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{3} + return fileDescriptor_25fa04679024a47d, []int{6} } func (m *QueryEmergencyGroupResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -193,7 +321,7 @@ func (m *QueryInflationParams) Reset() { *m = QueryInflationParams{} } func (m *QueryInflationParams) String() string { return proto.CompactTextString(m) } func (*QueryInflationParams) ProtoMessage() {} func (*QueryInflationParams) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{4} + return fileDescriptor_25fa04679024a47d, []int{7} } func (m *QueryInflationParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -231,7 +359,7 @@ func (m *QueryInflationParamsResponse) Reset() { *m = QueryInflationPara func (m *QueryInflationParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryInflationParamsResponse) ProtoMessage() {} func (*QueryInflationParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{5} + return fileDescriptor_25fa04679024a47d, []int{8} } func (m *QueryInflationParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -268,7 +396,7 @@ func (m *QueryInflationCycleEnd) Reset() { *m = QueryInflationCycleEnd{} func (m *QueryInflationCycleEnd) String() string { return proto.CompactTextString(m) } func (*QueryInflationCycleEnd) ProtoMessage() {} func (*QueryInflationCycleEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{6} + return fileDescriptor_25fa04679024a47d, []int{9} } func (m *QueryInflationCycleEnd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -306,7 +434,7 @@ func (m *QueryInflationCycleEndResponse) Reset() { *m = QueryInflationCy func (m *QueryInflationCycleEndResponse) String() string { return proto.CompactTextString(m) } func (*QueryInflationCycleEndResponse) ProtoMessage() {} func (*QueryInflationCycleEndResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{7} + return fileDescriptor_25fa04679024a47d, []int{10} } func (m *QueryInflationCycleEndResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -336,6 +464,9 @@ func (m *QueryInflationCycleEndResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryInflationCycleEndResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*QueryTokenBalances)(nil), "umee.ugov.v1.QueryTokenBalances") + proto.RegisterType((*QueryTokenBalancesResponse)(nil), "umee.ugov.v1.QueryTokenBalancesResponse") + proto.RegisterType((*DenomOwner)(nil), "umee.ugov.v1.DenomOwner") proto.RegisterType((*QueryMinGasPrice)(nil), "umee.ugov.v1.QueryMinGasPrice") proto.RegisterType((*QueryMinGasPriceResponse)(nil), "umee.ugov.v1.QueryMinGasPriceResponse") proto.RegisterType((*QueryEmergencyGroup)(nil), "umee.ugov.v1.QueryEmergencyGroup") @@ -349,45 +480,59 @@ func init() { func init() { proto.RegisterFile("umee/ugov/v1/query.proto", fileDescriptor_25fa04679024a47d) } var fileDescriptor_25fa04679024a47d = []byte{ - // 598 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x6f, 0xd3, 0x40, - 0x10, 0x8d, 0xa1, 0x54, 0xb0, 0x85, 0x16, 0x96, 0x52, 0x82, 0x9b, 0x6c, 0x5a, 0x17, 0x22, 0x8a, - 0xe8, 0xae, 0x52, 0xa4, 0x5e, 0x38, 0x35, 0x6d, 0xa9, 0x38, 0x20, 0x95, 0xc0, 0x01, 0xc1, 0x21, - 0xd8, 0xce, 0xd6, 0xac, 0x88, 0x77, 0x8d, 0x3f, 0x02, 0xe1, 0x88, 0xc4, 0x81, 0x5b, 0x05, 0x7f, - 0x83, 0x23, 0x3f, 0x22, 0xc7, 0x0a, 0x2e, 0x9c, 0x0a, 0x24, 0xfc, 0x10, 0xe4, 0xf5, 0xda, 0x8a, - 0x4d, 0x68, 0xb9, 0x79, 0xe7, 0xbd, 0x99, 0xf7, 0xc6, 0x6f, 0x40, 0x39, 0x72, 0x29, 0x25, 0x91, - 0x23, 0x7a, 0xa4, 0xd7, 0x20, 0x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 0xa2, 0x70, 0x26, 0xf0, 0x83, 0x06, 0xe6, 0x0a, 0x19, 0x41, 0x63, 0x82, 0x4a, 0x81, 0xa3, 0xdf, - 0x3a, 0x99, 0x93, 0x59, 0xa9, 0x4b, 0x2b, 0x4b, 0x10, 0xe5, 0xad, 0xb0, 0x94, 0xde, 0x4e, 0xae, - 0x01, 0x7e, 0xd4, 0xc0, 0xa5, 0xbf, 0xf2, 0x86, 0xd7, 0x8f, 0x53, 0x4a, 0x59, 0xfa, 0xed, 0xff, - 0x61, 0x65, 0x8e, 0x56, 0xa5, 0xa3, 0x15, 0xb8, 0xfc, 0x2f, 0x47, 0x76, 0xdc, 0xd1, 0xa6, 0xbc, - 0xd3, 0xdc, 0x1e, 0xfc, 0x42, 0xa5, 0xc1, 0x10, 0x69, 0x87, 0x43, 0xa4, 0xfd, 0x1c, 0x22, 0xed, - 0x60, 0x84, 0x4a, 0x87, 0x23, 0x54, 0xfa, 0x3e, 0x42, 0xa5, 0xa7, 0x75, 0x87, 0x85, 0x2f, 0x22, - 0x0b, 0xdb, 0xc2, 0x95, 0xa3, 0xd6, 0x38, 0x0d, 0x5f, 0x0b, 0xff, 0x65, 0x32, 0xb7, 0xb7, 0x41, - 0xde, 0xc8, 0xe1, 0xd6, 0xb4, 0xbc, 0xcb, 0x3b, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x94, - 0xa4, 0x3e, 0x28, 0x05, 0x00, 0x00, + // 827 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x4f, 0x3b, 0x45, + 0x18, 0xc7, 0x3b, 0x54, 0x40, 0xa6, 0xfc, 0x91, 0xb1, 0xe2, 0xb2, 0x94, 0x6d, 0x59, 0xb0, 0x16, + 0x22, 0xbb, 0x69, 0x4d, 0xb8, 0x98, 0x98, 0x50, 0xfe, 0xc5, 0x83, 0x11, 0x57, 0x0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84, 0xfe, 0x13, 0x80, 0xe8, 0xd3, 0xa8, 0xdd, 0x09, 0x3b, 0x27, 0xb4, + 0x8e, 0xdb, 0x98, 0xda, 0x24, 0x40, 0x79, 0x38, 0xd9, 0x22, 0x94, 0x79, 0x0a, 0x28, 0x81, 0xca, + 0x8c, 0x15, 0x2f, 0xd0, 0x12, 0x9c, 0x3a, 0x23, 0xae, 0x73, 0x16, 0x2a, 0x13, 0x25, 0x50, 0xc9, + 0x5a, 0x62, 0x85, 0x0e, 0x21, 0x7c, 0x84, 0x50, 0xb2, 0x25, 0x50, 0xc9, 0xd5, 0xca, 0x86, 0x38, + 0x94, 0x88, 0xd8, 0x88, 0x0f, 0x5a, 0x10, 0x1b, 0xc7, 0xd8, 0x21, 0x16, 0xb9, 0xe8, 0x92, 0x20, + 0xb4, 0x06, 0x2a, 0xf5, 0x5f, 0x01, 0x54, 0x9f, 0xc2, 0x58, 0x24, 0xe8, 0x30, 0x1a, 0x10, 0xf4, + 0x01, 0x9c, 0xe5, 0x1c, 0x0d, 0x76, 0x49, 0x89, 0x1f, 0x28, 0xa0, 0x94, 0xad, 0xe4, 0x6a, 0x8a, + 0x31, 0x38, 0x38, 0x63, 0x3f, 0x52, 0x7c, 0x12, 0x09, 0xac, 0x5c, 0x2b, 0xfd, 0x1f, 0xa0, 0x23, + 0x89, 0x71, 0x82, 0x33, 0xbe, 0x3b, 0x96, 0x31, 0x76, 0x96, 0x20, 0xbf, 0x05, 0x10, 0x3e, 0x9a, + 0xa0, 0x1a, 0x9c, 0xc6, 0xad, 0x96, 0x4f, 0x82, 0x20, 0x3e, 0xab, 0xba, 0xf2, 0xc7, 0xef, 0xdb, + 0x79, 0xd1, 0x77, 0x37, 0xce, 0x7c, 0x16, 0xfa, 0x2e, 0x75, 0xac, 0x44, 0x88, 0x3e, 0x84, 0xd3, + 0xcd, 0x78, 0x73, 0x02, 0x64, 0x59, 0x02, 0x49, 0x10, 0xf6, 0x98, 0x4b, 0xeb, 0x33, 0xfd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0x3d, 0x68, 0x99, 0x2f, 0xca, + 0x8e, 0x1b, 0x9e, 0x75, 0x9b, 0x86, 0xcd, 0x3c, 0xde, 0x65, 0x9b, 0x92, 0xf0, 0x92, 0xf9, 0xe7, + 0x71, 0xcb, 0xde, 0x8e, 0xf9, 0x35, 0xef, 0xdb, 0x9c, 0xe2, 0x6f, 0xe3, 0xfd, 0x17, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x6b, 0xb0, 0x89, 0x9c, 0xa0, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -410,6 +555,9 @@ type QueryClient interface { InflationParams(ctx context.Context, in *QueryInflationParams, opts ...grpc.CallOption) (*QueryInflationParamsResponse, error) // InflationCycleEnd returns inflation cycle end time InflationCycleEnd(ctx context.Context, in *QueryInflationCycleEnd, opts ...grpc.CallOption) (*QueryInflationCycleEndResponse, error) + // Token Balances queries for all account addresses that own a particular token + // denomination. + TokenBalances(ctx context.Context, in *QueryTokenBalances, opts ...grpc.CallOption) (*QueryTokenBalancesResponse, error) } type queryClient struct { @@ -456,6 +604,15 @@ func (c *queryClient) InflationCycleEnd(ctx context.Context, in *QueryInflationC return out, nil } +func (c *queryClient) TokenBalances(ctx context.Context, in *QueryTokenBalances, opts ...grpc.CallOption) (*QueryTokenBalancesResponse, error) { + out := new(QueryTokenBalancesResponse) + err := c.cc.Invoke(ctx, "/umee.ugov.v1.Query/TokenBalances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // MinGasPrice returns minimum transaction fees. @@ -466,6 +623,9 @@ type QueryServer interface { InflationParams(context.Context, *QueryInflationParams) (*QueryInflationParamsResponse, error) // InflationCycleEnd returns inflation cycle end time InflationCycleEnd(context.Context, *QueryInflationCycleEnd) (*QueryInflationCycleEndResponse, error) + // Token Balances queries for all account addresses that own a particular token + // denomination. + TokenBalances(context.Context, *QueryTokenBalances) (*QueryTokenBalancesResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -484,6 +644,9 @@ func (*UnimplementedQueryServer) InflationParams(ctx context.Context, req *Query func (*UnimplementedQueryServer) InflationCycleEnd(ctx context.Context, req *QueryInflationCycleEnd) (*QueryInflationCycleEndResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InflationCycleEnd not implemented") } +func (*UnimplementedQueryServer) TokenBalances(ctx context.Context, req *QueryTokenBalances) (*QueryTokenBalancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenBalances not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -561,6 +724,24 @@ func _Query_InflationCycleEnd_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_TokenBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenBalances) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenBalances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.ugov.v1.Query/TokenBalances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenBalances(ctx, req.(*QueryTokenBalances)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "umee.ugov.v1.Query", HandlerType: (*QueryServer)(nil), @@ -581,11 +762,151 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "InflationCycleEnd", Handler: _Query_InflationCycleEnd_Handler, }, + { + MethodName: "TokenBalances", + Handler: _Query_TokenBalances_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/ugov/v1/query.proto", } +func (m *QueryTokenBalances) 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 *QueryTokenBalances) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenBalances) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryTokenBalancesResponse) 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 *QueryTokenBalancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenBalancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.DenomOwners) > 0 { + for iNdEx := len(m.DenomOwners) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DenomOwners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DenomOwner) 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 *DenomOwner) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + 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))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryMinGasPrice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -795,12 +1116,12 @@ func (m *QueryInflationCycleEndResponse) MarshalToSizedBuffer(dAtA []byte) (int, var l int _ = l if m.End != nil { - n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.End):]) - if err3 != nil { - return 0, err3 + n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.End):]) + if err6 != nil { + return 0, err6 } - i -= n3 - i = encodeVarintQuery(dAtA, i, uint64(n3)) + i -= n6 + i = encodeVarintQuery(dAtA, i, uint64(n6)) i-- dAtA[i] = 0xa } @@ -818,6 +1139,60 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryTokenBalances) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryTokenBalancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DenomOwners) > 0 { + for _, e := range m.DenomOwners { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *DenomOwner) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = m.Balance.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryMinGasPrice) Size() (n int) { if m == nil { return 0 @@ -908,6 +1283,378 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryTokenBalances) 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 ErrIntOverflowQuery + } + 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: QueryTokenBalances: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenBalances: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTokenBalancesResponse) 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 ErrIntOverflowQuery + } + 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: QueryTokenBalancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DenomOwners", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DenomOwners = append(m.DenomOwners, &DenomOwner{}) + if err := m.DenomOwners[len(m.DenomOwners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DenomOwner) 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 ErrIntOverflowQuery + } + 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: DenomOwner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DenomOwner: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Balance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryMinGasPrice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ugov/query.pb.gw.go b/x/ugov/query.pb.gw.go index 9861335ca1..d3869ca4af 100644 --- a/x/ugov/query.pb.gw.go +++ b/x/ugov/query.pb.gw.go @@ -105,6 +105,42 @@ func local_request_Query_InflationCycleEnd_0(ctx context.Context, marshaler runt } +var ( + filter_Query_TokenBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_TokenBalances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenBalances + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TokenBalances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TokenBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TokenBalances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenBalances + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TokenBalances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TokenBalances(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -203,6 +239,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TokenBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TokenBalances_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TokenBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -324,6 +383,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TokenBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TokenBalances_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TokenBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -335,6 +414,8 @@ var ( pattern_Query_InflationParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "inflation_params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_InflationCycleEnd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "inflation_cycle_end"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TokenBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "token_balances"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -345,4 +426,6 @@ var ( forward_Query_InflationParams_0 = runtime.ForwardResponseMessage forward_Query_InflationCycleEnd_0 = runtime.ForwardResponseMessage + + forward_Query_TokenBalances_0 = runtime.ForwardResponseMessage ) From d1cfa64fed1d13aca9bb76792dff8f6f9797bda7 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Apr 2024 18:55:39 +0530 Subject: [PATCH 2/8] renamed DenomOwner to TokenBalance --- proto/umee/ugov/v1/query.proto | 6 +- x/ugov/keeper/query_server.go | 6 +- x/ugov/query.pb.go | 167 ++++++++++++++++----------------- 3 files changed, 89 insertions(+), 90 deletions(-) diff --git a/proto/umee/ugov/v1/query.proto b/proto/umee/ugov/v1/query.proto index 4a2747688a..21001dfe4f 100644 --- a/proto/umee/ugov/v1/query.proto +++ b/proto/umee/ugov/v1/query.proto @@ -56,16 +56,16 @@ message QueryTokenBalances{ // QueryDenomOwnersResponse defines the RPC response of a TokenBalances RPC query. message QueryTokenBalancesResponse { - repeated DenomOwner denom_owners = 1; + repeated TokenBalance token_balances = 1; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } -// DenomOwner defines structure representing an account that owns or holds a +// TokenBalance defines structure representing an account that owns or holds a // particular denominated token. It contains the account address and account // balance of the denominated token. // -message DenomOwner { +message TokenBalance { // address defines the address that owns a particular denomination. string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; diff --git a/x/ugov/keeper/query_server.go b/x/ugov/keeper/query_server.go index 844f91b9a7..a8f319b3ed 100644 --- a/x/ugov/keeper/query_server.go +++ b/x/ugov/keeper/query_server.go @@ -67,13 +67,13 @@ func (q Querier) TokenBalances(ctx context.Context, req *ugov.QueryTokenBalances return nil, err } - denomsOwners := make([]*ugov.DenomOwner, 0) + tb := make([]*ugov.TokenBalance, 0) for _, v := range resp.DenomOwners { - denomsOwners = append(denomsOwners, &ugov.DenomOwner{ + tb = append(tb, &ugov.TokenBalance{ Address: v.Address, Balance: v.Balance, }) } - return &ugov.QueryTokenBalancesResponse{Pagination: resp.Pagination, DenomOwners: denomsOwners}, nil + return &ugov.QueryTokenBalancesResponse{Pagination: resp.Pagination, TokenBalances: tb}, nil } diff --git a/x/ugov/query.pb.go b/x/ugov/query.pb.go index f250a343f5..c7f861de2a 100644 --- a/x/ugov/query.pb.go +++ b/x/ugov/query.pb.go @@ -82,7 +82,7 @@ var xxx_messageInfo_QueryTokenBalances proto.InternalMessageInfo // QueryDenomOwnersResponse defines the RPC response of a TokenBalances RPC query. type QueryTokenBalancesResponse struct { - DenomOwners []*DenomOwner `protobuf:"bytes,1,rep,name=denom_owners,json=denomOwners,proto3" json:"denom_owners,omitempty"` + TokenBalances []*TokenBalance `protobuf:"bytes,1,rep,name=token_balances,json=tokenBalances,proto3" json:"token_balances,omitempty"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } @@ -120,28 +120,28 @@ func (m *QueryTokenBalancesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryTokenBalancesResponse proto.InternalMessageInfo -// DenomOwner defines structure representing an account that owns or holds a +// TokenBalance defines structure representing an account that owns or holds a // particular denominated token. It contains the account address and account // balance of the denominated token. -type DenomOwner struct { +type TokenBalance struct { // address defines the address that owns a particular denomination. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // balance is the balance of the denominated coin for an account. Balance types.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` } -func (m *DenomOwner) Reset() { *m = DenomOwner{} } -func (m *DenomOwner) String() string { return proto.CompactTextString(m) } -func (*DenomOwner) ProtoMessage() {} -func (*DenomOwner) Descriptor() ([]byte, []int) { +func (m *TokenBalance) Reset() { *m = TokenBalance{} } +func (m *TokenBalance) String() string { return proto.CompactTextString(m) } +func (*TokenBalance) ProtoMessage() {} +func (*TokenBalance) Descriptor() ([]byte, []int) { return fileDescriptor_25fa04679024a47d, []int{2} } -func (m *DenomOwner) XXX_Unmarshal(b []byte) error { +func (m *TokenBalance) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DenomOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TokenBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DenomOwner.Marshal(b, m, deterministic) + return xxx_messageInfo_TokenBalance.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -151,17 +151,17 @@ func (m *DenomOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *DenomOwner) XXX_Merge(src proto.Message) { - xxx_messageInfo_DenomOwner.Merge(m, src) +func (m *TokenBalance) XXX_Merge(src proto.Message) { + xxx_messageInfo_TokenBalance.Merge(m, src) } -func (m *DenomOwner) XXX_Size() int { +func (m *TokenBalance) XXX_Size() int { return m.Size() } -func (m *DenomOwner) XXX_DiscardUnknown() { - xxx_messageInfo_DenomOwner.DiscardUnknown(m) +func (m *TokenBalance) XXX_DiscardUnknown() { + xxx_messageInfo_TokenBalance.DiscardUnknown(m) } -var xxx_messageInfo_DenomOwner proto.InternalMessageInfo +var xxx_messageInfo_TokenBalance proto.InternalMessageInfo // QueryMinGasPrice is a request type. type QueryMinGasPrice struct { @@ -466,7 +466,7 @@ var xxx_messageInfo_QueryInflationCycleEndResponse proto.InternalMessageInfo func init() { proto.RegisterType((*QueryTokenBalances)(nil), "umee.ugov.v1.QueryTokenBalances") proto.RegisterType((*QueryTokenBalancesResponse)(nil), "umee.ugov.v1.QueryTokenBalancesResponse") - proto.RegisterType((*DenomOwner)(nil), "umee.ugov.v1.DenomOwner") + proto.RegisterType((*TokenBalance)(nil), "umee.ugov.v1.TokenBalance") proto.RegisterType((*QueryMinGasPrice)(nil), "umee.ugov.v1.QueryMinGasPrice") proto.RegisterType((*QueryMinGasPriceResponse)(nil), "umee.ugov.v1.QueryMinGasPriceResponse") proto.RegisterType((*QueryEmergencyGroup)(nil), "umee.ugov.v1.QueryEmergencyGroup") @@ -480,59 +480,58 @@ func init() { func init() { proto.RegisterFile("umee/ugov/v1/query.proto", fileDescriptor_25fa04679024a47d) } var fileDescriptor_25fa04679024a47d = []byte{ - // 827 bytes of a gzipped FileDescriptorProto + // 813 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x4f, 0x3b, 0x45, - 0x18, 0xc7, 0x3b, 0x54, 0x40, 0xa6, 0xfc, 0x91, 0xb1, 0xe2, 0xb2, 0x94, 0x6d, 0x59, 0xb0, 0x16, - 0x22, 0x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 0x65, 0x26, 0xff, 0x15, 0xa1, 0xb7, 0xa5, - 0x6d, 0xf3, 0x4d, 0xf2, 0x84, 0xfe, 0x13, 0x80, 0xe8, 0xd3, 0xa8, 0xdd, 0x09, 0x3b, 0x27, 0xb4, - 0x8e, 0xdb, 0x98, 0xda, 0x24, 0x40, 0x79, 0x38, 0xd9, 0x22, 0x94, 0x79, 0x0a, 0x28, 0x81, 0xca, - 0x8c, 0x15, 0x2f, 0xd0, 0x12, 0x9c, 0x3a, 0x23, 0xae, 0x73, 0x16, 0x2a, 0x13, 0x25, 0x50, 0xc9, - 0x5a, 0x62, 0x85, 0x0e, 0x21, 0x7c, 0x84, 0x50, 0xb2, 0x25, 0x50, 0xc9, 0xd5, 0xca, 0x86, 0x38, - 0x94, 0x88, 0xd8, 0x88, 0x0f, 0x5a, 0x10, 0x1b, 0xc7, 0xd8, 0x21, 0x16, 0xb9, 0xe8, 0x92, 0x20, - 0xb4, 0x06, 0x2a, 0xf5, 0x5f, 0x01, 0x54, 0x9f, 0xc2, 0x58, 0x24, 0xe8, 0x30, 0x1a, 0x10, 0xf4, - 0x01, 0x9c, 0xe5, 0x1c, 0x0d, 0x76, 0x49, 0x89, 0x1f, 0x28, 0xa0, 0x94, 0xad, 0xe4, 0x6a, 0x8a, - 0x31, 0x38, 0x38, 0x63, 0x3f, 0x52, 0x7c, 0x12, 0x09, 0xac, 0x5c, 0x2b, 0xfd, 0x1f, 0xa0, 0x23, - 0x89, 0x71, 0x82, 0x33, 0xbe, 0x3b, 0x96, 0x31, 0x76, 0x96, 0x20, 0xbf, 0x05, 0x10, 0x3e, 0x9a, - 0xa0, 0x1a, 0x9c, 0xc6, 0xad, 0x96, 0x4f, 0x82, 0x20, 0x3e, 0xab, 0xba, 0xf2, 0xc7, 0xef, 0xdb, - 0x79, 0xd1, 0x77, 0x37, 0xce, 0x7c, 0x16, 0xfa, 0x2e, 0x75, 0xac, 0x44, 0x88, 0x3e, 0x84, 0xd3, - 0xcd, 0x78, 0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0x00, 0x97, 0x9e, + 0xcd, 0x1b, 0x6d, 0xbe, 0xe4, 0x94, 0xa8, 0xd4, 0xf7, 0xfe, 0x8f, 0x2a, 0x25, 0xda, 0xe2, 0x44, + 0x1b, 0x68, 0xfd, 0xbf, 0x88, 0xec, 0xa8, 0xa2, 0x45, 0x68, 0x07, 0x7d, 0x0b, 0xe0, 0xbc, 0xfc, + 0x01, 0xaf, 0x8c, 0xb1, 0x92, 0x14, 0x6a, 0x6d, 0x92, 0x22, 0x05, 0xd9, 0xe4, 0x20, 0x1a, 0x2a, + 0xc9, 0x20, 0xf2, 0xb7, 0xb8, 0x79, 0x30, 0xfc, 0x53, 0xcb, 0x0d, 0x1f, 0x35, 0x70, 0xff, 0xa8, + 0x81, 0x3f, 0x1e, 0x35, 0x70, 0xf3, 0xa4, 0xe5, 0xee, 0x9f, 0xb4, 0xdc, 0x6f, 0x4f, 0x5a, 0xee, + 0xf3, 0xaa, 0xe3, 0x86, 0xe7, 0xfd, 0xb6, 0x61, 0x33, 0x8f, 0x77, 0xd9, 0xa1, 0x24, 0xfc, 0x8a, + 0xf9, 0x17, 0x71, 0xcb, 0xc1, 0xae, 0xf9, 0x35, 0xef, 0xdb, 0x9e, 0xe1, 0x6f, 0xe3, 0xfd, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x49, 0xd6, 0xa4, 0x28, 0xa8, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -850,10 +849,10 @@ func (m *QueryTokenBalancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, err i-- dAtA[i] = 0x12 } - if len(m.DenomOwners) > 0 { - for iNdEx := len(m.DenomOwners) - 1; iNdEx >= 0; iNdEx-- { + if len(m.TokenBalances) > 0 { + for iNdEx := len(m.TokenBalances) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.DenomOwners[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TokenBalances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -867,7 +866,7 @@ func (m *QueryTokenBalancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *DenomOwner) Marshal() (dAtA []byte, err error) { +func (m *TokenBalance) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -877,12 +876,12 @@ func (m *DenomOwner) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DenomOwner) MarshalTo(dAtA []byte) (int, error) { +func (m *TokenBalance) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DenomOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TokenBalance) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1165,8 +1164,8 @@ func (m *QueryTokenBalancesResponse) Size() (n int) { } var l int _ = l - if len(m.DenomOwners) > 0 { - for _, e := range m.DenomOwners { + if len(m.TokenBalances) > 0 { + for _, e := range m.TokenBalances { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } @@ -1178,7 +1177,7 @@ func (m *QueryTokenBalancesResponse) Size() (n int) { return n } -func (m *DenomOwner) Size() (n int) { +func (m *TokenBalance) Size() (n int) { if m == nil { return 0 } @@ -1451,7 +1450,7 @@ func (m *QueryTokenBalancesResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DenomOwners", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenBalances", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1478,8 +1477,8 @@ func (m *QueryTokenBalancesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DenomOwners = append(m.DenomOwners, &DenomOwner{}) - if err := m.DenomOwners[len(m.DenomOwners)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.TokenBalances = append(m.TokenBalances, &TokenBalance{}) + if err := m.TokenBalances[len(m.TokenBalances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1540,7 +1539,7 @@ func (m *QueryTokenBalancesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DenomOwner) Unmarshal(dAtA []byte) error { +func (m *TokenBalance) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1563,10 +1562,10 @@ func (m *DenomOwner) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DenomOwner: wiretype end group for non-group") + return fmt.Errorf("proto: TokenBalance: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DenomOwner: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenBalance: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: From 503e5715deff817297242567b4803903888a7d8e Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Apr 2024 19:00:17 +0530 Subject: [PATCH 3/8] fix: fix the tests --- x/ugov/keeper/intest/keeper.go | 3 ++- x/ugov/keeper/keeper.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/x/ugov/keeper/intest/keeper.go b/x/ugov/keeper/intest/keeper.go index 00745b8bcf..1ca144bff5 100644 --- a/x/ugov/keeper/intest/keeper.go +++ b/x/ugov/keeper/intest/keeper.go @@ -7,6 +7,7 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + bkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/umee-network/umee/v6/tests/tsdk" "github.com/umee-network/umee/v6/x/ugov" @@ -20,7 +21,7 @@ func MkKeeper(t *testing.T) (*sdk.Context, ugov.Keeper) { ugov.RegisterInterfaces(ir) cdc := codec.NewProtoCodec(ir) storeKey := storetypes.NewMemoryStoreKey(ugov.StoreKey) - kb := keeper.NewBuilder(cdc, storeKey) + kb := keeper.NewBuilder(cdc, storeKey, bkeeper.BaseKeeper{}) ctx, _ := tsdk.NewCtxOneStore(t, storeKey) return &ctx, kb.Keeper(&ctx) } diff --git a/x/ugov/keeper/keeper.go b/x/ugov/keeper/keeper.go index 8ff100fe50..7689fea3f0 100644 --- a/x/ugov/keeper/keeper.go +++ b/x/ugov/keeper/keeper.go @@ -5,6 +5,7 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/umee-network/umee/v6/x/ugov" ) From 57336fc93e3a1bd5f6c81a5a948410e009b28ff6 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Apr 2024 22:08:52 +0530 Subject: [PATCH 4/8] renamed token-balances to denom-owners --- proto/umee/ugov/v1/query.proto | 31 +- x/ugov/client/cli/query.go | 12 +- x/ugov/keeper/query_server.go | 19 +- x/ugov/query.pb.go | 648 +++++---------------------------- x/ugov/query.pb.gw.go | 34 +- 5 files changed, 132 insertions(+), 612 deletions(-) diff --git a/proto/umee/ugov/v1/query.proto b/proto/umee/ugov/v1/query.proto index 21001dfe4f..a99cfaaff6 100644 --- a/proto/umee/ugov/v1/query.proto +++ b/proto/umee/ugov/v1/query.proto @@ -7,7 +7,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "amino/amino.proto"; +import "cosmos/bank/v1beta1/query.proto"; import "umee/ugov/v1/ugov.proto"; @@ -37,16 +37,16 @@ service Query { option (google.api.http).get = "/umee/ugov/v1/inflation_cycle_end"; } - // Token Balances queries for all account addresses that own a particular token + // DenomOwners queries for all account addresses that own a particular token // denomination. - rpc TokenBalances(QueryTokenBalances) returns (QueryTokenBalancesResponse){ - option (google.api.http).get = "/umee/ugov/v1/token_balances"; + rpc DenomOwners(QueryDenomOwners) returns (cosmos.bank.v1beta1.QueryDenomOwnersResponse){ + option (google.api.http).get = "/umee/ugov/v1/denom_owners"; } } -// which queries for a paginated set of all account holders of a particular +// QueryDenomOwners which queries for a paginated set of all account holders of a particular // denomination. -message QueryTokenBalances{ +message QueryDenomOwners{ // denom defines the coin denomination to query all account holders for. string denom = 1; int64 height = 2; @@ -54,25 +54,6 @@ message QueryTokenBalances{ cosmos.base.query.v1beta1.PageRequest pagination = 3; } -// QueryDenomOwnersResponse defines the RPC response of a TokenBalances RPC query. -message QueryTokenBalancesResponse { - repeated TokenBalance token_balances = 1; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// TokenBalance defines structure representing an account that owns or holds a -// particular denominated token. It contains the account address and account -// balance of the denominated token. -// -message TokenBalance { - // address defines the address that owns a particular denomination. - string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // balance is the balance of the denominated coin for an account. - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; -} - // QueryMinGasPrice is a request type. message QueryMinGasPrice {} diff --git a/x/ugov/client/cli/query.go b/x/ugov/client/cli/query.go index 37c4e865c3..1987922d92 100644 --- a/x/ugov/client/cli/query.go +++ b/x/ugov/client/cli/query.go @@ -25,7 +25,7 @@ func GetQueryCmd() *cobra.Command { QueryInflationParams(), QueryInflationCyleEnd(), QueryEmergencyGroup(), - QueryTokenBalances(), + QueryDenomOwners(), ) return cmd @@ -123,10 +123,10 @@ func QueryInflationCyleEnd() *cobra.Command { return cmd } -// QueryTokenBalances creates the Query/TokenBalances CLI. -func QueryTokenBalances() *cobra.Command { +// QueryDenomOwners creates the Query/DenomOwners CLI. +func QueryDenomOwners() *cobra.Command { cmd := &cobra.Command{ - Use: "token-balances [denom]", + Use: "denom-owners [denom]", Args: cobra.ExactArgs(1), Short: "Queries for all account addresses that own a particular token denomination.", RunE: func(cmd *cobra.Command, args []string) error { @@ -139,7 +139,7 @@ func QueryTokenBalances() *cobra.Command { return err } queryClient := ugov.NewQueryClient(clientCtx) - resp, err := queryClient.TokenBalances(cmd.Context(), &ugov.QueryTokenBalances{ + resp, err := queryClient.DenomOwners(cmd.Context(), &ugov.QueryDenomOwners{ Denom: args[0], Pagination: pageReq, }) @@ -148,7 +148,7 @@ func QueryTokenBalances() *cobra.Command { } flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "token-balances") + flags.AddPaginationFlagsToCmd(cmd, "denom-owners") return cmd } diff --git a/x/ugov/keeper/query_server.go b/x/ugov/keeper/query_server.go index a8f319b3ed..865c653415 100644 --- a/x/ugov/keeper/query_server.go +++ b/x/ugov/keeper/query_server.go @@ -52,28 +52,15 @@ func (q Querier) InflationCycleEnd(ctx context.Context, _ *ugov.QueryInflationCy return &ugov.QueryInflationCycleEndResponse{End: &cycleEndTime}, nil } -// TokenBalances implements ugov.QueryServer. -func (q Querier) TokenBalances(ctx context.Context, req *ugov.QueryTokenBalances) (*ugov.QueryTokenBalancesResponse, +// DenomOwners implements ugov.QueryServer. +func (q Querier) DenomOwners(ctx context.Context, req *ugov.QueryDenomOwners) (*banktypes.QueryDenomOwnersResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) if req.Height != 0 { sdkCtx = sdkCtx.WithBlockHeight(req.Height) } - resp, err := q.BankKeeper.DenomOwners(sdk.WrapSDKContext(sdkCtx), &banktypes.QueryDenomOwnersRequest{ + return q.BankKeeper.DenomOwners(sdk.WrapSDKContext(sdkCtx), &banktypes.QueryDenomOwnersRequest{ Denom: req.Denom, Pagination: req.Pagination, }) - if err != nil { - return nil, err - } - - tb := make([]*ugov.TokenBalance, 0) - for _, v := range resp.DenomOwners { - tb = append(tb, &ugov.TokenBalance{ - Address: v.Address, - Balance: v.Balance, - }) - } - - return &ugov.QueryTokenBalancesResponse{Pagination: resp.Pagination, TokenBalances: tb}, nil } diff --git a/x/ugov/query.pb.go b/x/ugov/query.pb.go index c7f861de2a..e77e679b08 100644 --- a/x/ugov/query.pb.go +++ b/x/ugov/query.pb.go @@ -9,7 +9,7 @@ import ( _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + types1 "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -37,9 +37,9 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// which queries for a paginated set of all account holders of a particular +// QueryDenomOwners which queries for a paginated set of all account holders of a particular // denomination. -type QueryTokenBalances struct { +type QueryDenomOwners struct { // denom defines the coin denomination to query all account holders for. Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` @@ -47,18 +47,18 @@ type QueryTokenBalances struct { Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } -func (m *QueryTokenBalances) Reset() { *m = QueryTokenBalances{} } -func (m *QueryTokenBalances) String() string { return proto.CompactTextString(m) } -func (*QueryTokenBalances) ProtoMessage() {} -func (*QueryTokenBalances) Descriptor() ([]byte, []int) { +func (m *QueryDenomOwners) Reset() { *m = QueryDenomOwners{} } +func (m *QueryDenomOwners) String() string { return proto.CompactTextString(m) } +func (*QueryDenomOwners) ProtoMessage() {} +func (*QueryDenomOwners) Descriptor() ([]byte, []int) { return fileDescriptor_25fa04679024a47d, []int{0} } -func (m *QueryTokenBalances) XXX_Unmarshal(b []byte) error { +func (m *QueryDenomOwners) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryTokenBalances) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryDenomOwners) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryTokenBalances.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryDenomOwners.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -68,100 +68,17 @@ func (m *QueryTokenBalances) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryTokenBalances) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTokenBalances.Merge(m, src) +func (m *QueryDenomOwners) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDenomOwners.Merge(m, src) } -func (m *QueryTokenBalances) XXX_Size() int { +func (m *QueryDenomOwners) XXX_Size() int { return m.Size() } -func (m *QueryTokenBalances) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTokenBalances.DiscardUnknown(m) +func (m *QueryDenomOwners) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDenomOwners.DiscardUnknown(m) } -var xxx_messageInfo_QueryTokenBalances proto.InternalMessageInfo - -// QueryDenomOwnersResponse defines the RPC response of a TokenBalances RPC query. -type QueryTokenBalancesResponse struct { - TokenBalances []*TokenBalance `protobuf:"bytes,1,rep,name=token_balances,json=tokenBalances,proto3" json:"token_balances,omitempty"` - // pagination defines the pagination in the response. - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryTokenBalancesResponse) Reset() { *m = QueryTokenBalancesResponse{} } -func (m *QueryTokenBalancesResponse) String() string { return proto.CompactTextString(m) } -func (*QueryTokenBalancesResponse) ProtoMessage() {} -func (*QueryTokenBalancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{1} -} -func (m *QueryTokenBalancesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryTokenBalancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryTokenBalancesResponse.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 *QueryTokenBalancesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryTokenBalancesResponse.Merge(m, src) -} -func (m *QueryTokenBalancesResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryTokenBalancesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryTokenBalancesResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryTokenBalancesResponse proto.InternalMessageInfo - -// TokenBalance defines structure representing an account that owns or holds a -// particular denominated token. It contains the account address and account -// balance of the denominated token. -type TokenBalance struct { - // address defines the address that owns a particular denomination. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // balance is the balance of the denominated coin for an account. - Balance types.Coin `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance"` -} - -func (m *TokenBalance) Reset() { *m = TokenBalance{} } -func (m *TokenBalance) String() string { return proto.CompactTextString(m) } -func (*TokenBalance) ProtoMessage() {} -func (*TokenBalance) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{2} -} -func (m *TokenBalance) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TokenBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TokenBalance.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 *TokenBalance) XXX_Merge(src proto.Message) { - xxx_messageInfo_TokenBalance.Merge(m, src) -} -func (m *TokenBalance) XXX_Size() int { - return m.Size() -} -func (m *TokenBalance) XXX_DiscardUnknown() { - xxx_messageInfo_TokenBalance.DiscardUnknown(m) -} - -var xxx_messageInfo_TokenBalance proto.InternalMessageInfo +var xxx_messageInfo_QueryDenomOwners proto.InternalMessageInfo // QueryMinGasPrice is a request type. type QueryMinGasPrice struct { @@ -171,7 +88,7 @@ func (m *QueryMinGasPrice) Reset() { *m = QueryMinGasPrice{} } func (m *QueryMinGasPrice) String() string { return proto.CompactTextString(m) } func (*QueryMinGasPrice) ProtoMessage() {} func (*QueryMinGasPrice) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{3} + return fileDescriptor_25fa04679024a47d, []int{1} } func (m *QueryMinGasPrice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +126,7 @@ func (m *QueryMinGasPriceResponse) Reset() { *m = QueryMinGasPriceRespon func (m *QueryMinGasPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryMinGasPriceResponse) ProtoMessage() {} func (*QueryMinGasPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{4} + return fileDescriptor_25fa04679024a47d, []int{2} } func (m *QueryMinGasPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -246,7 +163,7 @@ func (m *QueryEmergencyGroup) Reset() { *m = QueryEmergencyGroup{} } func (m *QueryEmergencyGroup) String() string { return proto.CompactTextString(m) } func (*QueryEmergencyGroup) ProtoMessage() {} func (*QueryEmergencyGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{5} + return fileDescriptor_25fa04679024a47d, []int{3} } func (m *QueryEmergencyGroup) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -284,7 +201,7 @@ func (m *QueryEmergencyGroupResponse) Reset() { *m = QueryEmergencyGroup func (m *QueryEmergencyGroupResponse) String() string { return proto.CompactTextString(m) } func (*QueryEmergencyGroupResponse) ProtoMessage() {} func (*QueryEmergencyGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{6} + return fileDescriptor_25fa04679024a47d, []int{4} } func (m *QueryEmergencyGroupResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -321,7 +238,7 @@ func (m *QueryInflationParams) Reset() { *m = QueryInflationParams{} } func (m *QueryInflationParams) String() string { return proto.CompactTextString(m) } func (*QueryInflationParams) ProtoMessage() {} func (*QueryInflationParams) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{7} + return fileDescriptor_25fa04679024a47d, []int{5} } func (m *QueryInflationParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -359,7 +276,7 @@ func (m *QueryInflationParamsResponse) Reset() { *m = QueryInflationPara func (m *QueryInflationParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryInflationParamsResponse) ProtoMessage() {} func (*QueryInflationParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{8} + return fileDescriptor_25fa04679024a47d, []int{6} } func (m *QueryInflationParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -396,7 +313,7 @@ func (m *QueryInflationCycleEnd) Reset() { *m = QueryInflationCycleEnd{} func (m *QueryInflationCycleEnd) String() string { return proto.CompactTextString(m) } func (*QueryInflationCycleEnd) ProtoMessage() {} func (*QueryInflationCycleEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{9} + return fileDescriptor_25fa04679024a47d, []int{7} } func (m *QueryInflationCycleEnd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -434,7 +351,7 @@ func (m *QueryInflationCycleEndResponse) Reset() { *m = QueryInflationCy func (m *QueryInflationCycleEndResponse) String() string { return proto.CompactTextString(m) } func (*QueryInflationCycleEndResponse) ProtoMessage() {} func (*QueryInflationCycleEndResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{10} + return fileDescriptor_25fa04679024a47d, []int{8} } func (m *QueryInflationCycleEndResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,9 +381,7 @@ func (m *QueryInflationCycleEndResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryInflationCycleEndResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*QueryTokenBalances)(nil), "umee.ugov.v1.QueryTokenBalances") - proto.RegisterType((*QueryTokenBalancesResponse)(nil), "umee.ugov.v1.QueryTokenBalancesResponse") - proto.RegisterType((*TokenBalance)(nil), "umee.ugov.v1.TokenBalance") + proto.RegisterType((*QueryDenomOwners)(nil), "umee.ugov.v1.QueryDenomOwners") proto.RegisterType((*QueryMinGasPrice)(nil), "umee.ugov.v1.QueryMinGasPrice") proto.RegisterType((*QueryMinGasPriceResponse)(nil), "umee.ugov.v1.QueryMinGasPriceResponse") proto.RegisterType((*QueryEmergencyGroup)(nil), "umee.ugov.v1.QueryEmergencyGroup") @@ -480,58 +395,53 @@ func init() { func init() { proto.RegisterFile("umee/ugov/v1/query.proto", fileDescriptor_25fa04679024a47d) } var fileDescriptor_25fa04679024a47d = []byte{ - // 813 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4f, 0x4f, 0x3b, 0x45, - 0x18, 0xc7, 0x3b, 0x54, 0xf8, 0xc9, 0x94, 0x3f, 0x32, 0x56, 0x5c, 0x96, 0xb2, 0x2d, 0x0b, 0xd6, - 0x42, 0x64, 0x37, 0xad, 0x09, 0x17, 0x13, 0x13, 0xca, 0xbf, 0x78, 0x30, 0xc1, 0x95, 0x83, 0xd1, - 0x43, 0x9d, 0x6e, 0x87, 0x65, 0x43, 0x77, 0xa6, 0xec, 0x6e, 0xab, 0x78, 0x93, 0xc4, 0x83, 0x9e, - 0x88, 0xbe, 0x09, 0x8e, 0x1c, 0x7c, 0x11, 0x3d, 0x12, 0xbd, 0x78, 0x42, 0x05, 0x13, 0xdf, 0x86, - 0xd9, 0xd9, 0xd9, 0x75, 0xa7, 0x54, 0xea, 0xa5, 0xe9, 0x3c, 0xcf, 0xf7, 0x79, 0xbe, 0x9f, 0x99, - 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x13, 0x25, 0x29, 0xc5, 0x3b, 0x9c, 0xa2, 0x8c, 0xd6, 0x64, 0x8a, 0x91, 0x6b, 0x82, 0xbe, 0x07, - 0x70, 0x71, 0x64, 0x46, 0x48, 0x1f, 0xe3, 0x32, 0xa2, 0x51, 0xb7, 0x27, 0x6b, 0x52, 0x94, 0x2a, - 0x47, 0xa9, 0x20, 0x4d, 0x46, 0x71, 0x13, 0x79, 0x2b, 0xbe, 0x0d, 0xe8, 0x47, 0x00, 0x97, 0x9e, - 0xcd, 0x1b, 0x6d, 0xbe, 0xe4, 0x94, 0xa8, 0xd4, 0xf7, 0xfe, 0x8f, 0x2a, 0x25, 0xda, 0xe2, 0x44, - 0x1b, 0x68, 0xfd, 0xbf, 0x88, 0xec, 0xa8, 0xa2, 0x45, 0x68, 0x07, 0x7d, 0x0b, 0xe0, 0xbc, 0xfc, - 0x01, 0xaf, 0x8c, 0xb1, 0x92, 0x14, 0x6a, 0x6d, 0x92, 0x22, 0x05, 0xd9, 0xe4, 0x20, 0x1a, 0x2a, - 0xc9, 0x20, 0xf2, 0xb7, 0xb8, 0x79, 0x30, 0xfc, 0x53, 0xcb, 0x0d, 0x1f, 0x35, 0x70, 0xff, 0xa8, - 0x81, 0x3f, 0x1e, 0x35, 0x70, 0xf3, 0xa4, 0xe5, 0xee, 0x9f, 0xb4, 0xdc, 0x6f, 0x4f, 0x5a, 0xee, - 0xf3, 0xaa, 0xe3, 0x86, 0xe7, 0xfd, 0xb6, 0x61, 0x33, 0x8f, 0x77, 0xd9, 0xa1, 0x24, 0xfc, 0x8a, - 0xf9, 0x17, 0x71, 0xcb, 0xc1, 0xae, 0xf9, 0x35, 0xef, 0xdb, 0x9e, 0xe1, 0x6f, 0xe3, 0xfd, 0x7f, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x49, 0xd6, 0xa4, 0x28, 0xa8, 0x07, 0x00, 0x00, + // 731 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0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0xa1, 0xb8, 0x25, 0x28, 0xaa, 0x64, 0x2a, + 0x4b, 0x91, 0x5b, 0x13, 0xf2, 0x0e, 0xe1, 0xf1, 0xdc, 0x8c, 0x88, 0x32, 0xc0, 0x25, 0xa7, 0x91, + 0xe6, 0x2f, 0xd6, 0x24, 0x28, 0x75, 0x81, 0x52, 0x23, 0x72, 0x16, 0x85, 0xc6, 0xf2, 0x56, 0xb8, + 0x0d, 0xe4, 0x3d, 0xc2, 0x57, 0x7e, 0x9b, 0x37, 0xb9, 0x79, 0x9e, 0x53, 0xac, 0x92, 0x6e, 0xff, + 0x8d, 0x2a, 0x21, 0x9a, 0x13, 0x44, 0x33, 0x64, 0xfa, 0x4f, 0x44, 0x66, 0x50, 0xd1, 0x02, 0xd6, + 0x21, 0xaf, 0x10, 0x2e, 0xa6, 0xff, 0x8e, 0x06, 0x6d, 0x49, 0x2a, 0x2f, 0x2d, 0x9c, 0x7d, 0xf1, + 0x6c, 0x27, 0xf9, 0xe2, 0xf3, 0xb2, 0x84, 0x44, 0x11, 0x24, 0x15, 0x22, 0x65, 0x49, 0xc4, 0x9f, + 0x5c, 0x8b, 0x0b, 0x6d, 0x73, 0xb5, 0xff, 0x43, 0x2e, 0xf4, 0x4f, 0x64, 0x74, 0x74, 0x22, 0xa3, + 0xef, 0x27, 0x32, 0x3a, 0x3c, 0x95, 0x0b, 0x47, 0xa7, 0x72, 0xe1, 0xeb, 0xa9, 0x5c, 0x78, 0x5a, + 0xb7, 0xa8, 0xb7, 0xed, 0xb7, 0x55, 0x93, 0xdb, 0xa2, 0xc7, 0x02, 0x03, 0x6f, 0x9f, 0x3b, 0x3b, + 0x61, 0xc3, 0xde, 0x92, 0xf6, 0x42, 0x74, 0x6d, 0x8f, 0x8a, 0x4f, 0xe3, 0xce, 0xaf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x22, 0x6c, 0x4d, 0xc2, 0x83, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -554,9 +464,9 @@ type QueryClient interface { InflationParams(ctx context.Context, in *QueryInflationParams, opts ...grpc.CallOption) (*QueryInflationParamsResponse, error) // InflationCycleEnd returns inflation cycle end time InflationCycleEnd(ctx context.Context, in *QueryInflationCycleEnd, opts ...grpc.CallOption) (*QueryInflationCycleEndResponse, error) - // Token Balances queries for all account addresses that own a particular token + // DenomOwners queries for all account addresses that own a particular token // denomination. - TokenBalances(ctx context.Context, in *QueryTokenBalances, opts ...grpc.CallOption) (*QueryTokenBalancesResponse, error) + DenomOwners(ctx context.Context, in *QueryDenomOwners, opts ...grpc.CallOption) (*types1.QueryDenomOwnersResponse, error) } type queryClient struct { @@ -603,9 +513,9 @@ func (c *queryClient) InflationCycleEnd(ctx context.Context, in *QueryInflationC return out, nil } -func (c *queryClient) TokenBalances(ctx context.Context, in *QueryTokenBalances, opts ...grpc.CallOption) (*QueryTokenBalancesResponse, error) { - out := new(QueryTokenBalancesResponse) - err := c.cc.Invoke(ctx, "/umee.ugov.v1.Query/TokenBalances", in, out, opts...) +func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwners, opts ...grpc.CallOption) (*types1.QueryDenomOwnersResponse, error) { + out := new(types1.QueryDenomOwnersResponse) + err := c.cc.Invoke(ctx, "/umee.ugov.v1.Query/DenomOwners", in, out, opts...) if err != nil { return nil, err } @@ -622,9 +532,9 @@ type QueryServer interface { InflationParams(context.Context, *QueryInflationParams) (*QueryInflationParamsResponse, error) // InflationCycleEnd returns inflation cycle end time InflationCycleEnd(context.Context, *QueryInflationCycleEnd) (*QueryInflationCycleEndResponse, error) - // Token Balances queries for all account addresses that own a particular token + // DenomOwners queries for all account addresses that own a particular token // denomination. - TokenBalances(context.Context, *QueryTokenBalances) (*QueryTokenBalancesResponse, error) + DenomOwners(context.Context, *QueryDenomOwners) (*types1.QueryDenomOwnersResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -643,8 +553,8 @@ func (*UnimplementedQueryServer) InflationParams(ctx context.Context, req *Query func (*UnimplementedQueryServer) InflationCycleEnd(ctx context.Context, req *QueryInflationCycleEnd) (*QueryInflationCycleEndResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InflationCycleEnd not implemented") } -func (*UnimplementedQueryServer) TokenBalances(ctx context.Context, req *QueryTokenBalances) (*QueryTokenBalancesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TokenBalances not implemented") +func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwners) (*types1.QueryDenomOwnersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { @@ -723,20 +633,20 @@ func _Query_InflationCycleEnd_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Query_TokenBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryTokenBalances) +func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDenomOwners) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).TokenBalances(ctx, in) + return srv.(QueryServer).DenomOwners(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/umee.ugov.v1.Query/TokenBalances", + FullMethod: "/umee.ugov.v1.Query/DenomOwners", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TokenBalances(ctx, req.(*QueryTokenBalances)) + return srv.(QueryServer).DenomOwners(ctx, req.(*QueryDenomOwners)) } return interceptor(ctx, in, info, handler) } @@ -762,15 +672,15 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_InflationCycleEnd_Handler, }, { - MethodName: "TokenBalances", - Handler: _Query_TokenBalances_Handler, + MethodName: "DenomOwners", + Handler: _Query_DenomOwners_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/ugov/v1/query.proto", } -func (m *QueryTokenBalances) Marshal() (dAtA []byte, err error) { +func (m *QueryDenomOwners) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -780,12 +690,12 @@ func (m *QueryTokenBalances) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryTokenBalances) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryDenomOwners) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryTokenBalances) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryDenomOwners) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -817,95 +727,6 @@ func (m *QueryTokenBalances) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryTokenBalancesResponse) 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 *QueryTokenBalancesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryTokenBalancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.TokenBalances) > 0 { - for iNdEx := len(m.TokenBalances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.TokenBalances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *TokenBalance) 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 *TokenBalance) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TokenBalance) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Balance.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - 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))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *QueryMinGasPrice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1115,12 +936,12 @@ func (m *QueryInflationCycleEndResponse) MarshalToSizedBuffer(dAtA []byte) (int, var l int _ = l if m.End != nil { - n6, err6 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.End):]) - if err6 != nil { - return 0, err6 + n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.End):]) + if err4 != nil { + return 0, err4 } - i -= n6 - i = encodeVarintQuery(dAtA, i, uint64(n6)) + i -= n4 + i = encodeVarintQuery(dAtA, i, uint64(n4)) i-- dAtA[i] = 0xa } @@ -1138,7 +959,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryTokenBalances) Size() (n int) { +func (m *QueryDenomOwners) Size() (n int) { if m == nil { return 0 } @@ -1158,40 +979,6 @@ func (m *QueryTokenBalances) Size() (n int) { return n } -func (m *QueryTokenBalancesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.TokenBalances) > 0 { - for _, e := range m.TokenBalances { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *TokenBalance) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = m.Balance.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - func (m *QueryMinGasPrice) Size() (n int) { if m == nil { return 0 @@ -1282,7 +1069,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryTokenBalances) Unmarshal(dAtA []byte) error { +func (m *QueryDenomOwners) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1305,10 +1092,10 @@ func (m *QueryTokenBalances) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryTokenBalances: wiretype end group for non-group") + return fmt.Errorf("proto: QueryDenomOwners: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTokenBalances: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryDenomOwners: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1419,241 +1206,6 @@ func (m *QueryTokenBalances) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryTokenBalancesResponse) 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 ErrIntOverflowQuery - } - 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: QueryTokenBalancesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryTokenBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TokenBalances", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TokenBalances = append(m.TokenBalances, &TokenBalance{}) - if err := m.TokenBalances[len(m.TokenBalances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TokenBalance) 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 ErrIntOverflowQuery - } - 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: TokenBalance: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TokenBalance: 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 ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Balance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryMinGasPrice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ugov/query.pb.gw.go b/x/ugov/query.pb.gw.go index d3869ca4af..9db24b5e48 100644 --- a/x/ugov/query.pb.gw.go +++ b/x/ugov/query.pb.gw.go @@ -106,37 +106,37 @@ func local_request_Query_InflationCycleEnd_0(ctx context.Context, marshaler runt } var ( - filter_Query_TokenBalances_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_DenomOwners_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_TokenBalances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTokenBalances +func request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwners var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TokenBalances_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.TokenBalances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.DenomOwners(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_TokenBalances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryTokenBalances +func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDenomOwners var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_TokenBalances_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.TokenBalances(ctx, &protoReq) + msg, err := server.DenomOwners(ctx, &protoReq) return msg, metadata, err } @@ -239,7 +239,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_TokenBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -250,7 +250,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_TokenBalances_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_DenomOwners_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -258,7 +258,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_TokenBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -383,7 +383,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_TokenBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -392,14 +392,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_TokenBalances_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_DenomOwners_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_TokenBalances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -415,7 +415,7 @@ var ( pattern_Query_InflationCycleEnd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "inflation_cycle_end"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_TokenBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "token_balances"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "denom_owners"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -427,5 +427,5 @@ var ( forward_Query_InflationCycleEnd_0 = runtime.ForwardResponseMessage - forward_Query_TokenBalances_0 = runtime.ForwardResponseMessage + forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage ) From b79202b0599ebc5d8075117284d2a70ae6995a12 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Apr 2024 22:40:57 +0530 Subject: [PATCH 5/8] added -l flags to enable denom-owners query --- app/app.go | 4 +++- x/ugov/keeper/keeper.go | 26 +++++++++++++------------- x/ugov/keeper/query_server.go | 18 +++++++++++------- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/app/app.go b/app/app.go index ea2643617a..1ba3902050 100644 --- a/app/app.go +++ b/app/app.go @@ -465,7 +465,9 @@ func New( app.NFTKeeper = nftkeeper.NewKeeper(keys[nftkeeper.StoreKey], appCodec, app.AccountKeeper, app.BankKeeper) - app.UGovKeeperB = ugovkeeper.NewBuilder(appCodec, keys[ugov.ModuleName], app.BankKeeper) + app.UGovKeeperB = ugovkeeper.NewBuilder(appCodec, keys[ugov.ModuleName], app.BankKeeper, + cast.ToBool(appOpts.Get(leveragetypes.FlagEnableLiquidatorQuery)), + ) app.OracleKeeper = oraclekeeper.NewKeeper( appCodec, diff --git a/x/ugov/keeper/keeper.go b/x/ugov/keeper/keeper.go index 7689fea3f0..f6da133619 100644 --- a/x/ugov/keeper/keeper.go +++ b/x/ugov/keeper/keeper.go @@ -13,26 +13,27 @@ var _ ugov.Keeper = Keeper{} // Builder constructs Keeper by perparing all related dependencies (notably the store). type Builder struct { - storeKey storetypes.StoreKey - Cdc codec.BinaryCodec - BankKeeper keeper.BaseKeeper + storeKey storetypes.StoreKey + Cdc codec.BinaryCodec + BankKeeper keeper.BaseKeeper + enableLiquidatorQuery bool } func NewBuilder( - cdc codec.BinaryCodec, key storetypes.StoreKey, bk keeper.BaseKeeper, + cdc codec.BinaryCodec, key storetypes.StoreKey, bk keeper.BaseKeeper, enableLiquidatorQuery bool, ) Builder { return Builder{ - Cdc: cdc, - storeKey: key, - BankKeeper: bk, + Cdc: cdc, + storeKey: key, + BankKeeper: bk, + enableLiquidatorQuery: enableLiquidatorQuery, } } func (kb Builder) Keeper(ctx *sdk.Context) ugov.Keeper { return Keeper{ - store: ctx.KVStore(kb.storeKey), - cdc: kb.Cdc, - BankKeeper: kb.BankKeeper, + store: ctx.KVStore(kb.storeKey), + cdc: kb.Cdc, } } @@ -43,7 +44,6 @@ func (kb Builder) EmergencyGroup(ctx *sdk.Context) ugov.WithEmergencyGroup { ret // Keeper provides a light interface for module data access and transformation type Keeper struct { - store sdk.KVStore - cdc codec.BinaryCodec - BankKeeper keeper.BaseKeeper + store sdk.KVStore + cdc codec.BinaryCodec } diff --git a/x/ugov/keeper/query_server.go b/x/ugov/keeper/query_server.go index 865c653415..5d6e41893d 100644 --- a/x/ugov/keeper/query_server.go +++ b/x/ugov/keeper/query_server.go @@ -6,6 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + ltypes "github.com/umee-network/umee/v6/x/leverage/types" "github.com/umee-network/umee/v6/x/ugov" ) @@ -55,12 +56,15 @@ func (q Querier) InflationCycleEnd(ctx context.Context, _ *ugov.QueryInflationCy // DenomOwners implements ugov.QueryServer. func (q Querier) DenomOwners(ctx context.Context, req *ugov.QueryDenomOwners) (*banktypes.QueryDenomOwnersResponse, error) { - sdkCtx := sdk.UnwrapSDKContext(ctx) - if req.Height != 0 { - sdkCtx = sdkCtx.WithBlockHeight(req.Height) + if q.enableLiquidatorQuery { + sdkCtx := sdk.UnwrapSDKContext(ctx) + if req.Height != 0 { + sdkCtx = sdkCtx.WithBlockHeight(req.Height) + } + return q.BankKeeper.DenomOwners(sdk.WrapSDKContext(sdkCtx), &banktypes.QueryDenomOwnersRequest{ + Denom: req.Denom, + Pagination: req.Pagination, + }) } - return q.BankKeeper.DenomOwners(sdk.WrapSDKContext(sdkCtx), &banktypes.QueryDenomOwnersRequest{ - Denom: req.Denom, - Pagination: req.Pagination, - }) + return nil, ltypes.ErrNotLiquidatorNode } From eb9fbee377886504d0f017bbcdae3a89376a8350 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 24 Apr 2024 22:47:00 +0530 Subject: [PATCH 6/8] fix: fix the tests --- x/ugov/keeper/intest/keeper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ugov/keeper/intest/keeper.go b/x/ugov/keeper/intest/keeper.go index 1ca144bff5..8331f2f1fe 100644 --- a/x/ugov/keeper/intest/keeper.go +++ b/x/ugov/keeper/intest/keeper.go @@ -21,7 +21,7 @@ func MkKeeper(t *testing.T) (*sdk.Context, ugov.Keeper) { ugov.RegisterInterfaces(ir) cdc := codec.NewProtoCodec(ir) storeKey := storetypes.NewMemoryStoreKey(ugov.StoreKey) - kb := keeper.NewBuilder(cdc, storeKey, bkeeper.BaseKeeper{}) + kb := keeper.NewBuilder(cdc, storeKey, bkeeper.BaseKeeper{}, true) ctx, _ := tsdk.NewCtxOneStore(t, storeKey) return &ctx, kb.Keeper(&ctx) } From 28d1dbe3c604ad6fa654065e749ba5229e3ebfbd Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 25 Apr 2024 23:28:41 +0530 Subject: [PATCH 7/8] move the DenomOwners to uibc module --- app/app.go | 5 +- proto/umee/ugov/v1/query.proto | 18 -- proto/umee/uibc/v1/query.proto | 8 + x/ugov/client/cli/query.go | 31 --- x/ugov/keeper/intest/keeper.go | 3 +- x/ugov/keeper/keeper.go | 15 +- x/ugov/keeper/query_server.go | 18 -- x/ugov/query.pb.go | 402 ++++------------------------- x/ugov/query.pb.gw.go | 83 ------ x/uibc/client/cli/query.go | 33 +++ x/uibc/expected_keepers.go | 6 + x/uibc/query.pb.go | 133 ++++++---- x/uibc/query.pb.gw.go | 84 ++++++ x/uibc/quota/grpc_query.go | 12 + x/uibc/quota/intest/suite_test.go | 11 +- x/uibc/quota/keeper.go | 4 +- x/uibc/quota/unit_test.go | 3 +- x/uibc/uics20/ibc_module_test.go | 3 +- x/uibc/uics20/ics4_wrapper_test.go | 3 +- 19 files changed, 306 insertions(+), 569 deletions(-) diff --git a/app/app.go b/app/app.go index 1ba3902050..397da90fd0 100644 --- a/app/app.go +++ b/app/app.go @@ -465,9 +465,7 @@ func New( app.NFTKeeper = nftkeeper.NewKeeper(keys[nftkeeper.StoreKey], appCodec, app.AccountKeeper, app.BankKeeper) - app.UGovKeeperB = ugovkeeper.NewBuilder(appCodec, keys[ugov.ModuleName], app.BankKeeper, - cast.ToBool(appOpts.Get(leveragetypes.FlagEnableLiquidatorQuery)), - ) + app.UGovKeeperB = ugovkeeper.NewBuilder(appCodec, keys[ugov.ModuleName]) app.OracleKeeper = oraclekeeper.NewKeeper( appCodec, @@ -555,6 +553,7 @@ func New( app.UIbcQuotaKeeperB = uibcquota.NewBuilder( appCodec, keys[uibc.StoreKey], app.LeverageKeeper, uibcoracle.FromUmeeAvgPriceOracle(app.OracleKeeper), app.UGovKeeperB.EmergencyGroup, + app.BankKeeper, ) /********** diff --git a/proto/umee/ugov/v1/query.proto b/proto/umee/ugov/v1/query.proto index a99cfaaff6..6470524160 100644 --- a/proto/umee/ugov/v1/query.proto +++ b/proto/umee/ugov/v1/query.proto @@ -6,8 +6,6 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/bank/v1beta1/query.proto"; import "umee/ugov/v1/ugov.proto"; @@ -36,22 +34,6 @@ service Query { rpc InflationCycleEnd(QueryInflationCycleEnd) returns (QueryInflationCycleEndResponse) { option (google.api.http).get = "/umee/ugov/v1/inflation_cycle_end"; } - - // DenomOwners queries for all account addresses that own a particular token - // denomination. - rpc DenomOwners(QueryDenomOwners) returns (cosmos.bank.v1beta1.QueryDenomOwnersResponse){ - option (google.api.http).get = "/umee/ugov/v1/denom_owners"; - } -} - -// QueryDenomOwners which queries for a paginated set of all account holders of a particular -// denomination. -message QueryDenomOwners{ - // denom defines the coin denomination to query all account holders for. - string denom = 1; - int64 height = 2; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 3; } // QueryMinGasPrice is a request type. diff --git a/proto/umee/uibc/v1/query.proto b/proto/umee/uibc/v1/query.proto index 901ad7efdd..969d22c6e1 100644 --- a/proto/umee/uibc/v1/query.proto +++ b/proto/umee/uibc/v1/query.proto @@ -5,6 +5,8 @@ import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; +import "cosmos/bank/v1beta1/query.proto"; + import "umee/uibc/v1/quota.proto"; import "umee/uibc/v1/uibc.proto"; @@ -40,6 +42,12 @@ service Query { rpc QuotaExpires(QueryQuotaExpires) returns (QueryQuotaExpiresResponse) { option (google.api.http).get = "/umee/uibc/v1/quota_expires"; } + + // DenomOwners queries for all account addresses that own a particular token + // denomination. + rpc DenomOwners(cosmos.bank.v1beta1.QueryDenomOwnersRequest) returns (cosmos.bank.v1beta1.QueryDenomOwnersResponse){ + option (google.api.http).get = "/umee/uibc/v1/denom_owners"; + } } // QueryAllInflows defines request type for query the inflow quota of registered denoms. diff --git a/x/ugov/client/cli/query.go b/x/ugov/client/cli/query.go index 1987922d92..43dec209b6 100644 --- a/x/ugov/client/cli/query.go +++ b/x/ugov/client/cli/query.go @@ -25,7 +25,6 @@ func GetQueryCmd() *cobra.Command { QueryInflationParams(), QueryInflationCyleEnd(), QueryEmergencyGroup(), - QueryDenomOwners(), ) return cmd @@ -122,33 +121,3 @@ func QueryInflationCyleEnd() *cobra.Command { return cmd } - -// QueryDenomOwners creates the Query/DenomOwners CLI. -func QueryDenomOwners() *cobra.Command { - cmd := &cobra.Command{ - Use: "denom-owners [denom]", - Args: cobra.ExactArgs(1), - Short: "Queries for all account addresses that own a particular token denomination.", - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - pageReq, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - queryClient := ugov.NewQueryClient(clientCtx) - resp, err := queryClient.DenomOwners(cmd.Context(), &ugov.QueryDenomOwners{ - Denom: args[0], - Pagination: pageReq, - }) - return cli.PrintOrErr(resp, err, clientCtx) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "denom-owners") - - return cmd -} diff --git a/x/ugov/keeper/intest/keeper.go b/x/ugov/keeper/intest/keeper.go index 8331f2f1fe..00745b8bcf 100644 --- a/x/ugov/keeper/intest/keeper.go +++ b/x/ugov/keeper/intest/keeper.go @@ -7,7 +7,6 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - bkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/umee-network/umee/v6/tests/tsdk" "github.com/umee-network/umee/v6/x/ugov" @@ -21,7 +20,7 @@ func MkKeeper(t *testing.T) (*sdk.Context, ugov.Keeper) { ugov.RegisterInterfaces(ir) cdc := codec.NewProtoCodec(ir) storeKey := storetypes.NewMemoryStoreKey(ugov.StoreKey) - kb := keeper.NewBuilder(cdc, storeKey, bkeeper.BaseKeeper{}, true) + kb := keeper.NewBuilder(cdc, storeKey) ctx, _ := tsdk.NewCtxOneStore(t, storeKey) return &ctx, kb.Keeper(&ctx) } diff --git a/x/ugov/keeper/keeper.go b/x/ugov/keeper/keeper.go index f6da133619..33d38d3fde 100644 --- a/x/ugov/keeper/keeper.go +++ b/x/ugov/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/umee-network/umee/v6/x/ugov" ) @@ -13,20 +12,16 @@ var _ ugov.Keeper = Keeper{} // Builder constructs Keeper by perparing all related dependencies (notably the store). type Builder struct { - storeKey storetypes.StoreKey - Cdc codec.BinaryCodec - BankKeeper keeper.BaseKeeper - enableLiquidatorQuery bool + storeKey storetypes.StoreKey + Cdc codec.BinaryCodec } func NewBuilder( - cdc codec.BinaryCodec, key storetypes.StoreKey, bk keeper.BaseKeeper, enableLiquidatorQuery bool, + cdc codec.BinaryCodec, key storetypes.StoreKey, ) Builder { return Builder{ - Cdc: cdc, - storeKey: key, - BankKeeper: bk, - enableLiquidatorQuery: enableLiquidatorQuery, + Cdc: cdc, + storeKey: key, } } diff --git a/x/ugov/keeper/query_server.go b/x/ugov/keeper/query_server.go index 5d6e41893d..bf136c33c0 100644 --- a/x/ugov/keeper/query_server.go +++ b/x/ugov/keeper/query_server.go @@ -4,9 +4,7 @@ import ( context "context" sdk "github.com/cosmos/cosmos-sdk/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - ltypes "github.com/umee-network/umee/v6/x/leverage/types" "github.com/umee-network/umee/v6/x/ugov" ) @@ -52,19 +50,3 @@ func (q Querier) InflationCycleEnd(ctx context.Context, _ *ugov.QueryInflationCy cycleEndTime := q.Keeper(&sdkCtx).InflationCycleEnd() return &ugov.QueryInflationCycleEndResponse{End: &cycleEndTime}, nil } - -// DenomOwners implements ugov.QueryServer. -func (q Querier) DenomOwners(ctx context.Context, req *ugov.QueryDenomOwners) (*banktypes.QueryDenomOwnersResponse, - error) { - if q.enableLiquidatorQuery { - sdkCtx := sdk.UnwrapSDKContext(ctx) - if req.Height != 0 { - sdkCtx = sdkCtx.WithBlockHeight(req.Height) - } - return q.BankKeeper.DenomOwners(sdk.WrapSDKContext(sdkCtx), &banktypes.QueryDenomOwnersRequest{ - Denom: req.Denom, - Pagination: req.Pagination, - }) - } - return nil, ltypes.ErrNotLiquidatorNode -} diff --git a/x/ugov/query.pb.go b/x/ugov/query.pb.go index e77e679b08..df7406236a 100644 --- a/x/ugov/query.pb.go +++ b/x/ugov/query.pb.go @@ -8,8 +8,6 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types "github.com/cosmos/cosmos-sdk/types" - query "github.com/cosmos/cosmos-sdk/types/query" - types1 "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -37,49 +35,6 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryDenomOwners which queries for a paginated set of all account holders of a particular -// denomination. -type QueryDenomOwners struct { - // denom defines the coin denomination to query all account holders for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (m *QueryDenomOwners) Reset() { *m = QueryDenomOwners{} } -func (m *QueryDenomOwners) String() string { return proto.CompactTextString(m) } -func (*QueryDenomOwners) ProtoMessage() {} -func (*QueryDenomOwners) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{0} -} -func (m *QueryDenomOwners) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryDenomOwners) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryDenomOwners.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 *QueryDenomOwners) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryDenomOwners.Merge(m, src) -} -func (m *QueryDenomOwners) XXX_Size() int { - return m.Size() -} -func (m *QueryDenomOwners) XXX_DiscardUnknown() { - xxx_messageInfo_QueryDenomOwners.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryDenomOwners proto.InternalMessageInfo - // QueryMinGasPrice is a request type. type QueryMinGasPrice struct { } @@ -88,7 +43,7 @@ func (m *QueryMinGasPrice) Reset() { *m = QueryMinGasPrice{} } func (m *QueryMinGasPrice) String() string { return proto.CompactTextString(m) } func (*QueryMinGasPrice) ProtoMessage() {} func (*QueryMinGasPrice) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{1} + return fileDescriptor_25fa04679024a47d, []int{0} } func (m *QueryMinGasPrice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,7 +81,7 @@ func (m *QueryMinGasPriceResponse) Reset() { *m = QueryMinGasPriceRespon func (m *QueryMinGasPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryMinGasPriceResponse) ProtoMessage() {} func (*QueryMinGasPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{2} + return fileDescriptor_25fa04679024a47d, []int{1} } func (m *QueryMinGasPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -163,7 +118,7 @@ func (m *QueryEmergencyGroup) Reset() { *m = QueryEmergencyGroup{} } func (m *QueryEmergencyGroup) String() string { return proto.CompactTextString(m) } func (*QueryEmergencyGroup) ProtoMessage() {} func (*QueryEmergencyGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{3} + return fileDescriptor_25fa04679024a47d, []int{2} } func (m *QueryEmergencyGroup) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -201,7 +156,7 @@ func (m *QueryEmergencyGroupResponse) Reset() { *m = QueryEmergencyGroup func (m *QueryEmergencyGroupResponse) String() string { return proto.CompactTextString(m) } func (*QueryEmergencyGroupResponse) ProtoMessage() {} func (*QueryEmergencyGroupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{4} + return fileDescriptor_25fa04679024a47d, []int{3} } func (m *QueryEmergencyGroupResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -238,7 +193,7 @@ func (m *QueryInflationParams) Reset() { *m = QueryInflationParams{} } func (m *QueryInflationParams) String() string { return proto.CompactTextString(m) } func (*QueryInflationParams) ProtoMessage() {} func (*QueryInflationParams) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{5} + return fileDescriptor_25fa04679024a47d, []int{4} } func (m *QueryInflationParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -276,7 +231,7 @@ func (m *QueryInflationParamsResponse) Reset() { *m = QueryInflationPara func (m *QueryInflationParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryInflationParamsResponse) ProtoMessage() {} func (*QueryInflationParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{6} + return fileDescriptor_25fa04679024a47d, []int{5} } func (m *QueryInflationParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +268,7 @@ func (m *QueryInflationCycleEnd) Reset() { *m = QueryInflationCycleEnd{} func (m *QueryInflationCycleEnd) String() string { return proto.CompactTextString(m) } func (*QueryInflationCycleEnd) ProtoMessage() {} func (*QueryInflationCycleEnd) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{7} + return fileDescriptor_25fa04679024a47d, []int{6} } func (m *QueryInflationCycleEnd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -351,7 +306,7 @@ func (m *QueryInflationCycleEndResponse) Reset() { *m = QueryInflationCy func (m *QueryInflationCycleEndResponse) String() string { return proto.CompactTextString(m) } func (*QueryInflationCycleEndResponse) ProtoMessage() {} func (*QueryInflationCycleEndResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_25fa04679024a47d, []int{8} + return fileDescriptor_25fa04679024a47d, []int{7} } func (m *QueryInflationCycleEndResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -381,7 +336,6 @@ func (m *QueryInflationCycleEndResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryInflationCycleEndResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*QueryDenomOwners)(nil), "umee.ugov.v1.QueryDenomOwners") proto.RegisterType((*QueryMinGasPrice)(nil), "umee.ugov.v1.QueryMinGasPrice") proto.RegisterType((*QueryMinGasPriceResponse)(nil), "umee.ugov.v1.QueryMinGasPriceResponse") proto.RegisterType((*QueryEmergencyGroup)(nil), "umee.ugov.v1.QueryEmergencyGroup") @@ -395,53 +349,45 @@ func init() { func init() { proto.RegisterFile("umee/ugov/v1/query.proto", fileDescriptor_25fa04679024a47d) } var fileDescriptor_25fa04679024a47d = []byte{ - // 731 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0x4d, 0x4f, 0x13, 0x5d, - 0x14, 0xc7, 0x7b, 0xe1, 0x81, 0x3c, 0xcf, 0xed, 0x23, 0xe8, 0xb5, 0x62, 0x1d, 0xca, 0xb4, 0x0c, - 0xda, 0x00, 0x91, 0x99, 0x14, 0x13, 0x36, 0xae, 0x28, 0x6f, 0x71, 0x61, 0xc4, 0xd1, 0x85, 0xd1, - 0x45, 0x9d, 0x4e, 0x0f, 0xc3, 0x0d, 0xcc, 0xbd, 0x65, 0x5e, 0x8a, 0xb8, 0x32, 0x26, 0x26, 0xba, - 0x23, 0xfa, 0x41, 0xdc, 0xf8, 0x21, 0xba, 0x24, 0xba, 0x71, 0x85, 0x0a, 0x7e, 0x10, 0x33, 0x77, - 0x5e, 0x98, 0x19, 0x2b, 0xb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06, 0x6d, 0x49, 0x2a, 0x2f, 0x2d, 0x9c, 0x7d, 0xf1, - 0x6c, 0x27, 0xf9, 0xe2, 0xf3, 0xb2, 0x84, 0x44, 0x11, 0x24, 0x15, 0x22, 0x65, 0x49, 0xc4, 0x9f, - 0x5c, 0x8b, 0x0b, 0x6d, 0x73, 0xb5, 0xff, 0x43, 0x2e, 0xf4, 0x4f, 0x64, 0x74, 0x74, 0x22, 0xa3, - 0xef, 0x27, 0x32, 0x3a, 0x3c, 0x95, 0x0b, 0x47, 0xa7, 0x72, 0xe1, 0xeb, 0xa9, 0x5c, 0x78, 0x5a, - 0xb7, 0xa8, 0xb7, 0xed, 0xb7, 0x55, 0x93, 0xdb, 0xa2, 0xc7, 0x02, 0x03, 0x6f, 0x9f, 0x3b, 0x3b, - 0x61, 0xc3, 0xde, 0x92, 0xf6, 0x42, 0x74, 0x6d, 0x8f, 0x8a, 0x4f, 0xe3, 0xce, 0xaf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x22, 0x6c, 0x4d, 0xc2, 0x83, 0x06, 0x00, 0x00, + // 598 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0x8d, 0xa1, 0x54, 0xb0, 0x85, 0x16, 0x96, 0x52, 0x82, 0x9b, 0x6c, 0x5a, 0x17, 0x22, 0x8a, + 0xe8, 0xae, 0x52, 0xa4, 0x5e, 0x38, 0x35, 0x6d, 0xa9, 0x38, 0x20, 0x95, 0xc0, 0x01, 0xc1, 0x21, + 0xd8, 0xce, 0xd6, 0xac, 0x88, 0x77, 0x8d, 0x3f, 0x02, 0xe1, 0x88, 0xc4, 0x81, 0x5b, 0x05, 0x7f, + 0x83, 0x23, 0x3f, 0x22, 0xc7, 0x0a, 0x2e, 0x9c, 0x0a, 0x24, 0xfc, 0x10, 0xe4, 0xf5, 0xda, 0x8a, +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, 0xd9, 0x7c, 0x98, 0x70, 0x79, + 0xc2, 0xfc, 0x3c, 0x45, 0x5f, 0x3d, 0x91, 0x92, 0xb9, 0xb8, 0x21, 0x5d, 0xd4, 0x60, 0x35, 0xef, + 0xa2, 0x70, 0x26, 0xf0, 0x83, 0x06, 0xe6, 0x0a, 0x19, 0x41, 0x63, 0x82, 0x4a, 0x81, 0xa3, 0xdf, + 0x3a, 0x99, 0x93, 0x59, 0xa9, 0x4b, 0x2b, 0x4b, 0x10, 0xe5, 0xad, 0xb0, 0x94, 0xde, 0x4e, 0xae, + 0x01, 0x7e, 0xd4, 0xc0, 0xa5, 0xbf, 0xf2, 0x86, 0xd7, 0x8f, 0x53, 0x4a, 0x59, 0xfa, 0xed, 0xff, + 0x61, 0x65, 0x8e, 0x56, 0xa5, 0xa3, 0x15, 0xb8, 0xfc, 0x2f, 0x47, 0x76, 0xdc, 0xd1, 0xa6, 0xbc, + 0xd3, 0xdc, 0x1e, 0xfc, 0x42, 0xa5, 0xc1, 0x10, 0x69, 0x87, 0x43, 0xa4, 0xfd, 0x1c, 0x22, 0xed, + 0x60, 0x84, 0x4a, 0x87, 0x23, 0x54, 0xfa, 0x3e, 0x42, 0xa5, 0xa7, 0x75, 0x87, 0x85, 0x2f, 0x22, + 0x0b, 0xdb, 0xc2, 0x95, 0xa3, 0xd6, 0x38, 0x0d, 0x5f, 0x0b, 0xff, 0x65, 0x32, 0xb7, 0xb7, 0x41, + 0xde, 0xc8, 0xe1, 0xd6, 0xb4, 0xbc, 0xcb, 0x3b, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x94, + 0xa4, 0x3e, 0x28, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -464,9 +410,6 @@ type QueryClient interface { InflationParams(ctx context.Context, in *QueryInflationParams, opts ...grpc.CallOption) (*QueryInflationParamsResponse, error) // InflationCycleEnd returns inflation cycle end time InflationCycleEnd(ctx context.Context, in *QueryInflationCycleEnd, opts ...grpc.CallOption) (*QueryInflationCycleEndResponse, error) - // DenomOwners queries for all account addresses that own a particular token - // denomination. - DenomOwners(ctx context.Context, in *QueryDenomOwners, opts ...grpc.CallOption) (*types1.QueryDenomOwnersResponse, error) } type queryClient struct { @@ -513,15 +456,6 @@ func (c *queryClient) InflationCycleEnd(ctx context.Context, in *QueryInflationC return out, nil } -func (c *queryClient) DenomOwners(ctx context.Context, in *QueryDenomOwners, opts ...grpc.CallOption) (*types1.QueryDenomOwnersResponse, error) { - out := new(types1.QueryDenomOwnersResponse) - err := c.cc.Invoke(ctx, "/umee.ugov.v1.Query/DenomOwners", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServer is the server API for Query service. type QueryServer interface { // MinGasPrice returns minimum transaction fees. @@ -532,9 +466,6 @@ type QueryServer interface { InflationParams(context.Context, *QueryInflationParams) (*QueryInflationParamsResponse, error) // InflationCycleEnd returns inflation cycle end time InflationCycleEnd(context.Context, *QueryInflationCycleEnd) (*QueryInflationCycleEndResponse, error) - // DenomOwners queries for all account addresses that own a particular token - // denomination. - DenomOwners(context.Context, *QueryDenomOwners) (*types1.QueryDenomOwnersResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -553,9 +484,6 @@ func (*UnimplementedQueryServer) InflationParams(ctx context.Context, req *Query func (*UnimplementedQueryServer) InflationCycleEnd(ctx context.Context, req *QueryInflationCycleEnd) (*QueryInflationCycleEndResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InflationCycleEnd not implemented") } -func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *QueryDenomOwners) (*types1.QueryDenomOwnersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") -} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -633,24 +561,6 @@ func _Query_InflationCycleEnd_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryDenomOwners) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).DenomOwners(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/umee.ugov.v1.Query/DenomOwners", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).DenomOwners(ctx, req.(*QueryDenomOwners)) - } - return interceptor(ctx, in, info, handler) -} - var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "umee.ugov.v1.Query", HandlerType: (*QueryServer)(nil), @@ -671,62 +581,11 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "InflationCycleEnd", Handler: _Query_InflationCycleEnd_Handler, }, - { - MethodName: "DenomOwners", - Handler: _Query_DenomOwners_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/ugov/v1/query.proto", } -func (m *QueryDenomOwners) 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 *QueryDenomOwners) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryDenomOwners) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *QueryMinGasPrice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -936,12 +795,12 @@ func (m *QueryInflationCycleEndResponse) MarshalToSizedBuffer(dAtA []byte) (int, var l int _ = l if m.End != nil { - n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.End):]) - if err4 != nil { - return 0, err4 + n3, err3 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.End, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.End):]) + if err3 != nil { + return 0, err3 } - i -= n4 - i = encodeVarintQuery(dAtA, i, uint64(n4)) + i -= n3 + i = encodeVarintQuery(dAtA, i, uint64(n3)) i-- dAtA[i] = 0xa } @@ -959,26 +818,6 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryDenomOwners) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - func (m *QueryMinGasPrice) Size() (n int) { if m == nil { return 0 @@ -1069,143 +908,6 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryDenomOwners) 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 ErrIntOverflowQuery - } - 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: QueryDenomOwners: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryDenomOwners: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - 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 ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Denom = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryMinGasPrice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ugov/query.pb.gw.go b/x/ugov/query.pb.gw.go index 9db24b5e48..9861335ca1 100644 --- a/x/ugov/query.pb.gw.go +++ b/x/ugov/query.pb.gw.go @@ -105,42 +105,6 @@ func local_request_Query_InflationCycleEnd_0(ctx context.Context, marshaler runt } -var ( - filter_Query_DenomOwners_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomOwners - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.DenomOwners(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryDenomOwners - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.DenomOwners(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -239,29 +203,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_DenomOwners_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -383,26 +324,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_DenomOwners_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -414,8 +335,6 @@ var ( pattern_Query_InflationParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "inflation_params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_InflationCycleEnd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "inflation_cycle_end"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "ugov", "v1", "denom_owners"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -426,6 +345,4 @@ var ( forward_Query_InflationParams_0 = runtime.ForwardResponseMessage forward_Query_InflationCycleEnd_0 = runtime.ForwardResponseMessage - - forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage ) diff --git a/x/uibc/client/cli/query.go b/x/uibc/client/cli/query.go index 183d3b4f88..39c266e268 100644 --- a/x/uibc/client/cli/query.go +++ b/x/uibc/client/cli/query.go @@ -5,7 +5,9 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/spf13/cobra" + "github.com/umee-network/umee/v6/util/cli" "github.com/umee-network/umee/v6/x/uibc" ) @@ -25,6 +27,7 @@ func GetQueryCmd() *cobra.Command { GetOutflows(), GetInflows(), GetQuotaExpireTime(), + QueryDenomOwners(), ) return cmd @@ -130,3 +133,33 @@ func GetOutflows() *cobra.Command { flags.AddQueryFlagsToCmd(cmd) return cmd } + +// QueryDenomOwners creates the Query/DenomOwners CLI. +func QueryDenomOwners() *cobra.Command { + cmd := &cobra.Command{ + Use: "denom-owners [denom]", + Args: cobra.ExactArgs(1), + Short: "Queries for all account addresses that own a particular token denomination.", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + queryClient := uibc.NewQueryClient(clientCtx) + resp, err := queryClient.DenomOwners(cmd.Context(), &banktypes.QueryDenomOwnersRequest{ + Denom: args[0], + Pagination: pageReq, + }) + return cli.PrintOrErr(resp, err, clientCtx) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "denom-owners") + + return cmd +} diff --git a/x/uibc/expected_keepers.go b/x/uibc/expected_keepers.go index 34b90b517f..c666cdd13a 100644 --- a/x/uibc/expected_keepers.go +++ b/x/uibc/expected_keepers.go @@ -1,6 +1,8 @@ package uibc import ( + context "context" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -12,6 +14,10 @@ type BankKeeper interface { GetDenomMetaData(ctx sdk.Context, denom string) (types.Metadata, bool) SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata) IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool) + DenomOwners( + goCtx context.Context, + req *types.QueryDenomOwnersRequest, + ) (*types.QueryDenomOwnersResponse, error) } type Leverage interface { diff --git a/x/uibc/query.pb.go b/x/uibc/query.pb.go index 4144fec82b..8f12195c97 100644 --- a/x/uibc/query.pb.go +++ b/x/uibc/query.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/x/bank/types" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -431,50 +432,54 @@ func init() { func init() { proto.RegisterFile("umee/uibc/v1/query.proto", fileDescriptor_2ca7e17b0958935d) } var fileDescriptor_2ca7e17b0958935d = []byte{ - // 685 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x3f, 0x53, 0xd4, 0x4e, - 0x18, 0xbe, 0xf0, 0xe7, 0xe0, 0xb7, 0x07, 0xf3, 0xd3, 0xe5, 0x80, 0x10, 0x20, 0xc1, 0x45, 0x91, - 0x42, 0x92, 0xe1, 0x9c, 0xb1, 0xf0, 0x4f, 0xe1, 0x89, 0x05, 0x8d, 0xca, 0x49, 0xa3, 0xcd, 0x4d, - 0xee, 0x6e, 0x39, 0x32, 0x64, 0xb3, 0xf1, 0xb2, 0x01, 0x52, 0xd8, 0x38, 0x63, 0xcf, 0x8c, 0x1f, - 0xc1, 0xaf, 0x60, 0x6f, 0x4b, 0xc9, 0x68, 0xe3, 0x58, 0x9c, 0xca, 0x59, 0x59, 0xfa, 0x09, 0x9c, - 0xdd, 0x6c, 0x62, 0x02, 0xc7, 0x69, 0x61, 0x75, 0xb7, 0xef, 0xf3, 0xbc, 0xcf, 0xf3, 0xe4, 0xdd, - 0x79, 0x17, 0xa8, 0x21, 0xc1, 0xd8, 0x0a, 0x9d, 0x46, 0xd3, 0xda, 0x5f, 0xb7, 0x5e, 0x84, 0xb8, - 0x13, 0x99, 0x7e, 0x87, 0x32, 0x0a, 0x27, 0x38, 0x62, 0x72, 0xc4, 0xdc, 0x5f, 0xd7, 0xe6, 0x9a, - 0x34, 0x20, 0x34, 0xa8, 0x0b, 0xcc, 0x8a, 0x0f, 0x31, 0x51, 0x2b, 0xb7, 0x69, 0x9b, 0xc6, 0x75, - 0xfe, 0x4f, 0x56, 0x17, 0xda, 0x94, 0xb6, 0x5d, 0x6c, 0xd9, 0xbe, 0x63, 0xd9, 0x9e, 0x47, 0x99, - 0xcd, 0x1c, 0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73, 0x03, 0x37, 0x3f, 0xbc, 0x5b, 0x03, - 0xf2, 0xc2, 0x36, 0x70, 0xb3, 0xc6, 0x85, 0xe0, 0x1d, 0x30, 0xe6, 0xc4, 0x16, 0xea, 0xd0, 0xd2, - 0xf0, 0x6a, 0xa9, 0x32, 0x6f, 0x66, 0xaf, 0x9b, 0x13, 0x1f, 0x50, 0xc7, 0x7b, 0x1a, 0x91, 0x06, - 0x75, 0xab, 0x23, 0xdc, 0xb0, 0x96, 0x74, 0xa0, 0x49, 0x50, 0x12, 0x21, 0x9f, 0xd8, 0x1d, 0x9b, - 0x04, 0x68, 0x13, 0x4c, 0x65, 0x8e, 0x69, 0xe4, 0x0a, 0x28, 0xfa, 0xa2, 0x22, 0x52, 0x97, 0x2a, - 0xe5, 0xbc, 0x43, 0xcc, 0x96, 0xd2, 0x92, 0x89, 0xae, 0x81, 0x49, 0x21, 0xf5, 0x38, 0x64, 0x83, - 0xc6, 0x44, 0xc0, 0x74, 0x8e, 0x96, 0x7a, 0x6e, 0x83, 0xa2, 0x4d, 0x68, 0xe8, 0xb1, 0x7f, 0x32, - 0x29, 0xa9, 0x85, 0x20, 0xb8, 0x24, 0xec, 0xee, 0xbb, 0x6e, 0xe2, 0x88, 0x9e, 0x01, 0xf5, 0x6c, - 0x2d, 0x4d, 0x71, 0x0f, 0x8c, 0x53, 0x59, 0x53, 0x95, 0xbf, 0x9d, 0x6e, 0xda, 0x52, 0x79, 0x3f, - 0x02, 0x46, 0x85, 0x36, 0x6c, 0x81, 0x62, 0x3c, 0x26, 0x38, 0x97, 0x17, 0xc8, 0xcc, 0x5b, 0xbb, - 0x72, 0x21, 0x94, 0x04, 0x42, 0x0b, 0xaf, 0x3e, 0x7e, 0x7f, 0x33, 0x34, 0x03, 0xcb, 0x56, 0x6e, - 0x77, 0xe2, 0xa1, 0x43, 0x17, 0x8c, 0xa7, 0xf3, 0x9e, 0xef, 0x23, 0x96, 0x80, 0xda, 0xf2, 0x00, - 0x30, 0xf5, 0xd2, 0x85, 0x97, 0x0a, 0x67, 0xf2, 0x5e, 0xc9, 0xd7, 0xc1, 0x08, 0x94, 0x32, 0x33, - 0x83, 0x7a, 0x1f, 0xcd, 0x0c, 0xae, 0xad, 0x0c, 0xc6, 0x53, 0x5b, 0x24, 0x6c, 0x17, 0xa0, 0x96, - 0xb7, 0xb5, 0x5d, 0xb7, 0x9e, 0x5a, 0xef, 0x82, 0xb1, 0x64, 0xfd, 0xb4, 0x3e, 0xb2, 0x12, 0xd3, - 0xd0, 0xc5, 0x58, 0x6a, 0xb7, 0x28, 0xec, 0x66, 0xe1, 0x74, 0xde, 0x4e, 0x6e, 0x08, 0x7c, 0xc9, - 0xb7, 0xfd, 0xf7, 0x7b, 0x03, 0x8d, 0x3e, 0x92, 0x59, 0x82, 0x76, 0xfd, 0x0f, 0x84, 0xd4, 0x78, - 0x59, 0x18, 0x2f, 0xc2, 0x79, 0xeb, 0xfc, 0x03, 0x59, 0xc7, 0x31, 0xb9, 0xba, 0x71, 0xfc, 0x4d, - 0x2f, 0x1c, 0x9f, 0xea, 0xca, 0xc9, 0xa9, 0xae, 0x7c, 0x3d, 0xd5, 0x95, 0xa3, 0x9e, 0x5e, 0x38, - 0xe9, 0xe9, 0x85, 0x4f, 0x3d, 0xbd, 0xf0, 0x3c, 0xbb, 0x0c, 0x5c, 0x64, 0xcd, 0xc3, 0xec, 0x80, - 0x76, 0xf6, 0x62, 0xc5, 0xfd, 0x5b, 0xd6, 0xa1, 0x90, 0x6d, 0x14, 0xc5, 0x13, 0x78, 0xf3, 0x57, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xd1, 0x47, 0x08, 0x23, 0x06, 0x00, 0x00, + // 744 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xbd, 0x52, 0xdb, 0x4a, + 0x18, 0xb5, 0xf8, 0x31, 0xdc, 0x35, 0xcc, 0xbd, 0x77, 0x31, 0x20, 0x04, 0x48, 0xdc, 0xe5, 0x86, + 0x50, 0x60, 0x69, 0xec, 0xcc, 0xa4, 0xc8, 0x4f, 0x11, 0xc7, 0x29, 0x68, 0x42, 0x70, 0x68, 0x92, + 0xc6, 0x23, 0xd9, 0x8b, 0xd1, 0x20, 0x69, 0x85, 0xb5, 0x32, 0xb8, 0x48, 0x93, 0x99, 0xb4, 0x19, + 0x66, 0xf2, 0x08, 0x79, 0x85, 0x3c, 0x04, 0x25, 0x93, 0x34, 0x99, 0x14, 0x4e, 0x02, 0xa9, 0x52, + 0xe6, 0x09, 0x32, 0xbb, 0x5a, 0x29, 0x12, 0x18, 0x87, 0x22, 0x95, 0xbd, 0xdf, 0x39, 0x7b, 0xce, + 0xd1, 0x27, 0x7d, 0x1f, 0x90, 0x43, 0x17, 0x63, 0x23, 0xb4, 0xad, 0xa6, 0xd1, 0x2d, 0x1b, 0x07, + 0x21, 0xee, 0xf4, 0x74, 0xbf, 0x43, 0x28, 0x81, 0x53, 0x0c, 0xd1, 0x19, 0xa2, 0x77, 0xcb, 0xca, + 0x42, 0x93, 0x04, 0x2e, 0x09, 0x1a, 0x1c, 0x33, 0xa2, 0x43, 0x44, 0x54, 0x8a, 0x6d, 0xd2, 0x26, + 0x51, 0x9d, 0xfd, 0x13, 0xd5, 0xa5, 0x36, 0x21, 0x6d, 0x07, 0x1b, 0xa6, 0x6f, 0x1b, 0xa6, 0xe7, + 0x11, 0x6a, 0x52, 0x9b, 0x78, 0xf1, 0x1d, 0x4d, 0xa0, 0xfc, 0x64, 0x85, 0xbb, 0x06, 0xb5, 0x5d, + 0x1c, 0x50, 0xd3, 0xf5, 0x63, 0x42, 0x64, 0x61, 0x58, 0xa6, 0xb7, 0x6f, 0x74, 0xcb, 0x16, 0xa6, + 0x66, 0x26, 0x9e, 0x72, 0x31, 0x38, 0xa1, 0xa6, 0x40, 0xe6, 0x33, 0x08, 0x7f, 0x00, 0x0e, 0xa0, + 0x19, 0xf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xa7, 0xbf, 0x07, 0x46, 0x7c, 0x48, 0x6c, 0xef, 0x69, 0xcf, + 0xb5, 0x88, 0x53, 0x1d, 0x63, 0x86, 0xf5, 0xf8, 0x06, 0x9a, 0x06, 0x05, 0x1e, 0xf2, 0x89, 0xd9, + 0x31, 0xdd, 0x00, 0x6d, 0x82, 0x99, 0xd4, 0x31, 0x89, 0x5c, 0x01, 0x79, 0x9f, 0x57, 0x78, 0xea, + 0x42, 0xa5, 0x98, 0x75, 0x88, 0xd8, 0x42, 0x5a, 0x30, 0xd1, 0x0d, 0x30, 0xcd, 0xa5, 0xb6, 0x42, + 0x3a, 0xac, 0x4d, 0x2e, 0x98, 0xcd, 0xd0, 0x12, 0xcf, 0x1d, 0x90, 0x37, 0x5d, 0x12, 0x7a, 0xf4, + 0x8f, 0x74, 0x4a, 0x68, 0x21, 0x08, 0xfe, 0xe1, 0x76, 0x0f, 0x1c, 0x27, 0x76, 0x44, 0xcf, 0x80, + 0x7c, 0xb1, 0x96, 0xa4, 0xb8, 0x0f, 0x26, 0x89, 0xa8, 0xc9, 0xd2, 0x75, 0xbb, 0x9b, 0x5c, 0xa9, + 0x9c, 0x8e, 0x83, 0x71, 0xae, 0x0d, 0x5b, 0x20, 0x1f, 0xb5, 0x09, 0x2e, 0x64, 0x05, 0x52, 0xfd, + 0x56, 0xfe, 0xbb, 0x12, 0x8a, 0x03, 0xa1, 0xa5, 0x97, 0x1f, 0xbe, 0xbd, 0x19, 0x99, 0x83, 0x45, + 0x23, 0x33, 0x3b, 0x51, 0xd3, 0xa1, 0x03, 0x26, 0x93, 0x7e, 0x2f, 0x0e, 0x10, 0x8b, 0x41, 0x65, + 0x75, 0x08, 0x98, 0x78, 0xa9, 0xdc, 0x4b, 0x86, 0x73, 0x59, 0xaf, 0xf8, 0xe9, 0x60, 0x0f, 0x14, + 0x52, 0x3d, 0x83, 0xea, 0x00, 0xcd, 0x14, 0xae, 0xac, 0x0d, 0xc7, 0x13, 0x5b, 0xc4, 0x6d, 0x97, + 0xa0, 0x92, 0xb5, 0x35, 0x1d, 0xa7, 0x91, 0x58, 0xef, 0x81, 0x89, 0x78, 0xfc, 0x94, 0x01, 0xb2, + 0x02, 0x53, 0xd0, 0xd5, 0x58, 0x62, 0xb7, 0xcc, 0xed, 0xe6, 0xe1, 0x6c, 0xd6, 0x4e, 0x4c, 0x08, + 0x7c, 0xc1, 0xa6, 0xfd, 0xd7, 0xbe, 0x81, 0xda, 0x00, 0xc9, 0x34, 0x41, 0xb9, 0xf9, 0x1b, 0x42, + 0x62, 0xbc, 0xca, 0x8d, 0x97, 0xe1, 0xa2, 0x71, 0x79, 0x41, 0x36, 0xb0, 0xb0, 0x7b, 0x2d, 0x81, + 0x42, 0x8d, 0x4d, 0xca, 0xd6, 0xa1, 0x87, 0x3b, 0x01, 0xdc, 0xd0, 0xc5, 0x57, 0xcd, 0xd6, 0xad, + 0x2e, 0xd6, 0x6d, 0x64, 0x92, 0xa2, 0xd5, 0xf1, 0x41, 0x88, 0x03, 0xaa, 0x94, 0xae, 0xc9, 0x1e, + 0xde, 0x79, 0x3e, 0xa9, 0x0d, 0xc2, 0xb9, 0xd5, 0xda, 0xc9, 0x57, 0x35, 0x77, 0x72, 0xa6, 0x4a, + 0xa7, 0x67, 0xaa, 0xf4, 0xe5, 0x4c, 0x95, 0x8e, 0xcf, 0xd5, 0xdc, 0xe9, 0xb9, 0x9a, 0xfb, 0x78, + 0xae, 0xe6, 0x9e, 0xa7, 0xa7, 0x93, 0x69, 0x94, 0x3c, 0x4c, 0x0f, 0x49, 0x67, 0x3f, 0x12, 0xec, + 0xde, 0x36, 0x8e, 0xb8, 0xaa, 0x95, 0xe7, 0x3b, 0xf9, 0xd6, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xcd, 0xf6, 0x7e, 0xec, 0xd5, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -501,6 +506,9 @@ type QueryClient interface { Inflows(ctx context.Context, in *QueryInflows, opts ...grpc.CallOption) (*QueryInflowsResponse, error) // QuotaExpires returns when current ibc quota will end. QuotaExpires(ctx context.Context, in *QueryQuotaExpires, opts ...grpc.CallOption) (*QueryQuotaExpiresResponse, error) + // DenomOwners queries for all account addresses that own a particular token + // denomination. + DenomOwners(ctx context.Context, in *types.QueryDenomOwnersRequest, opts ...grpc.CallOption) (*types.QueryDenomOwnersResponse, error) } type queryClient struct { @@ -556,6 +564,15 @@ func (c *queryClient) QuotaExpires(ctx context.Context, in *QueryQuotaExpires, o return out, nil } +func (c *queryClient) DenomOwners(ctx context.Context, in *types.QueryDenomOwnersRequest, opts ...grpc.CallOption) (*types.QueryDenomOwnersResponse, error) { + out := new(types.QueryDenomOwnersResponse) + err := c.cc.Invoke(ctx, "/umee.uibc.v1.Query/DenomOwners", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Params queries the parameters of the x/uibc module. @@ -570,6 +587,9 @@ type QueryServer interface { Inflows(context.Context, *QueryInflows) (*QueryInflowsResponse, error) // QuotaExpires returns when current ibc quota will end. QuotaExpires(context.Context, *QueryQuotaExpires) (*QueryQuotaExpiresResponse, error) + // DenomOwners queries for all account addresses that own a particular token + // denomination. + DenomOwners(context.Context, *types.QueryDenomOwnersRequest) (*types.QueryDenomOwnersResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -591,6 +611,9 @@ func (*UnimplementedQueryServer) Inflows(ctx context.Context, req *QueryInflows) func (*UnimplementedQueryServer) QuotaExpires(ctx context.Context, req *QueryQuotaExpires) (*QueryQuotaExpiresResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QuotaExpires not implemented") } +func (*UnimplementedQueryServer) DenomOwners(ctx context.Context, req *types.QueryDenomOwnersRequest) (*types.QueryDenomOwnersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DenomOwners not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -686,6 +709,24 @@ func _Query_QuotaExpires_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Query_DenomOwners_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.QueryDenomOwnersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).DenomOwners(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.uibc.v1.Query/DenomOwners", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).DenomOwners(ctx, req.(*types.QueryDenomOwnersRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "umee.uibc.v1.Query", HandlerType: (*QueryServer)(nil), @@ -710,6 +751,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QuotaExpires", Handler: _Query_QuotaExpires_Handler, }, + { + MethodName: "DenomOwners", + Handler: _Query_DenomOwners_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/uibc/v1/query.proto", diff --git a/x/uibc/query.pb.gw.go b/x/uibc/query.pb.gw.go index a97ad32e6b..5a7a9a5fb2 100644 --- a/x/uibc/query.pb.gw.go +++ b/x/uibc/query.pb.gw.go @@ -13,6 +13,7 @@ import ( "io" "net/http" + types_0 "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/golang/protobuf/descriptor" "github.com/golang/protobuf/proto" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -159,6 +160,42 @@ func local_request_Query_QuotaExpires_0(ctx context.Context, marshaler runtime.M } +var ( + filter_Query_DenomOwners_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq types_0.QueryDenomOwnersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.DenomOwners(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_DenomOwners_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq types_0.QueryDenomOwnersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomOwners_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.DenomOwners(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -280,6 +317,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_DenomOwners_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -421,6 +481,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_DenomOwners_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_DenomOwners_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_DenomOwners_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -434,6 +514,8 @@ var ( pattern_Query_Inflows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "uibc", "v1", "inflows"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QuotaExpires_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "uibc", "v1", "quota_expires"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_DenomOwners_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "uibc", "v1", "denom_owners"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -446,4 +528,6 @@ var ( forward_Query_Inflows_0 = runtime.ForwardResponseMessage forward_Query_QuotaExpires_0 = runtime.ForwardResponseMessage + + forward_Query_DenomOwners_0 = runtime.ForwardResponseMessage ) diff --git a/x/uibc/quota/grpc_query.go b/x/uibc/quota/grpc_query.go index be7f2fa328..f8b45c7256 100644 --- a/x/uibc/quota/grpc_query.go +++ b/x/uibc/quota/grpc_query.go @@ -4,6 +4,8 @@ import ( context "context" sdk "github.com/cosmos/cosmos-sdk/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/umee-network/umee/v6/x/uibc" ) @@ -94,3 +96,13 @@ func (q Querier) QuotaExpires(goCtx context.Context, _ *uibc.QueryQuotaExpires) return &uibc.QueryQuotaExpiresResponse{EndTime: *quotaExpireTime}, nil } + +// DenomOwners implements uibc.QueryServer. +func (q Querier) DenomOwners(ctx context.Context, req *banktypes.QueryDenomOwnersRequest) ( + *banktypes.QueryDenomOwnersResponse, + error) { + return q.bank.DenomOwners(ctx, &banktypes.QueryDenomOwnersRequest{ + Denom: req.Denom, + Pagination: req.Pagination, + }) +} diff --git a/x/uibc/quota/intest/suite_test.go b/x/uibc/quota/intest/suite_test.go index 6cc286c3e8..6c70b27065 100644 --- a/x/uibc/quota/intest/suite_test.go +++ b/x/uibc/quota/intest/suite_test.go @@ -4,20 +4,19 @@ import ( "fmt" "testing" - "github.com/cosmos/cosmos-sdk/codec" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cometbft/cometbft/crypto/secp256k1" tmrand "github.com/cometbft/cometbft/libs/rand" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "gotest.tools/v3/assert" - "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + storetypes "github.com/cosmos/cosmos-sdk/store/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + bkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/staking" "github.com/cosmos/cosmos-sdk/x/staking/testutil" + "gotest.tools/v3/assert" umeeapp "github.com/umee-network/umee/v6/app" appparams "github.com/umee-network/umee/v6/app/params" @@ -107,6 +106,6 @@ func initKeeper( storeKey := storetypes.NewMemoryStoreKey("quota") ctx, _ := tsdk.NewCtxOneStore(t, storeKey) eg := ugovmocks.NewSimpleEmergencyGroupBuilder() - kb := quota.NewBuilder(cdc, storeKey, leverage, oracle, eg) + kb := quota.NewBuilder(cdc, storeKey, leverage, oracle, eg, bkeeper.BaseKeeper{}) return ctx, kb.Keeper(&ctx) } diff --git a/x/uibc/quota/keeper.go b/x/uibc/quota/keeper.go index 845b3944a7..401f26a2f7 100644 --- a/x/uibc/quota/keeper.go +++ b/x/uibc/quota/keeper.go @@ -20,11 +20,12 @@ type Builder struct { leverage uibc.Leverage oracle uibc.Oracle ugov ugov.EmergencyGroupBuilder + bank uibc.BankKeeper } func NewBuilder( cdc codec.BinaryCodec, key storetypes.StoreKey, - leverage uibc.Leverage, oracle uibc.Oracle, ugov ugov.EmergencyGroupBuilder, + leverage uibc.Leverage, oracle uibc.Oracle, ugov ugov.EmergencyGroupBuilder, bk uibc.BankKeeper, ) Builder { return Builder{ cdc: cdc, @@ -32,6 +33,7 @@ func NewBuilder( leverage: leverage, oracle: oracle, ugov: ugov, + bank: bk, } } diff --git a/x/uibc/quota/unit_test.go b/x/uibc/quota/unit_test.go index a87e8b36ae..d569c8ee1f 100644 --- a/x/uibc/quota/unit_test.go +++ b/x/uibc/quota/unit_test.go @@ -7,6 +7,7 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + bkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" "github.com/stretchr/testify/require" "github.com/umee-network/umee/v6/tests/tsdk" @@ -25,7 +26,7 @@ func initKeeper(t *testing.T, l uibc.Leverage, o uibc.Oracle) TestKeeper { ir := cdctypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(ir) storeKey := storetypes.NewMemoryStoreKey("quota") - kb := NewBuilder(cdc, storeKey, l, o, eg) + kb := NewBuilder(cdc, storeKey, l, o, eg, bkeeper.BaseKeeper{}) ctx, _ := tsdk.NewCtxOneStore(t, storeKey) return TestKeeper{kb.Keeper(&ctx), t, &ctx} } diff --git a/x/uibc/uics20/ibc_module_test.go b/x/uibc/uics20/ibc_module_test.go index a88a9969c6..ae560d1522 100644 --- a/x/uibc/uics20/ibc_module_test.go +++ b/x/uibc/uics20/ibc_module_test.go @@ -8,6 +8,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + bkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" ics20types "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" "github.com/golang/mock/gomock" @@ -62,7 +63,7 @@ func TestIBCOnRecvPacket(t *testing.T) { storeKey := storetypes.NewMemoryStoreKey("quota") ctx, _ := tsdk.NewCtxOneStore(t, storeKey) eg := ugovmocks.NewSimpleEmergencyGroupBuilder() - kb := quota.NewBuilder(cdc, storeKey, leverageMock, oracleMock, eg) + kb := quota.NewBuilder(cdc, storeKey, leverageMock, oracleMock, eg, bkeeper.BaseKeeper{}) ics20Module := NewICS20Module(mockIBCModule, cdc, kb, mockLeverageMsgServer) validMemoMsgs := func(noOfMsgs int, fallbackAddr string) string { diff --git a/x/uibc/uics20/ics4_wrapper_test.go b/x/uibc/uics20/ics4_wrapper_test.go index 738ade72e1..89875b2453 100644 --- a/x/uibc/uics20/ics4_wrapper_test.go +++ b/x/uibc/uics20/ics4_wrapper_test.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + bkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" ics20types "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" @@ -52,7 +53,7 @@ func TestSendPacket(t *testing.T) { storeKey := storetypes.NewMemoryStoreKey("quota") ctx, _ := tsdk.NewCtxOneStore(t, storeKey) - kb := quota.NewBuilder(codec.NewProtoCodec(nil), storeKey, leverageMock, oracleMock, eg) + kb := quota.NewBuilder(codec.NewProtoCodec(nil), storeKey, leverageMock, oracleMock, eg, bkeeper.BaseKeeper{}) dp := uibc.DefaultParams() keeper := kb.Keeper(&ctx) keeper.SetParams(dp) From 13f0d9e3fda2e3e56c4c4fd58a069792bf68d48d Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sun, 28 Apr 2024 19:06:22 +0530 Subject: [PATCH 8/8] added height to DenomOwners req --- proto/umee/uibc/v1/query.proto | 2 ++ x/uibc/query.pb.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/proto/umee/uibc/v1/query.proto b/proto/umee/uibc/v1/query.proto index 969d22c6e1..9a1b4ef85c 100644 --- a/proto/umee/uibc/v1/query.proto +++ b/proto/umee/uibc/v1/query.proto @@ -45,6 +45,8 @@ service Query { // DenomOwners queries for all account addresses that own a particular token // denomination. + // For historical state data, height have to pass as a grpc headers request here + // check here: https://docs.cosmos.network/v0.50/user/run-node/interact-node#query-for-historical-state-using-grpcurl rpc DenomOwners(cosmos.bank.v1beta1.QueryDenomOwnersRequest) returns (cosmos.bank.v1beta1.QueryDenomOwnersResponse){ option (google.api.http).get = "/umee/uibc/v1/denom_owners"; } diff --git a/x/uibc/query.pb.go b/x/uibc/query.pb.go index 8f12195c97..1ad3d6fe88 100644 --- a/x/uibc/query.pb.go +++ b/x/uibc/query.pb.go @@ -508,6 +508,8 @@ type QueryClient interface { QuotaExpires(ctx context.Context, in *QueryQuotaExpires, opts ...grpc.CallOption) (*QueryQuotaExpiresResponse, error) // DenomOwners queries for all account addresses that own a particular token // denomination. + // For historical state data, height have to pass as a grpc headers request here + // check here: https://docs.cosmos.network/v0.50/user/run-node/interact-node#query-for-historical-state-using-grpcurl DenomOwners(ctx context.Context, in *types.QueryDenomOwnersRequest, opts ...grpc.CallOption) (*types.QueryDenomOwnersResponse, error) } @@ -589,6 +591,8 @@ type QueryServer interface { QuotaExpires(context.Context, *QueryQuotaExpires) (*QueryQuotaExpiresResponse, error) // DenomOwners queries for all account addresses that own a particular token // denomination. + // For historical state data, height have to pass as a grpc headers request here + // check here: https://docs.cosmos.network/v0.50/user/run-node/interact-node#query-for-historical-state-using-grpcurl DenomOwners(context.Context, *types.QueryDenomOwnersRequest) (*types.QueryDenomOwnersResponse, error) }