pub fn mine_blocks(&self, n: u64) -> Vec<Block> {
self.mine_blocks_with_subsidy(n, 50 * COIN_VALUE)
}
pub fn mine_blocks_with_subsidy(&self, n: u64, subsidy: u64) -> Vec<Block> {
let mut bitcoin_rpc_data = self.state();
(0..n)
.map(|_| bitcoin_rpc_data.push_block(subsidy))
.collect()
}
pub fn broadcast_tx(&self, template: TransactionTemplate) -> Txid {
self.state().broadcast_tx(template)
}
pub fn invalidate_tip(&self) -> BlockHash {
self.state().pop_block()
}
pub fn get_utxo_amount(&self, outpoint: &OutPoint) -> Option<Amount> {
self.state().utxos.get(outpoint).cloned()
}
pub fn tx(&self, bi: usize, ti: usize) -> Transaction {
let state = self.state();
state.blocks[&state.hashes[bi]].txdata[ti].clone()
}
pub fn mempool(&self) -> Vec<Transaction> {
self.state().mempool().to_vec()
}
pub fn descriptors(&self) -> Vec<String> {
self.state().descriptors.clone()
}
pub fn import_descriptor(&self, desc: String) {
self.state().descriptors.push(desc);