Additional support for HookDefinition, HookState, ImportVLSequence at fixPreviousTxnID Amendment

This commit is contained in:
tequ
2025-06-23 17:59:40 +09:00
parent 65f4945f22
commit 6728221831
2 changed files with 16 additions and 2 deletions

View File

@@ -89,6 +89,8 @@ LEDGER_ENTRY(ltHOOK_DEFINITION, 'D', HookDefinition, hook_definition, ({
{sfReferenceCount, soeREQUIRED}, {sfReferenceCount, soeREQUIRED},
{sfFee, soeREQUIRED}, {sfFee, soeREQUIRED},
{sfHookCallbackFee, soeOPTIONAL}, {sfHookCallbackFee, soeOPTIONAL},
{sfPreviousTxnID, soeOPTIONAL},
{sfPreviousTxnLgrSeq, soeOPTIONAL},
})) }))
/** A ledger object containing a hook-emitted transaction from a previous hook execution. /** A ledger object containing a hook-emitted transaction from a previous hook execution.
@@ -118,6 +120,8 @@ LEDGER_ENTRY(ltHOOK, 'H', Hook, hook, ({
LEDGER_ENTRY(ltIMPORT_VLSEQ, 0x0049, ImportVLSequence, import_vlseq, ({ LEDGER_ENTRY(ltIMPORT_VLSEQ, 0x0049, ImportVLSequence, import_vlseq, ({
{sfPublicKey, soeREQUIRED}, {sfPublicKey, soeREQUIRED},
{sfImportSequence, soeREQUIRED}, {sfImportSequence, soeREQUIRED},
{sfPreviousTxnID, soeOPTIONAL},
{sfPreviousTxnLgrSeq, soeOPTIONAL},
})) }))
/** The ledger object which tracks the current negative UNL state. /** The ledger object which tracks the current negative UNL state.
@@ -439,6 +443,8 @@ LEDGER_ENTRY(ltHOOK_STATE, 0x0076, HookState, hook_state, ({
{sfOwnerNode, soeREQUIRED}, {sfOwnerNode, soeREQUIRED},
{sfHookStateKey, soeREQUIRED}, {sfHookStateKey, soeREQUIRED},
{sfHookStateData, soeREQUIRED}, {sfHookStateData, soeREQUIRED},
{sfPreviousTxnID, soeOPTIONAL},
{sfPreviousTxnLgrSeq, soeOPTIONAL},
})) }))
/** A ledger object describing a single unidirectional XRP payment channel. /** A ledger object describing a single unidirectional XRP payment channel.

View File

@@ -135,8 +135,16 @@ STLedgerEntry::getJson(JsonOptions options) const
bool bool
STLedgerEntry::isThreadedType(Rules const& rules) const STLedgerEntry::isThreadedType(Rules const& rules) const
{ {
static constexpr std::array<LedgerEntryType, 5> newPreviousTxnIDTypes = { static constexpr std::array<LedgerEntryType, 8> newPreviousTxnIDTypes = {
ltDIR_NODE, ltAMENDMENTS, ltFEE_SETTINGS, ltNEGATIVE_UNL, ltAMM}; ltDIR_NODE,
ltAMENDMENTS,
ltFEE_SETTINGS,
ltNEGATIVE_UNL,
ltAMM,
ltHOOK_STATE,
ltHOOK_DEFINITION,
ltIMPORT_VLSEQ,
};
// Exclude PrevTxnID/PrevTxnLgrSeq if the fixPreviousTxnID amendment is not // Exclude PrevTxnID/PrevTxnLgrSeq if the fixPreviousTxnID amendment is not
// enabled and the ledger object type is in the above set // enabled and the ledger object type is in the above set
bool const excludePrevTxnID = !rules.enabled(fixPreviousTxnID) && bool const excludePrevTxnID = !rules.enabled(fixPreviousTxnID) &&