diff --git a/go.mod b/go.mod index 4d8cf45..176a486 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.1.7-0.20240522203001-10ea0211efd7 + github.com/smartcontractkit/chainlink-common v0.1.7-0.20240701152910-a52e4442f39d 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 dee4b9e..015330d 100644 --- a/go.sum +++ b/go.sum @@ -222,6 +222,8 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7 h1:od+11B83s0mQwAMPP3lhtb0nYz63pIKpJEKddfFpu/M= github.com/smartcontractkit/chainlink-common v0.1.7-0.20240522203001-10ea0211efd7/go.mod h1:cFHRblGbGn/rFYOOGsNbtLicMc1+5YdN0KoebYr93pk= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240701152910-a52e4442f39d h1:fbU9SDtBgf5dMgT1xnqdeagry9pxTCBzB4OuIykv8R0= +github.com/smartcontractkit/chainlink-common v0.1.7-0.20240701152910-a52e4442f39d/go.mod h1:L32xvCpk84Nglit64OhySPMP1tM3TTBK7Tw0qZl7Sd4= 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 a89d9ab..0a6028e 100644 --- a/median/plugin.go +++ b/median/plugin.go @@ -100,9 +100,9 @@ func (r *reportingPluginFactoryService) HealthReport() map[string]error { return map[string]error{r.Name(): r.Healthy()} } -// chainReaderContract adapts a [types.ChainReader] to [median.MedianContract]. +// chainReaderContract adapts a [types.ContractReader] to [median.MedianContract]. type chainReaderContract struct { - chainReader types.ChainReader + chainReader types.ContractReader lggr logger.Logger } @@ -123,7 +123,13 @@ type latestRoundRequested struct { func (c *chainReaderContract) LatestTransmissionDetails(ctx context.Context) (configDigest ocrtypes.ConfigDigest, epoch uint32, round uint8, latestAnswer *big.Int, latestTimestamp time.Time, err error) { var resp latestTransmissionDetailsResponse - err = c.chainReader.GetLatestValue(ctx, contractName, "LatestTransmissionDetails", nil, &resp) + binding := types.BoundContract{ + Address: "TODO", + Contract: contractName, + Method: "LatestTransmissionDetails", + } + + err = c.chainReader.GetLatestValue(ctx, binding, nil, &resp) if err != nil { if !errors.Is(err, types.ErrNotFound) { return @@ -146,7 +152,13 @@ func (c *chainReaderContract) LatestTransmissionDetails(ctx context.Context) (co func (c *chainReaderContract) LatestRoundRequested(ctx context.Context, lookback time.Duration) (configDigest ocrtypes.ConfigDigest, epoch uint32, round uint8, err error) { var resp latestRoundRequested - err = c.chainReader.GetLatestValue(ctx, contractName, "LatestRoundRequested", nil, &resp) + binding := types.BoundContract{ + Address: "TODO", + Contract: contractName, + Method: "LatestRoundRequested", + } + + err = c.chainReader.GetLatestValue(ctx, binding, nil, &resp) if err != nil { if !errors.Is(err, types.ErrNotFound) { return