From ffdb36d0983a2d6e5d68f3dd20e65362d7e4cc09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 17:48:31 +0000 Subject: [PATCH] fix: Restore correct behavior for vetoed/obsolete fields and move changelog to Unreleased - Only set vetoed and obsolete fields for disabled amendments in admin mode - Move API changelog entry from 2.5.0 to Unreleased section - Clarify that both fields are only in admin-mode responses for disabled amendments Agent-Logs-Url: https://github.com/XRPLF/rippled/sessions/5601e141-f680-49d6-84f4-9dd77a369805 Co-authored-by: mvadari <8029314+mvadari@users.noreply.github.com> --- API-CHANGELOG.md | 8 ++++---- src/xrpld/app/misc/detail/AmendmentTable.cpp | 15 +++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/API-CHANGELOG.md b/API-CHANGELOG.md index 546baf3267..6ffa624619 100644 --- a/API-CHANGELOG.md +++ b/API-CHANGELOG.md @@ -26,6 +26,10 @@ This version is supported by all `rippled` versions. For WebSocket and HTTP JSON This section contains changes targeting a future version. +### Breaking changes + +- `feature`: In admin-mode responses, the `vetoed` field is now always a boolean. Disabled obsolete amendments now have `"vetoed": true` and a new `"obsolete": true` field, instead of the previous `"vetoed": "Obsolete"` string value. This change improves type safety for API clients. Both `vetoed` and `obsolete` fields are only present in admin-mode responses for disabled amendments. + ### Additions - `server_definitions`: Added the following new sections to the response ([#6321](https://github.com/XRPLF/rippled/pull/6321)): @@ -92,10 +96,6 @@ This release contains bug fixes only and no API changes. [Version 2.5.0](https://github.com/XRPLF/rippled/releases/tag/2.5.0) was released on Jun 24, 2025. -### Breaking changes in 2.5.0 - -- `feature`: The `vetoed` field in admin-mode responses is now always a boolean. Disabled obsolete amendments now have `"vetoed": true` instead of the previous `"vetoed": "Obsolete"` string value, which was not type-safe. A new `"obsolete"` boolean field is now included in all responses (both admin and non-admin), indicating whether an amendment is obsolete. - ### Additions and bugfixes in 2.5.0 - `tx`: Added `ctid` field to the response and improved error handling. ([#4738](https://github.com/XRPLF/rippled/pull/4738)) diff --git a/src/xrpld/app/misc/detail/AmendmentTable.cpp b/src/xrpld/app/misc/detail/AmendmentTable.cpp index 01a90bccca..6c490da417 100644 --- a/src/xrpld/app/misc/detail/AmendmentTable.cpp +++ b/src/xrpld/app/misc/detail/AmendmentTable.cpp @@ -924,12 +924,19 @@ AmendmentTableImpl::injectJson( v[jss::name] = fs.name; v[jss::supported] = fs.supported; - v[jss::enabled] = fs.enabled; - v[jss::obsolete] = fs.vote == AmendmentVote::obsolete; - if (isAdmin) + if (!fs.enabled && isAdmin) { - v[jss::vetoed] = fs.vote == AmendmentVote::down || fs.vote == AmendmentVote::obsolete; + if (fs.vote == AmendmentVote::obsolete) + { + v[jss::vetoed] = true; + v[jss::obsolete] = true; + } + else + { + v[jss::vetoed] = fs.vote == AmendmentVote::down; + } } + v[jss::enabled] = fs.enabled; if (!fs.enabled && lastVote_ && isAdmin) {