diff --git a/htlcswitch/link_test.go b/htlcswitch/link_test.go index f508ede06..36f273112 100644 --- a/htlcswitch/link_test.go +++ b/htlcswitch/link_test.go @@ -444,7 +444,7 @@ func TestChannelLinkSingleHopPayment(t *testing.T) { t.Parallel() // Setup a alice-bob network. - alice, bob, err := createTwoClusterChannels( + alice, bob, err := createMirroredChannel( t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5, ) require.NoError(t, err, "unable to create channel") @@ -6318,7 +6318,7 @@ func TestChannelLinkCanceledInvoice(t *testing.T) { t.Parallel() // Setup a alice-bob network. - alice, bob, err := createTwoClusterChannels( + alice, bob, err := createMirroredChannel( t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5, ) require.NoError(t, err, "unable to create channel") @@ -6374,7 +6374,7 @@ type hodlInvoiceTestCtx struct { func newHodlInvoiceTestCtx(t *testing.T) (*hodlInvoiceTestCtx, error) { // Setup a alice-bob network. - alice, bob, err := createTwoClusterChannels( + alice, bob, err := createMirroredChannel( t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5, ) require.NoError(t, err, "unable to create channel") diff --git a/htlcswitch/test_utils.go b/htlcswitch/test_utils.go index 9a72197ec..0b3b0fcdf 100644 --- a/htlcswitch/test_utils.go +++ b/htlcswitch/test_utils.go @@ -1053,17 +1053,17 @@ func serverOptionRejectHtlc(alice, bob, carol bool) serverOption { } } -// createTwoClusterChannels creates lightning channels which are needed for -// a 2 hop network cluster to be initialized. -func createTwoClusterChannels(t *testing.T, aliceToBob, - bobToCarol btcutil.Amount) (*testLightningChannel, +// createMirroredChannel creates two LightningChannel objects which represent +// the state machines on either side of a single channel between alice and bob. +func createMirroredChannel(t *testing.T, aliceToBob, + bobToAlice btcutil.Amount) (*testLightningChannel, *testLightningChannel, error) { _, _, firstChanID, _ := genIDs() - // Create lightning channels between Alice<->Bob and Bob<->Carol + // Create lightning channels between Alice<->Bob for Alice and Bob alice, bob, err := createTestChannel(t, alicePrivKey, bobPrivKey, - aliceToBob, aliceToBob, 0, 0, firstChanID, + aliceToBob, bobToAlice, 0, 0, firstChanID, ) if err != nil { return nil, nil, errors.Errorf("unable to create "+