Skip to content

Commit 2026ec6

Browse files
committed
remove opts cache
1 parent 1bf4fc4 commit 2026ec6

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

llo/channel_definitions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func VerifyChannelDefinitions(codecs map[llotypes.ReportFormat]ReportCodec, chan
5252
func subtractChannelDefinitions(minuend llotypes.ChannelDefinitions, subtrahend llotypes.ChannelDefinitions, limit int) llotypes.ChannelDefinitions {
5353
differenceList := []ChannelDefinitionWithID{}
5454
for channelID, channelDefinition := range minuend {
55-
if _, ok := subtrahend[channelID]; !ok {
55+
if _, ok := subtrahend[channelID]; !ok || channelDefinition.Tombstone {
5656
differenceList = append(differenceList, ChannelDefinitionWithID{channelDefinition, channelID})
5757
}
5858
}

llo/plugin.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ type Plugin struct {
316316
PredecessorRetirementReportCache PredecessorRetirementReportCache
317317
ShouldRetireCache ShouldRetireCache
318318
ChannelDefinitionCache llotypes.ChannelDefinitionCache
319-
ChannelDefinitionOptsCache ChannelDefinitionOptsCache
320319
DataSource DataSource
321320
Logger logger.Logger
322321
N int

llo/plugin_outcome_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ func testOutcome(t *testing.T, outcomeCodec OutcomeCodec) {
174174
}
175175

176176
// Verify channel is reportable before tombstoning
177-
require.Nil(t, previousOutcome.IsReportable(channelID, 1, uint64(100*time.Millisecond), p.ReportCodecs, p.ChannelDefinitionOptsCache))
178-
reportable, _ := previousOutcome.ReportableChannels(1, uint64(100*time.Millisecond), p.ReportCodecs, p.ChannelDefinitionOptsCache)
177+
require.Nil(t, previousOutcome.IsReportable(channelID, 1, uint64(100*time.Millisecond)))
178+
reportable, _ := previousOutcome.ReportableChannels(1, uint64(100*time.Millisecond))
179179
assert.Contains(t, reportable, channelID)
180180

181181
// Encode previous outcome
@@ -215,12 +215,12 @@ func testOutcome(t *testing.T, outcomeCodec OutcomeCodec) {
215215
assert.Equal(t, tombstonedCd, decoded.ChannelDefinitions[channelID])
216216

217217
// Verify channel is no longer reportable
218-
err = decoded.IsReportable(channelID, 1, uint64(100*time.Millisecond), p.ReportCodecs, p.ChannelDefinitionOptsCache)
218+
err = decoded.IsReportable(channelID, 1, uint64(100*time.Millisecond))
219219
require.NotNil(t, err)
220220
assert.Contains(t, err.Error(), "tombstone channel")
221221

222222
// Verify ReportableChannels excludes the tombstoned channel
223-
reportable, unreportable := decoded.ReportableChannels(1, uint64(100*time.Millisecond), p.ReportCodecs, p.ChannelDefinitionOptsCache)
223+
reportable, unreportable := decoded.ReportableChannels(1, uint64(100*time.Millisecond))
224224
assert.NotContains(t, reportable, channelID, "Tombstoned channel should not be in reportable list")
225225
require.Len(t, unreportable, 1)
226226
assert.Equal(t, channelID, unreportable[0].ChannelID)

llo/plugin_reports_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,12 @@ func testReports(t *testing.T, outcomeCodec OutcomeCodec) {
199199
}
200200

201201
// Verify tombstoned channel is not reportable
202-
unreportableErr := outcome.IsReportable(1, protocolVersion, uint64(minReportInterval), p.ReportCodecs, p.ChannelDefinitionOptsCache)
202+
unreportableErr := outcome.IsReportable(1, protocolVersion, uint64(minReportInterval))
203203
require.NotNil(t, unreportableErr)
204204
assert.Contains(t, unreportableErr.Error(), "tombstone channel")
205205

206206
// Verify non-tombstoned channel is reportable
207-
require.Nil(t, outcome.IsReportable(2, protocolVersion, uint64(minReportInterval), p.ReportCodecs, p.ChannelDefinitionOptsCache))
207+
require.Nil(t, outcome.IsReportable(2, protocolVersion, uint64(minReportInterval)))
208208

209209
encoded, err := p.OutcomeCodec.Encode(outcome)
210210
require.NoError(t, err)

0 commit comments

Comments
 (0)