Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hydra-yse committed Dec 11, 2024
1 parent d9499de commit dae2d0d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions lib/core/src/test_utils/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ use boltz_client::{
},
Amount,
};
use electrum_client::bitcoin::{consensus::deserialize, OutPoint, Script, TxOut};
use electrum_client::GetBalanceRes;
use electrum_client::{
bitcoin::{consensus::deserialize, OutPoint, Script, TxOut},
HeaderNotification,
};
use lwk_wollet::{
bitcoin::constants::genesis_block,
elements::{BlockHash, Txid as ElementsTxid},
History,
};
Expand Down Expand Up @@ -60,7 +64,7 @@ impl MockLiquidChainService {
#[async_trait]
impl LiquidChainService for MockLiquidChainService {
async fn tip(&mut self) -> Result<u32> {
unimplemented!()
Ok(0)
}

async fn broadcast(
Expand Down Expand Up @@ -139,8 +143,11 @@ impl MockBitcoinChainService {

#[async_trait]
impl BitcoinChainService for MockBitcoinChainService {
fn tip(&mut self) -> Result<electrum_client::HeaderNotification> {
unimplemented!()
fn tip(&mut self) -> Result<HeaderNotification> {
Ok(HeaderNotification {
height: 0,
header: genesis_block(lwk_wollet::bitcoin::Network::Testnet).header,
})
}

fn broadcast(
Expand Down Expand Up @@ -186,11 +193,14 @@ impl BitcoinChainService for MockBitcoinChainService {
&self,
_script: &boltz_client::bitcoin::Script,
) -> Result<electrum_client::GetBalanceRes> {
unimplemented!()
Ok(GetBalanceRes {
confirmed: 0,
unconfirmed: 0,
})
}

fn scripts_get_balance(&self, _scripts: &[&Script]) -> Result<Vec<GetBalanceRes>> {
unimplemented!()
Ok(vec![])
}

async fn verify_tx(
Expand Down

0 comments on commit dae2d0d

Please sign in to comment.