Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/cosmos/cosmos-sdk into likh…
Browse files Browse the repository at this point in the history
…ita/pool
  • Loading branch information
likhita-809 committed Sep 27, 2023
2 parents de27ffe + ddd26b5 commit 0823a64
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions x/staking/keeper/alias_functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,7 @@ func (k Keeper) GetValidatorSet() types.ValidatorSet {

// Delegation gets the delegation interface for a particular set of delegator and validator addresses
func (k Keeper) Delegation(ctx context.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) (types.DelegationI, error) {
bond, err := k.Delegations.Get(ctx, collections.Join(addrDel, addrVal))
if err != nil {
return nil, err
}

return bond, nil
return k.Delegations.Get(ctx, collections.Join(addrDel, addrVal))
}

// IterateDelegations iterates through all of the delegations from a delegator
Expand All @@ -103,7 +98,7 @@ func (k Keeper) IterateDelegations(ctx context.Context, delAddr sdk.AccAddress,
) error {
var i int64
rng := collections.NewPrefixedPairRange[sdk.AccAddress, sdk.ValAddress](delAddr)
err := k.Delegations.Walk(ctx, rng, func(key collections.Pair[sdk.AccAddress, sdk.ValAddress], del types.Delegation) (stop bool, err error) {
return k.Delegations.Walk(ctx, rng, func(key collections.Pair[sdk.AccAddress, sdk.ValAddress], del types.Delegation) (stop bool, err error) {
stop = fn(i, del)
if stop {
return true, nil
Expand All @@ -112,11 +107,6 @@ func (k Keeper) IterateDelegations(ctx context.Context, delAddr sdk.AccAddress,

return false, nil
})
if err != nil {
return err
}

return nil
}

// GetAllSDKDelegations returns all delegations used during genesis dump
Expand Down

0 comments on commit 0823a64

Please sign in to comment.