From 446efc2fbfa44360888f5b16dd30c1fc6c05d885 Mon Sep 17 00:00:00 2001 From: Dave Hrycyszyn Date: Tue, 25 Jun 2024 17:32:44 +0100 Subject: [PATCH] Noted that we're signing as well as building tx in the method signature --- side-node/src/bitcoin/clients/esplora.rs | 2 +- side-node/src/bitcoin/driver.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/side-node/src/bitcoin/clients/esplora.rs b/side-node/src/bitcoin/clients/esplora.rs index 07fe848..038d0a7 100644 --- a/side-node/src/bitcoin/clients/esplora.rs +++ b/side-node/src/bitcoin/clients/esplora.rs @@ -34,7 +34,7 @@ impl EsploraWallet { /// Does NOT send it, you must call `broadcast` to do that. /// /// 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, recipient: Address, amount: Amount, diff --git a/side-node/src/bitcoin/driver.rs b/side-node/src/bitcoin/driver.rs index 115ebc4..e5e69fc 100644 --- a/side-node/src/bitcoin/driver.rs +++ b/side-node/src/bitcoin/driver.rs @@ -10,7 +10,9 @@ use crate::bitcoin::clients; /// /// Also, it very handily works with the mutinynet.com esplora server, which is configured /// 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 sammy = clients::esplora::create_wallet("sammy", Network::Signet)?; @@ -51,7 +53,7 @@ pub(crate) async fn run() -> Result<(), anyhow::Error> { 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?; Ok(())