Skip to content

Commit 70d8beb

Browse files
storopoliZk2u
andauthored
backport: fix(cli) don't expect a txid from the faucet api (#482) (#483)
fix(cli) don't expect a txid from the faucet api (#482) * fix(cli) don't expect a txid from the faucet api * chore: clippy * chore(cli) update messaging Co-authored-by: azz <[email protected]>
1 parent 9c45b61 commit 70d8beb

File tree

1 file changed

+4
-23
lines changed

1 file changed

+4
-23
lines changed

bin/strata-cli/src/cmd/faucet.rs

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ use std::str::FromStr;
33
#[cfg(feature = "strata_faucet")]
44
use alloy::{primitives::Address as StrataAddress, providers::WalletProvider};
55
use argh::FromArgs;
6-
use bdk_wallet::{
7-
bitcoin::{Address, Txid},
8-
KeychainKind,
9-
};
6+
use bdk_wallet::{bitcoin::Address, KeychainKind};
107
use console::Term;
118
use indicatif::ProgressBar;
129
use rand::{distributions::uniform::SampleRange, rngs::OsRng};
@@ -20,11 +17,7 @@ use crate::{
2017
net_type::{net_type_or_exit, NetworkType},
2118
strata::StrataWallet,
2219
};
23-
use crate::{
24-
seed::Seed,
25-
settings::Settings,
26-
signet::{print_bitcoin_explorer_url, SignetWallet},
27-
};
20+
use crate::{seed::Seed, settings::Settings, signet::SignetWallet};
2821

2922
/// Request some bitcoin from the faucet
3023
#[derive(FromArgs, PartialEq, Debug)]
@@ -168,21 +161,9 @@ pub async fn faucet(args: FaucetArgs, seed: Seed, settings: Settings) {
168161
let status = res.status();
169162
let body = res.text().await.expect("invalid response");
170163
if status == StatusCode::OK {
171-
#[cfg(feature = "strata_faucet")]
172-
if network_type == NetworkType::Signet {
173-
let _ = print_bitcoin_explorer_url(
174-
&Txid::from_str(&body).expect("valid txid"),
175-
&term,
176-
&settings,
177-
);
178-
}
179-
#[cfg(not(feature = "strata_faucet"))]
180-
let _ = print_bitcoin_explorer_url(
181-
&Txid::from_str(&body).expect("valid txid"),
182-
&term,
183-
&settings,
164+
let _ = term.write_line(
165+
"Successful queued request for signet bitcoin. It should arrive in your wallet soon.",
184166
);
185-
let _ = term.write_line(&format!("Successful. Claimed in transaction {body}"));
186167
} else {
187168
let _ = term.write_line(&format!("Failed: faucet responded with {status}: {body}"));
188169
}

0 commit comments

Comments
 (0)