| 17 | static const Consensus::Params paramsDummy = Consensus::Params(); |
| 18 | |
| 19 | class TestConditionChecker : public AbstractThresholdConditionChecker |
| 20 | { |
| 21 | private: |
| 22 | mutable ThresholdConditionCache cache; |
| 23 | |
| 24 | public: |
| 25 | int64_t BeginTime(const Consensus::Params& params) const override { return TestTime(10000); } |
| 26 | int64_t EndTime(const Consensus::Params& params) const override { return TestTime(20000); } |
| 27 | int Period(const Consensus::Params& params) const override { return 1000; } |
| 28 | int Threshold(const Consensus::Params& params) const override { return 900; } |
| 29 | bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override { return (pindex->nVersion & 0x100); } |
| 30 | |
| 31 | ThresholdState GetStateFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateFor(pindexPrev, paramsDummy, cache); } |
| 32 | int GetStateSinceHeightFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateSinceHeightFor(pindexPrev, paramsDummy, cache); } |
| 33 | }; |
| 34 | |
| 35 | class TestAlwaysActiveConditionChecker : public TestConditionChecker |
| 36 | { |