mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-24 15:25:18 +00:00
fix claim query: owner && depositType (#687)
This commit is contained in:
parent
69eacdddb0
commit
5fdf23a2ba
@ -188,18 +188,22 @@ func queryGetClaims(ctx sdk.Context, req abci.RequestQuery, k Keeper) ([]byte, e
|
||||
})
|
||||
case owner && depositType:
|
||||
harvestParams := k.GetParams(ctx)
|
||||
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)
|
||||
}
|
||||
}
|
||||
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:
|
||||
for _, dt := range types.DepositTypesClaimQuery {
|
||||
k.IterateClaimsByTypeAndDenom(ctx, dt, params.DepositDenom, func(claim types.Claim) (stop bool) {
|
||||
|
Loading…
Reference in New Issue
Block a user