fix: remove duplicat query logic (#684)

This commit is contained in:
Kevin Davis 2020-10-09 09:28:18 -04:00 committed by GitHub
parent dbb385ecd8
commit 8d142458dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,19 +228,15 @@ func queryGetClaims(ctx sdk.Context, req abci.RequestQuery, k Keeper) ([]byte, e
} else if owner { } else if owner {
harvestParams := k.GetParams(ctx) harvestParams := k.GetParams(ctx)
for _, lps := range harvestParams.LiquidityProviderSchedules { for _, lps := range harvestParams.LiquidityProviderSchedules {
for _, dt := range types.DepositTypesClaimQuery { claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, types.LP)
claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, dt) if found {
if found { claims = append(claims, claim)
claims = append(claims, claim)
}
} }
} }
for _, dds := range harvestParams.DelegatorDistributionSchedules { for _, dds := range harvestParams.DelegatorDistributionSchedules {
for _, dt := range types.DepositTypesClaimQuery { claim, found := k.GetClaim(ctx, params.Owner, dds.DistributionSchedule.DepositDenom, types.Stake)
claim, found := k.GetClaim(ctx, params.Owner, dds.DistributionSchedule.DepositDenom, dt) if found {
if found { claims = append(claims, claim)
claims = append(claims, claim)
}
} }
} }
} else if depositType { } else if depositType {