lntest/node: print amounts in same format
This commit is contained in:
2 files changed
+5
-5
No files matched your search
+2
-2
@@ -1279,7 +1279,7 @@ func (n *NetworkHarness) sendCoins(ctx context.Context, amt btcutil.Amount,
|
|||||||
// the target node's unconfirmed balance reflects the expected balance
|
// the target node's unconfirmed balance reflects the expected balance
|
||||||
// and exit.
|
// and exit.
|
||||||
if !confirmed {
|
if !confirmed {
|
||||||
expectedBalance := initialBalance.UnconfirmedBalance + int64(amt)
|
expectedBalance := btcutil.Amount(initialBalance.UnconfirmedBalance) + amt
|
||||||
return target.WaitForBalance(expectedBalance, false)
|
return target.WaitForBalance(expectedBalance, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1290,7 +1290,7 @@ func (n *NetworkHarness) sendCoins(ctx context.Context, amt btcutil.Amount,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
expectedBalance := initialBalance.ConfirmedBalance + int64(amt)
|
expectedBalance := btcutil.Amount(initialBalance.ConfirmedBalance) + amt
|
||||||
return target.WaitForBalance(expectedBalance, true)
|
return target.WaitForBalance(expectedBalance, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -915,7 +915,7 @@ func (hn *HarnessNode) WaitForBlockchainSync(ctx context.Context) error {
|
|||||||
|
|
||||||
// WaitForBalance waits until the node sees the expected confirmed/unconfirmed
|
// WaitForBalance waits until the node sees the expected confirmed/unconfirmed
|
||||||
// balance within their wallet.
|
// balance within their wallet.
|
||||||
func (hn *HarnessNode) WaitForBalance(expectedBalance int64, confirmed bool) error {
|
func (hn *HarnessNode) WaitForBalance(expectedBalance btcutil.Amount, confirmed bool) error {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
req := &lnrpc.WalletBalanceRequest{}
|
req := &lnrpc.WalletBalanceRequest{}
|
||||||
|
|
||||||
@@ -928,11 +928,11 @@ func (hn *HarnessNode) WaitForBalance(expectedBalance int64, confirmed bool) err
|
|||||||
|
|
||||||
if confirmed {
|
if confirmed {
|
||||||
lastBalance = btcutil.Amount(balance.ConfirmedBalance)
|
lastBalance = btcutil.Amount(balance.ConfirmedBalance)
|
||||||
return balance.ConfirmedBalance == expectedBalance
|
return btcutil.Amount(balance.ConfirmedBalance) == expectedBalance
|
||||||
}
|
}
|
||||||
|
|
||||||
lastBalance = btcutil.Amount(balance.UnconfirmedBalance)
|
lastBalance = btcutil.Amount(balance.UnconfirmedBalance)
|
||||||
return balance.UnconfirmedBalance == expectedBalance
|
return btcutil.Amount(balance.UnconfirmedBalance) == expectedBalance
|
||||||
}
|
}
|
||||||
|
|
||||||
err := WaitPredicate(doesBalanceMatch, 30*time.Second)
|
err := WaitPredicate(doesBalanceMatch, 30*time.Second)
|
||||||
|
|||||||
Reference in new issue
Block a user