From e3d4df7af18c470cab1e32b8d6ae366709456013 Mon Sep 17 00:00:00 2001 From: rajarshimaitra Date: Wed, 28 Sep 2022 17:59:09 +0530 Subject: [PATCH] Update integration_test This adds the previously added `proxy` feature into integration test for testing the proxy functionality. --- integration_test/Cargo.toml | 3 +++ integration_test/src/main.rs | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/integration_test/Cargo.toml b/integration_test/Cargo.toml index 1ecee4e2..e22fa90c 100644 --- a/integration_test/Cargo.toml +++ b/integration_test/Cargo.toml @@ -9,3 +9,6 @@ bitcoincore-rpc = { path = "../client" } bitcoin = { version = "0.29.0", features = ["serde", "rand"]} lazy_static = "1.4.0" log = "0.4" + +[features] +proxy = ["bitcoincore-rpc/proxy"] diff --git a/integration_test/src/main.rs b/integration_test/src/main.rs index c91cc33d..36188bfb 100644 --- a/integration_test/src/main.rs +++ b/integration_test/src/main.rs @@ -25,8 +25,8 @@ use bitcoin::hashes::hex::{FromHex, ToHex}; use bitcoin::hashes::Hash; use bitcoin::secp256k1; use bitcoin::{ - Address, Amount, PackedLockTime, Network, OutPoint, PrivateKey, Script, EcdsaSighashType, SignedAmount, - Sequence, Transaction, TxIn, TxOut, Txid, Witness, + Address, Amount, EcdsaSighashType, Network, OutPoint, PackedLockTime, PrivateKey, Script, + Sequence, SignedAmount, Transaction, TxIn, TxOut, Txid, Witness, }; use bitcoincore_rpc::bitcoincore_rpc_json::{ GetBlockTemplateModes, GetBlockTemplateRules, ScanTxOutRequest, @@ -125,8 +125,12 @@ fn main() { let rpc_url = format!("{}/wallet/testwallet", get_rpc_url()); let auth = get_auth(); + #[cfg(not(feature = "proxy"))] let cl = Client::new(&rpc_url, auth).unwrap(); + #[cfg(feature = "proxy")] + let cl = Client::new_with_proxy(&rpc_url, auth, "127.0.0.1:9050", None).unwrap(); + test_get_network_info(&cl); unsafe { VERSION = cl.version().unwrap() }; println!("Version: {}", version());