multi: move unit test backend funcs to new package
To avoid circular dependency issues between packages, we move the unit test backend creation function to a new package in the lntest parent package.
This commit is contained in:
8 files changed
+250
-215
No files matched your search
@@ -18,8 +18,8 @@ import (
|
||||
"github.com/btcsuite/btcwallet/chain"
|
||||
"github.com/btcsuite/btcwallet/waddrmgr"
|
||||
"github.com/lightningnetwork/lnd/blockcache"
|
||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lntest/unittest"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -326,7 +326,7 @@ func newTestWallet(t *testing.T, netParams *chaincfg.Params,
|
||||
func getChainBackend(t *testing.T, netParams *chaincfg.Params) (chain.Interface,
|
||||
*rpctest.Harness) {
|
||||
|
||||
miningNode := chainntnfs.NewMiner(
|
||||
miningNode := unittest.NewMiner(
|
||||
t, netParams, []string{"--txindex"}, true, 25,
|
||||
)
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/kvdb"
|
||||
"github.com/lightningnetwork/lnd/labels"
|
||||
"github.com/lightningnetwork/lnd/lntest/unittest"
|
||||
"github.com/lightningnetwork/lnd/lntest/wait"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwallet/btcwallet"
|
||||
@@ -2120,7 +2121,7 @@ func testReorgWalletBalance(r *rpctest.Harness, w *lnwallet.LightningWallet,
|
||||
|
||||
// Now we cause a reorganization as follows.
|
||||
// Step 1: create a new miner and start it.
|
||||
r2 := chainntnfs.NewMiner(
|
||||
r2 := unittest.NewMiner(
|
||||
t, r.ActiveNet, []string{"--txindex"}, false, 0,
|
||||
)
|
||||
newBalance, err := w.ConfirmedBalance(1, lnwallet.DefaultAccountName)
|
||||
@@ -3101,7 +3102,7 @@ func TestLightningWallet(t *testing.T, targetBackEnd string) {
|
||||
// dedicated miner to generate blocks, cause re-orgs, etc. We'll set
|
||||
// up this node with a chain length of 125, so we have plenty of BTC
|
||||
// to play around with.
|
||||
miningNode := chainntnfs.NewMiner(
|
||||
miningNode := unittest.NewMiner(
|
||||
t, netParams, []string{"--txindex"}, true, 25,
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user