2016-08-30 08:07:54 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"fmt"
|
|
|
|
"runtime/debug"
|
|
|
|
"testing"
|
2016-09-14 05:00:47 +03:00
|
|
|
"time"
|
2016-08-30 08:07:54 +03:00
|
|
|
|
2016-08-30 21:12:31 +03:00
|
|
|
"golang.org/x/net/context"
|
|
|
|
|
2016-09-15 22:24:52 +03:00
|
|
|
"github.com/lightningnetwork/lnd/lnrpc"
|
2016-08-30 08:07:54 +03:00
|
|
|
"github.com/roasbeef/btcd/rpctest"
|
|
|
|
"github.com/roasbeef/btcd/wire"
|
2016-08-31 05:36:33 +03:00
|
|
|
"github.com/roasbeef/btcrpcclient"
|
2016-08-30 08:07:54 +03:00
|
|
|
"github.com/roasbeef/btcutil"
|
|
|
|
)
|
|
|
|
|
|
|
|
type lndTestCase func(net *networkHarness, t *testing.T)
|
|
|
|
|
|
|
|
func assertTxInBlock(block *btcutil.Block, txid *wire.ShaHash, t *testing.T) {
|
|
|
|
for _, tx := range block.Transactions() {
|
|
|
|
if bytes.Equal(txid[:], tx.Sha()[:]) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
t.Fatalf("funding tx was not included in block")
|
|
|
|
}
|
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
// openChannelAndAssert attempts to open a channel with the specified
|
|
|
|
// parameters extended from Alice to Bob. Additionally, two items are asserted
|
|
|
|
// after the channel is considered open: the funding transactino should be
|
|
|
|
// found within a block, and that Alice can report the status of the new
|
|
|
|
// channel.
|
|
|
|
func openChannelAndAssert(t *testing.T, net *networkHarness, ctx context.Context,
|
|
|
|
alice, bob *lightningNode, amount btcutil.Amount) *lnrpc.ChannelPoint {
|
|
|
|
|
|
|
|
chanOpenUpdate, err := net.OpenChannel(ctx, alice, bob, amount, 1)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to open channel: %v", err)
|
|
|
|
}
|
2016-09-15 21:59:51 +03:00
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
// Mine a block, then wait for Alice's node to notify us that the
|
|
|
|
// channel has been opened. The funding transaction should be found
|
|
|
|
// within the newly mined block.
|
|
|
|
blockHash, err := net.Miner.Node.Generate(1)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to generate block: %v", err)
|
|
|
|
}
|
|
|
|
block, err := net.Miner.Node.GetBlock(blockHash[0])
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to get block: %v", err)
|
|
|
|
}
|
|
|
|
fundingChanPoint, err := net.WaitForChannelOpen(ctx, chanOpenUpdate)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("error while waiting for channel open: %v", err)
|
|
|
|
}
|
|
|
|
fundingTxID, err := wire.NewShaHash(fundingChanPoint.FundingTxid)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to create sha hash: %v", err)
|
|
|
|
}
|
|
|
|
assertTxInBlock(block, fundingTxID, t)
|
2016-09-15 21:59:51 +03:00
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
// The channel should be listed in the peer information returned by
|
|
|
|
// both peers.
|
|
|
|
chanPoint := wire.OutPoint{
|
|
|
|
Hash: *fundingTxID,
|
|
|
|
Index: fundingChanPoint.OutputIndex,
|
|
|
|
}
|
|
|
|
err = net.AssertChannelExists(ctx, alice, &chanPoint)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to assert channel existence: %v", err)
|
2016-09-15 21:59:51 +03:00
|
|
|
}
|
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
return fundingChanPoint
|
|
|
|
}
|
2016-09-15 21:59:51 +03:00
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
// closeChannelAndAssert attemps to close a channel identified by the passed
|
|
|
|
// channel point owned by the passed lighting node. A fully blocking channel
|
|
|
|
// closure is attempted, therefore the passed context should be a child derived
|
|
|
|
// via timeout from a base parent. Additionally, once the channel has been
|
|
|
|
// detected as closed, an assertion checks that the transaction is found within
|
|
|
|
// a block.
|
|
|
|
func closeChannelAndAssert(t *testing.T, net *networkHarness,
|
|
|
|
ctx context.Context, node *lightningNode,
|
|
|
|
fundingChanPoint *lnrpc.ChannelPoint) {
|
|
|
|
|
|
|
|
closeUpdates, err := net.CloseChannel(ctx, node, fundingChanPoint, false)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to close channel: %v", err)
|
|
|
|
}
|
2016-09-15 21:59:51 +03:00
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
// Finally, generate a single block, wait for the final close status
|
|
|
|
// update, then ensure that the closing transaction was included in the
|
|
|
|
// block.
|
|
|
|
blockHash, err := net.Miner.Node.Generate(1)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to generate block: %v", err)
|
|
|
|
}
|
|
|
|
block, err := net.Miner.Node.GetBlock(blockHash[0])
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to get block: %v", err)
|
|
|
|
}
|
2016-09-15 21:59:51 +03:00
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
closingTxid, err := net.WaitForChannelClose(ctx, closeUpdates)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("error while waiting for channel close: %v", err)
|
2016-09-15 21:59:51 +03:00
|
|
|
}
|
|
|
|
|
2016-09-18 03:34:39 +03:00
|
|
|
assertTxInBlock(block, closingTxid, t)
|
2016-09-15 21:59:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// testBasicChannelFunding performs a test exercising expected behavior from a
|
2016-08-30 08:07:54 +03:00
|
|
|
// basic funding workflow. The test creates a new channel between Alice and
|
|
|
|
// Bob, then immediately closes the channel after asserting some expected post
|
2016-09-15 21:59:51 +03:00
|
|
|
// conditions. Finally, the chain itself is checked to ensure the closing
|
2016-08-30 08:07:54 +03:00
|
|
|
// transaction was mined.
|
|
|
|
func testBasicChannelFunding(net *networkHarness, t *testing.T) {
|
2016-09-18 03:34:39 +03:00
|
|
|
timeout := time.Duration(time.Second * 5)
|
2016-08-31 05:36:33 +03:00
|
|
|
ctxb := context.Background()
|
2016-09-15 22:24:52 +03:00
|
|
|
|
2016-08-31 21:59:08 +03:00
|
|
|
chanAmt := btcutil.Amount(btcutil.SatoshiPerBitcoin / 2)
|
2016-08-31 05:36:33 +03:00
|
|
|
|
2016-09-15 22:24:52 +03:00
|
|
|
// First establish a channel with a capacity of 0.5 BTC between Alice
|
|
|
|
// and Bob. This function will block until the channel itself is fully
|
|
|
|
// open or an error occurs in the funding process. A series of
|
|
|
|
// assertions will be executed to ensure the funding process completed
|
|
|
|
// successfully.
|
2016-09-18 03:34:39 +03:00
|
|
|
ctxt, _ := context.WithTimeout(ctxb, timeout)
|
|
|
|
chanPoint := openChannelAndAssert(t, net, ctxt, net.Alice, net.Bob, chanAmt)
|
2016-09-15 22:24:52 +03:00
|
|
|
|
|
|
|
// Finally, immediately close the channel. This function will also
|
|
|
|
// block until the channel is closed and will additionally assert the
|
|
|
|
// relevant channel closing post conditions.
|
2016-09-18 03:34:39 +03:00
|
|
|
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
|
|
|
closeChannelAndAssert(t, net, ctxt, net.Alice, chanPoint)
|
2016-09-15 21:59:51 +03:00
|
|
|
}
|
2016-08-30 08:07:54 +03:00
|
|
|
|
2016-09-15 21:59:51 +03:00
|
|
|
// testChannelBalance creates a new channel between Alice and Bob, then
|
|
|
|
// checks channel balance to be equal amount specified while creation of channel.
|
|
|
|
func testChannelBalance(net *networkHarness, t *testing.T) {
|
2016-09-18 03:34:39 +03:00
|
|
|
timeout := time.Duration(time.Second * 5)
|
2016-09-15 21:59:51 +03:00
|
|
|
ctxb := context.Background()
|
2016-08-31 05:36:33 +03:00
|
|
|
|
2016-09-15 22:24:52 +03:00
|
|
|
// Creates a helper closure to be used below which asserts the proper
|
|
|
|
// response to a channel balance RPC.
|
|
|
|
checkChannelBalance := func(node lnrpc.LightningClient, amount btcutil.Amount) {
|
2016-09-15 21:59:51 +03:00
|
|
|
response, err := node.ChannelBalance(ctxb, &lnrpc.ChannelBalanceRequest{})
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to get channel balance: %v", err)
|
|
|
|
}
|
2016-08-31 05:36:33 +03:00
|
|
|
|
2016-09-15 21:59:51 +03:00
|
|
|
balance := btcutil.Amount(response.Balance)
|
|
|
|
if balance != amount {
|
|
|
|
t.Fatalf("channel balance wrong: %v != %v", balance, amount)
|
|
|
|
}
|
2016-08-30 08:07:54 +03:00
|
|
|
}
|
2016-08-31 21:59:08 +03:00
|
|
|
|
2016-09-15 22:24:52 +03:00
|
|
|
// Open a channel with 0.5 BTC between Alice and Bob, ensuring the
|
|
|
|
// channel has been opened properly.
|
2016-09-15 21:59:51 +03:00
|
|
|
amount := btcutil.Amount(btcutil.SatoshiPerBitcoin / 2)
|
2016-09-18 03:34:39 +03:00
|
|
|
ctxt, _ := context.WithTimeout(ctxb, timeout)
|
|
|
|
chanPoint := openChannelAndAssert(t, net, ctxt, net.Alice, net.Bob, amount)
|
2016-09-15 21:59:51 +03:00
|
|
|
|
2016-09-15 22:24:52 +03:00
|
|
|
// As this is a single funder channel, Alice's balance should be
|
|
|
|
// exactly 0.5 BTC since now state transitions have taken place yet.
|
2016-09-15 21:59:51 +03:00
|
|
|
checkChannelBalance(net.Alice, amount)
|
|
|
|
|
2016-09-15 22:24:52 +03:00
|
|
|
// Since we only explicitly wait for Alice's channel open notification,
|
|
|
|
// Bob might not yet have updated his internal state in response to
|
|
|
|
// Alice's channel open proof. So we sleep here for a second to let Bob
|
|
|
|
// catch up.
|
|
|
|
// TODO(roasbeef): Bob should also watch for the channel on-chain after
|
|
|
|
// the changes to restrict the number of pending channels are in.
|
2016-09-15 21:59:51 +03:00
|
|
|
time.Sleep(time.Second)
|
2016-09-15 22:24:52 +03:00
|
|
|
|
|
|
|
// Ensure Bob currently has no available balance within the channel.
|
2016-09-15 21:59:51 +03:00
|
|
|
checkChannelBalance(net.Bob, 0)
|
|
|
|
|
2016-09-15 22:24:52 +03:00
|
|
|
// Finally close the channel between Alice and Bob, asserting that the
|
|
|
|
// channel has been properly closed on-chain.
|
2016-09-18 03:34:39 +03:00
|
|
|
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
|
|
|
closeChannelAndAssert(t, net, ctxt, net.Alice, chanPoint)
|
2016-08-30 08:07:54 +03:00
|
|
|
}
|
|
|
|
|
2016-09-15 21:59:51 +03:00
|
|
|
// testChannelForceClosure performs a test to exercise the behavior of "force"
|
|
|
|
// closing a channel or unilaterally broadcasting the latest local commitment
|
2016-09-14 05:00:47 +03:00
|
|
|
// state on-chain. The test creates a new channel between Alice and Bob, then
|
|
|
|
// force closes the channel after some cursory assertions. Within the test, two
|
|
|
|
// transactions should be broadcast on-chain, the commitment transaction itself
|
|
|
|
// (which closes the channel), and the sweep transaction a few blocks later
|
|
|
|
// once the output(s) become mature.
|
|
|
|
//
|
|
|
|
// TODO(roabeef): also add an unsettled HTLC before force closing.
|
|
|
|
func testChannelForceClosure(net *networkHarness, t *testing.T) {
|
2016-09-18 03:34:39 +03:00
|
|
|
timeout := time.Duration(time.Second * 5)
|
2016-09-14 05:00:47 +03:00
|
|
|
ctxb := context.Background()
|
|
|
|
|
|
|
|
// First establish a channel ween with a capacity of 100k satoshis
|
|
|
|
// between Alice and Bob.
|
|
|
|
numFundingConfs := uint32(1)
|
|
|
|
chanAmt := btcutil.Amount(10e4)
|
|
|
|
chanOpenUpdate, err := net.OpenChannel(ctxb, net.Alice, net.Bob,
|
|
|
|
chanAmt, numFundingConfs)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to open channel: %v", err)
|
|
|
|
}
|
|
|
|
if _, err := net.Miner.Node.Generate(numFundingConfs); err != nil {
|
|
|
|
t.Fatalf("unable to mine block: %v", err)
|
|
|
|
}
|
2016-09-18 03:34:39 +03:00
|
|
|
ctxt, _ := context.WithTimeout(ctxb, timeout)
|
|
|
|
chanPoint, err := net.WaitForChannelOpen(ctxt, chanOpenUpdate)
|
2016-09-14 05:00:47 +03:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("error while waiting for channel to open: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Now that the channel is open, immediately execute a force closure of
|
|
|
|
// the channel. This will also assert that the commitment transaction
|
2016-09-15 22:24:52 +03:00
|
|
|
// was immediately broadcast in order to fulfill the force closure
|
2016-09-14 05:00:47 +03:00
|
|
|
// request.
|
|
|
|
closeUpdate, err := net.CloseChannel(ctxb, net.Alice, chanPoint, true)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to execute force channel closure: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Mine a block which should confirm the commitment transaction
|
|
|
|
// broadcast as a result of the force closure.
|
|
|
|
if _, err := net.Miner.Node.Generate(1); err != nil {
|
|
|
|
t.Fatalf("unable to generate block: %v", err)
|
|
|
|
}
|
2016-09-18 03:34:39 +03:00
|
|
|
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
|
|
|
closingTxID, err := net.WaitForChannelClose(ctxt, closeUpdate)
|
2016-09-14 05:00:47 +03:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("error while waiting for channel close: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Currently within the codebase, the default CSV is 4 relative blocks.
|
|
|
|
// So generate exactly 4 new blocks.
|
|
|
|
// TODO(roasbeef): should check default value in config here instead,
|
|
|
|
// or make delay a param
|
|
|
|
const defaultCSV = 4
|
|
|
|
if _, err := net.Miner.Node.Generate(defaultCSV); err != nil {
|
|
|
|
t.Fatalf("unable to mine blocks: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
// At this point, the sweeping transaction should now be broadcast. So
|
|
|
|
// we fetch the node's mempool to ensure it has been properly
|
2016-09-15 22:24:52 +03:00
|
|
|
// broadcast.
|
2016-09-14 05:00:47 +03:00
|
|
|
var sweepingTXID *wire.ShaHash
|
|
|
|
var mempool []*wire.ShaHash
|
|
|
|
mempoolPoll:
|
|
|
|
for {
|
|
|
|
select {
|
|
|
|
case <-time.After(time.Second * 5):
|
|
|
|
t.Fatalf("sweep tx not found in mempool")
|
|
|
|
default:
|
|
|
|
mempool, err = net.Miner.Node.GetRawMempool()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to fetch node's mempool: %v", err)
|
|
|
|
}
|
|
|
|
if len(mempool) == 0 {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
break mempoolPoll
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// There should be exactly one transaction within the mempool at this
|
|
|
|
// point.
|
|
|
|
// TODO(roasbeef): assertion may not necessarily hold with concurrent
|
|
|
|
// test executions
|
|
|
|
if len(mempool) != 1 {
|
|
|
|
t.Fatalf("node's mempool is wrong size, expected 1 got %v",
|
|
|
|
len(mempool))
|
|
|
|
}
|
|
|
|
sweepingTXID = mempool[0]
|
|
|
|
|
|
|
|
// Fetch the sweep transaction, all input it's spending should be from
|
2016-09-15 22:24:52 +03:00
|
|
|
// the commitment transaction which was broadcast on-chain.
|
2016-09-14 05:00:47 +03:00
|
|
|
sweepTx, err := net.Miner.Node.GetRawTransaction(sweepingTXID)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to fetch sweep tx: %v", err)
|
|
|
|
}
|
|
|
|
for _, txIn := range sweepTx.MsgTx().TxIn {
|
|
|
|
if !closingTxID.IsEqual(&txIn.PreviousOutPoint.Hash) {
|
|
|
|
t.Fatalf("sweep transaction not spending from commit "+
|
|
|
|
"tx %v, instead spending %v",
|
|
|
|
closingTxID, txIn.PreviousOutPoint)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Finally, we mine an additional block which should include the sweep
|
|
|
|
// transaction as the input scripts and the sequence locks on the
|
|
|
|
// inputs should be properly met.
|
|
|
|
blockHash, err := net.Miner.Node.Generate(1)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to generate block: %v", err)
|
|
|
|
}
|
|
|
|
block, err := net.Miner.Node.GetBlock(blockHash[0])
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to get block: %v", err)
|
|
|
|
}
|
|
|
|
assertTxInBlock(block, sweepTx.Sha(), t)
|
|
|
|
}
|
|
|
|
|
2016-08-30 08:07:54 +03:00
|
|
|
var lndTestCases = map[string]lndTestCase{
|
2016-09-14 05:00:47 +03:00
|
|
|
"basic funding flow": testBasicChannelFunding,
|
|
|
|
"channel force closure": testChannelForceClosure,
|
2016-09-15 22:24:52 +03:00
|
|
|
"channel balance": testChannelBalance,
|
2016-08-30 08:07:54 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// TestLightningNetworkDaemon performs a series of integration tests amongst a
|
2016-09-15 21:59:51 +03:00
|
|
|
// programmatically driven network of lnd nodes.
|
2016-08-30 08:07:54 +03:00
|
|
|
func TestLightningNetworkDaemon(t *testing.T) {
|
2016-09-14 05:00:47 +03:00
|
|
|
var (
|
|
|
|
btcdHarness *rpctest.Harness
|
|
|
|
lightningNetwork *networkHarness
|
|
|
|
currentTest string
|
|
|
|
err error
|
|
|
|
)
|
2016-08-30 08:07:54 +03:00
|
|
|
|
|
|
|
defer func() {
|
|
|
|
// If one of the integration tests caused a panic within the main
|
|
|
|
// goroutine, then tear down all the harnesses in order to avoid
|
|
|
|
// any leaked processes.
|
|
|
|
if r := recover(); r != nil {
|
|
|
|
fmt.Println("recovering from test panic: ", r)
|
|
|
|
if err := btcdHarness.TearDown(); err != nil {
|
|
|
|
fmt.Println("unable to tear btcd harnesses: ", err)
|
|
|
|
}
|
|
|
|
if err := lightningNetwork.TearDownAll(); err != nil {
|
|
|
|
fmt.Println("unable to tear lnd harnesses: ", err)
|
|
|
|
}
|
|
|
|
t.Fatalf("test %v panicked: %s", currentTest, debug.Stack())
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
|
2016-08-31 05:34:13 +03:00
|
|
|
// First create the network harness to gain access to its
|
|
|
|
// 'OnTxAccepted' call back.
|
2016-09-15 21:59:51 +03:00
|
|
|
lightningNetwork, err = newNetworkHarness()
|
2016-08-31 05:34:13 +03:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to create lightning network harness: %v", err)
|
|
|
|
}
|
|
|
|
defer lightningNetwork.TearDownAll()
|
|
|
|
|
|
|
|
handlers := &btcrpcclient.NotificationHandlers{
|
|
|
|
OnTxAccepted: lightningNetwork.OnTxAccepted,
|
|
|
|
}
|
|
|
|
|
2016-09-15 21:59:51 +03:00
|
|
|
// First create an instance of the btcd's rpctest.Harness. This will be
|
2016-08-30 08:07:54 +03:00
|
|
|
// used to fund the wallets of the nodes within the test network and to
|
|
|
|
// drive blockchain related events within the network.
|
2016-08-31 05:34:13 +03:00
|
|
|
btcdHarness, err = rpctest.New(harnessNetParams, handlers, nil)
|
2016-08-30 08:07:54 +03:00
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("unable to create mining node: %v", err)
|
|
|
|
}
|
|
|
|
defer btcdHarness.TearDown()
|
|
|
|
if err = btcdHarness.SetUp(true, 50); err != nil {
|
|
|
|
t.Fatalf("unable to set up mining node: %v", err)
|
|
|
|
}
|
2016-08-31 05:34:13 +03:00
|
|
|
if err := btcdHarness.Node.NotifyNewTransactions(false); err != nil {
|
|
|
|
t.Fatalf("unable to request transaction notifications: %v", err)
|
|
|
|
}
|
2016-08-30 08:07:54 +03:00
|
|
|
|
2016-08-31 05:34:13 +03:00
|
|
|
// With the btcd harness created, we can now complete the
|
2016-09-15 22:24:52 +03:00
|
|
|
// initialization of the network. args - list of lnd arguments,
|
|
|
|
// example: "--debuglevel=debug"
|
2016-09-15 21:59:51 +03:00
|
|
|
args := []string{}
|
|
|
|
if err := lightningNetwork.InitializeSeedNodes(btcdHarness, args); err != nil {
|
2016-08-31 05:34:13 +03:00
|
|
|
t.Fatalf("unable to initialize seed nodes: %v", err)
|
2016-08-30 08:07:54 +03:00
|
|
|
}
|
|
|
|
if err = lightningNetwork.SetUp(); err != nil {
|
|
|
|
t.Fatalf("unable to set up test lightning network: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
t.Logf("Running %v integration tests", len(lndTestCases))
|
|
|
|
for testName, lnTest := range lndTestCases {
|
|
|
|
t.Logf("Executing test %v", testName)
|
|
|
|
|
|
|
|
currentTest = testName
|
|
|
|
lnTest(lightningNetwork, t)
|
|
|
|
}
|
|
|
|
}
|