From a4fc59b1b2b84c574972567e830ecc9603d112af Mon Sep 17 00:00:00 2001 From: slowbackspace Date: Fri, 13 Dec 2024 13:29:56 +0100 Subject: [PATCH] fix: don't convert to cip129 non-drep voters --- CHANGELOG.md | 7 ++++++- .../governance/proposals/tx-hash/cert-index/votes.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23eb48f5..0e3332b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Support for CIP129 DRep ID - you can query DReps using both legacy format and CIP129 format. The `drep_id` and `hex` fields will reflect the format of the query param + ### Changed -- looser validation for cost model size +- BREAKING CHANGE: Endpoints `/governance/dreps` and `/governance/proposals/{tx_hash}/{cert_index}/votes` are now using CIP129 format +- Looser validation for cost model size in `epochs/:num/parameters` ## [2.4.0] - 2024-11-20 diff --git a/src/routes/governance/proposals/tx-hash/cert-index/votes.ts b/src/routes/governance/proposals/tx-hash/cert-index/votes.ts index 1a758c89..60df2356 100644 --- a/src/routes/governance/proposals/tx-hash/cert-index/votes.ts +++ b/src/routes/governance/proposals/tx-hash/cert-index/votes.ts @@ -37,7 +37,12 @@ async function route(fastify: FastifyInstance) { gracefulRelease(clientDbSync); for (const row of rows) { - // Convert voter id to cip129 format + if (!row.voter.startsWith('drep')) { + // Keep non-DRep voter unmodified + continue; + } + + // Convert voter id to CIP129 format const cip129DRep = dbSyncDRepToCIP129({ drep_id: row.voter, has_script: row.voter_has_script,