aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/transaction_utils.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-11-05 15:18:59 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-11-06 11:56:41 -0500
commitfaec28252cf4f8e754c689a7a44fd421f631db50 (patch)
tree8388cdbab437520619be106278739db3b06e7714 /src/test/util/transaction_utils.h
parent7967104aee055476107dc17265cefc4ae4e75378 (diff)
scripted-diff: test: Move setup_common to test library
-BEGIN VERIFY SCRIPT- # Move files for f in $(git ls-files src/test/lib/); do git mv $f src/test/util/; done git mv src/test/setup_common.cpp src/test/util/ git mv src/test/setup_common.h src/test/util/ # Replace Windows paths sed -i -e 's|\\setup_common|\\util\\setup_common|g' $(git grep -l '\\setup_common') sed -i -e 's|src\\test\\lib\\|src\\test\\util\\|g' build_msvc/test_bitcoin/test_bitcoin.vcxproj # Everything else sed -i -e 's|/setup_common|/util/setup_common|g' $(git grep -l 'setup_common') sed -i -e 's|test/lib/|test/util/|g' $(git grep -l 'test/lib/') # Fix include guard sed -i -e 's|BITCOIN_TEST_SETUP_COMMON_H|BITCOIN_TEST_UTIL_SETUP_COMMON_H|g' ./src/test/util/setup_common.h sed -i -e 's|BITCOIN_TEST_LIB_|BITCOIN_TEST_UTIL_|g' $(git grep -l 'BITCOIN_TEST_LIB_') -END VERIFY SCRIPT-
Diffstat (limited to 'src/test/util/transaction_utils.h')
-rw-r--r--src/test/util/transaction_utils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/util/transaction_utils.h b/src/test/util/transaction_utils.h
new file mode 100644
index 0000000000..57604646e7
--- /dev/null
+++ b/src/test/util/transaction_utils.h
@@ -0,0 +1,19 @@
+// Copyright (c) 2019 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_TEST_UTIL_TRANSACTION_UTILS_H
+#define BITCOIN_TEST_UTIL_TRANSACTION_UTILS_H
+
+#include <primitives/transaction.h>
+
+// create crediting transaction
+// [1 coinbase input => 1 output with given scriptPubkey and value]
+CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0);
+
+// create spending transaction
+// [1 input with referenced transaction outpoint, scriptSig, scriptWitness =>
+// 1 output with empty scriptPubKey, full value of referenced transaction]
+CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CTransaction& txCredit);
+
+#endif // BITCOIN_TEST_UTIL_TRANSACTION_UTILS_H