htlcswitch: rename for test parameters for accuracy

This commit is contained in:
Keagan McClelland committed 2024-08-01 11:56:50 -07:00
1 parent f54c9ea8f7
commit dc03637ae3
2 files changed
+9 -9

No files matched your search

+3 -3
View File
@@ -444,7 +444,7 @@ func TestChannelLinkSingleHopPayment(t *testing.T) {
t.Parallel() t.Parallel()
// Setup a alice-bob network. // Setup a alice-bob network.
alice, bob, err := createTwoClusterChannels( alice, bob, err := createMirroredChannel(
t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5, t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5,
) )
require.NoError(t, err, "unable to create channel") require.NoError(t, err, "unable to create channel")
@@ -6318,7 +6318,7 @@ func TestChannelLinkCanceledInvoice(t *testing.T) {
t.Parallel() t.Parallel()
// Setup a alice-bob network. // Setup a alice-bob network.
alice, bob, err := createTwoClusterChannels( alice, bob, err := createMirroredChannel(
t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5, t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5,
) )
require.NoError(t, err, "unable to create channel") require.NoError(t, err, "unable to create channel")
@@ -6374,7 +6374,7 @@ type hodlInvoiceTestCtx struct {
func newHodlInvoiceTestCtx(t *testing.T) (*hodlInvoiceTestCtx, error) { func newHodlInvoiceTestCtx(t *testing.T) (*hodlInvoiceTestCtx, error) {
// Setup a alice-bob network. // Setup a alice-bob network.
alice, bob, err := createTwoClusterChannels( alice, bob, err := createMirroredChannel(
t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5, t, btcutil.SatoshiPerBitcoin*3, btcutil.SatoshiPerBitcoin*5,
) )
require.NoError(t, err, "unable to create channel") require.NoError(t, err, "unable to create channel")
+6 -6
View File
@@ -1053,17 +1053,17 @@ func serverOptionRejectHtlc(alice, bob, carol bool) serverOption {
} }
} }
// createTwoClusterChannels creates lightning channels which are needed for // createMirroredChannel creates two LightningChannel objects which represent
// a 2 hop network cluster to be initialized. // the state machines on either side of a single channel between alice and bob.
func createTwoClusterChannels(t *testing.T, aliceToBob, func createMirroredChannel(t *testing.T, aliceToBob,
bobToCarol btcutil.Amount) (*testLightningChannel, bobToAlice btcutil.Amount) (*testLightningChannel,
*testLightningChannel, error) { *testLightningChannel, error) {
_, _, firstChanID, _ := genIDs() _, _, 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, alice, bob, err := createTestChannel(t, alicePrivKey, bobPrivKey,
aliceToBob, aliceToBob, 0, 0, firstChanID, aliceToBob, bobToAlice, 0, 0, firstChanID,
) )
if err != nil { if err != nil {
return nil, nil, errors.Errorf("unable to create "+ return nil, nil, errors.Errorf("unable to create "+