Skip to content

Commit

Permalink
refactor: remove delegation type check
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM committed Jul 25, 2024
1 parent 81ba633 commit 0aeb7ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/restaking/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (k Querier) PoolDelegations(goCtx context.Context, req *types.QueryPoolDele

// Query the pool delegations for the given pool id
delegations, pageRes, err := query.GenericFilteredPaginate(k.cdc, delegationsStore, req.Pagination, func(key []byte, delegation *types.Delegation) (*types.Delegation, error) {
if delegation.Type != types.DELEGATION_TYPE_POOL || delegation.TargetID != req.PoolId {
if delegation.TargetID != req.PoolId {
return nil, nil
}
return delegation, nil
Expand Down Expand Up @@ -117,7 +117,7 @@ func (k Querier) OperatorDelegations(goCtx context.Context, req *types.QueryOper

// Query the operator delegations for the given pool id
delegations, pageRes, err := query.GenericFilteredPaginate(k.cdc, delegationsStore, req.Pagination, func(key []byte, delegation *types.Delegation) (*types.Delegation, error) {
if delegation.Type != types.DELEGATION_TYPE_OPERATOR || delegation.TargetID != req.OperatorId {
if delegation.TargetID != req.OperatorId {
return nil, nil
}
return delegation, nil
Expand Down Expand Up @@ -191,7 +191,7 @@ func (k Querier) ServiceDelegations(goCtx context.Context, req *types.QueryServi

// Query the service delegations for the given pool id
delegations, pageRes, err := query.GenericFilteredPaginate(k.cdc, delegationsStore, req.Pagination, func(key []byte, delegation *types.Delegation) (*types.Delegation, error) {
if delegation.Type != types.DELEGATION_TYPE_SERVICE || delegation.TargetID != req.ServiceId {
if delegation.TargetID != req.ServiceId {
return nil, nil
}
return delegation, nil
Expand Down

0 comments on commit 0aeb7ca

Please sign in to comment.