-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: governance and unbonding fixes #1044
Changes from all commits
4ff950d
cff8d3f
ab70b19
7b11581
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { | ||
ApiV1GovProposalGetStatusEnum as ApiIndexerProposalStatusEnum, | ||
DefaultApi, | ||
Proposal as IndexerProposal, | ||
ProposalStatusEnum as IndexerProposalStatusEnum, | ||
|
@@ -257,16 +258,16 @@ const fromIndexerStatus = ( | |
|
||
const toIndexerStatus = ( | ||
proposalStatus: ProposalStatus | ||
): IndexerProposalStatusEnum => { | ||
): ApiIndexerProposalStatusEnum => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this change do? It looks we are using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So there are two enums specified in swagger file. One is for status used in query params and other is used as a part of proposal response type. I think they should always be the same(kind of), but in rust we have two, because query params and response are two separate things.
Second:
It's a bit confusing :D We can potentially leave two enums in rust but have only one described in swagger 🤔 |
||
switch (proposalStatus) { | ||
case "pending": | ||
return IndexerProposalStatusEnum.Pending; | ||
return ApiIndexerProposalStatusEnum.Pending; | ||
case "ongoing": | ||
return IndexerProposalStatusEnum.Voting; | ||
return ApiIndexerProposalStatusEnum.VotingPeriod; | ||
case "passed": | ||
return IndexerProposalStatusEnum.Passed; | ||
return ApiIndexerProposalStatusEnum.Passed; | ||
case "rejected": | ||
return IndexerProposalStatusEnum.Rejected; | ||
return ApiIndexerProposalStatusEnum.Rejected; | ||
default: | ||
return assertNever(proposalStatus); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually not sure if this is correct, just seemed wrong :D