Naming driver users
This commit is contained in:
@@ -11,16 +11,16 @@ use crate::bitcoin::clients;
|
|||||||
/// Also, it very handily works with the mutinynet.com esplora server, which is configured
|
/// Also, it very handily works with the mutinynet.com esplora server, which is configured
|
||||||
/// with 30 second block times.
|
/// with 30 second block times.
|
||||||
pub(crate) async fn run() -> Result<(), anyhow::Error> {
|
pub(crate) async fn run() -> Result<(), anyhow::Error> {
|
||||||
let mut wallet = clients::esplora::create_wallet("dave")?;
|
let mut dave = clients::esplora::create_wallet("dave")?;
|
||||||
|
|
||||||
let _next_address = wallet.next_unused_address()?;
|
let _next_address = dave.next_unused_address()?;
|
||||||
|
|
||||||
let balance = wallet.balance();
|
let balance = dave.balance();
|
||||||
println!("Wallet balance before syncing: {} sats", balance.total());
|
println!("Wallet balance before syncing: {} sats", balance.total());
|
||||||
|
|
||||||
wallet.sync().await?;
|
dave.sync().await?;
|
||||||
|
|
||||||
let balance = wallet.balance();
|
let balance = dave.balance();
|
||||||
println!("Wallet balance after syncing: {} sats", balance.total());
|
println!("Wallet balance after syncing: {} sats", balance.total());
|
||||||
|
|
||||||
let faucet_address = Address::from_str("mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt")?
|
let faucet_address = Address::from_str("mkHS9ne12qx9pS9VojpwU5xtRd4T7X7ZUt")?
|
||||||
@@ -35,8 +35,8 @@ pub(crate) async fn run() -> Result<(), anyhow::Error> {
|
|||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let tx = wallet.build_send_tx(faucet_address, send_amount)?;
|
let tx = dave.build_send_tx(faucet_address, send_amount)?;
|
||||||
wallet.broadcast(&tx).await?;
|
dave.broadcast(&tx).await?;
|
||||||
|
|
||||||
println!("Tx broadcasted! Txid: {}", tx.compute_txid());
|
println!("Tx broadcasted! Txid: {}", tx.compute_txid());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user