fix claim query: owner && depositType (#687)

This commit is contained in:
Denali Marsh 2020-10-13 16:37:46 +02:00 committed by GitHub
parent 69eacdddb0
commit 5fdf23a2ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,16 +188,20 @@ func queryGetClaims(ctx sdk.Context, req abci.RequestQuery, k Keeper) ([]byte, e
}) })
case owner && depositType: case owner && depositType:
harvestParams := k.GetParams(ctx) harvestParams := k.GetParams(ctx)
for _, lps := range harvestParams.LiquidityProviderSchedules { switch {
claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, params.DepositType) case params.DepositType == types.LP:
if found { for _, lps := range harvestParams.LiquidityProviderSchedules {
claims = append(claims, claim) claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, params.DepositType)
if found {
claims = append(claims, claim)
}
} }
} case params.DepositType == types.Stake:
for _, dss := range harvestParams.DelegatorDistributionSchedules { for _, dss := range harvestParams.DelegatorDistributionSchedules {
claim, found := k.GetClaim(ctx, params.Owner, dss.DistributionSchedule.DepositDenom, params.DepositType) claim, found := k.GetClaim(ctx, params.Owner, dss.DistributionSchedule.DepositDenom, params.DepositType)
if found { if found {
claims = append(claims, claim) claims = append(claims, claim)
}
} }
} }
case depositDenom: case depositDenom: