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

Commit

Permalink
fix client tests [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
irnb committed Aug 20, 2024
1 parent 8b4a3ab commit ee98b2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/lib/via_btc_client/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ mod tests {
#[tokio::test]
async fn test_new() {
let context = BitcoinRegtest::new().expect("Failed to create BitcoinRegtest");
let client = BitcoinClient::new(&context.get_url(), Network::Regtest)
let client = BitcoinClient::new(&context.get_url(), Network::Regtest, Auth::UserPass("rpcuser".to_string(), "rpcpassword".to_string()))
.await
.expect("Failed to create BitcoinClient");

Expand Down Expand Up @@ -163,7 +163,7 @@ mod tests {
#[tokio::test]
async fn test_fetch_block_height() {
let context = BitcoinRegtest::new().expect("Failed to create BitcoinRegtest");
let client = BitcoinClient::new(&context.get_url(), Network::Regtest, Auth::None)
let client = BitcoinClient::new(&context.get_url(), Network::Regtest, Auth::UserPass("rpcuser".to_string(), "rpcpassword".to_string()))
.await
.expect("Failed to create BitcoinClient");

Expand Down
3 changes: 2 additions & 1 deletion core/lib/via_btc_client/src/regtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ impl Drop for BitcoinRegtest {
#[cfg(test)]
mod tests {
use bitcoin::CompressedPublicKey;
use bitcoincore_rpc::Auth;
use secp256k1::Secp256k1;

use super::*;
Expand All @@ -109,7 +110,7 @@ mod tests {
#[tokio::test]
async fn test_bitcoin_regtest() {
let regtest = BitcoinRegtest::new().expect("Failed to create BitcoinRegtest");
let rpc = BitcoinRpcClient::new(&regtest.get_url(), "rpcuser", "rpcpassword")
let rpc = BitcoinRpcClient::new(&regtest.get_url(), Auth::UserPass("rpcuser".to_string(), "rpcpassword".to_string()))
.expect("Failed create rpc client");

let block_count = rpc
Expand Down

0 comments on commit ee98b2c

Please sign in to comment.