mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
lnwallet: actually use 'amount' parameter
This commit is contained in:
parent
6eb77b02c2
commit
9840585757
1 changed files with 4 additions and 1 deletions
|
@ -47,12 +47,15 @@ var (
|
||||||
zeroHash = bytes.Repeat([]byte{0}, 32)
|
zeroHash = bytes.Repeat([]byte{0}, 32)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// assertProperBalance asserts than the total value of the unspent outputs
|
||||||
|
// within the wallet are *exactly* amount. If unable to retrieve the current
|
||||||
|
// balance, or the assertion fails, the test will halt with a fatal error.
|
||||||
func assertProperBalance(t *testing.T, lw *LightningWallet, numConfirms, amount int32) {
|
func assertProperBalance(t *testing.T, lw *LightningWallet, numConfirms, amount int32) {
|
||||||
balance, err := lw.wallet.TxStore.Balance(0, 20)
|
balance, err := lw.wallet.TxStore.Balance(0, 20)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to query for balance: %v", err)
|
t.Fatalf("unable to query for balance: %v", err)
|
||||||
}
|
}
|
||||||
if balance != btcutil.Amount(20*1e8) {
|
if balance != btcutil.Amount(amount*1e8) {
|
||||||
t.Fatalf("wallet credits not properly loaded, should have 20BTC, "+
|
t.Fatalf("wallet credits not properly loaded, should have 20BTC, "+
|
||||||
"instead have %v", balance)
|
"instead have %v", balance)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue