Skip to content

Commit

Permalink
Update integration_test
Browse files Browse the repository at this point in the history
This adds the previously added `proxy` feature into integration test for
testing the proxy functionality.
  • Loading branch information
rajarshimaitra committed Sep 28, 2022
1 parent 6230777 commit e3d4df7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions integration_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
8 changes: 6 additions & 2 deletions integration_test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit e3d4df7

Please sign in to comment.