Skip to content

Commit

Permalink
fix: use correct pool status
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Nov 6, 2023
1 parent 001a20c commit ea2cd89
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 73 deletions.
18 changes: 9 additions & 9 deletions docs/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
points:
type: string
Expand Down Expand Up @@ -1084,7 +1084,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
title: >-
BasicPool contains the necessary properties need for a
Expand Down Expand Up @@ -3951,7 +3951,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
points:
type: string
Expand Down Expand Up @@ -5002,7 +5002,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
account:
type: string
Expand Down Expand Up @@ -5519,7 +5519,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
account:
type: string
Expand Down Expand Up @@ -5997,7 +5997,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
points:
type: string
Expand Down Expand Up @@ -6427,7 +6427,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
points:
type: string
Expand Down Expand Up @@ -6969,7 +6969,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
points:
type: string
Expand Down Expand Up @@ -7442,7 +7442,7 @@ paths:
- POOL_STATUS_NO_FUNDS
- POOL_STATUS_NOT_ENOUGH_DELEGATION
- POOL_STATUS_UPGRADING
- POOL_STATUS_VP_TOO_HIGH
- POOL_STATUS_VOTING_POWER_TOO_HIGH
default: POOL_STATUS_UNSPECIFIED
points:
type: string
Expand Down
135 changes: 72 additions & 63 deletions x/pool/types/pool.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x/query/keeper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (k Keeper) GetPoolStatus(ctx sdk.Context, pool *pooltypes.Pool) pooltypes.P
} else if totalDelegation < pool.MinDelegation {
poolStatus = pooltypes.POOL_STATUS_NOT_ENOUGH_DELEGATION
} else if highestDelegation*2 > totalDelegation {
poolStatus = pooltypes.POOL_STATUS_VP_TOO_HIGH
poolStatus = pooltypes.POOL_STATUS_VOTING_POWER_TOO_HIGH
} else if pool.TotalFunds == 0 {
poolStatus = pooltypes.POOL_STATUS_NO_FUNDS
} else {
Expand Down

0 comments on commit ea2cd89

Please sign in to comment.