2018-12-28 12:10:28 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
2021-06-20 22:44:44 +02:00
|
|
|
* Copyright (C) 2018-2020 Tom Zander <tom@flowee.org>
|
2018-12-28 12:10:28 +01:00
|
|
|
*
|
|
|
|
|
* 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 POW_TESTS_H
|
|
|
|
|
#define POW_TESTS_H
|
|
|
|
|
|
|
|
|
|
#include <common/TestFloweeBase.h>
|
|
|
|
|
|
2020-08-10 12:12:08 +02:00
|
|
|
class CBlockIndex;
|
|
|
|
|
|
2018-12-28 12:10:28 +01:00
|
|
|
class POWTests : public TestFloweeBase
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2020-08-10 12:12:08 +02:00
|
|
|
private:
|
|
|
|
|
double TargetFromBits(const uint32_t nBits) const;
|
|
|
|
|
|
|
|
|
|
double GetASERTApproximationError(const CBlockIndex *pindexPrev, const uint32_t finalBits,
|
|
|
|
|
const CBlockIndex *pindexReferenceBlock) const;
|
2018-12-28 12:10:28 +01:00
|
|
|
private slots:
|
|
|
|
|
void get_next_work();
|
|
|
|
|
void get_next_work_pow_limit();
|
|
|
|
|
void get_next_work_lower_limit_actual();
|
|
|
|
|
void get_next_work_upper_limit_actual();
|
|
|
|
|
void GetBlockProofEquivalentTime_test();
|
|
|
|
|
void retargeting_test();
|
|
|
|
|
void cash_difficulty_test();
|
2020-08-10 12:12:08 +02:00
|
|
|
|
|
|
|
|
// asert (from 2020)
|
|
|
|
|
void asert_difficulty_test();
|
|
|
|
|
void calculate_asert_test();
|
2018-12-28 12:10:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|