pub struct TestConfig {
pub rpc_port: u16,
pub rpc_username: String,
pub rpc_password: String,
pub network: Network,
pub core_version: Option<u32>,
}
Expand description
TestConfig represents the configuration needed to run a Bitcoin node in a test environment.
Fields§
§rpc_port: u16
The port number for RPC communication with the Bitcoin node. A value of 0 indicates that an available port should be automatically selected.
rpc_username: String
The username for RPC authentication.
rpc_password: String
The password for RPC authentication.
network: Network
Which Bitcoin network to run against.
core_version: Option<u32>
Bitcoin Core version; None
to auto-detect
Implementations§
Source§impl TestConfig
impl TestConfig
Sourcepub fn as_chain_str(&self) -> &'static str
pub fn as_chain_str(&self) -> &'static str
Return the value used with -chain=<value>
for the configured network
Sourcepub fn network_from_str(s: &str) -> Option<Network>
pub fn network_from_str(s: &str) -> Option<Network>
Parse network from common strings (case-insensitive). Accepts: regtest, testnet|test, signet, mainnet|main|bitcoin, testnet4.
Trait Implementations§
Source§impl Clone for TestConfig
impl Clone for TestConfig
Source§fn clone(&self) -> TestConfig
fn clone(&self) -> TestConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TestConfig
impl Debug for TestConfig
Auto Trait Implementations§
impl Freeze for TestConfig
impl RefUnwindSafe for TestConfig
impl Send for TestConfig
impl Sync for TestConfig
impl Unpin for TestConfig
impl UnwindSafe for TestConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more