Account_info add flags (#812)

Fixes #768
This commit is contained in:
cyan317
2023-08-04 16:22:39 +01:00
committed by GitHub
parent 4d42cb3cdb
commit d61d702ccd
10 changed files with 364 additions and 73 deletions

View File

@@ -1325,4 +1325,21 @@ getNFTID(boost::json::object const& request)
return tokenid;
}
bool
isAmendmentEnabled(
std::shared_ptr<Backend::BackendInterface const> const& backend,
boost::asio::yield_context yield,
uint32_t seq,
ripple::uint256 amendmentId)
{
// the amendments should always be present in ledger
auto const& amendments = backend->fetchLedgerObject(ripple::keylet::amendments().key, seq, yield);
ripple::SLE amendmentsSLE{
ripple::SerialIter{amendments->data(), amendments->size()}, ripple::keylet::amendments().key};
auto const listAmendments = amendmentsSLE.getFieldV256(ripple::sfAmendments);
return std::find(listAmendments.begin(), listAmendments.end(), amendmentId) != listAmendments.end();
}
} // namespace RPC