Skip to content

Commit 76a4867

Browse files
committed
Fix tests
1 parent 42ed35f commit 76a4867

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

client/src/format.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ pub fn print_list_unspent(utxos: Vec<WalletOutput>, format: Format) {
152152
pub fn print_server_info(info: ServerInfo, format: Format) {
153153
match format {
154154
Format::Text => {
155-
println!("CHAIN: {}", info.network);
156-
println!(" Height {}", info.tip.height);
157-
println!(" Hash {}", info.tip.hash);
155+
println!("Network: {}", info.network);
156+
println!("Height {}", info.tip.height);
157+
println!("Hash {}", info.tip.hash);
158+
println!("Progress {:.2}%", info.progress * 100.0);
158159
}
159160
Format::Json => {
160161
println!("{}", serde_json::to_string_pretty(&info).unwrap());

client/tests/fetcher_tests.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use spaces_client::source::{
88
BitcoinBlockSource, BitcoinRpc, BitcoinRpcAuth, BlockEvent, BlockFetcher,
99
};
1010
use spaces_protocol::{bitcoin::BlockHash, constants::ChainAnchor};
11+
use spaces_protocol::bitcoin::Network;
1112
use spaces_testutil::TestRig;
1213

1314
async fn setup(blocks: u64) -> Result<(TestRig, u64, BlockHash)> {
@@ -27,8 +28,9 @@ fn test_block_fetching_from_bitcoin_rpc() -> Result<()> {
2728
let fetcher_rpc = BitcoinBlockSource::new(BitcoinRpc::new(
2829
&rig.bitcoind.rpc_url(),
2930
BitcoinRpcAuth::UserPass("user".to_string(), "password".to_string()),
31+
true
3032
));
31-
let (fetcher, receiver) = BlockFetcher::new(fetcher_rpc.clone(), 8);
33+
let (fetcher, receiver) = BlockFetcher::new(Network::Regtest, fetcher_rpc.clone(), 8);
3234
fetcher.start(ChainAnchor { hash, height: 0 });
3335

3436
let timeout = Duration::from_secs(5);

0 commit comments

Comments
 (0)