mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 07:35:07 +02:00
itest+lntest: add new method FundNumCoins
Most of the time we only need to fund the node with given number of UTXOs without concerning the amount, so we add the more efficient funding method as it mines a single block in the end.
This commit is contained in:
@@ -779,24 +779,24 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
|
||||
// Bob needs two more wallet utxos:
|
||||
// - when sweeping anchors, he needs one utxo for each sweep.
|
||||
// - when sweeping HTLCs, he needs one utxo for each sweep.
|
||||
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
|
||||
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
|
||||
numUTXOs := 2
|
||||
|
||||
// Bob should have enough wallet UTXOs here to sweep the HTLC in the
|
||||
// end of this test. However, due to a known issue, Bob's wallet may
|
||||
// report there's no UTXO available. For details,
|
||||
// - https://github.com/lightningnetwork/lnd/issues/8786
|
||||
//
|
||||
// TODO(yy): remove this step once the issue is resolved.
|
||||
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
|
||||
// TODO(yy): remove this extra UTXO once the issue is resolved.
|
||||
numUTXOs++
|
||||
|
||||
// For neutrino backend, we need two more UTXOs for Bob to create his
|
||||
// sweeping txns.
|
||||
if ht.IsNeutrinoBackend() {
|
||||
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
|
||||
ht.FundCoins(btcutil.SatoshiPerBitcoin, bob)
|
||||
numUTXOs += 2
|
||||
}
|
||||
|
||||
ht.FundNumCoins(bob, numUTXOs)
|
||||
|
||||
// Subscribe the invoices.
|
||||
stream1 := carol.RPC.SubscribeSingleInvoice(payHashSettled[:])
|
||||
stream2 := carol.RPC.SubscribeSingleInvoice(payHashHold[:])
|
||||
|
Reference in New Issue
Block a user