mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-05 16:58:00 +00:00
@@ -802,19 +802,17 @@ TEST_F(BackendTest, Basic)
|
|||||||
auto generateNextLedger = [seed](auto lgrInfo) {
|
auto generateNextLedger = [seed](auto lgrInfo) {
|
||||||
++lgrInfo.seq;
|
++lgrInfo.seq;
|
||||||
lgrInfo.parentHash = lgrInfo.hash;
|
lgrInfo.parentHash = lgrInfo.hash;
|
||||||
std::srand(std::time(nullptr));
|
static auto randomEngine = std::default_random_engine(seed);
|
||||||
std::shuffle(
|
std::shuffle(
|
||||||
lgrInfo.txHash.begin(),
|
lgrInfo.txHash.begin(),
|
||||||
lgrInfo.txHash.end(),
|
lgrInfo.txHash.end(),
|
||||||
std::default_random_engine(seed));
|
randomEngine);
|
||||||
std::shuffle(
|
std::shuffle(
|
||||||
lgrInfo.accountHash.begin(),
|
lgrInfo.accountHash.begin(),
|
||||||
lgrInfo.accountHash.end(),
|
lgrInfo.accountHash.end(),
|
||||||
std::default_random_engine(seed));
|
randomEngine);
|
||||||
std::shuffle(
|
std::shuffle(
|
||||||
lgrInfo.hash.begin(),
|
lgrInfo.hash.begin(), lgrInfo.hash.end(), randomEngine);
|
||||||
lgrInfo.hash.end(),
|
|
||||||
std::default_random_engine(seed));
|
|
||||||
return lgrInfo;
|
return lgrInfo;
|
||||||
};
|
};
|
||||||
auto writeLedger = [&](auto lgrInfo,
|
auto writeLedger = [&](auto lgrInfo,
|
||||||
@@ -2213,19 +2211,17 @@ TEST_F(BackendTest, cacheIntegration)
|
|||||||
auto generateNextLedger = [seed](auto lgrInfo) {
|
auto generateNextLedger = [seed](auto lgrInfo) {
|
||||||
++lgrInfo.seq;
|
++lgrInfo.seq;
|
||||||
lgrInfo.parentHash = lgrInfo.hash;
|
lgrInfo.parentHash = lgrInfo.hash;
|
||||||
std::srand(std::time(nullptr));
|
static auto randomEngine = std::default_random_engine(seed);
|
||||||
std::shuffle(
|
std::shuffle(
|
||||||
lgrInfo.txHash.begin(),
|
lgrInfo.txHash.begin(),
|
||||||
lgrInfo.txHash.end(),
|
lgrInfo.txHash.end(),
|
||||||
std::default_random_engine(seed));
|
randomEngine);
|
||||||
std::shuffle(
|
std::shuffle(
|
||||||
lgrInfo.accountHash.begin(),
|
lgrInfo.accountHash.begin(),
|
||||||
lgrInfo.accountHash.end(),
|
lgrInfo.accountHash.end(),
|
||||||
std::default_random_engine(seed));
|
randomEngine);
|
||||||
std::shuffle(
|
std::shuffle(
|
||||||
lgrInfo.hash.begin(),
|
lgrInfo.hash.begin(), lgrInfo.hash.end(), randomEngine);
|
||||||
lgrInfo.hash.end(),
|
|
||||||
std::default_random_engine(seed));
|
|
||||||
return lgrInfo;
|
return lgrInfo;
|
||||||
};
|
};
|
||||||
auto writeLedger = [&](auto lgrInfo, auto objs, auto state) {
|
auto writeLedger = [&](auto lgrInfo, auto objs, auto state) {
|
||||||
@@ -2295,7 +2291,14 @@ TEST_F(BackendTest, cacheIntegration)
|
|||||||
EXPECT_TRUE(retLgr);
|
EXPECT_TRUE(retLgr);
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(
|
||||||
RPC::ledgerInfoToBlob(*retLgr),
|
RPC::ledgerInfoToBlob(*retLgr),
|
||||||
RPC::ledgerInfoToBlob(lgrInfo));
|
RPC::ledgerInfoToBlob(lgrInfo))
|
||||||
|
<< "retLgr seq:" << retLgr->seq
|
||||||
|
<< "; lgrInfo seq:" << lgrInfo.seq
|
||||||
|
<< "; retLgr hash:" << retLgr->hash
|
||||||
|
<< "; lgrInfo hash:" << lgrInfo.hash
|
||||||
|
<< "; retLgr parentHash:" << retLgr->parentHash
|
||||||
|
<< "; lgr Info parentHash:" << lgrInfo.parentHash;
|
||||||
|
|
||||||
std::vector<ripple::uint256> keys;
|
std::vector<ripple::uint256> keys;
|
||||||
for (auto [key, obj] : objs)
|
for (auto [key, obj] : objs)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user