Skip to content

Commit e87b90f

Browse files
committed
Support legacy field in protobuf layer.
1 parent 0c67bb0 commit e87b90f

File tree

5 files changed

+6
-23
lines changed

5 files changed

+6
-23
lines changed

execute/observation.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ func (p *Plugin) Observation(
4848
}
4949
lggr.Infow("decoded previous outcome", "previousOutcome", previousOutcome)
5050

51-
// TODO: Support "Reports" field.
52-
if len(previousOutcome.Reports) > 0 {
53-
previousOutcome.Report = previousOutcome.Reports[0]
54-
}
55-
5651
// If the previous outcome was the filter state, and reports were built, mark the messages as inflight.
5752
if previousOutcome.State == exectypes.Filter {
5853
for _, chainReport := range previousOutcome.Report.ChainReports {

execute/outcome.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ func (p *Plugin) Outcome(
3535
return nil, fmt.Errorf("unable to decode previous outcome: %w", err)
3636
}
3737

38-
// TODO: Support "Reports" field.
39-
if len(previousOutcome.Reports) > 0 {
40-
previousOutcome.Report = previousOutcome.Reports[0]
41-
}
42-
4338
state := previousOutcome.State.Next()
4439
lggr = logger.With(lggr, "execPluginState", state)
4540
lggr.Debugw("Execute plugin performing outcome",

execute/plugin.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,6 @@ func (p *Plugin) ValidateObservation(
358358
return fmt.Errorf("unable to decode previous outcome: %w", err)
359359
}
360360

361-
// TODO: Support "Reports" field.
362-
if len(previousOutcome.Reports) > 0 {
363-
previousOutcome.Report = previousOutcome.Reports[0]
364-
}
365-
366361
supportedChains, err := p.supportedChains(ao.Observer)
367362
if err != nil {
368363
return fmt.Errorf("error finding supported chains by node: %w", err)
@@ -564,11 +559,6 @@ func (p *Plugin) Reports(
564559
return nil, fmt.Errorf("unable to decode outcome: %w", err)
565560
}
566561

567-
// TODO: Support "Reports" field.
568-
if len(decodedOutcome.Reports) > 0 {
569-
decodedOutcome.Report = decodedOutcome.Reports[0]
570-
}
571-
572562
if len(decodedOutcome.Report.ChainReports) == 0 {
573563
lggr.Warn("empty report", "report", decodedOutcome.Report)
574564
return nil, nil

execute/tracked.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ func currentState(p *TrackedPlugin, outctx ocr3types.OutcomeContext) exectypes.P
103103
}
104104

105105
// TODO: Support "Reports" field.
106-
if len(out.Reports) > 0 {
107-
out.Report = out.Reports[0]
108-
}
109106

110107
return out.State.Next()
111108
}

pkg/ocrtypecodec/v1/exec.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ func (e *ExecCodecProto) DecodeOutcome(data []byte) (exectypes.Outcome, error) {
120120
outc.Reports = e.tr.execPluginReportsFromProto([]*ocrtypecodecpb.ExecutePluginReport{pbOutc.ExecutePluginReport})
121121
}
122122

123+
// Decode the new report format into the legacy field as an intermediate step for implementing this feature.
124+
// TODO: Remove temporary function after the 'Reports' field is fully implemented.
125+
if len(outc.Reports) > 0 {
126+
outc.Report = outc.Reports[0]
127+
}
128+
123129
return outc, nil
124130
}
125131

0 commit comments

Comments
 (0)