regen-network / groups-ui

:rocket: UI for the Cosmos SDK group module
https://groups.regen.network
Apache License 2.0
6 stars 4 forks source link

Remove proposal status and vote option enum workarounds #124

Open ryanchristo opened 1 year ago

ryanchristo commented 1 year ago

This issue tracks the removal of the workarounds in src/util/enum.ts for proposal status and vote option. This may involve investigating the issue upstream in either regen-js and/or telescope to identify its source.

/**
 * TODO: the generated `ProposalStatus` enum returns number values, but the
 * actual API response is the keys of those values. We also can't import that
 * enum directly because of a combo of vite and the generated code - this is a
 * copy-pasted version of the enum from the SDK, converted to a normal object,
 * used to generate an equivalent a second object with the correct values
 */
const GeneratedProposalStatus: typeof ProposalStatusType = {
...
/** TODO: VoteOption won't properly import into vite as an export directly from
 * the generated lib - this is copy-pasted */
export const VoteOption: typeof VoteOptionType = {
...