Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions itest/litd_custom_channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ var (
"--taproot-assets.custodianproofretrievaldelay=500ms",
}
litdArgsTemplate = append(litdArgsTemplateNoOracle, []string{
"--taproot-assets.experimental.rfq.priceoracletlsinsecure",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid repeating this string literal, consider defining it as a constant. This string is used four times in this file.

You can define the constant at the file level, for example before the var block at line 59:

const priceOracleTlsInsecure = "--taproot-assets.experimental.rfq.priceoracletlsinsecure"

Then, use this constant here and in the other three locations where this string appears (lines 103, 4129, and 4978).

Suggested change
"--taproot-assets.experimental.rfq.priceoracletlsinsecure",
priceOracleTlsInsecure,

"--taproot-assets.experimental.rfq.priceoracleaddress=" +
"use_mock_price_oracle_service_promise_to_" +
"not_use_on_mainnet",
Expand All @@ -99,6 +100,7 @@ var (
}...)

litdArgsTemplateDiffOracle = append(litdArgsTemplateNoOracle, []string{
"--taproot-assets.experimental.rfq.priceoracletlsinsecure",
"--taproot-assets.experimental.rfq.priceoracleaddress=" +
"use_mock_price_oracle_service_promise_to_" +
"not_use_on_mainnet",
Expand Down Expand Up @@ -4123,10 +4125,12 @@ func testCustomChannelsOraclePricing(ctx context.Context, net *NetworkHarness,

lndArgs := slices.Clone(lndArgsTemplate)
litdArgs := slices.Clone(litdArgsTemplateNoOracle)
litdArgs = append(litdArgs, fmt.Sprintf(
"--taproot-assets.experimental.rfq.priceoracleaddress="+
"rfqrpc://%s", oracleAddr,
))
litdArgs = append(litdArgs,
"--taproot-assets.experimental.rfq.priceoracletlsinsecure",
fmt.Sprintf(
"--taproot-assets.experimental.rfq.priceoracleaddress="+
"rfqrpc://%s", oracleAddr,
))

// We use Charlie as the proof courier. But in order for Charlie to also
// use itself, we need to define its port upfront.
Expand Down Expand Up @@ -4970,10 +4974,12 @@ func testCustomChannelsDecodeAssetInvoice(ctx context.Context,

lndArgs := slices.Clone(lndArgsTemplate)
litdArgs := slices.Clone(litdArgsTemplateNoOracle)
litdArgs = append(litdArgs, fmt.Sprintf(
"--taproot-assets.experimental.rfq.priceoracleaddress="+
"rfqrpc://%s", oracleAddr,
))
litdArgs = append(litdArgs,
"--taproot-assets.experimental.rfq.priceoracletlsinsecure",
fmt.Sprintf(
"--taproot-assets.experimental.rfq.priceoracleaddress="+
"rfqrpc://%s", oracleAddr,
))

// We'll just make a single node here, as this doesn't actually rely on
// a set of active channels.
Expand Down
Loading