|
xrpld
|
Simulate a peerSet that supplies peers to ledger replay subtasks. More...


Public Member Functions | |
| TestPeerSet (LedgerReplayMsgHandler &me, LedgerReplayMsgHandler &other, PeerSetBehavior bhvr, bool enableLedgerReplay) | |
| void | addPeers (std::size_t limit, std::function< bool(std::shared_ptr< Peer > const &)> hasItem, std::function< void(std::shared_ptr< Peer > const &)> onPeerAdded) override |
| void | sendRequest (::google::protobuf::Message const &msg, protocol::MessageType type, std::shared_ptr< Peer > const &peer) override |
| std::set< Peer::id_t > const & | getPeerIds () const override |
| get the set of ids of previously added peers | |
| virtual void | addPeers (std::size_t limit, std::function< bool(std::shared_ptr< Peer > const &)> hasItem, std::function< void(std::shared_ptr< Peer > const &)> onPeerAdded)=0 |
| Try add more peers. | |
| template<typename MessageType> | |
| void | sendRequest (MessageType const &message, std::shared_ptr< Peer > const &peer) |
| send a message | |
| virtual void | sendRequest (::google::protobuf::Message const &message, protocol::MessageType type, std::shared_ptr< Peer > const &peer)=0 |
Public Attributes | |
| LedgerReplayMsgHandler & | local |
| LedgerReplayMsgHandler & | remote |
| std::shared_ptr< TestPeer > | dummyPeer |
| PeerSetBehavior | behavior |
| std::atomic< int > | sendCount {0} |
Simulate a peerSet that supplies peers to ledger replay subtasks.
It connects the ledger replay client side and server side message handlers. Depending on the configured PeerSetBehavior, it may drop or repeat some of the messages.
Definition at line 418 of file LedgerReplay_test.cpp.
| xrpl::test::TestPeerSet::TestPeerSet | ( | LedgerReplayMsgHandler & | me, |
| LedgerReplayMsgHandler & | other, | ||
| PeerSetBehavior | bhvr, | ||
| bool | enableLedgerReplay ) |
Definition at line 420 of file LedgerReplay_test.cpp.
|
override |
Definition at line 433 of file LedgerReplay_test.cpp.
|
override |
Definition at line 443 of file LedgerReplay_test.cpp.
|
nodiscardoverridevirtual |
get the set of ids of previously added peers
Implements xrpl::PeerSet.
Definition at line 489 of file LedgerReplay_test.cpp.
|
pure virtualinherited |
Try add more peers.
| limit | number of peers to add |
| hasItem | callback that helps to select peers |
| onPeerAdded | callback called when a peer is added |
Implemented in xrpl::DummyPeerSet, and xrpl::PeerSetImpl.
|
inherited |
|
pure virtualinherited |
Implemented in xrpl::DummyPeerSet, and xrpl::PeerSetImpl.
| LedgerReplayMsgHandler& xrpl::test::TestPeerSet::local |
Definition at line 495 of file LedgerReplay_test.cpp.
| LedgerReplayMsgHandler& xrpl::test::TestPeerSet::remote |
Definition at line 496 of file LedgerReplay_test.cpp.
| std::shared_ptr<TestPeer> xrpl::test::TestPeerSet::dummyPeer |
Definition at line 497 of file LedgerReplay_test.cpp.
| PeerSetBehavior xrpl::test::TestPeerSet::behavior |
Definition at line 498 of file LedgerReplay_test.cpp.
| std::atomic<int> xrpl::test::TestPeerSet::sendCount {0} |
Definition at line 499 of file LedgerReplay_test.cpp.