rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
xrpl::test::PeerPartial Class Referenceabstract

Simulate two entities - peer directly connected to the server (via squelch in PeerSim) and PeerImp (via Overlay) More...

Inheritance diagram for xrpl::test::PeerPartial:
Inheritance graph
[legend]
Collaboration diagram for xrpl::test::PeerPartial:
Collaboration graph
[legend]

Public Types

using ptr = std::shared_ptr< Peer >
 
using id_t = std::uint32_t
 Uniquely identifies a peer.
 

Public Member Functions

 PeerPartial ()
 
virtual ~PeerPartial ()
 
virtual void onMessage (MessageSPtr const &m, SquelchCB f)=0
 
virtual void onMessage (protocol::TMSquelch const &squelch)=0
 
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
 Adjust this peer's load balance based on the type of load imposed.
 
bool cluster () const override
 Returns true if this connection is a member of the cluster.
 
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 const & 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
 Send aggregated transactions' hashes.
 
void addTxQueue (uint256 const &) override
 Aggregate transaction's hash.
 
void removeTxQueue (uint256 const &) override
 Remove hash from the transactions' hashes queue.
 
virtual id_t id () const =0
 
virtual std::string const & fingerprint () const =0
 

Public Attributes

PublicKey nodePublicKey_
 

Detailed Description

Simulate two entities - peer directly connected to the server (via squelch in PeerSim) and PeerImp (via Overlay)

Definition at line 46 of file reduce_relay_test.cpp.

Member Typedef Documentation

◆ ptr

using xrpl::Peer::ptr = std::shared_ptr<Peer>
inherited

Definition at line 27 of file xrpld/overlay/Peer.h.

◆ id_t

using xrpl::Peer::id_t = std::uint32_t
inherited

Uniquely identifies a peer.

This can be stored in tables to find the peer later. Callers can discover if the peer is no longer connected and make adjustments as needed.

Definition at line 34 of file xrpld/overlay/Peer.h.

Constructor & Destructor Documentation

◆ PeerPartial()

xrpl::test::PeerPartial::PeerPartial ( )

Definition at line 49 of file reduce_relay_test.cpp.

◆ ~PeerPartial()

virtual xrpl::test::PeerPartial::~PeerPartial ( )
virtual

Definition at line 55 of file reduce_relay_test.cpp.

Member Function Documentation

◆ onMessage() [1/2]

virtual void xrpl::test::PeerPartial::onMessage ( MessageSPtr const &  m,
SquelchCB  f 
)
pure virtual

Implemented in xrpl::test::PeerSim.

◆ onMessage() [2/2]

virtual void xrpl::test::PeerPartial::onMessage ( protocol::TMSquelch const &  squelch)
pure virtual

Implemented in xrpl::test::PeerSim.

◆ send() [1/2]

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

Definition at line 63 of file reduce_relay_test.cpp.

◆ send() [2/2]

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

Implements xrpl::Peer.

Definition at line 70 of file reduce_relay_test.cpp.

◆ getRemoteAddress()

beast::IP::Endpoint xrpl::test::PeerPartial::getRemoteAddress ( ) const
overridevirtual

Implements xrpl::Peer.

Definition at line 74 of file reduce_relay_test.cpp.

◆ charge()

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

Adjust this peer's load balance based on the type of load imposed.

Implements xrpl::Peer.

Definition at line 79 of file reduce_relay_test.cpp.

◆ cluster()

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

Returns true if this connection is a member of the cluster.

Implements xrpl::Peer.

Definition at line 84 of file reduce_relay_test.cpp.

◆ isHighLatency()

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

Implements xrpl::Peer.

Definition at line 89 of file reduce_relay_test.cpp.

◆ getScore()

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

Implements xrpl::Peer.

Definition at line 94 of file reduce_relay_test.cpp.

◆ getNodePublic()

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

Implements xrpl::Peer.

Definition at line 99 of file reduce_relay_test.cpp.

◆ json()

Json::Value xrpl::test::PeerPartial::json ( )
overridevirtual

Implements xrpl::Peer.

Definition at line 104 of file reduce_relay_test.cpp.

◆ supportsFeature()

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

Implements xrpl::Peer.

Definition at line 109 of file reduce_relay_test.cpp.

◆ publisherListSequence()

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

Implements xrpl::Peer.

Definition at line 114 of file reduce_relay_test.cpp.

◆ setPublisherListSequence()

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

Implements xrpl::Peer.

Definition at line 119 of file reduce_relay_test.cpp.

◆ getClosedLedgerHash()

uint256 const & xrpl::test::PeerPartial::getClosedLedgerHash ( ) const
overridevirtual

Implements xrpl::Peer.

Definition at line 123 of file reduce_relay_test.cpp.

◆ hasLedger()

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

Implements xrpl::Peer.

Definition at line 129 of file reduce_relay_test.cpp.

◆ ledgerRange()

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

Implements xrpl::Peer.

Definition at line 134 of file reduce_relay_test.cpp.

◆ hasTxSet()

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

Implements xrpl::Peer.

Definition at line 138 of file reduce_relay_test.cpp.

◆ cycleStatus()

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

Implements xrpl::Peer.

Definition at line 143 of file reduce_relay_test.cpp.

◆ hasRange()

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

Implements xrpl::Peer.

Definition at line 147 of file reduce_relay_test.cpp.

◆ compressionEnabled()

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

Implements xrpl::Peer.

Definition at line 152 of file reduce_relay_test.cpp.

◆ txReduceRelayEnabled()

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

Implements xrpl::Peer.

Definition at line 157 of file reduce_relay_test.cpp.

◆ sendTxQueue()

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

Send aggregated transactions' hashes.

Implements xrpl::Peer.

Definition at line 162 of file reduce_relay_test.cpp.

◆ addTxQueue()

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

Aggregate transaction's hash.

Implements xrpl::Peer.

Definition at line 166 of file reduce_relay_test.cpp.

◆ removeTxQueue()

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

Remove hash from the transactions' hashes queue.

Implements xrpl::Peer.

Definition at line 170 of file reduce_relay_test.cpp.

◆ id()

virtual id_t xrpl::Peer::id ( ) const
pure virtualinherited

◆ fingerprint()

virtual std::string const & xrpl::Peer::fingerprint ( ) const
pure virtualinherited

Member Data Documentation

◆ nodePublicKey_

PublicKey xrpl::test::PeerPartial::nodePublicKey_

Definition at line 54 of file reduce_relay_test.cpp.