address other comments
This commit is contained in:
parent
eeff820427
commit
327f7e1673
@ -24,7 +24,7 @@ func (k Keeper) GetDelegation(ctx sdk.Context,
|
||||
return delegation, true
|
||||
}
|
||||
|
||||
// return all delegations to a specific validator. Useful for querier.
|
||||
// return all delegations used during genesis dump
|
||||
func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegation) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
iterator := sdk.KVStorePrefixIterator(store, DelegationKey)
|
||||
@ -37,8 +37,8 @@ func (k Keeper) GetAllDelegations(ctx sdk.Context) (delegations []types.Delegati
|
||||
return delegations
|
||||
}
|
||||
|
||||
// return all delegations used during genesis dump
|
||||
func (k Keeper) GetAllDelegationsToValidator(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation) {
|
||||
// return all delegations to a specific validator. Useful for querier.
|
||||
func (k Keeper) GetValidatorDelegations(ctx sdk.Context, valAddr sdk.ValAddress) (delegations []types.Delegation) {
|
||||
store := ctx.KVStore(k.storeKey)
|
||||
iterator := sdk.KVStorePrefixIterator(store, DelegationKey)
|
||||
defer iterator.Close()
|
||||
|
||||
@ -131,7 +131,7 @@ func queryValidatorDelegations(ctx sdk.Context, cdc *codec.Codec, req abci.Reque
|
||||
return []byte{}, sdk.ErrUnknownAddress("")
|
||||
}
|
||||
|
||||
delegations := k.GetAllDelegationsToValidator(ctx, params.ValidatorAddr)
|
||||
delegations := k.GetValidatorDelegations(ctx, params.ValidatorAddr)
|
||||
|
||||
res, errRes = codec.MarshalJSONIndent(cdc, delegations)
|
||||
if errRes != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user