diff --git a/go.mod b/go.mod index c7de08d..7dcd133 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21.3 require ( github.com/hashicorp/go-plugin v1.6.0 - github.com/smartcontractkit/chainlink-common v0.2.2-0.20240802183453-a0e0a638468c + github.com/smartcontractkit/chainlink-common v0.2.2-0.20240819142040-5fee32566d96 github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c github.com/stretchr/testify v1.9.0 ) diff --git a/go.sum b/go.sum index 47afc94..a6d40d6 100644 --- a/go.sum +++ b/go.sum @@ -129,14 +129,18 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 h1:WCcC4vZDS1tYNxjWlwRJZQy28r8CM github.com/santhosh-tekuri/jsonschema/v5 v5.2.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240723135651-f3834dfa53fd h1:IA3z1CURIWxL2SrayoMbPApERBmX+xFX1f8etYFTVo0= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240723135651-f3834dfa53fd/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240801143749-22c729620ed7 h1:nIHK1aMQmzzRe9xje3QRcNyz3B/PWx9XGUdQy0qz8AA= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240801143749-22c729620ed7/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240801145223-4ad42a43cfb3 h1:l7YAtvdkV9y/pWmGPej9xylQkq3dLsypQRViSJtRc9U= -github.com/smartcontractkit/chainlink-common v0.2.2-0.20240801145223-4ad42a43cfb3/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= github.com/smartcontractkit/chainlink-common v0.2.2-0.20240802183453-a0e0a638468c h1:djORnj8p7qPPR2Vqec9GTYJaod8KeWlNhYqblwmDxvU= github.com/smartcontractkit/chainlink-common v0.2.2-0.20240802183453-a0e0a638468c/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240807142535-07a9beb0ce06 h1:ZfibbyjOpV6q4RDUeEJ5ZqFOodl4DOEhUleRAU+tvWo= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240807142535-07a9beb0ce06/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240809193136-ac9bab33d23d h1:QDwarvq5UpAPxY8hUTsPYe0ufHb27rh+2XFrM6CMQGE= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240809193136-ac9bab33d23d/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240815135306-ee568c3a0fda h1:v4jD3oQAYgTSqDF26LDaUvmpH1g87r80yiO5yg6MWGE= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240815135306-ee568c3a0fda/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240816161455-038768672604 h1:RsZ1L5VTIMGbGDKxRq5oUJMsyXvCogX/WB/3l9AIS2Y= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240816161455-038768672604/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240819142040-5fee32566d96 h1:qcUez2R7N+cxWuR3OpEM/6E4r91joz3T6fFjLGzRvCI= +github.com/smartcontractkit/chainlink-common v0.2.2-0.20240819142040-5fee32566d96/go.mod h1:Jg1sCTsbxg76YByI8ifpFby3FvVqISStHT8ypy9ocmY= github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16 h1:TFe+FvzxClblt6qRfqEhUfa4kFQx5UobuoFGO2W4mMo= github.com/smartcontractkit/go-plugin v0.0.0-20240208201424-b3b91517de16/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= diff --git a/median/plugin.go b/median/plugin.go index c6954b9..f052f24 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -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()...) @@ -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() } @@ -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 } @@ -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, } @@ -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, }