Change get_balance to return in categories.

Add type balance with add, display traits. Change affected tests.
Update `CHANGELOG.md`
This commit is contained in:
wszdexdrf
2022-06-22 14:37:29 +05:30
committed by Daniela Brozzoni
parent dc7adb7161
commit 0f03831274
7 changed files with 226 additions and 70 deletions

View File

@@ -385,7 +385,7 @@ mod test {
.sync_wallet(&wallet, None, Default::default())
.unwrap();
assert_eq!(wallet.get_balance().unwrap(), 50_000);
assert_eq!(wallet.get_balance().unwrap().untrusted_pending, 50_000);
}
#[test]

View File

@@ -194,7 +194,7 @@ This example shows how to sync multiple walles and return the sum of their balan
# use bdk::database::*;
# use bdk::wallet::*;
# use bdk::*;
fn sum_of_balances<B: BlockchainFactory>(blockchain_factory: B, wallets: &[Wallet<MemoryDatabase>]) -> Result<u64, Error> {
fn sum_of_balances<B: BlockchainFactory>(blockchain_factory: B, wallets: &[Wallet<MemoryDatabase>]) -> Result<Balance, Error> {
Ok(wallets
.iter()
.map(|w| -> Result<_, Error> {