From ee98b2c2291bc31ec4ae921f420c883694b578ad Mon Sep 17 00:00:00 2001 From: Hamid Bateni Date: Tue, 20 Aug 2024 10:43:50 +0400 Subject: [PATCH] fix client tests [ci skip] --- core/lib/via_btc_client/src/client/mod.rs | 4 ++-- core/lib/via_btc_client/src/regtest.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/lib/via_btc_client/src/client/mod.rs b/core/lib/via_btc_client/src/client/mod.rs index 841c53f52a1c..334f6aafee4b 100644 --- a/core/lib/via_btc_client/src/client/mod.rs +++ b/core/lib/via_btc_client/src/client/mod.rs @@ -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"); @@ -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"); diff --git a/core/lib/via_btc_client/src/regtest.rs b/core/lib/via_btc_client/src/regtest.rs index f0d4fdd02769..9cf26859d37f 100644 --- a/core/lib/via_btc_client/src/regtest.rs +++ b/core/lib/via_btc_client/src/regtest.rs @@ -101,6 +101,7 @@ impl Drop for BitcoinRegtest { #[cfg(test)] mod tests { use bitcoin::CompressedPublicKey; + use bitcoincore_rpc::Auth; use secp256k1::Secp256k1; use super::*; @@ -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(®test.get_url(), "rpcuser", "rpcpassword") + let rpc = BitcoinRpcClient::new(®test.get_url(), Auth::UserPass("rpcuser".to_string(), "rpcpassword".to_string())) .expect("Failed create rpc client"); let block_count = rpc