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