Skip to content

Commit

Permalink
Add extra stuff to DSopts
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav committed Sep 12, 2024
1 parent 9f0a98d commit ca30ec7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions llo/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,30 @@ const (
type DSOpts interface {
VerboseLogging() bool
SeqNr() uint64
OutCtx() ocr3types.OutcomeContext
ConfigDigest() ocr2types.ConfigDigest
}

type dsOpts struct {
verboseLogging bool
seqNr uint64
outCtx ocr3types.OutcomeContext
configDigest ocr2types.ConfigDigest
}

func (o dsOpts) VerboseLogging() bool {
return o.verboseLogging
}

func (o dsOpts) SeqNr() uint64 {
return o.seqNr
return o.outCtx.SeqNr
}

func (o dsOpts) OutCtx() ocr3types.OutcomeContext {
return o.outCtx
}

func (o dsOpts) ConfigDigest() ocr2types.ConfigDigest {
return o.configDigest
}

type DataSource interface {
Expand Down
2 changes: 1 addition & 1 deletion llo/plugin_observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (p *Plugin) observation(ctx context.Context, outctx ocr3types.OutcomeContex
}
}

if err := p.DataSource.Observe(ctx, streamValues, dsOpts{p.Config.VerboseLogging, outctx.SeqNr}); err != nil {
if err := p.DataSource.Observe(ctx, streamValues, dsOpts{p.Config.VerboseLogging, outctx, p.ConfigDigest}); err != nil {
return nil, fmt.Errorf("DataSource.Observe error: %w", err)
}
}
Expand Down

0 comments on commit ca30ec7

Please sign in to comment.