20 #include <ripple/app/tx/impl/DepositPreauth.h>
21 #include <ripple/basics/Log.h>
22 #include <ripple/ledger/View.h>
23 #include <ripple/protocol/Feature.h>
24 #include <ripple/protocol/Indexes.h>
25 #include <ripple/protocol/TxFlags.h>
26 #include <ripple/protocol/st.h>
45 JLOG(j.trace()) <<
"Malformed transaction: Invalid flags set.";
51 if (
static_cast<bool>(optAuth) ==
static_cast<bool>(optUnauth))
56 <<
"Malformed transaction: "
57 "Invalid Authorize and Unauthorize field combination.";
62 AccountID const target{optAuth ? *optAuth : *optUnauth};
63 if (target == beast::zero)
65 JLOG(j.trace()) <<
"Malformed transaction: Authorized or Unauthorized "
74 <<
"Malformed transaction: Attempting to DepositPreauth self.";
143 JLOG(
j_.
trace()) <<
"Adding DepositPreauth to owner directory "
145 << (page ?
"success" :
"failure");
179 JLOG(j.
warn()) <<
"Selected DepositPreauth does not exist.";
187 JLOG(j.
fatal()) <<
"Unable to delete DepositPreauth from owner.";
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
Stream trace() const
Severity stream access functions.
virtual std::shared_ptr< SLE > peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
const uint256 featureDepositPreauth
virtual void erase(std::shared_ptr< SLE > const &sle)=0
Remove a peeked SLE.
boost::optional< std::uint64_t > dirInsert(Keylet const &directory, uint256 const &key, std::function< void(std::shared_ptr< SLE > const &)> const &describe)
Insert an entry to a directory.
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
const SF_Account sfAccount(access, STI_ACCOUNT, 1, "Account")
const SF_Account sfUnauthorize(access, STI_ACCOUNT, 6, "Unauthorize")
std::string to_string(ListDisposition disposition)
const SF_U64 sfOwnerNode(access, STI_UINT64, 4, "OwnerNode")
const SF_U32 sfOwnerCount(access, STI_UINT32, 13, "OwnerCount")
NotTEC preflight1(PreflightContext const &ctx)
Performs early sanity checks on the account and fee fields.
Writeable view to a ledger, for applying a transaction.
bool dirRemove(Keylet const &directory, std::uint64_t page, uint256 const &key, bool keepRoot)
Remove an entry from a directory.
static TER removeFromLedger(Application &app, ApplyView &view, uint256 const &delIndex, beast::Journal j)
void adjustOwnerCount(ApplyView &view, std::shared_ptr< SLE > const &sle, std::int32_t amount, beast::Journal j)
Adjust the owner count up or down.
static TER preclaim(PreclaimContext const &ctx)
Keylet account(AccountID const &id) noexcept
AccountID root.
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
A generic endpoint for log messages.
bool enabled(uint256 const &id) const
Returns true if a feature is enabled.
State information when determining if a tx is likely to claim a fee.
virtual void insert(std::shared_ptr< SLE > const &sle)=0
Insert a new state SLE.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
virtual beast::Journal journal(std::string const &name)=0
XRPAmount accountReserve(std::size_t ownerCount) const
Returns the account reserve given the owner count, in drops.
bool isFieldPresent(SField const &field) const
@ tecINSUFFICIENT_RESERVE
const std::uint32_t tfUniversalMask
State information when preflighting a tx.
const SF_Account sfAuthorize(access, STI_ACCOUNT, 5, "Authorize")
static NotTEC preflight(PreflightContext const &ctx)
Keylet depositPreauth(AccountID const &owner, AccountID const &preauthorized) noexcept
A DepositPreauth.
TERSubset< CanCvtToNotTEC > NotTEC