Skip to content

Commit

Permalink
update common
Browse files Browse the repository at this point in the history
  • Loading branch information
EasterTheBunny committed Sep 3, 2024
1 parent 6b9fa38 commit 549ae01
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ toolchain go1.22.6
require (
github.com/hashicorp/go-plugin v1.6.2-0.20240829161738-06afb6d7ae99
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240903145040-b10f97aaedca
github.com/smartcontractkit/chainlink-feeds v0.1.0
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c
github.com/stretchr/testify v1.9.0
)
Expand Down Expand Up @@ -76,4 +75,4 @@ require (
// until merged upstream: https://github.com/mwitkow/grpc-proxy/pull/69
replace github.com/mwitkow/grpc-proxy => github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f

module example.com/mod
module github.com/smartcontractkit/chainlink-feeds
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240903145040-b10f97aaedca h1:tuv6FkcnT6qC+qjOQ0NGDVUvq14uvEJhyBu3z+iuQoQ=
github.com/smartcontractkit/chainlink-common v0.2.2-0.20240903145040-b10f97aaedca/go.mod h1:D/qaCoq0SxXzg5NRN5FtBRv98VBf+D2NOC++RbvvuOc=
github.com/smartcontractkit/chainlink-feeds v0.1.0 h1:mR6dHzr9WxWeTlyYQ1kokKYZSz3GEgjKWJmpi8IcXrQ=
github.com/smartcontractkit/chainlink-feeds v0.1.0/go.mod h1:vy1L7NybTy2F/Yv7BOh+oZBa1MACD6gzd1+DkcSkfp8=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs=
github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA=
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c h1:lIyMbTaF2H0Q71vkwZHX/Ew4KF2BxiKhqEXwF8rn+KI=
Expand Down
12 changes: 6 additions & 6 deletions median/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewPlugin(lggr logger.Logger) *Plugin {
return &Plugin{Plugin: loop.Plugin{Logger: lggr}, stop: make(services.StopChan)}
}

func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProvider, contractAddr string, dataSource, juelsPerFeeCoin, gasPriceSubunits median.DataSource, errorLog loop.ErrorLog) (loop.ReportingPluginFactory, error) {
func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProvider, contractID string, dataSource, juelsPerFeeCoin, gasPriceSubunits median.DataSource, errorLog loop.ErrorLog) (loop.ReportingPluginFactory, error) {
var ctxVals loop.ContextValues
ctxVals.SetValues(ctx)
lggr := logger.With(p.Logger, ctxVals.Args()...)
Expand Down Expand Up @@ -57,12 +57,12 @@ func (p *Plugin) NewMedianFactory(ctx context.Context, provider types.MedianProv

if cr := provider.ChainReader(); cr != nil {
if err := provider.ChainReader().Bind(ctx, []types.BoundContract{
{Address: contractAddr, Name: contractAddr},
{Address: contractID, Name: contractName},
}); err != nil {
return nil, err
}

factory.ContractTransmitter = &contractReaderContract{contractAddr: contractAddr, contractReader: cr, lggr: lggr}
factory.ContractTransmitter = &contractReaderContract{contractID: contractID, contractReader: cr, lggr: lggr}
} else {
factory.ContractTransmitter = provider.MedianContract()
}
Expand Down Expand Up @@ -109,7 +109,7 @@ func (r *reportingPluginFactoryService) HealthReport() map[string]error {

// contractReaderContract adapts a [types.ContractReader] to [median.MedianContract].
type contractReaderContract struct {
contractAddr string
contractID string
contractReader types.ContractReader
lggr logger.Logger
}
Expand All @@ -132,7 +132,7 @@ func (c *contractReaderContract) LatestTransmissionDetails(ctx context.Context)
var resp latestTransmissionDetailsResponse

binding := types.BoundContract{
Address: c.contractAddr,
Address: c.contractID,
Name: contractName,
}

Expand Down Expand Up @@ -160,7 +160,7 @@ func (c *contractReaderContract) LatestRoundRequested(ctx context.Context, lookb
var resp latestRoundRequested

binding := types.BoundContract{
Address: c.contractAddr,
Address: c.contractID,
Name: contractName,
}

Expand Down

0 comments on commit 549ae01

Please sign in to comment.