Skip to content

Commit

Permalink
don't make two new methods, one is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocynicys committed Jun 28, 2024
1 parent 0a0a118 commit c42b29c
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions teos/src/carrier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,18 @@ pub struct Carrier {

impl Carrier {
/// Creates a new [Carrier] instance.
#[cfg(not(test))]
pub fn new(
bitcoin_cli: Arc<BitcoindClient>,
bitcoind_reachable: Arc<(Mutex<bool>, Condvar)>,
last_known_block_height: u32,
#[cfg(test)] stopper: Option<crate::test_utils::BitcoindStopper>,
) -> Self {
Carrier {
bitcoin_cli,
bitcoind_reachable,
issued_receipts: HashMap::new(),
block_height: last_known_block_height,
}
}

/// Creates a new [Carrier] instance.
#[cfg(test)]
pub fn new(
bitcoin_cli: Arc<BitcoindClient>,
bitcoind_reachable: Arc<(Mutex<bool>, Condvar)>,
last_known_block_height: u32,
stopper: Option<crate::test_utils::BitcoindStopper>,
) -> Self {
Carrier {
bitcoin_cli,
bitcoind_reachable,
issued_receipts: HashMap::new(),
block_height: last_known_block_height,
#[cfg(test)]
_stopper: stopper,
}
}
Expand Down

0 comments on commit c42b29c

Please sign in to comment.