Trait fedimint_testing::btc::BitcoinTest
source · pub trait BitcoinTest {
// Required methods
fn lock_exclusive<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Box<dyn BitcoinTest + Send + Sync>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn mine_blocks<'life0, 'async_trait>(
&'life0 self,
block_num: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn prepare_funding_wallet<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn send_and_mine_block<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
amount: Amount
) -> Pin<Box<dyn Future<Output = (TxOutProof, Transaction)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_new_address<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Address> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn mine_block_and_get_received<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address
) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_mempool_tx_fee<'life0, 'life1, 'async_trait>(
&'life0 self,
txid: &'life1 Txid
) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Required Methods§
sourcefn lock_exclusive<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Box<dyn BitcoinTest + Send + Sync>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn lock_exclusive<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Box<dyn BitcoinTest + Send + Sync>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Make the underlying instance act as if it was exclusively available for the existence of the returned guard.
sourcefn mine_blocks<'life0, 'async_trait>(
&'life0 self,
block_num: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mine_blocks<'life0, 'async_trait>(
&'life0 self,
block_num: u64
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mines a given number of blocks
sourcefn prepare_funding_wallet<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_funding_wallet<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Prepare funding wallet
If needed will mine initial 100 blocks for send_and_mine_block
to
work.
sourcefn send_and_mine_block<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
amount: Amount
) -> Pin<Box<dyn Future<Output = (TxOutProof, Transaction)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_and_mine_block<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
amount: Amount
) -> Pin<Box<dyn Future<Output = (TxOutProof, Transaction)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send some bitcoin to an address then mine a block to confirm it. Returns the proof that the transaction occurred.
The implementation is responsible for making sure the funds can be sent (e.g. first 100 blocks are mined to make funds available)
sourcefn get_new_address<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Address> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_new_address<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Address> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a new address.
sourcefn mine_block_and_get_received<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address
) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mine_block_and_get_received<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address
) -> Pin<Box<dyn Future<Output = Amount> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mine a block to include any pending transactions then get the amount received to an address