mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Consensus transaction recovery/deferral completely ignores the TxQ
This commit is contained in:
committed by
Nik Bougalis
parent
aaa601841c
commit
ae9930b87d
@@ -31,7 +31,7 @@ class HashRouter_test : public beast::unit_test::suite
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 2s, 2);
|
||||
HashRouter router(stopwatch, 2s);
|
||||
|
||||
uint256 const key1(1);
|
||||
uint256 const key2(2);
|
||||
@@ -68,7 +68,7 @@ class HashRouter_test : public beast::unit_test::suite
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 2s, 2);
|
||||
HashRouter router(stopwatch, 2s);
|
||||
|
||||
uint256 const key1(1);
|
||||
uint256 const key2(2);
|
||||
@@ -146,7 +146,7 @@ class HashRouter_test : public beast::unit_test::suite
|
||||
// Normal HashRouter
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 2s, 2);
|
||||
HashRouter router(stopwatch, 2s);
|
||||
|
||||
uint256 const key1(1);
|
||||
uint256 const key2(2);
|
||||
@@ -174,7 +174,7 @@ class HashRouter_test : public beast::unit_test::suite
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 2s, 2);
|
||||
HashRouter router(stopwatch, 2s);
|
||||
|
||||
uint256 const key1(1);
|
||||
BEAST_EXPECT(router.setFlags(key1, 10));
|
||||
@@ -187,7 +187,7 @@ class HashRouter_test : public beast::unit_test::suite
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 1s, 2);
|
||||
HashRouter router(stopwatch, 1s);
|
||||
|
||||
uint256 const key1(1);
|
||||
|
||||
@@ -225,47 +225,12 @@ class HashRouter_test : public beast::unit_test::suite
|
||||
BEAST_EXPECT(peers && peers->size() == 0);
|
||||
}
|
||||
|
||||
void
|
||||
testRecover()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 1s, 5);
|
||||
|
||||
uint256 const key1(1);
|
||||
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(!router.shouldRecover(key1));
|
||||
// Expire, but since the next search will
|
||||
// be for this entry, it will get refreshed
|
||||
// instead.
|
||||
++stopwatch;
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
// Expire, but since the next search will
|
||||
// be for this entry, it will get refreshed
|
||||
// instead.
|
||||
++stopwatch;
|
||||
// Recover again. Recovery is independent of
|
||||
// time as long as the entry doesn't expire.
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
// Expire again
|
||||
++stopwatch;
|
||||
BEAST_EXPECT(router.shouldRecover(key1));
|
||||
BEAST_EXPECT(!router.shouldRecover(key1));
|
||||
}
|
||||
|
||||
void
|
||||
testProcess()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
TestStopwatch stopwatch;
|
||||
HashRouter router(stopwatch, 5s, 5);
|
||||
HashRouter router(stopwatch, 5s);
|
||||
uint256 const key(1);
|
||||
HashRouter::PeerShortID peer = 1;
|
||||
int flags;
|
||||
@@ -286,7 +251,6 @@ public:
|
||||
testSuppression();
|
||||
testSetFlags();
|
||||
testRelay();
|
||||
testRecover();
|
||||
testProcess();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user