xrpld
Loading...
Searching...
No Matches
xrpl::test::PeerSim Class Reference
Inheritance diagram for xrpl::test::PeerSim:
Collaboration diagram for xrpl::test::PeerSim:

Public Types

using id_t = Peer::id_t

Public Member Functions

 PeerSim (Overlay &overlay, beast::Journal journal)
 ~PeerSim () override=default
id_t id () const override
std::string const & fingerprint () const override
void onMessage (MessageSPtr const &m, SquelchCB f) override
 Local Peer (PeerImp).
void onMessage (protocol::TMSquelch const &squelch) override
 Remote Peer (Directly connected Peer).
void send (protocol::TMSquelch const &squelch)
void send (std::shared_ptr< Message > const &m) override
beast::ip::Endpoint getRemoteAddress () const override
void charge (resource::Charge const &fee, std::string const &context={}) override
bool cluster () const override
bool isHighLatency () const override
int getScore (bool) const override
PublicKey const & getNodePublic () const override
json::Value json () override
bool supportsFeature (ProtocolFeature f) const override
std::optional< std::size_tpublisherListSequence (PublicKey const &) const override
void setPublisherListSequence (PublicKey const &, std::size_t const) override
uint256 getClosedLedgerHash () const override
bool hasLedger (uint256 const &hash, std::uint32_t seq) const override
void ledgerRange (std::uint32_t &minSeq, std::uint32_t &maxSeq) const override
bool hasTxSet (uint256 const &hash) const override
void cycleStatus () override
bool hasRange (std::uint32_t uMin, std::uint32_t uMax) override
bool compressionEnabled () const override
bool txReduceRelayEnabled () const override
void sendTxQueue () override
void addTxQueue (uint256 const &) override
void removeTxQueue (uint256 const &) override
shared_from_this (T... args)
weak_from_this (T... args)

Static Public Member Functions

static void resetId ()

Public Attributes

PublicKey nodePublicKey
int id
std::set< int > set

Private Attributes

std::string fingerprint_
id_t id_ {sid++}
Overlayoverlay_
reduce_relay::Squelch< ManualClocksquelch_

Static Private Attributes

static id_t sid = 0

Detailed Description

Definition at line 465 of file reduce_relay_test.cpp.

Member Typedef Documentation

◆ id_t

Definition at line 468 of file reduce_relay_test.cpp.

Constructor & Destructor Documentation

◆ PeerSim()

xrpl::test::PeerSim::PeerSim ( Overlay & overlay,
beast::Journal journal )

Definition at line 469 of file reduce_relay_test.cpp.

◆ ~PeerSim()

xrpl::test::PeerSim::~PeerSim ( )
overridedefault

Member Function Documentation

◆ id()

id_t xrpl::test::PeerSim::id ( ) const
override

Definition at line 476 of file reduce_relay_test.cpp.

◆ fingerprint()

std::string const & xrpl::test::PeerSim::fingerprint ( ) const
override

Definition at line 482 of file reduce_relay_test.cpp.

◆ resetId()

void xrpl::test::PeerSim::resetId ( )
static

Definition at line 488 of file reduce_relay_test.cpp.

◆ onMessage() [1/2]

void xrpl::test::PeerSim::onMessage ( MessageSPtr const & m,
SquelchCB f )
overridevirtual

Local Peer (PeerImp).

Implements xrpl::test::PeerPartial.

Definition at line 497 of file reduce_relay_test.cpp.

◆ onMessage() [2/2]

void xrpl::test::PeerSim::onMessage ( protocol::TMSquelch const & squelch)
overridevirtual

Remote Peer (Directly connected Peer).

Implements xrpl::test::PeerPartial.

Definition at line 512 of file reduce_relay_test.cpp.

◆ send() [1/2]

void xrpl::test::PeerPartial::send ( protocol::TMSquelch const & squelch)
inherited

Definition at line 85 of file reduce_relay_test.cpp.

◆ send() [2/2]

void xrpl::test::PeerPartial::send ( std::shared_ptr< Message > const & m)
overrideinherited

Definition at line 92 of file reduce_relay_test.cpp.

◆ getRemoteAddress()

beast::ip::Endpoint xrpl::test::PeerPartial::getRemoteAddress ( ) const
nodiscardoverrideinherited

Definition at line 96 of file reduce_relay_test.cpp.

◆ charge()

void xrpl::test::PeerPartial::charge ( resource::Charge const & fee,
std::string const & context = {} )
overrideinherited

Definition at line 101 of file reduce_relay_test.cpp.

◆ cluster()

bool xrpl::test::PeerPartial::cluster ( ) const
nodiscardoverrideinherited

Definition at line 105 of file reduce_relay_test.cpp.

◆ isHighLatency()

bool xrpl::test::PeerPartial::isHighLatency ( ) const
nodiscardoverrideinherited

Definition at line 110 of file reduce_relay_test.cpp.

◆ getScore()

int xrpl::test::PeerPartial::getScore ( bool ) const
nodiscardoverrideinherited

Definition at line 115 of file reduce_relay_test.cpp.

◆ getNodePublic()

PublicKey const & xrpl::test::PeerPartial::getNodePublic ( ) const
nodiscardoverrideinherited

Definition at line 120 of file reduce_relay_test.cpp.

◆ json()

json::Value xrpl::test::PeerPartial::json ( )
overrideinherited

Definition at line 125 of file reduce_relay_test.cpp.

◆ supportsFeature()

bool xrpl::test::PeerPartial::supportsFeature ( ProtocolFeature f) const
nodiscardoverrideinherited

Definition at line 130 of file reduce_relay_test.cpp.

◆ publisherListSequence()

std::optional< std::size_t > xrpl::test::PeerPartial::publisherListSequence ( PublicKey const & ) const
nodiscardoverrideinherited

Definition at line 135 of file reduce_relay_test.cpp.

◆ setPublisherListSequence()

void xrpl::test::PeerPartial::setPublisherListSequence ( PublicKey const & ,
std::size_t const  )
overrideinherited

Definition at line 140 of file reduce_relay_test.cpp.

◆ getClosedLedgerHash()

uint256 xrpl::test::PeerPartial::getClosedLedgerHash ( ) const
nodiscardoverrideinherited

Definition at line 144 of file reduce_relay_test.cpp.

◆ hasLedger()

bool xrpl::test::PeerPartial::hasLedger ( uint256 const & hash,
std::uint32_t seq ) const
nodiscardoverrideinherited

Definition at line 150 of file reduce_relay_test.cpp.

◆ ledgerRange()

void xrpl::test::PeerPartial::ledgerRange ( std::uint32_t & minSeq,
std::uint32_t & maxSeq ) const
overrideinherited

Definition at line 155 of file reduce_relay_test.cpp.

◆ hasTxSet()

bool xrpl::test::PeerPartial::hasTxSet ( uint256 const & hash) const
nodiscardoverrideinherited

Definition at line 159 of file reduce_relay_test.cpp.

◆ cycleStatus()

void xrpl::test::PeerPartial::cycleStatus ( )
overrideinherited

Definition at line 164 of file reduce_relay_test.cpp.

◆ hasRange()

bool xrpl::test::PeerPartial::hasRange ( std::uint32_t uMin,
std::uint32_t uMax )
overrideinherited

Definition at line 168 of file reduce_relay_test.cpp.

◆ compressionEnabled()

bool xrpl::test::PeerPartial::compressionEnabled ( ) const
nodiscardoverrideinherited

Definition at line 173 of file reduce_relay_test.cpp.

◆ txReduceRelayEnabled()

bool xrpl::test::PeerPartial::txReduceRelayEnabled ( ) const
nodiscardoverrideinherited

Definition at line 178 of file reduce_relay_test.cpp.

◆ sendTxQueue()

void xrpl::test::PeerPartial::sendTxQueue ( )
overrideinherited

Definition at line 183 of file reduce_relay_test.cpp.

◆ addTxQueue()

void xrpl::test::PeerPartial::addTxQueue ( uint256 const & )
overrideinherited

Definition at line 187 of file reduce_relay_test.cpp.

◆ removeTxQueue()

void xrpl::test::PeerPartial::removeTxQueue ( uint256 const & )
overrideinherited

Definition at line 191 of file reduce_relay_test.cpp.

Member Data Documentation

◆ sid

id_t xrpl::test::PeerSim::sid = 0
staticprivate

Definition at line 527 of file reduce_relay_test.cpp.

◆ fingerprint_

std::string xrpl::test::PeerSim::fingerprint_
private

Definition at line 528 of file reduce_relay_test.cpp.

◆ id_

id_t xrpl::test::PeerSim::id_ {sid++}
private

Definition at line 529 of file reduce_relay_test.cpp.

◆ overlay_

Overlay& xrpl::test::PeerSim::overlay_
private

Definition at line 530 of file reduce_relay_test.cpp.

◆ squelch_

reduce_relay::Squelch<ManualClock> xrpl::test::PeerSim::squelch_
private

Definition at line 531 of file reduce_relay_test.cpp.

◆ nodePublicKey

PublicKey xrpl::test::PeerPartial::nodePublicKey
inherited

Definition at line 78 of file reduce_relay_test.cpp.

◆ id

int xrpl::test::Peer::id
inherited

Definition at line 15 of file BasicNetwork.cpp.

◆ set

std::set<int> xrpl::test::Peer::set
inherited

Definition at line 16 of file BasicNetwork.cpp.