Skip to content

Commit

Permalink
Fixed vetoable proposals only returning the latest vetoable proposal.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Dec 13, 2023
1 parent 5beaa90 commit da8dd05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/data/formulas/contract/daoCore/veto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const vetoableProposals: ContractFormula<VetoableProposalDaos[]> = {
(
await getTransformationMatches(
undefined,
`proposalVetoer:${contractAddress}`
`proposalVetoer:${contractAddress}:*`
)
)?.map(({ contractAddress, value }) => ({
proposalModuleAddress: contractAddress,
Expand Down
8 changes: 6 additions & 2 deletions src/data/transformers/proposal/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const vetoer: Transformer = {
getValue: () => '',
}

// Map `proposalVetoer:<VETOER>` to proposal ID.
// Create map from `proposalVetoer:<VETOER>:<PROPOSAL ID>` to proposal ID.
const proposalVetoer: Transformer = {
filter: {
codeIdsKeys: CODE_IDS_KEYS,
Expand All @@ -96,7 +96,11 @@ const proposalVetoer: Transformer = {
event.key.startsWith(KEY_PREFIX_PROPOSALS_V2)) &&
!!event.valueJson.veto,
},
name: (event) => `proposalVetoer:${event.valueJson.veto.vetoer}`,
name: (event) => {
// "proposals"|"proposals_v2", proposalId
const [, proposalId] = dbKeyToKeys(event.key, [false, true])
return `proposalVetoer:${event.valueJson.veto.vetoer}:${proposalId}`
},
getValue: (event) => {
// "proposals"|"proposals_v2", proposalId
const [, proposalId] = dbKeyToKeys(event.key, [false, true])
Expand Down

0 comments on commit da8dd05

Please sign in to comment.