2#include <test/jtx/envconfig.h>
4#include <xrpld/app/ledger/BuildLedger.h>
5#include <xrpld/app/ledger/LedgerMaster.h>
6#include <xrpld/app/ledger/LedgerReplay.h>
7#include <xrpld/app/ledger/LedgerReplayTask.h>
8#include <xrpld/app/ledger/LedgerReplayer.h>
9#include <xrpld/app/ledger/detail/LedgerDeltaAcquire.h>
10#include <xrpld/app/ledger/detail/LedgerReplayMsgHandler.h>
11#include <xrpld/app/ledger/detail/SkipListAcquire.h>
12#include <xrpld/overlay/PeerSet.h>
13#include <xrpld/overlay/detail/PeerImp.h>
15#include <xrpl/basics/Slice.h>
33 auto const alice =
Account(
"alice");
34 auto const bob =
Account(
"bob");
37 env.
fund(
XRP(100000), alice, bob);
42 auto const lastClosedParent =
ledgerMaster.getLedgerByHash(lastClosed->header().parentHash);
47 BEAST_EXPECT(replayed->header().hash == lastClosed->header().hash);
330 bool enableLedgerReplay)
350 ::google::protobuf::Message
const& msg,
351 protocol::MessageType type,
364 if (((rand() % 100) + 1) <= dropRate)
369 case protocol::mtPROOF_PATH_REQ: {
373 dynamic_cast<protocol::TMProofPathRequest const&
>(msg));
381 case protocol::mtREPLAY_DELTA_REQ: {
385 dynamic_cast<protocol::TMReplayDeltaRequest const&
>(msg));
476 auto fundedAccounts =
accounts.size();
477 for (
int i = 0; i < newAccounts; ++i)
491 int fundedAccounts =
accounts.size();
492 assert(fundedAccounts >= newTxes);
499 auto updateIdx = [&]() {
500 assert(fundedAccounts > senders.
size());
501 fromIdx = (fromIdx + r) % fundedAccounts;
503 fromIdx = (fromIdx + 1) % fundedAccounts;
505 toIdx = (toIdx + r * 2) % fundedAccounts;
506 if (toIdx == fromIdx)
507 toIdx = (toIdx + 1) % fundedAccounts;
510 for (
int i = 0; i < newTxes; ++i)
593 uint256 hash = finishLedgerHash;
595 for (; i < totalReplay; ++i)
600 hash = l->header().parentHash;
608 int const totalRound = 100;
609 for (
int i = 0; i < totalRound; ++i)
613 if (i < totalRound - 1)
622 int const totalRound = 100;
623 for (
int i = 0; i < totalRound; ++i)
639 if (i < totalRound - 1)
657 return t->parameter_.finishHash_ == hash && t->parameter_.totalLedgers_ == totalReplay;
693 return i->second.lock();
703 return i->second.lock();
706 template <
typename T>
726 if (
taskStatus(task->skipListAcquirer_) == skiplistExpect)
728 if (task->deltas_.size() == deltaExpects.
size())
730 for (
int i = 0; i < deltaExpects.
size(); ++i)
732 if (
taskStatus(task->deltas_[i]) != deltaExpects[i])
750 auto t =
findTask(hash, totalReplay);
756 return asExpected(t, taskExpect, skiplistExpect, deltaExpects);
767 auto t =
findTask(hash, totalReplay);
773 return asExpected(t, taskExpect, skiplistExpect, deltaExpects);
787 return checkStatus(hash, totalReplay, taskExpect, skiplistExpect, deltaExpects);
867 request->set_ledgerhash(l->header().hash.data(), l->header().hash.size());
868 request->set_type(protocol::TMLedgerMapType::lmACCOUNT_STATE);
870 server.msgHandler.processProofPathRequest(request));
871 BEAST_EXPECT(reply->has_error());
872 BEAST_EXPECT(!server.msgHandler.processProofPathResponse(reply));
877 request->set_type(protocol::TMLedgerMapType::lmACCOUNT_STATE);
880 request->set_ledgerhash(hash.
data(), hash.
size());
882 server.msgHandler.processProofPathRequest(request));
883 BEAST_EXPECT(reply->has_error());
889 request->set_ledgerhash(l->header().hash.data(), l->header().hash.size());
890 request->set_type(protocol::TMLedgerMapType::lmACCOUNT_STATE);
894 server.msgHandler.processProofPathRequest(request));
895 BEAST_EXPECT(!reply->has_error());
896 BEAST_EXPECT(server.msgHandler.processProofPathResponse(reply));
903 reply->set_ledgerheader(r);
904 BEAST_EXPECT(!server.msgHandler.processProofPathResponse(reply));
906 reply->set_ledgerheader(r);
907 BEAST_EXPECT(server.msgHandler.processProofPathResponse(reply));
909 reply->mutable_path()->RemoveLast();
910 BEAST_EXPECT(!server.msgHandler.processProofPathResponse(reply));
926 server.msgHandler.processReplayDeltaRequest(request));
927 BEAST_EXPECT(reply->has_error());
928 BEAST_EXPECT(!server.msgHandler.processReplayDeltaResponse(reply));
931 request->set_ledgerhash(hash.
data(), hash.
size());
933 server.msgHandler.processReplayDeltaRequest(request));
934 BEAST_EXPECT(reply->has_error());
935 BEAST_EXPECT(!server.msgHandler.processReplayDeltaResponse(reply));
941 request->set_ledgerhash(l->header().hash.data(), l->header().hash.size());
943 server.msgHandler.processReplayDeltaRequest(request));
944 BEAST_EXPECT(!reply->has_error());
945 BEAST_EXPECT(server.msgHandler.processReplayDeltaResponse(reply));
952 reply->set_ledgerheader(r);
953 BEAST_EXPECT(!server.msgHandler.processReplayDeltaResponse(reply));
955 reply->set_ledgerheader(r);
956 BEAST_EXPECT(server.msgHandler.processReplayDeltaResponse(reply));
958 reply->mutable_transaction()->RemoveLast();
959 BEAST_EXPECT(!server.msgHandler.processReplayDeltaResponse(reply));
972 for (
int i = 0; i < count; ++i)
978 BEAST_EXPECT(!tp10.
update(
uint256(777), 5, makeSkipList(10)));
980 BEAST_EXPECT(tp10.
update(
uint256(10), 10, makeSkipList(10)));
1008 BEAST_EXPECT(tp20.
update(
uint256(20), 20, makeSkipList(20)));
1049 auto handshake = [&](
bool client,
bool server,
bool expecting) ->
bool {
1052 http_request.version(request.version());
1053 http_request.base() = request.base();
1054 bool const serverResult =
1056 if (serverResult != expecting)
1063 true, http_request, addr, addr,
uint256{1}, 1, {1, 0}, serverEnv.
app());
1065 return clientResult == expecting;
1068 BEAST_EXPECT(handshake(
false,
false,
false));
1069 BEAST_EXPECT(handshake(
false,
true,
false));
1070 BEAST_EXPECT(handshake(
true,
false,
false));
1071 BEAST_EXPECT(handshake(
true,
true,
true));
1077 testcase(
"local node has all the ledgers");
1082 NetworkOfTwo net(*
this, {totalReplay + 1}, psBhvr, ilBhvr, peerFeature);
1085 uint256 const finalHash = l->header().hash;
1086 for (
int i = 0; i < totalReplay; ++i)
1091 net.client.ledgerMaster.storeLedger(l);
1092 l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash);
1103 BEAST_EXPECT(net.client.waitAndCheckStatus(
1107 net.client.replayer.sweep();
1108 BEAST_EXPECT(net.client.countsAsExpected(0, 0, 0));
1114 testcase(
"all the ledgers from InboundLedgers");
1123 uint256 const finalHash = l->header().hash;
1127 BEAST_EXPECT(net.client.waitAndCheckStatus(
1138 auto waitForSweep = [&net]() {
1139 for (
auto numAttempts = 0; numAttempts < 20; ++numAttempts)
1141 net.client.replayer.sweep();
1142 if (net.client.countsAsExpected(0, 0, 0))
1150 BEAST_EXPECT(waitForSweep());
1156 switch (peerSetBehavior)
1162 testcase(
"network drops 50% messages");
1165 testcase(
"network repeats all messages");
1180 uint256 const finalHash = l->header().hash;
1181 for (
int i = 0; i < totalReplay - 1; ++i)
1183 l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash);
1185 net.client.ledgerMaster.storeLedger(l);
1190 BEAST_EXPECT(net.client.waitAndCheckStatus(
1192 BEAST_EXPECT(net.client.waitForLedgers(finalHash, totalReplay));
1195 net.client.replayer.sweep();
1196 BEAST_EXPECT(net.client.countsAsExpected(0, 0, 0));
1203 int const totalReplay = 3;
1212 uint256 const finalHash = l->header().hash;
1216 BEAST_EXPECT(net.client.checkStatus(
1219 BEAST_EXPECT(net.client.countsAsExpected(1, 1, 0));
1220 net.client.replayer.stop();
1221 BEAST_EXPECT(net.client.countsAsExpected(0, 0, 0));
1227 testcase(
"SkipListAcquire bad reply");
1228 int const totalReplay = 3;
1231 {totalReplay + 1 + 1},
1237 uint256 const finalHash = l->header().hash;
1240 auto skipList = net.client.findSkipListAcquire(finalHash);
1242 std::uint8_t payload[55] = {0x6A, 0x09, 0xE6, 0x67, 0xF3, 0xBC, 0xC9, 0x08, 0xB2};
1244 skipList->processData(l->seq(), item);
1247 BEAST_EXPECT(net.client.waitAndCheckStatus(
1252 BEAST_EXPECT(net.client.waitAndCheckStatus(
1254 BEAST_EXPECT(net.client.countsAsExpected(2, 1, 0));
1260 testcase(
"LedgerDeltaAcquire bad reply");
1261 int const totalReplay = 3;
1270 uint256 const finalHash = l->header().hash;
1271 net.client.ledgerMaster.storeLedger(l);
1274 auto delta = net.client.findLedgerDeltaAcquire(l->header().parentHash);
1280 net.client.taskStatus(net.client.findTask(finalHash, totalReplay)) ==
1286 net.client.taskStatus(net.client.findTask(finalHash, totalReplay + 1)) ==
1294 int const totalReplay = 5;
1297 {(totalReplay * 3) + 1},
1302 uint256 const finalHash = l->header().hash;
1305 BEAST_EXPECT(net.client.waitAndCheckStatus(
1307 BEAST_EXPECT(net.client.waitForLedgers(finalHash, totalReplay));
1311 BEAST_EXPECT(net.client.countsAsExpected(1, 1, totalReplay - 1));
1314 BEAST_EXPECT(net.client.countsAsExpected(2, 1, totalReplay - 1));
1317 for (
int i = 0; i < totalReplay + 2; ++i)
1319 l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash);
1321 auto finalHash_early = l->header().hash;
1323 BEAST_EXPECT(net.client.waitAndCheckStatus(
1329 BEAST_EXPECT(net.client.waitForLedgers(finalHash_early, totalReplay));
1330 BEAST_EXPECT(net.client.countsAsExpected(3, 2, 2 * (totalReplay - 1)));
1333 l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash);
1334 auto finalHash_moreEarly = l->header().parentHash;
1335 net.client.replayer.replay(
1337 BEAST_EXPECT(net.client.waitAndCheckStatus(
1338 finalHash_moreEarly,
1343 BEAST_EXPECT(net.client.waitForLedgers(finalHash_moreEarly, totalReplay));
1344 BEAST_EXPECT(net.client.countsAsExpected(4, 3, (2 * (totalReplay - 1)) + 2));
1349 BEAST_EXPECT(net.client.waitAndCheckStatus(
1355 BEAST_EXPECT(net.client.waitForLedgers(finalHash, totalReplay * 3));
1356 BEAST_EXPECT(net.client.countsAsExpected(5, 3, (totalReplay * 3) - 1));
1359 net.client.replayer.sweep();
1360 BEAST_EXPECT(net.client.countsAsExpected(0, 0, 0));
1391 testcase(
"SkipListAcquire timeout");
1392 int const totalReplay = 3;
1401 uint256 const finalHash = l->header().hash;
1405 BEAST_EXPECT(net.client.waitAndCheckStatus(
1409 BEAST_EXPECT(net.client.countsAsExpected(1, 1, 0));
1410 net.client.replayer.sweep();
1411 BEAST_EXPECT(net.client.countsAsExpected(0, 0, 0));
1417 testcase(
"LedgerDeltaAcquire timeout");
1418 int const totalReplay = 3;
1427 uint256 const finalHash = l->header().hash;
1428 net.client.ledgerMaster.storeLedger(l);
1433 BEAST_EXPECT(net.client.waitAndCheckStatus(
1437 BEAST_EXPECT(net.client.countsAsExpected(1, 1, totalReplay - 1));
1438 net.client.replayer.sweep();
1439 BEAST_EXPECT(net.client.countsAsExpected(0, 0, 0));
1456 int const totalReplay = 250;
1457 int const rounds = 4;
1460 {(totalReplay * rounds) + 1},
1466 auto l = net.server.ledgerMaster.getClosedLedger();
1467 for (
int i = 0; i < rounds; ++i)
1469 finishHashes.
push_back(l->header().hash);
1470 for (
int j = 0; j < totalReplay; ++j)
1472 l = net.server.ledgerMaster.getLedgerByHash(l->header().parentHash);
1475 BEAST_EXPECT(finishHashes.size() == rounds);
1477 for (
int i = 0; i < rounds; ++i)
1479 net.client.replayer.replay(
1484 for (
int i = 0; i < rounds; ++i)
1486 BEAST_EXPECT(net.client.waitAndCheckStatus(
1494 BEAST_EXPECT(net.client.waitForLedgers(finishHashes[0], totalReplay * rounds));
1495 BEAST_EXPECT(net.client.countsAsExpected(rounds, rounds, rounds * (totalReplay - 1)));
1498 net.client.replayer.sweep();
1499 BEAST_EXPECT(net.client.countsAsExpected(0, 0, 0));
1505BEAST_DEFINE_TESTSUITE(LedgerReplayerTimeout, app,
xrpl);
1506BEAST_DEFINE_TESTSUITE_MANUAL(LedgerReplayerLong, app,
xrpl);
A version-independent IP address and port combination.
testcase_t testcase
Memberspace for declaring test cases.
virtual Config & config()=0
void loadFromString(std::string const &fileContents)
Load the config from the contents of the string.
Manages the lifetime of inbound ledgers.
bool storeLedger(std::shared_ptr< Ledger const > ledger)
std::shared_ptr< Ledger const > getClosedLedger()
std::shared_ptr< Ledger const > getLedgerByHash(uint256 const &hash)
bool processProofPathResponse(std::shared_ptr< protocol::TMProofPathResponse > const &msg)
Process TMProofPathResponse.
protocol::TMProofPathResponse processProofPathRequest(std::shared_ptr< protocol::TMProofPathRequest > const &msg)
Process TMProofPathRequest and return TMProofPathResponse.
bool processReplayDeltaResponse(std::shared_ptr< protocol::TMReplayDeltaResponse > const &msg)
Process TMReplayDeltaResponse.
protocol::TMReplayDeltaResponse processReplayDeltaRequest(std::shared_ptr< protocol::TMReplayDeltaRequest > const &msg)
Process TMReplayDeltaRequest and return TMReplayDeltaResponse.
bool update(uint256 const &hash, std::uint32_t seq, std::vector< uint256 > const &sList)
fill all the fields that was not filled during construction
bool canMergeInto(TaskParameter const &existingTask) const
check if this task can be merged into an existing task
InboundLedger::Reason reason_
std::uint32_t totalLedgers_
Manages the lifetime of ledger replay tasks.
hash_map< uint256, std::weak_ptr< SkipListAcquire > > skipLists_
std::vector< std::shared_ptr< LedgerReplayTask > > tasks_
hash_map< uint256, std::weak_ptr< LedgerDeltaAcquire > > deltas_
beast::severities::Severity threshold() const
Supports data retrieval by managing a set of peers.
Represents a peer connection in the overlay.
std::uint32_t id_t
Uniquely identifies a peer.
virtual LedgerMaster & getLedgerMaster()=0
virtual Logs & getLogs()=0
An immutable linear range of bytes.
static constexpr std::size_t size()
Ledger replay client side.
TaskStatus taskStatus(std::shared_ptr< T > const &t)
std::size_t countDeltas()
std::vector< std::shared_ptr< LedgerReplayTask > > getTasks()
bool asExpected(uint256 const &hash, int totalReplay, TaskStatus taskExpect, TaskStatus skiplistExpect, std::vector< TaskStatus > const &deltaExpects)
LedgerMaster & ledgerMaster
MagicInboundLedgers inboundLedgers
std::size_t countSkipLists()
LedgerReplayMsgHandler clientMsgHandler
bool haveLedgers(uint256 const &finishLedgerHash, int totalReplay)
void addLedger(std::shared_ptr< Ledger const > const &l)
std::shared_ptr< SkipListAcquire > findSkipListAcquire(uint256 const &hash)
bool countsAsExpected(std::size_t tasks, std::size_t skipLists, std::size_t deltas)
bool waitForLedgers(uint256 const &finishLedgerHash, int totalReplay)
LedgerReplayMsgHandler serverMsgHandler
LedgerReplayClient(beast::unit_test::suite &suite, LedgerServer &server, PeerSetBehavior behavior=PeerSetBehavior::Good, InboundLedgersBehavior inboundBhvr=InboundLedgersBehavior::Good, PeerFeature peerFeature=PeerFeature::LedgerReplayEnabled)
bool waitAndCheckStatus(uint256 const &hash, int totalReplay, TaskStatus taskExpect, TaskStatus skiplistExpect, std::vector< TaskStatus > const &deltaExpects)
bool asExpected(std::shared_ptr< LedgerReplayTask > const &task, TaskStatus taskExpect, TaskStatus skiplistExpect, std::vector< TaskStatus > const &deltaExpects)
std::shared_ptr< LedgerReplayTask > findTask(uint256 const &hash, int totalReplay)
bool checkStatus(uint256 const &hash, int totalReplay, TaskStatus taskExpect, TaskStatus skiplistExpect, std::vector< TaskStatus > const &deltaExpects)
std::shared_ptr< LedgerDeltaAcquire > findLedgerDeltaAcquire(uint256 const &hash)
Simulate a network InboundLedgers.
virtual void sweep() override
virtual size_t cacheSize() override
virtual void logFailure(uint256 const &h, std::uint32_t seq) override
MagicInboundLedgers(LedgerMaster &ledgerSource, LedgerMaster &ledgerSink, InboundLedgersBehavior bhvr)
virtual void gotFetchPack() override
InboundLedgersBehavior bhvr
virtual ~MagicInboundLedgers()=default
LedgerMaster & ledgerSink
virtual void stop() override
virtual void acquireAsync(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason reason) override
virtual void clearFailures() override
virtual bool gotLedgerData(LedgerHash const &ledgerHash, std::shared_ptr< Peer >, std::shared_ptr< protocol::TMLedgerData >) override
LedgerMaster & ledgerSource
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason) override
virtual Json::Value getInfo() override
virtual std::size_t fetchRate() override
Returns the rate of historical ledger fetches per minute.
virtual std::shared_ptr< InboundLedger > find(LedgerHash const &hash) override
virtual void onLedgerFetched() override
Called when a complete ledger is obtained.
virtual bool isFailure(uint256 const &h) override
virtual void gotStaleData(std::shared_ptr< protocol::TMLedgerData > packet) override
LedgerReplayMsgHandler & local
LedgerReplayMsgHandler & remote
TestPeerSetBuilder(LedgerReplayMsgHandler &me, LedgerReplayMsgHandler &other, PeerSetBehavior bhvr, PeerFeature peerFeature)
std::unique_ptr< PeerSet > build() override
void cycleStatus() override
uint256 const & getClosedLedgerHash() const override
std::optional< std::size_t > publisherListSequence(PublicKey const &) const override
bool supportsFeature(ProtocolFeature f) const override
PublicKey const & getNodePublic() const override
beast::IP::Endpoint getRemoteAddress() const override
std::string const & fingerprint() const override
void ledgerRange(std::uint32_t &minSeq, std::uint32_t &maxSeq) const override
bool compressionEnabled() 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.
Json::Value json() override
bool ledgerReplayEnabled_
bool hasLedger(uint256 const &hash, std::uint32_t seq) const override
bool txReduceRelayEnabled() const override
TestPeer(bool enableLedgerReplay)
bool hasTxSet(uint256 const &hash) const override
int getScore(bool) const override
bool isHighLatency() const override
bool cluster() const override
Returns true if this connection is a member of the cluster.
void addTxQueue(uint256 const &) override
Aggregate transaction's hash.
void removeTxQueue(uint256 const &) override
Remove hash from the transactions' hashes queue.
void send(std::shared_ptr< Message > const &m) override
void sendTxQueue() override
Send aggregated transactions' hashes.
bool hasRange(std::uint32_t uMin, std::uint32_t uMax) override
void setPublisherListSequence(PublicKey const &, std::size_t const) override
Immutable cryptographic account descriptor.
A transaction testing environment.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
beast::Journal const journal
Set the regular signature on a JTx.
T emplace_back(T... args)
boost::asio::ip::address Address
A namespace for easy access to logging severity values.
Severity
Severity level / threshold of a Journal message.
Keylet const & skip() noexcept
The index of the "short" skip list.
XRP_t const XRP
Converts to XRP Issue or STAmount.
Json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
static autofill_t const autofill
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
PrettyAmount drops(Integer i)
Returns an XRP PrettyAmount, which is trivially convertible to STAmount.
static uint256 ledgerHash(LedgerHeader const &info)
void logAll(LedgerServer &server, LedgerReplayClient &client, beast::severities::Severity level=Severity::kTrace)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
PublicKey derivePublicKey(KeyType type, SecretKey const &sk)
Derive the public key from a secret key.
boost::intrusive_ptr< SHAMapItem > make_shamapitem(uint256 const &tag, Slice data)
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
auto makeRequest(bool crawlPublic, bool comprEnabled, bool ledgerReplayEnabled, bool txReduceRelayEnabled, bool vpReduceRelayEnabled) -> request_type
Make outbound http request.
bool peerFeatureEnabled(headers const &request, std::string const &feature, std::string value, bool config)
Check if a feature should be enabled for a peer.
SecretKey randomSecretKey()
Create a secret key using secure random numbers.
std::shared_ptr< Ledger > buildLedger(std::shared_ptr< Ledger const > const &parent, NetClock::time_point closeTime, bool const closeTimeCorrect, NetClock::duration closeResolution, Application &app, CanonicalTXSet &txns, std::set< TxID > &failedTxs, beast::Journal j)
Build a new ledger by applying consensus transactions.
http_response_type makeResponse(bool crawlPublic, http_request_type const &req, beast::IP::Address public_ip, beast::IP::Address remote_ip, uint256 const &sharedValue, std::optional< std::uint32_t > networkID, ProtocolVersion protocol, Application &app)
Make http response.
@ ledgerMaster
ledger master data for signing
static constexpr char FEATURE_LEDGER_REPLAY[]
void run() override
Runs the suite.
void run() override
Runs the suite.
void testSkipListTimeout()
void testLedgerDeltaTimeout()
void run() override
Runs the suite.
Test cases: LedgerReplayer_test: – process TMProofPathRequest and TMProofPathResponse – process TMRep...
void run() override
Runs the suite.
void testAllLocal(int totalReplay)
void testSkipListBadReply()
void testPeerSetBehavior(PeerSetBehavior peerSetBehavior, int totalReplay=4)
void testAllInboundLedgers(int totalReplay)
void testLedgerReplayOverlap()
void testLedgerDeltaBadReply()
Utility class for (1) creating ledgers with txns and (2) providing the ledgers via the ledgerMaster.
LedgerMaster & ledgerMaster
std::vector< jtx::Account > accounts
LedgerServer(beast::unit_test::suite &suite, Parameter const &p)
void createLedgerHistory()
create ledger history
void sendPayments(int newTxes)
LedgerReplayMsgHandler msgHandler
void createAccounts(int newAccounts)
NetworkOfTwo(beast::unit_test::suite &suite, LedgerServer::Parameter const ¶m, PeerSetBehavior behavior=PeerSetBehavior::Good, InboundLedgersBehavior inboundBhvr=InboundLedgersBehavior::Good, PeerFeature peerFeature=PeerFeature::LedgerReplayEnabled)
LedgerReplayClient client
Simulate a peerSet that supplies peers to ledger replay subtasks.
std::set< Peer::id_t > const & getPeerIds() const override
get the set of ids of previously added peers
LedgerReplayMsgHandler & local
std::shared_ptr< TestPeer > dummyPeer
TestPeerSet(LedgerReplayMsgHandler &me, LedgerReplayMsgHandler &other, PeerSetBehavior bhvr, bool enableLedgerReplay)
void sendRequest(::google::protobuf::Message const &msg, protocol::MessageType type, std::shared_ptr< Peer > const &peer) override
LedgerReplayMsgHandler & remote
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
Try add more peers.
Set the sequence number on a JTx.