Struct bitcoin_test::TestChain100Setup
source · pub struct TestChain100Setup { /* private fields */ }
Expand description
| Testing fixture that pre-creates a | 100-block REGTEST-mode block chain |
Implementations§
source§impl TestChain100Setup
impl TestChain100Setup
pub fn new(extra_args: &Vec<*const u8>) -> Self
sourcepub fn mine_blocks(&mut self, num_blocks: i32)
pub fn mine_blocks(&mut self, num_blocks: i32)
| Mine a series of new blocks on the active | chain. |
sourcepub fn create_block(
&mut self,
txns: &Vec<MutableTransaction>,
script_pub_key: &Script,
chainstate: &mut ChainState
) -> Block
pub fn create_block( &mut self, txns: &Vec<MutableTransaction>, script_pub_key: &Script, chainstate: &mut ChainState ) -> Block
| Create a new block with just given transactions, | coinbase paying to scriptPubKey. |
sourcepub fn create_and_process_block(
&mut self,
txns: &Vec<MutableTransaction>,
script_pub_key: &Script,
chainstate: Option<*mut ChainState>
) -> Block
pub fn create_and_process_block( &mut self, txns: &Vec<MutableTransaction>, script_pub_key: &Script, chainstate: Option<*mut ChainState> ) -> Block
| Create a new block with just given transactions, | coinbase paying to scriptPubKey, and | try to add it to the current chain. | | If no chainstate is specified, default | to the active. |
sourcepub fn create_valid_mempool_transaction(
&mut self,
input_transaction: TransactionRef,
input_vout: i32,
input_height: i32,
input_signing_key: Key,
output_destination: Script,
output_amount: Option<Amount>,
submit: Option<bool>
) -> MutableTransaction
pub fn create_valid_mempool_transaction( &mut self, input_transaction: TransactionRef, input_vout: i32, input_height: i32, input_signing_key: Key, output_destination: Script, output_amount: Option<Amount>, submit: Option<bool> ) -> MutableTransaction
| 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 | ––––– | @param submit | | Whether or not to submit to mempool |