MCPcopy Create free account
hub / github.com/ElementsProject/elements / TestConditionChecker

Class TestConditionChecker

src/test/versionbits_tests.cpp:32–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30static const Consensus::Params paramsDummy = Consensus::Params();
31
32class TestConditionChecker : public AbstractThresholdConditionChecker
33{
34private:
35 mutable ThresholdConditionCache cache;
36
37public:
38 int64_t BeginTime(const Consensus::Params& params) const override { return TestTime(10000); }
39 int64_t EndTime(const Consensus::Params& params) const override { return TestTime(20000); }
40 int Period(const Consensus::Params& params) const override { return 1000; }
41 int Threshold(const Consensus::Params& params) const override { return 900; }
42 bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override { return (pindex->nVersion & 0x100); }
43
44 ThresholdState GetStateFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateFor(pindexPrev, paramsDummy, cache); }
45 int GetStateSinceHeightFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateSinceHeightFor(pindexPrev, paramsDummy, cache); }
46};
47
48class TestDelayedActivationConditionChecker : public TestConditionChecker
49{

Callers 1

VersionBitsTesterClass · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected