aboutsummaryrefslogtreecommitdiff
path: root/src/test/lib/transaction_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/lib/transaction_utils.h')
-rw-r--r--src/test/lib/transaction_utils.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/lib/transaction_utils.h b/src/test/lib/transaction_utils.h
new file mode 100644
index 0000000000..6f297ac34f
--- /dev/null
+++ b/src/test/lib/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_LIB_TRANSACTION_UTILS_H
+#define BITCOIN_TEST_LIB_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_LIB_TRANSACTION_UTILS_H