refactor(wallet): rename get_balance() to balance()

This commit is contained in:
Steve Myers
2024-06-01 17:46:24 -05:00
parent 4a8452f9b8
commit 50137b0425
8 changed files with 14 additions and 14 deletions

View File

@@ -33,7 +33,7 @@ fn main() -> Result<(), anyhow::Error> {
let address = wallet.next_unused_address(KeychainKind::External)?;
println!("Generated Address: {}", address);
let balance = wallet.get_balance();
let balance = wallet.balance();
println!("Wallet balance before syncing: {} sats", balance.total());
print!("Syncing...");
@@ -65,7 +65,7 @@ fn main() -> Result<(), anyhow::Error> {
wallet.apply_update(update)?;
wallet.commit()?;
let balance = wallet.get_balance();
let balance = wallet.balance();
println!("Wallet balance after syncing: {} sats", balance.total());
if balance.total() < SEND_AMOUNT {

View File

@@ -30,7 +30,7 @@ async fn main() -> Result<(), anyhow::Error> {
let address = wallet.next_unused_address(KeychainKind::External)?;
println!("Generated Address: {}", address);
let balance = wallet.get_balance();
let balance = wallet.balance();
println!("Wallet balance before syncing: {} sats", balance.total());
print!("Syncing...");
@@ -78,7 +78,7 @@ async fn main() -> Result<(), anyhow::Error> {
wallet.commit()?;
println!();
let balance = wallet.get_balance();
let balance = wallet.balance();
println!("Wallet balance after syncing: {} sats", balance.total());
if balance.total() < SEND_AMOUNT {

View File

@@ -29,7 +29,7 @@ fn main() -> Result<(), anyhow::Error> {
let address = wallet.next_unused_address(KeychainKind::External)?;
println!("Generated Address: {}", address);
let balance = wallet.get_balance();
let balance = wallet.balance();
println!("Wallet balance before syncing: {} sats", balance.total());
print!("Syncing...");
@@ -55,7 +55,7 @@ fn main() -> Result<(), anyhow::Error> {
wallet.commit()?;
println!();
let balance = wallet.get_balance();
let balance = wallet.balance();
println!("Wallet balance after syncing: {} sats", balance.total());
if balance.total() < SEND_AMOUNT {

View File

@@ -100,7 +100,7 @@ fn main() -> anyhow::Result<()> {
start_load_wallet.elapsed().as_secs_f32()
);
let balance = wallet.get_balance();
let balance = wallet.balance();
println!("Wallet balance before syncing: {} sats", balance.total());
let wallet_tip = wallet.latest_checkpoint();
@@ -163,7 +163,7 @@ fn main() -> anyhow::Result<()> {
}
}
let wallet_tip_end = wallet.latest_checkpoint();
let balance = wallet.get_balance();
let balance = wallet.balance();
println!(
"Synced {} blocks in {}s",
blocks_received,