Skip to content

Commit

Permalink
fix: don't convert to cip129 non-drep voters
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Dec 13, 2024
1 parent 3939d71 commit 816b4f0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/routes/governance/proposals/tx-hash/cert-index/votes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 816b4f0

Please sign in to comment.