This commit is contained in:
Richard Holland
2023-12-20 11:35:51 +00:00
parent 4eba415e9b
commit 3a6f5faacd

View File

@@ -338,7 +338,8 @@ getTransactionalStakeHolders(STTx const& tx, ReadView const& rv)
auto escrow = rv.read(kl);
if (!escrow || escrow->getFieldU16(sfLedgerEntryType) != ltESCROW)
if (!escrow ||
escrow->getFieldU16(sfLedgerEntryType) != ltESCROW)
return {};
// this should always be the same as owner, but defensively...
@@ -2815,10 +2816,10 @@ DEFINE_HOOK_FUNCTION(
ripple::Keylet kl = keylet_type == keylet_code::CHILD
? ripple::keylet::child(id)
: keylet_type == keylet_code::EMITTED_TXN
? ripple::keylet::emittedTxn(id)
: keylet_type == keylet_code::HOOK_DEFINITION
? ripple::keylet::hookDefinition(id)
: ripple::keylet::unchecked(id);
? ripple::keylet::emittedTxn(id)
: keylet_type == keylet_code::HOOK_DEFINITION
? ripple::keylet::hookDefinition(id)
: ripple::keylet::unchecked(id);
return serialize_keylet(kl, memory, write_ptr, write_len);
}
@@ -2847,10 +2848,10 @@ DEFINE_HOOK_FUNCTION(
ripple::Keylet kl = keylet_type == keylet_code::HOOK
? ripple::keylet::hook(id)
: keylet_type == keylet_code::SIGNERS
? ripple::keylet::signers(id)
: keylet_type == keylet_code::OWNER_DIR
? ripple::keylet::ownerDir(id)
: ripple::keylet::account(id);
? ripple::keylet::signers(id)
: keylet_type == keylet_code::OWNER_DIR
? ripple::keylet::ownerDir(id)
: ripple::keylet::account(id);
return serialize_keylet(kl, memory, write_ptr, write_len);
}
@@ -2890,10 +2891,10 @@ DEFINE_HOOK_FUNCTION(
ripple::Keylet kl = keylet_type == keylet_code::CHECK
? ripple::keylet::check(id, seq)
: keylet_type == keylet_code::ESCROW
? ripple::keylet::escrow(id, seq)
: keylet_type == keylet_code::NFT_OFFER
? ripple::keylet::nftoffer(id, seq)
: ripple::keylet::offer(id, seq);
? ripple::keylet::escrow(id, seq)
: keylet_type == keylet_code::NFT_OFFER
? ripple::keylet::nftoffer(id, seq)
: ripple::keylet::offer(id, seq);
return serialize_keylet(kl, memory, write_ptr, write_len);
}
@@ -3011,11 +3012,13 @@ DEFINE_HOOK_FUNCTION(
WRITE_WASM_MEMORY_AND_RETURN(
write_ptr,
write_len,
keylet_type == keylet_code::AMENDMENTS ? cAmendments.data()
: keylet_type == keylet_code::FEES ? cFees.data()
: keylet_type == keylet_code::NEGATIVE_UNL
? cNegativeUNL.data()
: cEmittedDir.data(),
keylet_type == keylet_code::AMENDMENTS
? cAmendments.data()
: keylet_type == keylet_code::FEES
? cFees.data()
: keylet_type == keylet_code::NEGATIVE_UNL
? cNegativeUNL.data()
: cEmittedDir.data(),
34,
memory,
memory_length);
@@ -5853,9 +5856,9 @@ DEFINE_HOOK_FUNCTION(
size_t free_count = hook_api::max_slots - hookCtx.slot.size();
size_t needed_count = slot_into_tx == 0 && slot_into_meta == 0 ? 2
: slot_into_tx != 0 && slot_into_meta != 0 ? 0
: 1;
size_t needed_count = slot_into_tx == 0 && slot_into_meta == 0
? 2
: slot_into_tx != 0 && slot_into_meta != 0 ? 0 : 1;
if (free_count < needed_count)
return NO_FREE_SLOTS;