1#include <xrpl/tx/transactors/account/SetRegularKey.h>
3#include <xrpl/basics/Slice.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/protocol/Indexes.h>
7#include <xrpl/protocol/LedgerFormats.h>
8#include <xrpl/protocol/PublicKey.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>
30 if (sle && !sle->isFlag(lsfPasswordSpent))
61 sle->setFlag(lsfPasswordSpent);
63 if (
ctx_.tx.isFieldPresent(sfRegularKey))
65 sle->setAccountID(sfRegularKey,
ctx_.tx.getAccountID(sfRegularKey));
73 sle->makeFieldAbsent(sfRegularKey);
76 ctx_.view().update(sle);
A generic endpoint for log messages.
virtual SLE::pointer peek(Keylet const &k)=0
Prepare to modify the SLE associated with key.
std::shared_ptr< STLedgerEntry const > const & const_ref
bool isFieldPresent(SField const &field) const
AccountID getAccountID(SField const &field) const
Blob getSigningPubKey() const
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.
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
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 XRPAmount minimumFee(ServiceRegistry ®istry, XRPAmount baseFee, Fees const &fees, ApplyFlags flags)
Compute the minimum fee required to process a transaction with a given baseFee based on the current s...
static XRPAmount calculateBaseFee(ReadView const &view, STTx const &tx)
AccountID const accountID_
Keylet signerList(AccountID const &account) noexcept
A SignerList.
Keylet account(AccountID const &id) noexcept
AccountID root.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
TERSubset< CanCvtToNotTEC > NotTEC
AccountID calcAccountID(PublicKey const &pk)
TERSubset< CanCvtToTER > TER
std::enable_if_t< std::is_same_v< T, char >||std::is_same_v< T, unsigned char >, Slice > makeSlice(std::array< T, N > const &a)
State information when preflighting a tx.