Skip to content

Commit 4814d98

Browse files
committed
integration,rpctest: remove unused create test chain option
The previous commit made CreateTestChain option useless, so this commit cleans up the codebase by effectively removing the option and all the references to it.
1 parent 3e14b8d commit 4814d98

7 files changed

Lines changed: 9 additions & 36 deletions

File tree

integration/chain_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ func TestGetTxSpendingPrevOut(t *testing.T) {
3232
require.NoError(t, err)
3333

3434
// Setup the node.
35-
sOpts := &rpctest.SetUpOpts{
36-
CreateTestChain: true,
37-
NumMatureOutputs: 100,
38-
}
35+
sOpts := &rpctest.SetUpOpts{NumMatureOutputs: 100}
3936
require.NoError(t, r.SetUp(sOpts))
4037
t.Cleanup(func() {
4138
require.NoError(t, r.TearDown(nil))

integration/csv_fork_test.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ func TestBIP0113Activation(t *testing.T) {
115115
if err != nil {
116116
t.Fatal("unable to create primary harness: ", err)
117117
}
118-
sOpts := &rpctest.SetUpOpts{
119-
CreateTestChain: true,
120-
NumMatureOutputs: 1,
121-
}
118+
sOpts := &rpctest.SetUpOpts{NumMatureOutputs: 1}
122119
if err := r.SetUp(sOpts); err != nil {
123120
t.Fatalf("unable to setup test chain: %v", err)
124121
}
@@ -416,10 +413,7 @@ func TestBIP0068AndBIP0112Activation(t *testing.T) {
416413
if err != nil {
417414
t.Fatal("unable to create primary harness: ", err)
418415
}
419-
sOpts := &rpctest.SetUpOpts{
420-
CreateTestChain: true,
421-
NumMatureOutputs: 1,
422-
}
416+
sOpts := &rpctest.SetUpOpts{NumMatureOutputs: 1}
423417
if err := r.SetUp(sOpts); err != nil {
424418
t.Fatalf("unable to setup test chain: %v", err)
425419
}

integration/p2a_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ func TestPayToAnchorSimple(t *testing.T) {
3838

3939
// Initialize the test harness with mining enabled to confirm
4040
// transactions.
41-
sOpts := &rpctest.SetUpOpts{
42-
CreateTestChain: true,
43-
NumMatureOutputs: 25,
44-
}
41+
sOpts := &rpctest.SetUpOpts{NumMatureOutputs: 25}
4542
err = harness.SetUp(sOpts)
4643
if err != nil {
4744
t.Fatalf("unable to setup test harness: %v", err)

integration/rawtx_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ func TestTestMempoolAccept(t *testing.T) {
3333
require.NoError(t, err)
3434

3535
// Setup the node.
36-
sOpts := &rpctest.SetUpOpts{
37-
CreateTestChain: true,
38-
NumMatureOutputs: 100,
39-
}
36+
sOpts := &rpctest.SetUpOpts{NumMatureOutputs: 100}
4037
require.NoError(t, r.SetUp(sOpts))
4138
t.Cleanup(func() {
4239
require.NoError(t, r.TearDown(nil))

integration/rpcserver_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,7 @@ func TestMain(m *testing.M) {
316316
// Initialize the primary mining node with a chain of length 125,
317317
// providing 25 mature coinbases to allow spending from for testing
318318
// purposes.
319-
sOpts := &rpctest.SetUpOpts{
320-
CreateTestChain: true,
321-
NumMatureOutputs: 25,
322-
}
319+
sOpts := &rpctest.SetUpOpts{NumMatureOutputs: 25}
323320
if err := primaryHarness.SetUp(sOpts); err != nil {
324321
fmt.Println("unable to setup test chain: ", err)
325322

integration/rpctest/rpc_harness.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,6 @@ func New(opts *HarnessOpts) (*Harness, error) {
285285
// SetUpOpts are options that can be passed to SetUp when starting the harness
286286
// instance.
287287
type SetUpOpts struct {
288-
// CreateTestChain tells the harness to generate blocks.
289-
CreateTestChain bool
290-
291288
// NumMatureOutputs is the count of mature outputs to be generated.
292289
NumMatureOutputs uint32
293290

integration/rpctest/rpc_harness_test.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,7 @@ func testMemWalletReorg(r *Harness, t *testing.T) {
478478
if err != nil {
479479
t.Fatal(err)
480480
}
481-
sOpts := &SetUpOpts{
482-
CreateTestChain: true,
483-
NumMatureOutputs: 5,
484-
}
481+
sOpts := &SetUpOpts{NumMatureOutputs: 5}
485482
if err := harness.SetUp(sOpts); err != nil {
486483
t.Fatalf("unable to complete rpctest setup: %v", err)
487484
}
@@ -559,7 +556,7 @@ func testNodeRestart(_ *Harness, t *testing.T) {
559556
// Start the node and mine some blocks.
560557
h, err := New(nil)
561558
require.NoError(t, err)
562-
err = h.SetUp(&SetUpOpts{CreateTestChain: true, NumMatureOutputs: 1})
559+
err = h.SetUp(&SetUpOpts{NumMatureOutputs: 1})
563560
require.NoError(t, err)
564561
count, err := h.Client.GetBlockCount()
565562
require.NoError(t, err)
@@ -714,10 +711,7 @@ func TestMain(m *testing.M) {
714711
// Initialize the main mining node with a chain of length 125,
715712
// providing 25 mature coinbases to allow spending from for testing
716713
// purposes.
717-
sOpts := &SetUpOpts{
718-
CreateTestChain: true,
719-
NumMatureOutputs: numMatureOutputs,
720-
}
714+
sOpts := &SetUpOpts{NumMatureOutputs: numMatureOutputs}
721715
if err = mainHarness.SetUp(sOpts); err != nil {
722716
fmt.Println("unable to setup test chain: ", err)
723717

0 commit comments

Comments
 (0)