xrpld
Loading...
Searching...
No Matches
xrpl::test::TestPeer Class Reference

Simulate a network peer. More...

Inheritance diagram for xrpl::test::TestPeer:
Collaboration diagram for xrpl::test::TestPeer:

Public Member Functions

 TestPeer (bool enableLedgerReplay)
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
id_t id () const 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
void sendTxQueue () override
void addTxQueue (uint256 const &) override
void removeTxQueue (uint256 const &) override
bool txReduceRelayEnabled () const override
std::string const & fingerprint () const override

Public Attributes

std::string fingerprint_
bool ledgerReplayEnabled_
PublicKey nodePublicKey_
int id
std::set< int > set

Detailed Description

Simulate a network peer.

Depending on the configured PeerFeature, it either supports the ProtocolFeature::LedgerReplay or not

Definition at line 272 of file LedgerReplay_test.cpp.

Constructor & Destructor Documentation

◆ TestPeer()

xrpl::test::TestPeer::TestPeer ( bool enableLedgerReplay)

Definition at line 275 of file LedgerReplay_test.cpp.

Member Function Documentation

◆ send()

void xrpl::test::TestPeer::send ( std::shared_ptr< Message > const & m)
override

Definition at line 282 of file LedgerReplay_test.cpp.

◆ getRemoteAddress()

beast::ip::Endpoint xrpl::test::TestPeer::getRemoteAddress ( ) const
nodiscardoverride

Definition at line 286 of file LedgerReplay_test.cpp.

◆ charge()

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

Definition at line 291 of file LedgerReplay_test.cpp.

◆ id()

id_t xrpl::test::TestPeer::id ( ) const
nodiscardoverride

Definition at line 295 of file LedgerReplay_test.cpp.

◆ cluster()

bool xrpl::test::TestPeer::cluster ( ) const
nodiscardoverride

Definition at line 300 of file LedgerReplay_test.cpp.

◆ isHighLatency()

bool xrpl::test::TestPeer::isHighLatency ( ) const
nodiscardoverride

Definition at line 305 of file LedgerReplay_test.cpp.

◆ getScore()

int xrpl::test::TestPeer::getScore ( bool ) const
nodiscardoverride

Definition at line 310 of file LedgerReplay_test.cpp.

◆ getNodePublic()

PublicKey const & xrpl::test::TestPeer::getNodePublic ( ) const
nodiscardoverride

Definition at line 315 of file LedgerReplay_test.cpp.

◆ json()

json::Value xrpl::test::TestPeer::json ( )
override

Definition at line 320 of file LedgerReplay_test.cpp.

◆ supportsFeature()

bool xrpl::test::TestPeer::supportsFeature ( ProtocolFeature f) const
nodiscardoverride

Definition at line 325 of file LedgerReplay_test.cpp.

◆ publisherListSequence()

std::optional< std::size_t > xrpl::test::TestPeer::publisherListSequence ( PublicKey const & ) const
nodiscardoverride

Definition at line 330 of file LedgerReplay_test.cpp.

◆ setPublisherListSequence()

void xrpl::test::TestPeer::setPublisherListSequence ( PublicKey const & ,
std::size_t const  )
override

Definition at line 335 of file LedgerReplay_test.cpp.

◆ getClosedLedgerHash()

uint256 xrpl::test::TestPeer::getClosedLedgerHash ( ) const
nodiscardoverride

Definition at line 339 of file LedgerReplay_test.cpp.

◆ hasLedger()

bool xrpl::test::TestPeer::hasLedger ( uint256 const & hash,
std::uint32_t seq ) const
nodiscardoverride

Definition at line 345 of file LedgerReplay_test.cpp.

◆ ledgerRange()

void xrpl::test::TestPeer::ledgerRange ( std::uint32_t & minSeq,
std::uint32_t & maxSeq ) const
override

Definition at line 350 of file LedgerReplay_test.cpp.

◆ hasTxSet()

bool xrpl::test::TestPeer::hasTxSet ( uint256 const & hash) const
nodiscardoverride

Definition at line 354 of file LedgerReplay_test.cpp.

◆ cycleStatus()

void xrpl::test::TestPeer::cycleStatus ( )
override

Definition at line 359 of file LedgerReplay_test.cpp.

◆ hasRange()

bool xrpl::test::TestPeer::hasRange ( std::uint32_t uMin,
std::uint32_t uMax )
override

Definition at line 363 of file LedgerReplay_test.cpp.

◆ compressionEnabled()

bool xrpl::test::TestPeer::compressionEnabled ( ) const
nodiscardoverride

Definition at line 368 of file LedgerReplay_test.cpp.

◆ sendTxQueue()

void xrpl::test::TestPeer::sendTxQueue ( )
override

Definition at line 373 of file LedgerReplay_test.cpp.

◆ addTxQueue()

void xrpl::test::TestPeer::addTxQueue ( uint256 const & )
override

Definition at line 377 of file LedgerReplay_test.cpp.

◆ removeTxQueue()

void xrpl::test::TestPeer::removeTxQueue ( uint256 const & )
override

Definition at line 381 of file LedgerReplay_test.cpp.

◆ txReduceRelayEnabled()

bool xrpl::test::TestPeer::txReduceRelayEnabled ( ) const
nodiscardoverride

Definition at line 385 of file LedgerReplay_test.cpp.

◆ fingerprint()

std::string const & xrpl::test::TestPeer::fingerprint ( ) const
nodiscardoverride

Definition at line 391 of file LedgerReplay_test.cpp.

Member Data Documentation

◆ fingerprint_

std::string xrpl::test::TestPeer::fingerprint_

Definition at line 397 of file LedgerReplay_test.cpp.

◆ ledgerReplayEnabled_

bool xrpl::test::TestPeer::ledgerReplayEnabled_

Definition at line 398 of file LedgerReplay_test.cpp.

◆ nodePublicKey_

PublicKey xrpl::test::TestPeer::nodePublicKey_

Definition at line 399 of file LedgerReplay_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.