refactor(export): store multisigned tx as sfExportedTxn object in metadata

Use sfExportedTxn (OBJECT) instead of sfBlob (VL) for the multisigned
transaction in sfExportResult metadata. This renders as readable JSON
with all fields visible (Account, Signers, etc.) instead of an opaque
hex blob.

Also compute the tx hash directly via getHash(HashPrefix::transactionID)
on the STObject instead of serializing/deserializing through STTx.
This commit is contained in:
Nicholas Dudfield
2026-03-18 14:16:25 +07:00
parent 8c747a1916
commit de43ca2385
2 changed files with 37 additions and 21 deletions

View File

@@ -695,8 +695,20 @@ struct Export_test : public beast::unit_test::suite
{
auto const& result =
exportMeta->peekAtField(sfExportResult).downcast<STObject>();
if (result.isFieldPresent(sfBlob))
multisignedBlob = result.getFieldVL(sfBlob);
if (result.isFieldPresent(sfExportedTxn))
{
// Serialize the nested object to get the raw blob
// for submission to XRPL.
auto const& expTxn = const_cast<STObject&>(result)
.peekFieldObject(sfExportedTxn);
Serializer s;
expTxn.add(s);
multisignedBlob = s.peekData();
log << "Xahau: ExportResult.ExportedTxn = "
<< expTxn.getJson(JsonOptions::none).toStyledString()
<< std::endl;
}
}
log << "Xahau: multisigned blob size = " << multisignedBlob.size()
<< std::endl;