From 9a3bbe8fc57d88919acd4eadbc96124711f17ec2 Mon Sep 17 00:00:00 2001 From: Amiti Uttarwar Date: Mon, 25 Jan 2021 11:51:38 -0800 Subject: [test] Introduce a unit test helper to create a valid mempool transaction. --- src/test/util/setup_common.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/test/util/setup_common.h') 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; -- cgit v1.2.3