| 30 | static const Consensus::Params paramsDummy = Consensus::Params(); |
| 31 | |
| 32 | class TestConditionChecker : public AbstractThresholdConditionChecker |
| 33 | { |
| 34 | private: |
| 35 | mutable ThresholdConditionCache cache; |
| 36 | |
| 37 | public: |
| 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 | |
| 48 | class TestDelayedActivationConditionChecker : public TestConditionChecker |
| 49 | { |