mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-22 03:25:49 +00:00
fixInnerObjTemplate2 amendment (#5047)
* fixInnerObjTemplate2 amendment: Apply inner object templates to all remaining (non-AMM) inner objects. Adds a unit test for applying the template to sfMajorities. Other remaining inner objects showed no problems having templates applied. * Move CMake directory * Rearrange sources * Rewrite includes * Recompute loops --------- Co-authored-by: Pretty Printer <cpp@ripple.com>
This commit is contained in:
@@ -61,10 +61,19 @@ STObject::STObject(SerialIter& sit, SField const& name, int depth) noexcept(
|
||||
}
|
||||
|
||||
STObject
|
||||
STObject::makeInnerObject(SField const& name, Rules const& rules)
|
||||
STObject::makeInnerObject(SField const& name)
|
||||
{
|
||||
STObject obj{name};
|
||||
if (rules.enabled(fixInnerObjTemplate))
|
||||
|
||||
// The if is complicated because inner object templates were added in
|
||||
// two phases:
|
||||
// 1. If there are no available Rules, then always apply the template.
|
||||
// 2. fixInnerObjTemplate added templates to two AMM inner objects.
|
||||
// 3. fixInnerObjTemplate2 added templates to all remaining inner objects.
|
||||
std::optional<Rules> const& rules = getCurrentTransactionRules();
|
||||
bool const isAMMObj = name == sfAuctionSlot || name == sfVoteEntry;
|
||||
if (!rules || (rules->enabled(fixInnerObjTemplate) && isAMMObj) ||
|
||||
(rules->enabled(fixInnerObjTemplate2) && !isAMMObj))
|
||||
{
|
||||
if (SOTemplate const* elements =
|
||||
InnerObjectFormats::getInstance().findSOTemplateBySField(name))
|
||||
|
||||
Reference in New Issue
Block a user