Skip to content

Commit

Permalink
Add more info to dummy transmitter logs
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav committed Jun 25, 2024
1 parent c23693e commit 271d3ce
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion core/services/llo/bm/dummy_transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/smartcontractkit/libocr/offchainreporting2plus/types"
ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types"

"github.com/smartcontractkit/chainlink-data-streams/llo"

"github.com/smartcontractkit/chainlink-common/pkg/services"
llotypes "github.com/smartcontractkit/chainlink-common/pkg/types/llo"

Expand Down Expand Up @@ -57,8 +59,27 @@ func (t *transmitter) Transmit(
report ocr3types.ReportWithInfo[llotypes.ReportInfo],
sigs []types.AttributedOnchainSignature,
) error {
lggr := t.lggr
switch report.Info.ReportFormat {
// TODO: support EVM?
case llotypes.ReportFormatJSON:
r, err := (llo.JSONReportCodec{}).Decode(report.Report)
if err != nil {
lggr.Debugw("Failed to decode JSON report", "err", err)
}
lggr = lggr.With(
"report.Report.ConfigDigest", r.ConfigDigest,
"report.Report.ChainSelector", r.ChainSelector,
"report.Report.SeqNr uint64", r.SeqNr,
"report.Report.ChannelID", r.ChannelID,
"report.Report.ValidAfterSeconds", r.ValidAfterSeconds,
"report.Report.ValidUntilSeconds", r.ValidUntilSeconds,
"report.Report.Values", r.Values,
"report.Report.Specimen", r.Specimen,
)
}
transmitSuccessCount.Inc()
t.lggr.Infow("Transmit (dummy)", "digest", digest, "seqNr", seqNr, "report.Report", report.Report, "report.Info", report.Info, "sigs", sigs)
lggr.Infow("Transmit (dummy)", "digest", digest, "seqNr", seqNr, "report.Report", report.Report, "report.Info", report.Info, "sigs", sigs)
return nil
}

Expand Down

0 comments on commit 271d3ce

Please sign in to comment.