20 #include <ripple/app/tx/impl/CreateTicket.h>
21 #include <ripple/app/ledger/Ledger.h>
22 #include <ripple/basics/Log.h>
23 #include <ripple/protocol/Feature.h>
24 #include <ripple/protocol/Indexes.h>
25 #include <ripple/protocol/TxFlags.h>
47 "Malformed transaction: bad expiration";
79 if (
view().parentCloseTime() >= expiration)
88 sleTicket->setFieldU32 (
sfExpiration, expiration.time_since_epoch().count());
104 sleTicket->setAccountID (
sfTarget, target_account);
113 "Creating ticket " <<
to_string (sleTicket->key()) <<
114 ": " << (page ?
"success" :
"failure");
NotTEC preflight2(PreflightContext const &ctx)
Checks whether the signature appears valid.
const SF_Account sfTarget(access, STI_ACCOUNT, 7, "Target")
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 SF_U32 sfSequence(access, STI_UINT32, 4, "Sequence")
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
const SF_Account sfAccount(access, STI_ACCOUNT, 1, "Account")
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.
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 const account_t account
AccountID getAccountID(SField const &field) const
Keylet ownerDir(AccountID const &id)
The root page of an account's directory.
std::uint32_t getFlags() const
bool enabled(uint256 const &id) const
Returns true if a feature is enabled.
const uint256 featureTickets
const SF_U32 sfExpiration(access, STI_UINT32, 10, "Expiration")
std::uint32_t getSequence() const
boost::optional< std::uint64_t > dirAdd(ApplyView &view, Keylet const &dir, uint256 const &uLedgerIndex, bool strictOrder, std::function< void(SLE::ref)> fDescriber, beast::Journal j)
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
uint256 getTicketIndex(AccountID const &account, std::uint32_t uSequence)
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
static NotTEC preflight(PreflightContext const &ctx)
const std::uint32_t tfUniversalMask
std::uint32_t getFieldU32(SField const &field) const
State information when preflighting a tx.
std::chrono::time_point< NetClock > time_point
TERSubset< CanCvtToNotTEC > NotTEC