diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 368410fe..16e3e215 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -8097,515 +8097,458 @@ paths: items: type: object properties: - staker: - description: staker ... + address: + type: string + title: address of the staker + validator: type: object properties: - address: + operator_address: type: string - title: address of the staker - validator: + description: >- + operator_address defines the address of the + validator's operator; bech encoded in JSON. + consensus_pubkey: + description: >- + consensus_pubkey is the consensus public key of the + validator, as a Protobuf Any. type: object properties: - operator_address: + '@type': type: string description: >- - operator_address defines the address of the - validator's operator; bech encoded in JSON. - consensus_pubkey: - description: >- - consensus_pubkey is the consensus public key of - the validator, as a Protobuf Any. - type: object - properties: - '@type': - type: string - description: >- - A URL/resource name that uniquely identifies - the type of the serialized + A URL/resource name that uniquely identifies the + type of the serialized - protocol buffer message. This string must - contain at least + protocol buffer message. This string must + contain at least - one "/" character. The last segment of the - URL's path must represent + one "/" character. The last segment of the URL's + path must represent - the fully qualified name of the type (as in + the fully qualified name of the type (as in - `path/google.protobuf.Duration`). The name - should be in a canonical form + `path/google.protobuf.Duration`). The name + should be in a canonical form - (e.g., leading "." is not accepted). + (e.g., leading "." is not accepted). - In practice, teams usually precompile into - the binary all types that they + In practice, teams usually precompile into the + binary all types that they - expect it to use in the context of Any. - However, for URLs which use the + expect it to use in the context of Any. However, + for URLs which use the - scheme `http`, `https`, or no scheme, one - can optionally set up a type + scheme `http`, `https`, or no scheme, one can + optionally set up a type - server that maps type URLs to message - definitions as follows: + server that maps type URLs to message + definitions as follows: - * If no scheme is provided, `https` is - assumed. + * If no scheme is provided, `https` is assumed. - * An HTTP GET on the URL must yield a - [google.protobuf.Type][] - value in binary format, or produce an error. - * Applications are allowed to cache lookup - results based on the - URL, or have them precompiled into a binary to avoid any - lookup. Therefore, binary compatibility needs to be preserved - on changes to types. (Use versioned type names to manage - breaking changes.) + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup + results based on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) - Note: this functionality is not currently - available in the official + Note: this functionality is not currently + available in the official - protobuf release, and it is not used for - type URLs beginning with + protobuf release, and it is not used for type + URLs beginning with - type.googleapis.com. As of May 2023, there - are no widely used type server + type.googleapis.com. As of May 2023, there are + no widely used type server - implementations and no plans to implement - one. + implementations and no plans to implement one. - Schemes other than `http`, `https` (or the - empty scheme) might be + Schemes other than `http`, `https` (or the empty + scheme) might be - used with implementation specific semantics. - additionalProperties: {} - jailed: - type: boolean + used with implementation specific semantics. + additionalProperties: {} + jailed: + type: boolean + description: >- + jailed defined whether the validator has been jailed + from bonded status or not. + status: + description: >- + status is the validator status + (bonded/unbonding/unbonded). + type: string + enum: + - BOND_STATUS_UNSPECIFIED + - BOND_STATUS_UNBONDED + - BOND_STATUS_UNBONDING + - BOND_STATUS_BONDED + default: BOND_STATUS_UNSPECIFIED + tokens: + type: string + description: >- + tokens define the delegated tokens (incl. + self-delegation). + delegator_shares: + type: string + description: >- + delegator_shares defines total shares issued to a + validator's delegators. + description: + description: >- + description defines the description terms for the + validator. + type: object + properties: + moniker: + type: string description: >- - jailed defined whether the validator has been - jailed from bonded status or not. - status: + moniker defines a human-readable name for the + validator. + identity: + type: string description: >- - status is the validator status - (bonded/unbonding/unbonded). + identity defines an optional identity signature + (ex. UPort or Keybase). + website: type: string - enum: - - BOND_STATUS_UNSPECIFIED - - BOND_STATUS_UNBONDED - - BOND_STATUS_UNBONDING - - BOND_STATUS_BONDED - default: BOND_STATUS_UNSPECIFIED - tokens: + description: website defines an optional website link. + security_contact: type: string description: >- - tokens define the delegated tokens (incl. - self-delegation). - delegator_shares: + security_contact defines an optional email for + security contact. + details: type: string + description: details define other optional details. + unbonding_height: + type: string + format: int64 + description: >- + unbonding_height defines, if unbonding, the height + at which this validator has begun unbonding. + unbonding_time: + type: string + format: date-time + description: >- + unbonding_time defines, if unbonding, the min time + for the validator to complete unbonding. + commission: + description: commission defines the commission parameters. + type: object + properties: + commission_rates: description: >- - delegator_shares defines total shares issued to - a validator's delegators. - description: - description: >- - description defines the description terms for - the validator. + commission_rates defines the initial commission + rates to be used for creating a validator. type: object properties: - moniker: + rate: type: string description: >- - moniker defines a human-readable name for - the validator. - identity: + rate is the commission rate charged to + delegators, as a fraction. + max_rate: type: string description: >- - identity defines an optional identity - signature (ex. UPort or Keybase). - website: - type: string - description: website defines an optional website link. - security_contact: + max_rate defines the maximum commission rate + which validator can ever charge, as a + fraction. + max_change_rate: type: string description: >- - security_contact defines an optional email - for security contact. - details: - type: string - description: details define other optional details. - unbonding_height: - type: string - format: int64 - description: >- - unbonding_height defines, if unbonding, the - height at which this validator has begun - unbonding. - unbonding_time: + max_change_rate defines the maximum daily + increase of the validator commission, as a + fraction. + update_time: type: string format: date-time description: >- - unbonding_time defines, if unbonding, the min - time for the validator to complete unbonding. - commission: - description: commission defines the commission parameters. - type: object - properties: - commission_rates: - description: >- - commission_rates defines the initial - commission rates to be used for creating a - validator. - type: object - properties: - rate: - type: string - description: >- - rate is the commission rate charged to - delegators, as a fraction. - max_rate: - type: string - description: >- - max_rate defines the maximum commission - rate which validator can ever charge, as - a fraction. - max_change_rate: - type: string - description: >- - max_change_rate defines the maximum - daily increase of the validator - commission, as a fraction. - update_time: - type: string - format: date-time - description: >- - update_time is the last time the commission - rate was changed. - min_self_delegation: - type: string - description: >- - min_self_delegation is the validator's self - declared minimum self delegation. + update_time is the last time the commission rate + was changed. + min_self_delegation: + type: string + description: >- + min_self_delegation is the validator's self declared + minimum self delegation. - Since: cosmos-sdk 0.46 - unbonding_on_hold_ref_count: - type: string - format: int64 - title: >- - strictly positive if this validator's unbonding - has been stopped by external modules - unbonding_ids: - type: array - items: - type: string - format: uint64 - title: >- - list of unbonding ids, each uniquely identifing - an unbonding of this validator - description: >- - Validator defines a validator, together with the - total amount of the + Since: cosmos-sdk 0.46 + unbonding_on_hold_ref_count: + type: string + format: int64 + title: >- + strictly positive if this validator's unbonding has + been stopped by external modules + unbonding_ids: + type: array + items: + type: string + format: uint64 + title: >- + list of unbonding ids, each uniquely identifing an + unbonding of this validator + description: >- + Validator defines a validator, together with the total + amount of the - Validator's bond shares and their exchange rate to - coins. Slashing results in + Validator's bond shares and their exchange rate to + coins. Slashing results in - a decrease in the exchange rate, allowing correct - calculation of future + a decrease in the exchange rate, allowing correct + calculation of future - undelegations without iterating over delegators. - When coins are delegated to + undelegations without iterating over delegators. When + coins are delegated to - this validator, the validator is credited with a - delegation whose number of + this validator, the validator is credited with a + delegation whose number of - bond shares is based on the amount of coins - delegated divided by the current + bond shares is based on the amount of coins delegated + divided by the current - exchange rate. Voting power can be calculated as - total bonded shares + exchange rate. Voting power can be calculated as total + bonded shares - multiplied by exchange rate. - total_pool_stake: - type: string - format: uint64 - title: >- - total_pool_stake returns the amount the validator - has in total + multiplied by exchange rate. + total_pool_stake: + type: string + format: uint64 + title: >- + total_pool_stake returns the amount the validator has in + total - staked in all his pools - pools: - type: array - items: + staked in all his pools + pools: + type: array + items: + type: object + properties: + pool: + title: pool contains useful information about the pool type: object properties: - pool: - title: >- - pool contains useful information about the - pool - type: object - properties: - id: - type: string - format: uint64 - title: id is the ID of the pool - name: - type: string - title: name of the pool - runtime: - type: string - description: |- - runtime for the protocol nodes - like evm, bitcoin, etc. - logo: - type: string - title: logo of the pool - inflation_share_weight: - type: string - title: >- - inflation_share_weight is the base payout - for each bundle reward - upload_interval: - type: string - format: uint64 - title: >- - upload_interval is the interval bundles - get created - total_funds: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination - and an amount. - - - NOTE: The amount field is an Int which - implements the custom method - - signatures required by gogoproto. - title: >- - total_funds of the pool. If the pool runs - - out of funds no more bundles will be - produced - total_stake: - type: string - format: uint64 - title: total_stake of the pool - status: - description: |- - status of the pool if pool is able - to produce bundles, etc. - type: string - enum: - - POOL_STATUS_UNSPECIFIED - - POOL_STATUS_ACTIVE - - POOL_STATUS_DISABLED - - POOL_STATUS_NO_FUNDS - - POOL_STATUS_NOT_ENOUGH_DELEGATION - - POOL_STATUS_UPGRADING - - POOL_STATUS_VOTING_POWER_TOO_HIGH - - POOL_STATUS_END_KEY_REACHED - default: POOL_STATUS_UNSPECIFIED - points: + id: type: string format: uint64 + title: id is the ID of the pool + name: + type: string + title: name of the pool + runtime: + type: string description: |- - points indicates if the staker is inactive - If the staker misses a vote, a point is added. - After 5 points the staker is removed from - the stakers set. - is_leaving: - type: boolean + runtime for the protocol nodes + like evm, bitcoin, etc. + logo: + type: string + title: logo of the pool + inflation_share_weight: + type: string title: >- - is_leaving indicates if a user has scheduled a - - a PoolLeave entry. After the leave-time is - over - - the staker will no longer participate in that - pool - valaddress: + inflation_share_weight is the base payout for + each bundle reward + upload_interval: type: string - description: >- - Valaddress is the address which is authorized - to vote + format: uint64 + title: >- + upload_interval is the interval bundles get + created + total_funds: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and + an amount. - and submit bundles. If the server gets - compromised - the staker can just change the valaddress. - balance: + NOTE: The amount field is an Int which + implements the custom method + + signatures required by gogoproto. + title: |- + total_funds of the pool. If the pool runs + out of funds no more bundles will be produced + total_stake: type: string format: uint64 - title: >- - balance is the valaddress account balance and - indicates + title: total_stake of the pool + status: + description: |- + status of the pool if pool is able + to produce bundles, etc. + type: string + enum: + - POOL_STATUS_UNSPECIFIED + - POOL_STATUS_ACTIVE + - POOL_STATUS_DISABLED + - POOL_STATUS_NO_FUNDS + - POOL_STATUS_NOT_ENOUGH_DELEGATION + - POOL_STATUS_UPGRADING + - POOL_STATUS_VOTING_POWER_TOO_HIGH + - POOL_STATUS_END_KEY_REACHED + default: POOL_STATUS_UNSPECIFIED + points: + type: string + format: uint64 + description: |- + points indicates if the staker is inactive + If the staker misses a vote, a point is added. + After 5 points the staker is removed from + the stakers set. + is_leaving: + type: boolean + title: |- + is_leaving indicates if a user has scheduled a + a PoolLeave entry. After the leave-time is over + the staker will no longer participate in that pool + valaddress: + type: string + description: >- + Valaddress is the address which is authorized to + vote - whether or not the valaccount needs additional - funds to + and submit bundles. If the server gets compromised - pay for gas fees - commission: - type: string - title: >- - commission is the commission the validator has - chosen for + the staker can just change the valaddress. + balance: + type: string + format: uint64 + title: >- + balance is the valaddress account balance and + indicates - this specific pool - pending_commission_change: - description: >- - pending_commission_change shows if the staker - plans + whether or not the valaccount needs additional + funds to - to change its commission. Delegators will see - a warning in + pay for gas fees + commission: + type: string + title: >- + commission is the commission the validator has + chosen for - the UI. A Commission change takes some time - until + this specific pool + pending_commission_change: + description: >- + pending_commission_change shows if the staker + plans - the commission is applied. Users have time to - redelegate + to change its commission. Delegators will see a + warning in - if they not agree with the new commission. - type: object - properties: - commission: - type: string - title: |- - commission is the new commission that will - become active once the change-time is over - creation_date: - type: string - format: int64 - description: >- - creation_date is the UNIX-timestamp (in - seconds) + the UI. A Commission change takes some time until - of when the entry was created. - title: >- - CommissionChangeEntry shows when the old - commission + the commission is applied. Users have time to + redelegate - of a staker will change to the new commission - stake_fraction: + if they not agree with the new commission. + type: object + properties: + commission: type: string - title: >- - stake fraction is a percentage the validator - has chosen for + title: |- + commission is the new commission that will + become active once the change-time is over + creation_date: + type: string + format: int64 + description: >- + creation_date is the UNIX-timestamp (in + seconds) - this pool. It is the fraction of how much of - his total stake + of when the entry was created. + title: >- + CommissionChangeEntry shows when the old + commission - the validator wants to stake in this specific - pool - pending_stake_fraction_change: - description: >- - pending_stake_fraction_change shows if the - staker plans + of a staker will change to the new commission + stake_fraction: + type: string + title: >- + stake fraction is a percentage the validator has + chosen for - to change its stake fraction. Delegators will - see a warning in + this pool. It is the fraction of how much of his + total stake - the UI. A stake fraction change takes some - time until + the validator wants to stake in this specific pool + pending_stake_fraction_change: + description: >- + pending_stake_fraction_change shows if the staker + plans - the stake fraction is applied. Users have time - to redelegate + to change its stake fraction. Delegators will see + a warning in - if they not agree with the new stake fraction. - type: object - properties: - stake_fraction: - type: string - title: >- - stake_fraction is the new stake_fraction - that will + the UI. A stake fraction change takes some time + until - become active once the change-time is over - creation_date: - type: string - format: int64 - description: >- - creation_date is the UNIX-timestamp (in - seconds) + the stake fraction is applied. Users have time to + redelegate - of when the entry was created. + if they not agree with the new stake fraction. + type: object + properties: + stake_fraction: + type: string title: >- - StakeFractionChangeEntry shows when the old - stake fraction + stake_fraction is the new stake_fraction that + will - of a staker will change to the new stake - fraction - pool_stake: + become active once the change-time is over + creation_date: type: string - format: uint64 - title: >- - pool stake shows the actual amount the - validator has staked + format: int64 + description: >- + creation_date is the UNIX-timestamp (in + seconds) - in this pool. It can be lower than the - specified stake fraction + of when the entry was created. + title: >- + StakeFractionChangeEntry shows when the old stake + fraction - because of the max voting power limit - title: |- - PoolMembership shows in which pool the staker - is participating - description: |- - pools is a list of all pools the staker is currently - participating, i.e. allowed to vote and upload data. - title: >- - FullStaker aggregates information from the staker and - its delegators + of a staker will change to the new stake fraction + pool_stake: + type: string + format: uint64 + title: >- + pool stake shows the actual amount the validator + has staked - as well as pending queue entries into one object. + in this pool. It can be lower than the specified + stake fraction - It contains almost all needed information for a - convenient usage - valaccount: - description: valaccount ... - type: object - properties: - pool_id: - type: string - format: uint64 - description: |- - pool_id defines the pool in which the address - is allowed to vote in. - staker: - type: string - description: staker is the address the valaccount is voting for. - valaddress: - type: string - title: |- - valaddress is the account stored on the protocol - node which votes for the staker in the given pool - points: - type: string - format: uint64 - description: |- - When a node is inactive (does not vote at all) - A point is added, after a certain amount of points - is reached the node gets kicked out. - is_leaving: - type: boolean - description: >- - isLeaving indicates if a staker is leaving the given - pool. - commission: - type: string - description: commission ... - stake_fraction: - type: string - description: stake_fraction ... - description: StakerPoolResponse ... + because of the max voting power limit + title: |- + PoolMembership shows in which pool the staker + is participating + description: |- + pools is a list of all pools the staker is currently + participating, i.e. allowed to vote and upload data. + title: >- + FullStaker aggregates information from the staker and its + delegators + + as well as pending queue entries into one object. + + It contains almost all needed information for a convenient + usage description: stakers ... description: >- QueryStakersByPoolResponse is the response type for the diff --git a/proto/kyve/query/v1beta1/stakers.proto b/proto/kyve/query/v1beta1/stakers.proto index 7bcfd3d5..8a86e5f8 100644 --- a/proto/kyve/query/v1beta1/stakers.proto +++ b/proto/kyve/query/v1beta1/stakers.proto @@ -99,19 +99,11 @@ message QueryStakersByPoolRequest { // QueryStakersByPoolResponse is the response type for the Query/Staker RPC method. message QueryStakersByPoolResponse { // stakers ... - repeated StakerPoolResponse stakers = 1 [(gogoproto.nullable) = false]; -} - -// StakerPoolResponse ... -message StakerPoolResponse { - // staker ... - FullStaker staker = 1; - // valaccount ... - kyve.stakers.v1beta1.Valaccount valaccount = 2; + repeated FullStaker stakers = 1 [(gogoproto.nullable) = false]; } // ========================= -// stakers_by_pool/{pool_id} +// stakers_by_pool_count // ========================= // QueryStakersByPoolCountRequest ... diff --git a/x/query/keeper/grpc_query_stakers_by_pool.go b/x/query/keeper/grpc_query_stakers_by_pool.go index 7d5d7199..14299655 100644 --- a/x/query/keeper/grpc_query_stakers_by_pool.go +++ b/x/query/keeper/grpc_query_stakers_by_pool.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "sort" "github.com/KYVENetwork/chain/x/query/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -15,24 +16,22 @@ func (k Keeper) StakersByPool(c context.Context, req *types.QueryStakersByPoolRe return nil, status.Error(codes.InvalidArgument, "invalid request") } - data := make([]types.StakerPoolResponse, 0) - ctx := sdk.UnwrapSDKContext(c) - _, found := k.poolKeeper.GetPool(ctx, req.PoolId) - if !found { + if _, found := k.poolKeeper.GetPool(ctx, req.PoolId); !found { return nil, sdkerrors.ErrKeyNotFound } + stakers := make([]types.FullStaker, 0) + valaccounts := k.stakerKeeper.GetAllValaccountsOfPool(ctx, req.PoolId) for _, valaccount := range valaccounts { - if _, exist := k.stakerKeeper.GetValidator(ctx, valaccount.Staker); exist { - data = append(data, types.StakerPoolResponse{ - Staker: k.GetFullStaker(ctx, valaccount.Staker), - Valaccount: valaccount, - }) - } + stakers = append(stakers, *k.GetFullStaker(ctx, valaccount.Staker)) } - return &types.QueryStakersByPoolResponse{Stakers: data}, nil + sort.Slice(stakers, func(i, j int) bool { + return k.stakerKeeper.GetValidatorPoolStake(ctx, stakers[i].Address, req.PoolId) > k.stakerKeeper.GetValidatorPoolStake(ctx, stakers[j].Address, req.PoolId) + }) + + return &types.QueryStakersByPoolResponse{Stakers: stakers}, nil } diff --git a/x/query/types/stakers.pb.go b/x/query/types/stakers.pb.go index 86d0d02d..4f1a0789 100644 --- a/x/query/types/stakers.pb.go +++ b/x/query/types/stakers.pb.go @@ -6,7 +6,7 @@ package types import ( context "context" fmt "fmt" - types "github.com/KYVENetwork/chain/x/stakers/types" + _ "github.com/KYVENetwork/chain/x/stakers/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" @@ -323,7 +323,7 @@ func (m *QueryStakersByPoolRequest) GetPoolId() uint64 { // QueryStakersByPoolResponse is the response type for the Query/Staker RPC method. type QueryStakersByPoolResponse struct { // stakers ... - Stakers []StakerPoolResponse `protobuf:"bytes,1,rep,name=stakers,proto3" json:"stakers"` + Stakers []FullStaker `protobuf:"bytes,1,rep,name=stakers,proto3" json:"stakers"` } func (m *QueryStakersByPoolResponse) Reset() { *m = QueryStakersByPoolResponse{} } @@ -359,68 +359,13 @@ func (m *QueryStakersByPoolResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryStakersByPoolResponse proto.InternalMessageInfo -func (m *QueryStakersByPoolResponse) GetStakers() []StakerPoolResponse { +func (m *QueryStakersByPoolResponse) GetStakers() []FullStaker { if m != nil { return m.Stakers } return nil } -// StakerPoolResponse ... -type StakerPoolResponse struct { - // staker ... - Staker *FullStaker `protobuf:"bytes,1,opt,name=staker,proto3" json:"staker,omitempty"` - // valaccount ... - Valaccount *types.Valaccount `protobuf:"bytes,2,opt,name=valaccount,proto3" json:"valaccount,omitempty"` -} - -func (m *StakerPoolResponse) Reset() { *m = StakerPoolResponse{} } -func (m *StakerPoolResponse) String() string { return proto.CompactTextString(m) } -func (*StakerPoolResponse) ProtoMessage() {} -func (*StakerPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6aa31a681566da33, []int{6} -} -func (m *StakerPoolResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StakerPoolResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StakerPoolResponse.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 *StakerPoolResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StakerPoolResponse.Merge(m, src) -} -func (m *StakerPoolResponse) XXX_Size() int { - return m.Size() -} -func (m *StakerPoolResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StakerPoolResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StakerPoolResponse proto.InternalMessageInfo - -func (m *StakerPoolResponse) GetStaker() *FullStaker { - if m != nil { - return m.Staker - } - return nil -} - -func (m *StakerPoolResponse) GetValaccount() *types.Valaccount { - if m != nil { - return m.Valaccount - } - return nil -} - // QueryStakersByPoolCountRequest ... type QueryStakersByPoolCountRequest struct { // pagination defines an optional pagination for the request. @@ -431,7 +376,7 @@ func (m *QueryStakersByPoolCountRequest) Reset() { *m = QueryStakersByPo func (m *QueryStakersByPoolCountRequest) String() string { return proto.CompactTextString(m) } func (*QueryStakersByPoolCountRequest) ProtoMessage() {} func (*QueryStakersByPoolCountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_6aa31a681566da33, []int{7} + return fileDescriptor_6aa31a681566da33, []int{6} } func (m *QueryStakersByPoolCountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -479,7 +424,7 @@ func (m *QueryStakersByPoolCountResponse) Reset() { *m = QueryStakersByP func (m *QueryStakersByPoolCountResponse) String() string { return proto.CompactTextString(m) } func (*QueryStakersByPoolCountResponse) ProtoMessage() {} func (*QueryStakersByPoolCountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_6aa31a681566da33, []int{8} + return fileDescriptor_6aa31a681566da33, []int{7} } func (m *QueryStakersByPoolCountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -530,7 +475,6 @@ func init() { proto.RegisterType((*QueryStakerResponse)(nil), "kyve.query.v1beta1.QueryStakerResponse") proto.RegisterType((*QueryStakersByPoolRequest)(nil), "kyve.query.v1beta1.QueryStakersByPoolRequest") proto.RegisterType((*QueryStakersByPoolResponse)(nil), "kyve.query.v1beta1.QueryStakersByPoolResponse") - proto.RegisterType((*StakerPoolResponse)(nil), "kyve.query.v1beta1.StakerPoolResponse") proto.RegisterType((*QueryStakersByPoolCountRequest)(nil), "kyve.query.v1beta1.QueryStakersByPoolCountRequest") proto.RegisterType((*QueryStakersByPoolCountResponse)(nil), "kyve.query.v1beta1.QueryStakersByPoolCountResponse") } @@ -538,54 +482,51 @@ func init() { func init() { proto.RegisterFile("kyve/query/v1beta1/stakers.proto", fileDescriptor_6aa31a681566da33) } var fileDescriptor_6aa31a681566da33 = []byte{ - // 739 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x4f, 0x4f, 0x13, 0x4d, - 0x1c, 0xee, 0x94, 0xa6, 0x0d, 0x03, 0xef, 0x1b, 0x32, 0x2f, 0xe1, 0x2d, 0xab, 0x2c, 0xcd, 0x6a, - 0x4a, 0x45, 0xd9, 0x09, 0x45, 0x8d, 0x07, 0x63, 0xe4, 0x4f, 0x6b, 0x1a, 0x12, 0x82, 0xdb, 0x42, - 0xa2, 0x97, 0x66, 0xda, 0x4e, 0xb6, 0x9b, 0x96, 0x9d, 0xb2, 0xb3, 0x45, 0x1b, 0xc2, 0x41, 0x2f, - 0x7a, 0x32, 0x26, 0x7e, 0x00, 0x0f, 0xc6, 0x8b, 0x17, 0xfd, 0x18, 0x1c, 0x49, 0xbc, 0x78, 0x32, - 0x06, 0xfc, 0x0e, 0x5e, 0x4d, 0x67, 0x67, 0x71, 0x17, 0x5a, 0x5b, 0x12, 0x0f, 0xde, 0x66, 0x76, - 0x9e, 0x67, 0x7e, 0xcf, 0xf3, 0xcc, 0xfc, 0x66, 0x61, 0xaa, 0xd1, 0xd9, 0xa3, 0x78, 0xb7, 0x4d, - 0x9d, 0x0e, 0xde, 0x5b, 0xac, 0x50, 0x97, 0x2c, 0x62, 0xee, 0x92, 0x06, 0x75, 0xb8, 0xde, 0x72, - 0x98, 0xcb, 0x10, 0xea, 0x22, 0x74, 0x81, 0xd0, 0x25, 0x42, 0x99, 0xaf, 0x32, 0xbe, 0xc3, 0x38, - 0xae, 0x10, 0x7e, 0x96, 0xdc, 0x22, 0xa6, 0x65, 0x13, 0xd7, 0x62, 0xb6, 0xc7, 0x57, 0x26, 0x4d, - 0x66, 0x32, 0x31, 0xc4, 0xdd, 0x91, 0xfc, 0x7a, 0xd9, 0x64, 0xcc, 0x6c, 0x52, 0x4c, 0x5a, 0x16, - 0x26, 0xb6, 0xcd, 0x5c, 0x41, 0x91, 0x35, 0x15, 0xb5, 0x87, 0x2a, 0x4f, 0x81, 0xb7, 0xae, 0x89, - 0x75, 0xa9, 0xb3, 0xb7, 0x6e, 0xed, 0x23, 0x80, 0xff, 0x3d, 0xec, 0x72, 0x8a, 0xde, 0x67, 0x83, - 0xee, 0xb6, 0x29, 0x77, 0x51, 0x1e, 0xc2, 0x5f, 0x1a, 0x93, 0x20, 0x05, 0x32, 0x63, 0xd9, 0xb4, - 0xee, 0x19, 0xd2, 0xbb, 0x86, 0xc2, 0x5e, 0xf5, 0x4d, 0x62, 0x52, 0xc9, 0x35, 0x02, 0x4c, 0x74, - 0x07, 0xc6, 0xb9, 0x4b, 0xdc, 0x36, 0x4f, 0x46, 0x53, 0x20, 0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xf2, 0x6e, 0x09, 0x79, 0x18, 0x2d, 0xfc, 0x26, 0x9f, 0x72, - 0xa5, 0x53, 0xee, 0xbe, 0x1b, 0x78, 0x5f, 0x3e, 0x26, 0x07, 0xe8, 0xd3, 0x69, 0x67, 0x07, 0x6f, - 0x36, 0xca, 0x0e, 0x57, 0x3d, 0xd8, 0x71, 0xca, 0xd2, 0x85, 0x38, 0x52, 0xf6, 0xa2, 0x90, 0x7d, - 0x1d, 0x5d, 0x1b, 0x42, 0x76, 0x59, 0xf4, 0xfe, 0xca, 0xda, 0xe1, 0xb1, 0x0a, 0x8e, 0x8e, 0x55, - 0xf0, 0xed, 0x58, 0x05, 0xaf, 0x4f, 0xd4, 0xc8, 0xd1, 0x89, 0x1a, 0xf9, 0x72, 0xa2, 0x46, 0x1e, - 0xcf, 0x9b, 0x96, 0x5b, 0x6f, 0x57, 0xf4, 0x2a, 0xdb, 0xc1, 0xeb, 0x8f, 0xb6, 0x73, 0x1b, 0xd4, - 0x7d, 0xc2, 0x9c, 0x06, 0xae, 0xd6, 0x89, 0x65, 0xe3, 0xa7, 0x72, 0x77, 0xb7, 0xd3, 0xa2, 0xbc, - 0x12, 0x17, 0xbf, 0xd3, 0xa5, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x68, 0x64, 0xf5, 0xe3, 0x2a, - 0x08, 0x00, 0x00, + // 691 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xc7, 0x33, 0x69, 0x48, 0xe8, 0xb4, 0x4a, 0x19, 0x4b, 0x4d, 0x57, 0xbb, 0x0d, 0xab, 0xb4, + 0xb1, 0xda, 0x1d, 0x9a, 0x2a, 0x78, 0x10, 0xa1, 0x3f, 0x52, 0x09, 0x85, 0x52, 0x77, 0xd3, 0x82, + 0x22, 0x84, 0x4d, 0x32, 0x6c, 0x96, 0x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0x7f, 0xd2, 0x48, 0xec, 0x05, 0x81, 0x7d, + 0x13, 0xdd, 0x18, 0x00, 0xbb, 0x52, 0xf3, 0xa5, 0xcb, 0xab, 0x87, 0xc7, 0x2a, 0x38, 0x3a, 0x56, + 0xc1, 0xb7, 0x63, 0x15, 0xbc, 0x3e, 0x51, 0x13, 0x47, 0x27, 0x6a, 0xe2, 0xcb, 0x89, 0x9a, 0x78, + 0x3c, 0x67, 0x3b, 0xbc, 0xd1, 0xa9, 0xea, 0x35, 0xba, 0x83, 0xd7, 0x1f, 0x6d, 0x17, 0x37, 0x08, + 0x7f, 0x4a, 0xbd, 0x26, 0xae, 0x35, 0x2c, 0xc7, 0xc5, 0xcf, 0xe4, 0xe9, 0xbc, 0xdb, 0x26, 0xac, + 0x9a, 0x16, 0xff, 0x5a, 0x8b, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xcf, 0x3c, 0x86, 0x13, 0x91, + 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1011,53 +952,6 @@ func (m *QueryStakersByPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *StakerPoolResponse) 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 *StakerPoolResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StakerPoolResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Valaccount != nil { - { - size, err := m.Valaccount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakers(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Staker != nil { - { - size, err := m.Staker.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintStakers(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *QueryStakersByPoolCountRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1243,23 +1137,6 @@ func (m *QueryStakersByPoolResponse) Size() (n int) { return n } -func (m *StakerPoolResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Staker != nil { - l = m.Staker.Size() - n += 1 + l + sovStakers(uint64(l)) - } - if m.Valaccount != nil { - l = m.Valaccount.Size() - n += 1 + l + sovStakers(uint64(l)) - } - return n -} - func (m *QueryStakersByPoolCountRequest) Size() (n int) { if m == nil { return 0 @@ -1847,7 +1724,7 @@ func (m *QueryStakersByPoolResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Stakers = append(m.Stakers, StakerPoolResponse{}) + m.Stakers = append(m.Stakers, FullStaker{}) if err := m.Stakers[len(m.Stakers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1873,128 +1750,6 @@ func (m *QueryStakersByPoolResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *StakerPoolResponse) 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 ErrIntOverflowStakers - } - 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: StakerPoolResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StakerPoolResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Staker", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakers - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Staker == nil { - m.Staker = &FullStaker{} - } - if err := m.Staker.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Valaccount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowStakers - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthStakers - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthStakers - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Valaccount == nil { - m.Valaccount = &types.Valaccount{} - } - if err := m.Valaccount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipStakers(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthStakers - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryStakersByPoolCountRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0