Skip to content

Commit 5c42394

Browse files
committed
Fix NeweOutcome.
1 parent 4a5ec79 commit 5c42394

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

execute/exectypes/outcome.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ func NewOutcome(
111111
state PluginState,
112112
selectedCommits []CommitData,
113113
report cciptypes.ExecutePluginReport,
114+
reports []cciptypes.ExecutePluginReport,
114115
) Outcome {
115-
return NewSortedOutcome(state, selectedCommits, report)
116+
return NewSortedOutcome(state, selectedCommits, report, reports)
116117
}
117118

118119
// NewSortedOutcome ensures canonical ordering of the outcome.
@@ -121,6 +122,7 @@ func NewSortedOutcome(
121122
state PluginState,
122123
pendingCommits []CommitData,
123124
report cciptypes.ExecutePluginReport,
125+
reports []cciptypes.ExecutePluginReport,
124126
) Outcome {
125127
pendingCommitsCP := append([]CommitData{}, pendingCommits...)
126128
reportCP := append([]cciptypes.ExecutePluginReportSingleChain{}, report.ChainReports...)
@@ -138,5 +140,6 @@ func NewSortedOutcome(
138140
State: state,
139141
CommitReports: pendingCommitsCP,
140142
Report: cciptypes.ExecutePluginReport{ChainReports: reportCP},
143+
Reports: reports,
141144
}
142145
}

execute/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import (
2929

3030
"github.com/smartcontractkit/chainlink-ccip/execute/exectypes"
3131
"github.com/smartcontractkit/chainlink-ccip/execute/internal/cache"
32-
"github.com/smartcontractkit/chainlink-ccip/execute/metrics"
3332
"github.com/smartcontractkit/chainlink-ccip/execute/report"
3433
"github.com/smartcontractkit/chainlink-ccip/execute/tokendata/observer"
34+
"github.com/smartcontractkit/chainlink-ccip/executemetrics"
3535
"github.com/smartcontractkit/chainlink-ccip/internal/libs/slicelib"
3636
"github.com/smartcontractkit/chainlink-ccip/internal/plugincommon"
3737
"github.com/smartcontractkit/chainlink-ccip/internal/plugincommon/discovery"

pkg/ocrtypecodec/v1/exec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (e *ExecCodecProto) DecodeObservation(data []byte) (exectypes.Observation,
7979
}
8080

8181
func (e *ExecCodecProto) EncodeOutcome(outcome exectypes.Outcome) ([]byte, error) {
82-
outcome = exectypes.NewOutcome(outcome.State, outcome.CommitReports, outcome.Report)
82+
outcome = exectypes.NewOutcome(outcome.State, outcome.CommitReports, outcome.Report, outcome.Reports)
8383

8484
pbObs := &ocrtypecodecpb.ExecOutcome{
8585
PluginState: string(outcome.State),
@@ -162,7 +162,7 @@ func (*ExecCodecJSON) DecodeObservation(data []byte) (exectypes.Observation, err
162162

163163
func (*ExecCodecJSON) EncodeOutcome(outcome exectypes.Outcome) ([]byte, error) {
164164
// We sort again here in case construction is not via the constructor.
165-
return json.Marshal(exectypes.NewOutcome(outcome.State, outcome.CommitReports, outcome.Report))
165+
return json.Marshal(exectypes.NewOutcome(outcome.State, outcome.CommitReports, outcome.Report, outcome.Reports))
166166
}
167167

168168
func (*ExecCodecJSON) DecodeOutcome(data []byte) (exectypes.Outcome, error) {

0 commit comments

Comments
 (0)