mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 02:02:17 +02:00
routing: use require in router test
This commit refactors some of the tests in router_test.go to use the require package.
This commit is contained in:
@@ -352,11 +352,8 @@ func (m *mockChainView) Stop() error {
|
||||
func TestEdgeUpdateNotification(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ctx, cleanUp, err := createTestCtxSingleNode(0)
|
||||
ctx, cleanUp := createTestCtxSingleNode(t, 0)
|
||||
defer cleanUp()
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create router: %v", err)
|
||||
}
|
||||
|
||||
// First we'll create the utxo for the channel to be "closed"
|
||||
const chanValue = 10000
|
||||
@@ -546,11 +543,8 @@ func TestNodeUpdateNotification(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
const startingBlockHeight = 101
|
||||
ctx, cleanUp, err := createTestCtxSingleNode(startingBlockHeight)
|
||||
ctx, cleanUp := createTestCtxSingleNode(t, startingBlockHeight)
|
||||
defer cleanUp()
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create router: %v", err)
|
||||
}
|
||||
|
||||
// We only accept node announcements from nodes having a known channel,
|
||||
// so create one now.
|
||||
@@ -739,11 +733,8 @@ func TestNotificationCancellation(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
const startingBlockHeight = 101
|
||||
ctx, cleanUp, err := createTestCtxSingleNode(startingBlockHeight)
|
||||
ctx, cleanUp := createTestCtxSingleNode(t, startingBlockHeight)
|
||||
defer cleanUp()
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create router: %v", err)
|
||||
}
|
||||
|
||||
// Create a new client to receive notifications.
|
||||
ntfnClient, err := ctx.router.SubscribeTopology()
|
||||
@@ -831,11 +822,8 @@ func TestChannelCloseNotification(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
const startingBlockHeight = 101
|
||||
ctx, cleanUp, err := createTestCtxSingleNode(startingBlockHeight)
|
||||
ctx, cleanUp := createTestCtxSingleNode(t, startingBlockHeight)
|
||||
defer cleanUp()
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create router: %v", err)
|
||||
}
|
||||
|
||||
// First we'll create the utxo for the channel to be "closed"
|
||||
const chanValue = 10000
|
||||
|
Reference in New Issue
Block a user