Initialize reqwest clients with verbose logging

This commit is contained in:
Thomas Eizinger 2021-04-19 10:10:46 +10:00
parent 7e688eb7e8
commit 0970c2bc72
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
6 changed files with 34 additions and 24 deletions

View file

@ -25,7 +25,7 @@ pub struct Wallet {
impl Wallet {
/// Connect to a wallet RPC and load the given wallet by name.
pub async fn open_or_create(url: Url, name: String, env_config: Config) -> Result<Self> {
let client = wallet::Client::new(url);
let client = wallet::Client::new(url)?;
let open_wallet_response = client.open_wallet(name.clone()).await;
if open_wallet_response.is_err() {

View file

@ -165,7 +165,7 @@ impl WalletRpc {
}
// Send a json rpc request to make sure monero_wallet_rpc is ready
Client::localhost(port).get_version().await?;
Client::localhost(port)?.get_version().await?;
Ok(WalletRpcProcess {
_child: child,

View file

@ -44,7 +44,7 @@ where
let cli = Cli::default();
let _guard = tracing_subscriber::fmt()
.with_env_filter("warn,swap=debug,monero_harness=debug,monero_rpc=debug,bitcoin_harness=info,testcontainers=info")
.with_env_filter("warn,swap=debug,monero_harness=debug,monero_rpc=debug,bitcoin_harness=info,testcontainers=info") // add `reqwest::connect::verbose=trace` if you want to logs of the RPC clients
.with_test_writer()
.set_default();
@ -276,7 +276,7 @@ async fn init_test_wallets(
.unwrap();
let xmr_wallet = swap::monero::Wallet::connect(
monero.wallet(name).unwrap().client(),
monero.wallet(name).unwrap().client().clone(),
name.to_string(),
env_config,
)