mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Redesign CSF framework (RIPD-1361):
- Separate `Scheduler` from `BasicNetwork`. - Add an event/collector framework for monitoring invariants and calculating statistics. - Allow distinct network and trust connections between Peers. - Add a simple routing strategy to support broadcasting arbitrary messages. - Add a common directed graph (`Digraph`) class for representing network and trust topologies. - Add a `PeerGroup` class for simpler specification of the trust and network topologies. - Add a `LedgerOracle` class to ensure distinct ledger histories and simplify branch checking. - Add a `Submitter` to send transactions in at fixed or random intervals to fixed or random peers. Co-authored-by: Joseph McGee
This commit is contained in:
@@ -95,11 +95,32 @@ class LedgerTiming_test : public beast::unit_test::suite
|
||||
|
||||
}
|
||||
|
||||
void testEffCloseTime()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
using tp = NetClock::time_point;
|
||||
tp close = effCloseTime(tp{10s}, 30s, tp{0s});
|
||||
BEAST_EXPECT(close == tp{1s});
|
||||
|
||||
close = effCloseTime(tp{16s}, 30s, tp{0s});
|
||||
BEAST_EXPECT(close == tp{30s});
|
||||
|
||||
close = effCloseTime(tp{16s}, 30s, tp{30s});
|
||||
BEAST_EXPECT(close == tp{31s});
|
||||
|
||||
close = effCloseTime(tp{16s}, 30s, tp{60s});
|
||||
BEAST_EXPECT(close == tp{61s});
|
||||
|
||||
close = effCloseTime(tp{31s}, 30s, tp{0s});
|
||||
BEAST_EXPECT(close == tp{30s});
|
||||
}
|
||||
|
||||
void
|
||||
run() override
|
||||
{
|
||||
testGetNextLedgerTimeResolution();
|
||||
testRoundCloseTime();
|
||||
testEffCloseTime();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user