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:
harvestParams := k.GetParams(ctx)
for _, lps := range harvestParams.LiquidityProviderSchedules {
claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, params.DepositType)
if found {
claims = append(claims, claim)
switch {
case params.DepositType == types.LP:
for _, lps := range harvestParams.LiquidityProviderSchedules {
claim, found := k.GetClaim(ctx, params.Owner, lps.DepositDenom, params.DepositType)
if found {
claims = append(claims, claim)
}
}
}
for _, dss := range harvestParams.DelegatorDistributionSchedules {
claim, found := k.GetClaim(ctx, params.Owner, dss.DistributionSchedule.DepositDenom, params.DepositType)
if found {
claims = append(claims, claim)
case params.DepositType == types.Stake:
for _, dss := range harvestParams.DelegatorDistributionSchedules {
claim, found := k.GetClaim(ctx, params.Owner, dss.DistributionSchedule.DepositDenom, params.DepositType)
if found {
claims = append(claims, claim)
}
}
}
case depositDenom: