Skip to content

Commit 5d52f63

Browse files
committed
itest: universe server harness uses a dedicated LND node
In this commit we ensure that the universe server harness uses a new dedicated LND node. The universe harness previously used the Bob standby LND node. This change allows us to use an in-test tapd node with LND node Bob without conflicting with the universe server tapd node. This change will be important when passing messages between tapd nodes (e.g. RFQ system) via LND nodes.
1 parent ac8a237 commit 5d52f63

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

itest/integration_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ func TestTaprootAssetsDaemon(t *testing.T) {
5050

5151
lndHarness.SetupStandbyNodes()
5252

53+
// Create a new LND node for use with the universe server.
54+
t.Log("Starting universe server LND node")
55+
uniServerLndHarness := lndHarness.NewNode("uni-server-lnd", nil)
56+
57+
// Wait for the new LND node to be fully synced to the blockchain.
58+
lndHarness.WaitForBlockchainSync(uniServerLndHarness)
59+
5360
t.Logf("Running %v integration tests", len(testList))
5461
for _, testCase := range testList {
5562
logLine := fmt.Sprintf("STARTING ============ %v ============\n",
@@ -60,12 +67,18 @@ func TestTaprootAssetsDaemon(t *testing.T) {
6067
// created and later discarded for each test run to
6168
// assure no state is taken over between runs.
6269
tapdHarness, uniHarness, proofCourier := setupHarnesses(
63-
t1, ht, lndHarness,
70+
t1, ht, lndHarness, uniServerLndHarness,
6471
testCase.proofCourierType,
6572
)
6673
lndHarness.EnsureConnected(
6774
lndHarness.Alice, lndHarness.Bob,
6875
)
76+
lndHarness.EnsureConnected(
77+
lndHarness.Alice, uniServerLndHarness,
78+
)
79+
lndHarness.EnsureConnected(
80+
lndHarness.Bob, uniServerLndHarness,
81+
)
6982

7083
lndHarness.Alice.AddToLogf(logLine)
7184
lndHarness.Bob.AddToLogf(logLine)

itest/test_harness.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,13 @@ func nextAvailablePort() int {
290290
// setupHarnesses creates new server and client harnesses that are connected
291291
// to each other through an in-memory gRPC connection.
292292
func setupHarnesses(t *testing.T, ht *harnessTest,
293-
lndHarness *lntest.HarnessTest,
293+
lndHarness *lntest.HarnessTest, uniServerLndHarness *node.HarnessNode,
294294
proofCourierType proof.CourierType) (*tapdHarness,
295295
*universeServerHarness, proof.CourierHarness) {
296296

297-
universeServer := newUniverseServerHarness(t, ht, lndHarness.Bob)
297+
// Create a new universe server harness and start it.
298+
t.Log("Starting universe server harness")
299+
universeServer := newUniverseServerHarness(t, ht, uniServerLndHarness)
298300

299301
t.Logf("Starting universe server harness, listening on %v",
300302
universeServer.ListenAddr)

itest/universe_server_harness.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ type universeServerHarness struct {
1414

1515
// ListenAddr is the address that the service is listening on.
1616
ListenAddr string
17+
18+
// lndHarness is the instance of the lnd harness that the service is
19+
// using.
20+
LndHarness *node.HarnessNode
1721
}
1822

1923
func newUniverseServerHarness(t *testing.T, ht *harnessTest,
@@ -28,6 +32,7 @@ func newUniverseServerHarness(t *testing.T, ht *harnessTest,
2832
return &universeServerHarness{
2933
service: service,
3034
ListenAddr: service.rpcHost(),
35+
LndHarness: lndHarness,
3136
}
3237
}
3338

0 commit comments

Comments
 (0)