Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add logs, tests for indexer` [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
steph-rs committed Aug 20, 2024
1 parent e420047 commit 8dac0f4
Show file tree
Hide file tree
Showing 6 changed files with 619 additions and 88 deletions.
8 changes: 5 additions & 3 deletions core/lib/via_btc_client/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ pub struct BitcoinClient {
network: Network,
}

#[async_trait]
impl BitcoinOps for BitcoinClient {
impl BitcoinClient {
#[instrument(skip(auth), target = "bitcoin_client")]
async fn new(rpc_url: &str, network: Network, auth: Auth) -> BitcoinClientResult<Self>
pub(crate) fn new(rpc_url: &str, network: Network, auth: Auth) -> BitcoinClientResult<Self>
where
Self: Sized,
{
debug!("Creating new BitcoinClient");
let rpc = Box::new(BitcoinRpcClient::new(rpc_url, auth)?);
Ok(Self { rpc, network })
}
}

#[async_trait]
impl BitcoinOps for BitcoinClient {
#[instrument(skip(self), target = "bitcoin_client")]
async fn get_balance(&self, address: &Address) -> BitcoinClientResult<u128> {
debug!("Getting balance");
Expand Down
Loading

0 comments on commit 8dac0f4

Please sign in to comment.