20#ifndef RIPPLE_PROTOCOL_STVALIDATION_H_INCLUDED 
   21#define RIPPLE_PROTOCOL_STVALIDATION_H_INCLUDED 
   23#include <xrpl/basics/Log.h> 
   24#include <xrpl/beast/utility/instrumentation.h> 
   25#include <xrpl/protocol/PublicKey.h> 
   26#include <xrpl/protocol/STObject.h> 
   27#include <xrpl/protocol/SecretKey.h> 
   28#include <xrpl/protocol/Units.h> 
   75    template <
class LookupNodeID>
 
   78        LookupNodeID&& lookupNodeID,
 
 
  172template <
class LookupNodeID>
 
  175    LookupNodeID&& lookupNodeID,
 
  177    : 
STObject(validationFormat(), sit, sfValidation)
 
  178    , signingPubKey_([this]() {
 
  182            Throw<std::runtime_error>(
"Invalid public key in validation");
 
  186    , nodeID_(lookupNodeID(signingPubKey_))
 
  188    if (checkSignature && !isValid())
 
  190        JLOG(
debugLog().error()) << 
"Invalid signature in validation: " 
  192        Throw<std::runtime_error>(
"Invalid signature in validation");
 
  197        "ripple::STValidation::STValidation(SerialIter) : nonzero node");
 
 
  215    : 
STObject(validationFormat(), sfValidation)
 
  218    , seenTime_(signTime)
 
  222        "ripple::STValidation::STValidation(PublicKey, SecretKey) : nonzero " 
  227        LogicError(
"We can only use secp256k1 keys for signing validations");
 
  245                "Required field '" + e.sField().getName() +
 
  246                "' missing from validation.");
 
 
Tracks the number of instances of an object.
 
Slice slice() const noexcept
 
Defines the fields and their attributes within a STObject.
 
A type which can be exported to a well known binary format.
 
Blob getFieldVL(SField const &field) const
 
bool setFlag(std::uint32_t)
 
bool isFieldPresent(SField const &field) const
 
void setFieldU32(SField const &field, std::uint32_t)
 
void setFieldVL(SField const &field, Blob const &)
 
PublicKey const & getSignerPublic() const noexcept
 
uint256 getConsensusHash() const
 
std::string render() const
 
std::optional< bool > valid_
 
STValidation(SerialIter &sit, LookupNodeID &&lookupNodeID, bool checkSignature)
Construct a STValidation from a peer from serialized data.
 
Blob getSerialized() const
 
NetClock::time_point getSeenTime() const noexcept
 
void setSeen(NetClock::time_point s)
 
bool isTrusted() const noexcept
 
PublicKey const signingPubKey_
 
static SOTemplate const & validationFormat()
 
NodeID const & getNodeID() const noexcept
 
bool isFull() const noexcept
 
NetClock::time_point seenTime_
 
STBase * copy(std::size_t n, void *buf) const override
 
uint256 getLedgerHash() const
 
bool isValid() const noexcept
 
uint256 getSigningHash() const
 
Blob getSignature() const
 
STBase * move(std::size_t n, void *buf) override
 
NetClock::time_point getSignTime() const
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
std::string toBase58(AccountID const &v)
Convert AccountID to base58 checked string.
 
std::optional< KeyType > publicKeyType(Slice const &slice)
Returns the type of public key.
 
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
 
beast::Journal debugLog()
Returns a debug journal.
 
Buffer signDigest(PublicKey const &pk, SecretKey const &sk, uint256 const &digest)
Generate a signature for a message digest.
 
constexpr std::uint32_t vfFullyCanonicalSig
 
std::string to_string(base_uint< Bits, Tag > const &a)
 
constexpr std::uint32_t vfFullValidation
 
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
 
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
 
T time_since_epoch(T... args)