Skip to content

Commit da144b0

Browse files
committed
ChannelDefinitionCache accepts the previous outcome
1 parent 6f599fb commit da144b0

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

llo/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ type PredecessorRetirementReportCache interface {
162162
}
163163

164164
type ChannelDefinitionCache interface {
165-
Definitions() llotypes.ChannelDefinitions
165+
Definitions(previous llotypes.ChannelDefinitions) llotypes.ChannelDefinitions
166166
}
167167

168168
// A ReportingPlugin allows plugging custom logic into the OCR3 protocol. The OCR

llo/plugin_observation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (p *Plugin) observation(ctx context.Context, outctx ocr3types.OutcomeContex
7575
// can agree on the same set of changes.
7676
//
7777
// ChannelIDs should always be sorted the same way (channel ID ascending).
78-
expectedChannelDefs := p.ChannelDefinitionCache.Definitions()
78+
expectedChannelDefs := p.ChannelDefinitionCache.Definitions(previousOutcome.ChannelDefinitions)
7979
if err = VerifyChannelDefinitions(p.ReportCodecs, expectedChannelDefs); err != nil {
8080
// If channel definitions is invalid, do not error out but instead
8181
// don't vote on any new channels.

llo/plugin_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type mockChannelDefinitionCache struct {
2929
definitions llotypes.ChannelDefinitions
3030
}
3131

32-
func (m *mockChannelDefinitionCache) Definitions() llotypes.ChannelDefinitions {
32+
func (m *mockChannelDefinitionCache) Definitions(previous llotypes.ChannelDefinitions) llotypes.ChannelDefinitions {
3333
return m.definitions
3434
}
3535

@@ -53,7 +53,7 @@ func (m *mockChannelDefinitionCache) Start(ctx context.Context) error {
5353
return nil
5454
}
5555

56-
var _ llotypes.ChannelDefinitionCache = &mockChannelDefinitionCache{}
56+
var _ ChannelDefinitionCache = &mockChannelDefinitionCache{}
5757

5858
type mockDataSource struct {
5959
s StreamValues

0 commit comments

Comments
 (0)