mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 23:35:19 +00:00
fix claim query: owner && depositType (#687)
This commit is contained in:
parent
69eacdddb0
commit
5fdf23a2ba
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user