Repository navigation
Conversation
mesudip
left a comment
There was a problem hiding this comment.
The route itself looks right: literal path before :stakeKey, page validation, the cache in the wallet-state namespaces (cleared per block), 501 through withMethod, the feature following the provider's method, NO_ROUTE and the capability specs updated, and the rest-api-v1 maps. npm run verify in govtool-backend passes (23 suites, 476 tests). One claim needs fixing before merge, because it lands in the append-only decision log and the redesigned dashboard (#4316) already relies on it.
Must fix
-
"Newest first, so the first row is the current one" is not true.
- Where: D178 in
docs/api/decisions.md:5949, the doc comment ongetDelegationHistory(src/account/account.service.ts:89), and the test name attest/account-delegation-history.spec.ts:95. - The history is every
delegation_votecertificate (HISTORY_SQL,govtool-provider-dbsync/src/accounts.ts:210). A delegation stops standing when the account deregisters its stake key, or when the DRep retires (cleared by the ledger from protocol 10). The provider's own current-delegation query checks both:account_deregisteredanddrep_retiredinDELEGATION_SQL,accounts.ts:103-126. - Effect: #4316's My Delegations table (
GovernanceTab.tsx:592-594) marks row 0 "Current" and shows the account's present voting power next to it, even when that delegation is gone. - Fix: word it as "newest first; the newest row is the latest delegation certificate, which may no longer stand (the current delegation is
/ada-holder/get-current-delegation)". Decisions are append-only, so this has to be right when it merges.
- Where: D178 in
-
Decision number. #4318 also adds a D178 ("Page tags come from the backend through nginx includes"), and #4322's D179 refers to this PR's D178. Whichever of these merges second needs to renumber.
Should fix (or follow up)
-
Page numbering.
- This route is 1-based and reads
page=0as page 1 (src/account/account.controller.ts:19-20). It answers with the same{ elements, page, pageSize, total }envelope as/drep/listand/proposal/list, which are 0-based (drep.controller.ts:79,proposal.controller.ts:40). - A caller paging it like those lists gets the first page twice, with no error.
- Either reject
page=0with a 400 or state the base in rest-api-v1.md.pageSize=0is also silently read as 1.
- This route is 1-based and reads
-
Docs.
govtool/AGENTS.md's list of what govtool-backend serves beyond the legacy routes doesn't name the new route. Neither doestests/AGENTS.md's list of newer routes that have no pytest cases.
8e3593b to
200fcee
Compare
|
Thanks. I rebased the branch on develop (it conflicted after #4317, #4318 and #4319) and force-pushed; the fixes are three commits on top of e960773:
|
List of changes
GET /account/{stakeKey}/delegation-history: the account's governance delegations, newest first, as{ elements, page, pageSize, total }, read through the provider'slistDelegationHistoryaccount.delegationHistorywhere the provider has that method (db-sync); Koios, Blockfrost and the fixture keep it unavailable (noSource) and the route answers 501docs/api/decisions.mdand in therest-api-v1.mdroute mapsThe redesigned DRep dashboard (#4316) already reads this route once the feature is served.
Checklist