feat: Check default fields are not default when serializing (#6267)

Co-authored-by: Vito <5780819+Tapanito@users.noreply.github.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
Co-authored-by: Bart <bthomee@users.noreply.github.com>
This commit is contained in:
Ed Hennis
2026-07-23 17:39:11 -04:00
committed by GitHub
parent 4c0180b3db
commit 7908aec2ec

View File

@@ -899,6 +899,10 @@ STObject::add(Serializer& s, WhichFields whichFields) const
XRPL_ASSERT(
(sType != STI_OBJECT) || (field->getFName().fieldType == STI_OBJECT),
"xrpl::STObject::add : valid field type");
XRPL_ASSERT(
getStyle(field->getFName()) != SoeDefault || !field->isDefault(),
"xrpl::STObject::add : non-default value");
field->addFieldID(s);
field->add(s);
if (sType == STI_ARRAY || sType == STI_OBJECT)