lnd_test: use RegTest instead of SimNet during integration tests
This commit is contained in:
parent
81cb3cb739
commit
35f3544111
@ -67,7 +67,9 @@ func (b BtcdBackendConfig) Name() string {
|
||||
// NewBackend starts a new rpctest.Harness and returns a BtcdBackendConfig for
|
||||
// that node. miner should be set to the P2P address of the miner to connect
|
||||
// to.
|
||||
func NewBackend(miner string) (*BtcdBackendConfig, func(), error) {
|
||||
func NewBackend(miner string, netParams *chaincfg.Params) (
|
||||
*BtcdBackendConfig, func(), error) {
|
||||
|
||||
args := []string{
|
||||
"--rejectnonstd",
|
||||
"--txindex",
|
||||
@ -76,7 +78,6 @@ func NewBackend(miner string) (*BtcdBackendConfig, func(), error) {
|
||||
"--logdir=" + logDir,
|
||||
"--connect=" + miner,
|
||||
}
|
||||
netParams := &chaincfg.SimNetParams
|
||||
chainBackend, err := rpctest.New(netParams, nil, args)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("unable to create btcd node: %v", err)
|
||||
|
@ -45,7 +45,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
harnessNetParams = &chaincfg.SimNetParams
|
||||
harnessNetParams = &chaincfg.RegressionNetParams
|
||||
)
|
||||
|
||||
const (
|
||||
@ -14415,7 +14415,9 @@ func TestLightningNetworkDaemon(t *testing.T) {
|
||||
}()
|
||||
|
||||
// Start a chain backend.
|
||||
chainBackend, cleanUp, err := lntest.NewBackend(miner.P2PAddress())
|
||||
chainBackend, cleanUp, err := lntest.NewBackend(
|
||||
miner.P2PAddress(), harnessNetParams,
|
||||
)
|
||||
if err != nil {
|
||||
ht.Fatalf("unable to start backend: %v", err)
|
||||
}
|
||||
@ -14454,7 +14456,7 @@ func TestLightningNetworkDaemon(t *testing.T) {
|
||||
|
||||
// Next mine enough blocks in order for segwit and the CSV package
|
||||
// soft-fork to activate on SimNet.
|
||||
numBlocks := chaincfg.SimNetParams.MinerConfirmationWindow * 2
|
||||
numBlocks := harnessNetParams.MinerConfirmationWindow * 2
|
||||
if _, err := miner.Node.Generate(numBlocks); err != nil {
|
||||
ht.Fatalf("unable to generate blocks: %v", err)
|
||||
}
|
||||
|
@ -2,7 +2,11 @@
|
||||
|
||||
package lntest
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg"
|
||||
)
|
||||
|
||||
// NeutrinoBackendConfig is an implementation of the BackendConfig interface
|
||||
// backed by a neutrino node.
|
||||
@ -35,7 +39,9 @@ func (b NeutrinoBackendConfig) Name() string {
|
||||
}
|
||||
|
||||
// NewBackend starts and returns a NeutrinoBackendConfig for the node.
|
||||
func NewBackend(miner string) (*NeutrinoBackendConfig, func(), error) {
|
||||
func NewBackend(miner string, _ *chaincfg.Params) (
|
||||
*NeutrinoBackendConfig, func(), error) {
|
||||
|
||||
bd := &NeutrinoBackendConfig{
|
||||
minerAddr: miner,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user