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>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-15 17:48:31 +00:00
committed by GitHub
parent c5037b0dc6
commit ffdb36d098
2 changed files with 15 additions and 8 deletions

View File

@@ -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))

View File

@@ -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)
{