Skip to content

Commit

Permalink
Update chainlink common to remove debuging log line that was left by …
Browse files Browse the repository at this point in the history
…mistake
  • Loading branch information
nolag committed Jan 10, 2024
1 parent 0e9227c commit c8ec3ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.3

require (
github.com/hashicorp/go-plugin v1.5.2
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240109222055-f385b4fa6457
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240110155415-407896b07206
github.com/smartcontractkit/libocr v0.0.0-20231020123319-d255366a6545
github.com/stretchr/testify v1.8.4
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240109222055-f385b4fa6457 h1:bgF5Df5ClSxkc0S3posRfgLxgrj1iE+vkPcsjyvKqBw=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240109222055-f385b4fa6457/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240110155415-407896b07206 h1:CfKu1c/DBx5qi1lFC9e/aVWwO0IyWKw2poBQR2VflnA=
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240110155415-407896b07206/go.mod h1:f+0ei9N4PlTJHu7pbGzEjTnBUr45syPdGFu5+31lS5Q=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306 h1:ko88+ZznniNJZbZPWAvHQU8SwKAdHngdDZ+pvVgB5ss=
github.com/smartcontractkit/go-plugin v0.0.0-20231003134350-e49dad63b306/go.mod h1:w1sAEES3g3PuV/RzUrgow20W2uErMly84hhD3um1WL4=
github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU=
Expand Down
10 changes: 10 additions & 0 deletions median/report_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ type reportCodec struct {
var _ median.ReportCodec = &reportCodec{}

func (r *reportCodec) BuildReport(observations []median.ParsedAttributedObservation) (ocrtypes.Report, error) {
values := make([]*big.Int, len(observations))
for i, o := range observations {
values[i] = o.Value
}
fmt.Printf("values: %v\n", values)
if len(observations) == 0 {
return nil, fmt.Errorf("cannot build report from empty attributed observations")
}
Expand All @@ -39,6 +44,11 @@ func (r *reportCodec) MedianFromReport(report ocrtypes.Report) (*big.Int, error)
if err := r.codec.Decode(context.Background(), report, agg, typeName); err != nil {
return nil, err
}
observations := make([]*big.Int, len(agg.Observations))
for i, o := range agg.Observations {

Check failure on line 48 in median/report_codec.go

View workflow job for this annotation

GitHub Actions / ci-lint

S1001: should use copy(to, from) instead of a loop (gosimple)
observations[i] = o
}
fmt.Printf("observations: %v\n", observations)
medianObservation := len(agg.Observations) / 2
return agg.Observations[medianObservation], nil
}
Expand Down

0 comments on commit c8ec3ff

Please sign in to comment.