1#include <xrpl/tx/transactors/check/CheckCancel.h>
3#include <xrpl/basics/Log.h>
4#include <xrpl/ledger/ApplyView.h>
5#include <xrpl/ledger/View.h>
6#include <xrpl/ledger/helpers/AccountRootHelpers.h>
7#include <xrpl/protocol/AccountID.h>
8#include <xrpl/protocol/Indexes.h>
9#include <xrpl/protocol/SField.h>
10#include <xrpl/protocol/STLedgerEntry.h>
11#include <xrpl/protocol/STTx.h>
12#include <xrpl/protocol/TER.h>
13#include <xrpl/protocol/XRPAmount.h>
14#include <xrpl/tx/Transactor.h>
31 JLOG(ctx.
j.
warn()) <<
"Check does not exist.";
44 if (acctId != (*sleCheck)[sfAccount] && acctId != (*sleCheck)[sfDestination])
46 JLOG(ctx.
j.
warn()) <<
"Check is not expired and canceler is "
47 "neither check source nor destination.";
61 JLOG(
j_.warn()) <<
"Check does not exist.";
65 AccountID const srcId{sleCheck->getAccountID(sfAccount)};
66 AccountID const dstId{sleCheck->getAccountID(sfDestination)};
67 auto viewJ =
ctx_.registry.get().getJournal(
"View");
77 JLOG(
j_.fatal()) <<
"Unable to delete check from destination.";
87 JLOG(
j_.fatal()) <<
"Unable to delete check from owner.";
A generic endpoint for log messages.
virtual SLE::pointer peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
virtual void erase(SLE::ref sle)=0
Remove a peeked SLE.
static TER preclaim(PreclaimContext const &ctx)
bool finalizeInvariants(STTx const &tx, TER result, XRPAmount fee, ReadView const &view, beast::Journal const &j) override
Check transaction-specific post-conditions after all entries have been visited.
static NotTEC preflight(PreflightContext const &ctx)
void visitInvariantEntry(bool isDelete, SLE::const_ref before, SLE::const_ref after) override
Inspect a single ledger entry modified by this transaction.
virtual SLE::const_pointer read(Keylet const &k) const =0
Return the state item associated with a key.
std::shared_ptr< STLedgerEntry const > const & const_ref
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Keylet check(AccountID const &id, std::uint32_t seq) noexcept
A Check.
Keylet account(AccountID const &id) noexcept
AccountID root.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool hasExpired(ReadView const &view, std::optional< std::uint32_t > const &exp)
Determines whether the given expiration time has passed.
TERSubset< CanCvtToNotTEC > NotTEC
void adjustOwnerCount(ApplyView &view, SLE::ref sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
TERSubset< CanCvtToTER > TER
State information when determining if a tx is likely to claim a fee.
State information when preflighting a tx.