aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/setup_common.h
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-01-25 11:51:38 -0800
committerAmiti Uttarwar <amiti@uttarwar.org>2021-02-16 12:23:00 -0800
commit9a3bbe8fc57d88919acd4eadbc96124711f17ec2 (patch)
treeed94fff1955c62629edd6127757518211e8fa86d /src/test/util/setup_common.h
parent92fee79dab384acea47bf20741a9847a58253330 (diff)
downloadbitcoin-9a3bbe8fc57d88919acd4eadbc96124711f17ec2.tar.xz
[test] Introduce a unit test helper to create a valid mempool transaction.
Diffstat (limited to 'src/test/util/setup_common.h')
-rw-r--r--src/test/util/setup_common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/util/setup_common.h b/src/test/util/setup_common.h
index 4be4763f35..33f24e7c44 100644
--- a/src/test/util/setup_common.h
+++ b/src/test/util/setup_common.h
@@ -123,6 +123,23 @@ struct TestChain100Setup : public RegTestingSetup {
//! Mine a series of new blocks on the active chain.
void mineBlocks(int num_blocks);
+ /**
+ * Create a transaction and submit to the mempool.
+ *
+ * @param input_transaction The transaction to spend
+ * @param input_vout The vout to spend from the input_transaction
+ * @param input_height The height of the block that included the input_transaction
+ * @param input_signing_key The key to spend the input_transaction
+ * @param output_destination Where to send the output
+ * @param output_amount How much to send
+ */
+ CMutableTransaction CreateValidMempoolTransaction(CTransactionRef input_transaction,
+ int input_vout,
+ int input_height,
+ CKey input_signing_key,
+ CScript output_destination,
+ CAmount output_amount = CAmount(1 * COIN));
+
~TestChain100Setup();
bool m_deterministic;