feat: use Amount on TxBuilder::add_recipient

This commit is contained in:
Leonardo Lima committed 2024-05-05 12:07:07 -03:00
1 parent d5c0e7200c
commit 22aa534d76
9 files changed
+102 -102

No files matched your search

+2 -3
View File
@@ -1,5 +1,5 @@
const DB_MAGIC: &str = "bdk_wallet_electrum_example";
const SEND_AMOUNT: u64 = 5000;
const SEND_AMOUNT: Amount = Amount::from_sat(5000);
const STOP_GAP: usize = 50;
const BATCH_SIZE: usize = 5;
@@ -81,8 +81,7 @@ fn main() -> Result<(), anyhow::Error> {
let balance = wallet.get_balance();
println!("Wallet balance after syncing: {} sats", balance.total());
// TODO: (@leonardo) Should we format here, or update on constant and TxBuilder::add_recipient() instead ?
if balance.total() < Amount::from_sat(SEND_AMOUNT) {
if balance.total() < SEND_AMOUNT {
println!(
"Please send at least {} sats to the receiving address",
SEND_AMOUNT