1#ifndef XRPL_APP_CONSENSUSS_VALIDATIONS_H_INCLUDED
2#define XRPL_APP_CONSENSUSS_VALIDATIONS_H_INCLUDED
4#include <xrpld/app/ledger/Ledger.h>
5#include <xrpld/consensus/Validations.h>
7#include <xrpl/protocol/Protocol.h>
8#include <xrpl/protocol/RippleLedgerHash.h>
9#include <xrpl/protocol/STValidation.h>
44 return val_->getLedgerHash();
51 return val_->getFieldU32(sfLedgerSequence);
58 return val_->getSignTime();
65 return val_->getSeenTime();
72 return val_->getSignerPublic();
79 return val_->getNodeID();
86 return val_->isTrusted();
105 return val_->isFull();
112 return ~(*val_)[~sfLoadFee];
119 return (*
val_)[sfCookie];
A generic endpoint for log messages.
Wraps a ledger instance for use in generic Validations LedgerTrie.
ID id() const
The ID (hash) of the ledger.
ID operator[](Seq const &s) const
Lookup the ID of the ancestor ledger.
friend Seq mismatch(RCLValidatedLedger const &a, RCLValidatedLedger const &b)
Find the sequence number of the earliest mismatching ancestor.
std::vector< uint256 > ancestors_
Seq seq() const
The sequence (index) of the ledger.
Wrapper over STValidation for generic Validation code.
std::shared_ptr< STValidation > val_
std::optional< std::uint32_t > loadFee() const
Get the load fee of the validation if it exists.
bool trusted() const
Whether the validation is considered trusted.
std::uint32_t seq() const
Validated ledger's sequence number (0 if none)
NetClock::time_point signTime() const
Validation's signing time.
NetClock::time_point seenTime() const
Validated ledger's first seen time.
std::uint64_t cookie() const
Get the cookie specified in the validation (0 if not set)
RCLValidation(std::shared_ptr< STValidation > const &v)
Constructor.
uint256 ledgerID() const
Validated ledger's hash.
std::shared_ptr< STValidation > unwrap() const
Extract the underlying STValidation being wrapped.
NodeID nodeID() const
NodeID of validator that published the validation.
bool full() const
Whether the validation is full (not-partial)
PublicKey key() const
Public key of validator that published the validation.
Generic validations adaptor class for RCL.
beast::Journal journal() const
std::optional< RCLValidatedLedger > acquire(LedgerHash const &id)
Attempt to acquire the ledger with given id from the network.
NetClock::time_point now() const
Current time used to determine if validations are stale.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::uint32_t LedgerIndex
A ledger index.
base_uint< 160, detail::NodeIDTag > NodeID
NodeID is a 160-bit hash representing one node.
void handleNewValidation(Application &app, std::shared_ptr< STValidation > const &val, std::string const &source, BypassAccept const bypassAccept, std::optional< beast::Journal > j)
Handle a new validation.