From 816b4f0d9b2787082bf53c4083eb8f9ed46b9cba 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 | 8 ++++++++ .../governance/proposals/tx-hash/cert-index/votes.ts | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81fcfa7c..6eb2f595 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +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 + +- BREAKING CHANGE: Endpoints `/governance/dreps` and `/governance/proposals/{tx_hash}/{cert_index}/votes` are now using CIP129 format + ## [2.4.0] - 2024-11-20 ### Added 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,