7df238b281
Duplicate the test_bitcoin file into the common dir, I hope to remove the original in future. Make the common dir a new static lib and create a new qtestlib based unit test out of the old doublespend unit test.
57 lines
2.0 KiB
C++
57 lines
2.0 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 MEMPOOLHELPER_H
|
|
#define MEMPOOLHELPER_H
|
|
|
|
#include <txmempool.h>
|
|
|
|
class CTxMemPoolEntry;
|
|
class CTxMemPool;
|
|
|
|
struct TestMemPoolEntryHelper
|
|
{
|
|
// Default values
|
|
CAmount nFee;
|
|
int64_t nTime;
|
|
double dPriority;
|
|
unsigned int nHeight;
|
|
bool hadNoDependencies;
|
|
bool spendsCoinbase;
|
|
unsigned int sigOpCount;
|
|
LockPoints lp;
|
|
|
|
TestMemPoolEntryHelper() :
|
|
nFee(0), nTime(0), dPriority(0.0), nHeight(1),
|
|
hadNoDependencies(false), spendsCoinbase(false), sigOpCount(1) { }
|
|
|
|
CTxMemPoolEntry FromTx(CMutableTransaction &tx, CTxMemPool *pool = nullptr);
|
|
|
|
// Change the default value
|
|
TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; }
|
|
TestMemPoolEntryHelper &Time(int64_t _time) { nTime = _time; return *this; }
|
|
TestMemPoolEntryHelper &Priority(double _priority) { dPriority = _priority; return *this; }
|
|
TestMemPoolEntryHelper &Height(unsigned int _height) { nHeight = _height; return *this; }
|
|
TestMemPoolEntryHelper &HadNoDependencies(bool _hnd) { hadNoDependencies = _hnd; return *this; }
|
|
TestMemPoolEntryHelper &SpendsCoinbase(bool _flag) { spendsCoinbase = _flag; return *this; }
|
|
TestMemPoolEntryHelper &SigOps(unsigned int _sigops) { sigOpCount = _sigops; return *this; }
|
|
};
|
|
|
|
#endif
|