]> Untitled Git - bdk/commitdiff
Use hardcoded send amount for `wallet_esplora` example
author志宇 <hello@evanlinjin.me>
Mon, 6 Mar 2023 21:47:13 +0000 (10:47 +1300)
committer志宇 <hello@evanlinjin.me>
Mon, 6 Mar 2023 21:47:13 +0000 (10:47 +1300)
example-crates/wallet_esplora/src/main.rs

index fa4e0b17e080a1a9717743b294242e5d21f4e965..73459e0c21faf801a7dac5f5d8b6e9c9979f4be2 100644 (file)
@@ -8,6 +8,7 @@ use bdk_esplora::EsploraExt;
 use bdk_file_store::KeychainStore;
 use std::str::FromStr;
 
+const SEND_AMOUNT: u64 = 5000;
 const STOP_GAP: usize = 50;
 const PARALLEL_REQUESTS: usize = 5;
 
@@ -58,7 +59,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
 
     let mut tx_builder = wallet.build_tx();
     tx_builder
-        .add_recipient(faucet_address.script_pubkey(), (balance.total()) / 5)
+        .add_recipient(faucet_address.script_pubkey(), SEND_AMOUNT)
         .enable_rbf();
 
     let (mut psbt, _) = tx_builder.finish()?;