mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-27 09:00:09 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user