Struct bdk_testenv::TestEnv

source ·
pub struct TestEnv {
    pub bitcoind: BitcoinD,
    pub electrsd: ElectrsD,
}
Expand description

Struct for running a regtest environment with a single bitcoind node with an electrs instance connected to it.

Fields§

§bitcoind: BitcoinD§electrsd: ElectrsD

Implementations§

Construct a new TestEnv instance with default configurations.

Exposes the [ElectrumApi] calls from the Electrum client.

Exposes the [RpcApi] calls from [bitcoincore_rpc].

Mine a number of blocks of a given size count, which may be specified to a given coinbase address.

Mine a block that is guaranteed to be empty even with transactions in the mempool.

This method waits for the Electrum notification indicating that a new block has been mined.

Invalidate a number of blocks of a given size count.

Reorg a number of blocks of a given size count. Refer to TestEnv::mine_empty_block for more information.

Reorg with a number of empty blocks of a given size count.

Send a tx of a given amount to a given address.

Create a checkpoint linked list of all the blocks in the chain.

Get the genesis hash of the blockchain.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.