2017-11-09 19:34:51 +01:00
|
|
|
/*
|
|
|
|
|
* This file is part of the Flowee project
|
2021-06-20 22:44:44 +02:00
|
|
|
* Copyright (C) 2016 Tom Zander <tom@flowee.org>
|
2017-11-09 19:34:51 +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/>.
|
|
|
|
|
*/
|
2016-09-07 19:28:04 +02:00
|
|
|
|
2018-01-16 10:47:52 +00:00
|
|
|
#ifndef FLOWEE_TEST_TRANSACTION_UTILS_H
|
|
|
|
|
#define FLOWEE_TEST_TRANSACTION_UTILS_H
|
2016-09-07 19:28:04 +02:00
|
|
|
|
2017-07-23 12:37:49 +02:00
|
|
|
#include <vector>
|
2017-07-24 22:48:20 +02:00
|
|
|
#include <string>
|
2017-07-23 12:37:49 +02:00
|
|
|
|
2016-09-07 19:28:04 +02:00
|
|
|
class CScript;
|
2017-04-22 00:57:16 +09:00
|
|
|
struct CMutableTransaction;
|
2017-08-15 09:38:08 -06:00
|
|
|
class CTransaction;
|
2016-09-07 19:28:04 +02:00
|
|
|
|
|
|
|
|
namespace TxUtils {
|
|
|
|
|
void RandomScript(CScript &script);
|
2016-11-17 12:46:15 +01:00
|
|
|
void RandomInScript(CScript &script);
|
2016-11-07 16:22:29 +01:00
|
|
|
|
|
|
|
|
enum RandomTransactionType {
|
|
|
|
|
SingleOutput,
|
|
|
|
|
AnyOutputCount
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void RandomTransaction(CMutableTransaction &tx, RandomTransactionType single);
|
2016-09-15 22:48:59 +02:00
|
|
|
|
2017-07-23 12:37:49 +02:00
|
|
|
// create one transaction and repeat it until it fills up the space.
|
|
|
|
|
std::vector<CTransaction> transactionsForBlock(int minSize);
|
2017-07-24 22:48:20 +02:00
|
|
|
|
|
|
|
|
std::string FormatScript(const CScript& script);
|
2016-09-07 19:28:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|