refactor: restructure balance

This commit is contained in:
Matthew
2023-11-15 15:57:02 -06:00
parent e5ded1a726
commit 05ce7dad31
15 changed files with 54 additions and 71 deletions

View File

@@ -12,9 +12,9 @@ class LiveTxBuilderTest {
val esploraClient = EsploraClient("https://mempool.space/testnet/api")
val update = esploraClient.scan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total()}")
println("Balance: ${wallet.getBalance().total}")
assert(wallet.getBalance().total() > 0uL)
assert(wallet.getBalance().total > 0uL)
val recipient: Address = Address("tb1qrnfslnrve9uncz9pzpvf83k3ukz22ljgees989", Network.TESTNET)
val psbt: PartiallySignedTransaction = TxBuilder()

View File

@@ -12,9 +12,9 @@ class LiveWalletTest {
// val esploraClient = EsploraClient("https://blockstream.info/testnet/api")
val update = esploraClient.scan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total()}")
println("Balance: ${wallet.getBalance().total}")
assert(wallet.getBalance().total() > 0uL)
assert(wallet.getBalance().total > 0uL)
}
@Test
@@ -25,10 +25,10 @@ class LiveWalletTest {
val update = esploraClient.scan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total()}")
println("Balance: ${wallet.getBalance().total}")
println("New address: ${wallet.getAddress(AddressIndex.New).address.asString()}")
assert(wallet.getBalance().total() > 0uL) {
assert(wallet.getBalance().total > 0uL) {
"Wallet balance must be greater than 0! Please send funds to ${wallet.getAddress(AddressIndex.New).address} and try again."
}

View File

@@ -47,7 +47,7 @@ class OfflineWalletTest {
assertEquals(
expected = 0uL,
actual = wallet.getBalance().total()
actual = wallet.getBalance().total
)
}
}