diff --git a/src/ripple/app/hook/Enum.h b/src/ripple/app/hook/Enum.h index c8662fa00..c790f6e84 100644 --- a/src/ripple/app/hook/Enum.h +++ b/src/ripple/app/hook/Enum.h @@ -161,7 +161,7 @@ namespace hook_api PAGE = 19, ESCROW = 20, PAYCHAN = 21, - EMITTED = 22, + EMITTED_TXN = 22, NFT_OFFER = 23 }; } diff --git a/src/ripple/app/hook/impl/applyHook.cpp b/src/ripple/app/hook/impl/applyHook.cpp index f4bb8acd4..7095ac93a 100644 --- a/src/ripple/app/hook/impl/applyHook.cpp +++ b/src/ripple/app/hook/impl/applyHook.cpp @@ -858,7 +858,7 @@ hook::apply( isCallback && wasmParam & 1 ? std::optional( (*(applyCtx.view().peek( - keylet::emitted(applyCtx.tx.getFieldH256(sfTransactionHash))) + keylet::emittedTxn(applyCtx.tx.getFieldH256(sfTransactionHash))) )).downcast()) : std::optional() }; @@ -1386,7 +1386,7 @@ removeEmissionEntry(ripple::ApplyContext& applyCtx) if (!const_cast(tx).isFieldPresent(sfEmitDetails)) return tesSUCCESS; - auto key = keylet::emitted(tx.getTransactionID()); + auto key = keylet::emittedTxn(tx.getTransactionID()); auto const& sle = applyCtx.view().peek(key); @@ -1444,9 +1444,9 @@ finalizeHookResult( ptr->add(s); SerialIter sit(s.slice()); - auto emittedId = keylet::emitted(id); + auto emittedId = keylet::emittedTxn(id); + auto sleEmitted = applyCtx.view().peek(emittedId); - auto sleEmitted = applyCtx.view().peek(keylet::emitted(id)); if (!sleEmitted) { ++emission_count; @@ -2355,7 +2355,7 @@ DEFINE_HOOK_FUNCTION( // keylets that take a 32 byte uint case keylet_code::CHILD: - case keylet_code::EMITTED: + case keylet_code::EMITTED_TXN: case keylet_code::UNCHECKED: { if (a == 0 || b == 0) @@ -2376,7 +2376,7 @@ DEFINE_HOOK_FUNCTION( ripple::Keylet kl = keylet_type == keylet_code::CHILD ? ripple::keylet::child(id) : - keylet_type == keylet_code::EMITTED ? ripple::keylet::emitted(id) : + keylet_type == keylet_code::EMITTED_TXN ? ripple::keylet::emittedTxn(id) : ripple::keylet::unchecked(id); return serialize_keylet(kl, memory, write_ptr, write_len); diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 631d86da0..2c9819f0b 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -1206,7 +1206,7 @@ NetworkOPsImp::processTransaction( // This function is called by several different parts of the codebase // under no circumstances will we ever accept an emitted txn from the network. // Emitted txns are *always* and *only* inserted by TxQ::accept, and only - // arise from processing ltEMITTED out of the EMITTED_DIR. + // arise from processing ltEMITTED_TXN out of the EMITTED_DIR. // This isn't always an error because a fetch pack etc might include an emitted txn // and if this is a deliberate attempt to send an emitted txn over the network it was // already billed in PeerImp diff --git a/src/ripple/app/misc/impl/TxQ.cpp b/src/ripple/app/misc/impl/TxQ.cpp index d26748b2f..ef1f37cf4 100644 --- a/src/ripple/app/misc/impl/TxQ.cpp +++ b/src/ripple/app/misc/impl/TxQ.cpp @@ -1460,10 +1460,10 @@ TxQ::accept(Application& app, OpenView& view) LedgerEntryType const nodeType{ safe_cast((*sleItem)[sfLedgerEntryType])}; - if (nodeType != ltEMITTED) + if (nodeType != ltEMITTED_TXN) { JLOG(j_.fatal()) - << "EmittedTxn processing: emitted directory contained non ltEMITTED type"; + << "EmittedTxn processing: emitted directory contained non ltEMITTED_TXN type"; break; } diff --git a/src/ripple/app/tx/impl/ApplyContext.h b/src/ripple/app/tx/impl/ApplyContext.h index 7c6aab3fb..7d03d1276 100644 --- a/src/ripple/app/tx/impl/ApplyContext.h +++ b/src/ripple/app/tx/impl/ApplyContext.h @@ -117,7 +117,7 @@ public: TER checkInvariants(TER const result, XRPAmount const fee); - bool emitted() + bool isEmittedTxn() { return tx.isFieldPresent(sfEmitDetails); } diff --git a/src/ripple/app/tx/impl/Change.cpp b/src/ripple/app/tx/impl/Change.cpp index 28fb75a4f..a45bde9d0 100644 --- a/src/ripple/app/tx/impl/Change.cpp +++ b/src/ripple/app/tx/impl/Change.cpp @@ -341,7 +341,7 @@ Change::applyEmitFailure() JLOG(j_.warn()) << "HookEmit[" << txnID << "]: ttEmitFailure removing emitted txn"; - auto key = keylet::emitted(txnID); + auto key = keylet::emittedTxn(txnID); auto const& sle = view().peek(key); diff --git a/src/ripple/app/tx/impl/InvariantCheck.cpp b/src/ripple/app/tx/impl/InvariantCheck.cpp index f3a5a438d..5b49f1e48 100644 --- a/src/ripple/app/tx/impl/InvariantCheck.cpp +++ b/src/ripple/app/tx/impl/InvariantCheck.cpp @@ -389,7 +389,7 @@ LedgerEntryTypesMatch::visitEntry( case ltHOOK: case ltHOOK_DEFINITION: case ltHOOK_STATE: - case ltEMITTED: + case ltEMITTED_TXN: case ltNFTOKEN_PAGE: case ltNFTOKEN_OFFER: break; diff --git a/src/ripple/app/tx/impl/Transactor.cpp b/src/ripple/app/tx/impl/Transactor.cpp index 9495c7fbb..58f68fe3a 100644 --- a/src/ripple/app/tx/impl/Transactor.cpp +++ b/src/ripple/app/tx/impl/Transactor.cpp @@ -478,7 +478,7 @@ Transactor::consumeSeqProxy(SLE::pointer const& sleAccount) assert(sleAccount); // do not update sequence of sfAccountTxnID for emitted tx - if (ctx_.emitted()) + if (ctx_.isEmittedTxn()) return tesSUCCESS; SeqProxy const seqProx = ctx_.tx.getSeqProxy(); @@ -1507,7 +1507,7 @@ Transactor::operator()() auto const& hooksOriginator = view().read(keylet::hook(accountID)); // First check if the Sending account has any hooks that can be fired - if (hooksOriginator && hooksOriginator->isFieldPresent(sfHooks) && !ctx_.emitted()) + if (hooksOriginator && hooksOriginator->isFieldPresent(sfHooks) && !ctx_.isEmittedTxn()) result = executeHookChain( hooksOriginator, diff --git a/src/ripple/protocol/Indexes.h b/src/ripple/protocol/Indexes.h index f3cc2917a..52033f393 100644 --- a/src/ripple/protocol/Indexes.h +++ b/src/ripple/protocol/Indexes.h @@ -56,7 +56,7 @@ Keylet const& emittedDir() noexcept; Keylet -emitted(uint256 const& id) noexcept; +emittedTxn(uint256 const& id) noexcept; Keylet hookDefinition(uint256 const& hash) noexcept; diff --git a/src/ripple/protocol/LedgerFormats.h b/src/ripple/protocol/LedgerFormats.h index e5c9aabf3..c144bcad5 100644 --- a/src/ripple/protocol/LedgerFormats.h +++ b/src/ripple/protocol/LedgerFormats.h @@ -235,7 +235,7 @@ enum LedgerEntryType : std::uint16_t \sa keylet::emitted */ - ltEMITTED = 'E', + ltEMITTED_TXN = 'E', }; // clang-format off diff --git a/src/ripple/protocol/impl/Indexes.cpp b/src/ripple/protocol/impl/Indexes.cpp index 9695122d6..f4669234e 100644 --- a/src/ripple/protocol/impl/Indexes.cpp +++ b/src/ripple/protocol/impl/Indexes.cpp @@ -64,7 +64,7 @@ enum class LedgerNameSpace : std::uint16_t { HOOK_STATE_DIR = 'J', HOOK_STATE = 'v', HOOK_DEFINITION = 'D', - EMITTED = 'E', + EMITTED_TXN = 'E', EMITTED_DIR = 'F', NFTOKEN_OFFER = 'q', NFTOKEN_BUY_OFFERS = 'h', @@ -150,9 +150,9 @@ hookStateDir(AccountID const& id, uint256 const& ns) noexcept } Keylet -emitted(uint256 const& id) noexcept +emittedTxn(uint256 const& id) noexcept { - return {ltEMITTED, indexHash(LedgerNameSpace::EMITTED, id)}; + return {ltEMITTED_TXN, indexHash(LedgerNameSpace::EMITTED_TXN, id)}; } Keylet diff --git a/src/ripple/protocol/impl/LedgerFormats.cpp b/src/ripple/protocol/impl/LedgerFormats.cpp index d549850ee..a1d0fb491 100644 --- a/src/ripple/protocol/impl/LedgerFormats.cpp +++ b/src/ripple/protocol/impl/LedgerFormats.cpp @@ -277,8 +277,8 @@ LedgerFormats::LedgerFormats() }, commonFields); - add(jss::Emitted, - ltEMITTED, + add(jss::EmittedTxn, + ltEMITTED_TXN, { {sfEmittedTxn, soeOPTIONAL}, {sfOwnerNode, soeREQUIRED}, diff --git a/src/ripple/protocol/jss.h b/src/ripple/protocol/jss.h index 30c3da60d..71a38c6f1 100644 --- a/src/ripple/protocol/jss.h +++ b/src/ripple/protocol/jss.h @@ -107,7 +107,7 @@ JSS(SetHook); // transaction type. JSS(Hook); // ledger type. JSS(HookState); // ledger type. JSS(HookDefinition); -JSS(Emitted); // ledger type. +JSS(EmittedTxn); // ledger type. JSS(SignerList); // ledger type. JSS(SignerListSet); // transaction type. JSS(SigningPubKey); // field.