Noted that we're signing as well as building tx in the method signature

This commit is contained in:
Dave Hrycyszyn
2024-06-25 17:32:44 +01:00
parent c7095ced7b
commit 446efc2fbf
2 changed files with 5 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ impl EsploraWallet {
/// Does NOT send it, you must call `broadcast` to do that. /// Does NOT send it, you must call `broadcast` to do that.
/// ///
/// We could split the creation and signing easily if needed. /// We could split the creation and signing easily if needed.
pub(crate) fn build_send_tx( pub(crate) fn build_and_sign_send_tx(
&mut self, &mut self,
recipient: Address, recipient: Address,
amount: Amount, amount: Amount,

View File

@@ -10,7 +10,9 @@ 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> {}
async fn simple_transfer() -> Result<(), anyhow::Error> {
let mut dave = clients::esplora::create_wallet("dave", Network::Signet)?; let mut dave = clients::esplora::create_wallet("dave", Network::Signet)?;
let mut sammy = clients::esplora::create_wallet("sammy", Network::Signet)?; let mut sammy = clients::esplora::create_wallet("sammy", Network::Signet)?;
@@ -51,7 +53,7 @@ pub(crate) async fn run() -> Result<(), anyhow::Error> {
std::process::exit(0); std::process::exit(0);
} }
let tx = dave.build_send_tx(sammy_address, send_amount)?; let tx = dave.build_and_sign_send_tx(sammy_address, send_amount)?;
dave.broadcast(&tx).await?; dave.broadcast(&tx).await?;
Ok(()) Ok(())