Skip to content

Commit

Permalink
Clean up EVMProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Dec 15, 2023
1 parent ce1051f commit b1cfbf4
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions core/services/ocr2/plugins/ocr2keeper/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ import (
ocr2keepers20polling "github.com/smartcontractkit/chainlink-automation/pkg/v2/observer/polling"
ocr2keepers20runner "github.com/smartcontractkit/chainlink-automation/pkg/v2/runner"
ocr2keepers21 "github.com/smartcontractkit/chainlink-automation/pkg/v3/types"
"github.com/smartcontractkit/chainlink-common/pkg/types"

"github.com/smartcontractkit/chainlink/v2/core/chains/legacyevm"
"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/services/job"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ethkey"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/models"
evmregistry20 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v20"
evmregistry21 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21"
evmregistry21transmit "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/transmit"
"github.com/smartcontractkit/chainlink/v2/core/services/pg"
evmrelay "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm"
)

type Encoder20 interface {
Expand All @@ -43,29 +40,6 @@ var (
ErrNoChainFromSpec = fmt.Errorf("could not create chain from spec")
)

func EVMProvider(db *sqlx.DB, chain legacyevm.Chain, lggr logger.Logger, spec job.Job, ethKeystore keystore.Eth) (evmrelay.OCR2KeeperProvider, error) {
oSpec := spec.OCR2OracleSpec
ocr2keeperRelayer := evmrelay.NewOCR2KeeperRelayer(db, chain, lggr.Named("OCR2KeeperRelayer"), ethKeystore)

keeperProvider, err := ocr2keeperRelayer.NewOCR2KeeperProvider(
types.RelayArgs{
ExternalJobID: spec.ExternalJobID,
JobID: oSpec.ID,
ContractID: oSpec.ContractID,
RelayConfig: oSpec.RelayConfig.Bytes(),
},
types.PluginArgs{
TransmitterID: oSpec.TransmitterID.String,
PluginConfig: oSpec.PluginConfig.Bytes(),
},
)
if err != nil {
return nil, fmt.Errorf("%w: failed to create new ocr2keeper provider", err)
}

return keeperProvider, nil
}

func EVMDependencies20(
spec job.Job,
lggr logger.Logger,
Expand Down

0 comments on commit b1cfbf4

Please sign in to comment.