Files
thehub/testing/common/MockApplication.h
T
TomZ f868a8274e Make all protocol upgrades equal.
The "UAHF" one used to be "more equal", mostly just because it happened
to be the first.
This makes them all equally equal.

Specifically this removes the special casing and the enum for the 201708
HF (aka BCH fork-point).
We select the right branch now purely based on the historical check-
points.
2019-06-02 13:57:47 +02:00

56 lines
1.7 KiB
C++

/*
* This file is part of the Flowee project
* Copyright (c) 2015 The Bitcoin Core developers
* Copyright (C) 2017 Tom Zander <tomz@freedommail.ch>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MOCKAPPLICATION_H
#define MOCKAPPLICATION_H
#include <Application.h>
#include <validation/Engine.h>
class MockApplication : public Application
{
public:
MockApplication() = delete;
inline static void doInit() {
static_cast<MockApplication*>(Application::instance())->pub_init();
}
inline static void doStartThreads() {
static_cast<MockApplication*>(Application::instance())->pub_startThreads();
}
inline static void setValidationEngine(Validation::Engine *bv) {
static_cast<MockApplication*>(Application::instance())->replaceValidationEngine(bv);
}
protected:
inline void pub_init() {
init();
}
inline void pub_startThreads() {
startThreads();
}
inline void replaceValidationEngine(Validation::Engine *bv) {
m_validationEngine.release();
m_validationEngine.reset(bv);
}
};
#endif