From 8d142458dd0319ca17f3382a74d807707f7b88db Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Fri, 9 Oct 2020 09:28:18 -0400 Subject: [PATCH] fix: remove duplicat query logic (#684) --- x/harvest/keeper/querier.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/x/harvest/keeper/querier.go b/x/harvest/keeper/querier.go index 91d322bc..12cfd407 100644 --- a/x/harvest/keeper/querier.go +++ b/x/harvest/keeper/querier.go @@ -228,19 +228,15 @@ func queryGetClaims(ctx sdk.Context, req abci.RequestQuery, k Keeper) ([]byte, e } else if owner { harvestParams := k.GetParams(ctx) for _, lps := range harvestParams.LiquidityProviderSchedules { - for _, dt := range types.DepositTypesClaimQuery { - claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, dt) - if found { - claims = append(claims, claim) - } + claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, types.LP) + if found { + claims = append(claims, claim) } } for _, dds := range harvestParams.DelegatorDistributionSchedules { - for _, dt := range types.DepositTypesClaimQuery { - claim, found := k.GetClaim(ctx, params.Owner, dds.DistributionSchedule.DepositDenom, dt) - if found { - claims = append(claims, claim) - } + claim, found := k.GetClaim(ctx, params.Owner, dds.DistributionSchedule.DepositDenom, types.Stake) + if found { + claims = append(claims, claim) } } } else if depositType {