Skip to content

Commit

Permalink
Fix aliases, run mockery
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Aug 1, 2024
1 parent 5f0bd9c commit 6f44c5b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
12 changes: 6 additions & 6 deletions core/capabilities/ccip/ocrimpls/contract_transmitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"
"time"

ocrimpls2 "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
Expand Down Expand Up @@ -243,7 +243,7 @@ func newTestUniverse[RI any](t *testing.T, ks *keyringsAndSigners[RI]) *testUniv
for i := 0; i < 4; i++ {
kb, err2 := ocr2key.New(kschaintype.EVM)
require.NoError(t, err2, "failed to create key")
kr := ocrimpls2.NewOnchainKeyring[RI](kb, logger.TestLogger(t))
kr := ocrimpls.NewOnchainKeyring[RI](kb, logger.TestLogger(t))
signers = append(signers, common.BytesToAddress(kr.PublicKey()))
keyrings = append(keyrings, kr)
}
Expand Down Expand Up @@ -309,21 +309,21 @@ func newTestUniverse[RI any](t *testing.T, ks *keyringsAndSigners[RI]) *testUniv
require.NoError(t, chainWriter.Start(testutils.Context(t)), "failed to start chain writer")
t.Cleanup(func() { require.NoError(t, chainWriter.Close()) })

transmitterWithSigs := ocrimpls2.XXXNewContractTransmitterTestsOnly[RI](
transmitterWithSigs := ocrimpls.XXXNewContractTransmitterTestsOnly[RI](
chainWriter,
ocrtypes.Account(transmitters[0].Hex()),
contractName,
methodTransmitWithSignatures,
ocr3HelperAddr.Hex(),
ocrimpls2.ToCommitCalldata,
ocrimpls.ToCommitCalldata,
)
transmitterWithoutSigs := ocrimpls2.XXXNewContractTransmitterTestsOnly[RI](
transmitterWithoutSigs := ocrimpls.XXXNewContractTransmitterTestsOnly[RI](
chainWriter,
ocrtypes.Account(transmitters[0].Hex()),
contractName,
methodTransmitWithoutSignatures,
ocr3HelperAddr.Hex(),
ocrimpls2.ToExecCalldata,
ocrimpls.ToExecCalldata,
)

return &testUniverse[RI]{
Expand Down
34 changes: 17 additions & 17 deletions core/capabilities/ccip/oraclecreator/inprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"time"

ccipevm2 "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
evm2 "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"
ocrimpls2 "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccipevm"
evmconfig "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ocrimpls"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -111,7 +111,7 @@ func (i *inprocessOracleCreator) CreateBootstrapOracle(config cctypes.OCR3Config
bootstrapperArgs := libocr3.BootstrapperArgs{
BootstrapperFactory: i.peerWrapper.Peer2,
V2Bootstrappers: i.bootstrapperLocators,
ContractConfigTracker: ocrimpls2.NewConfigTracker(config),
ContractConfigTracker: ocrimpls.NewConfigTracker(config),
Database: i.db,
LocalConfig: defaultLocalConfig(),
Logger: ocrcommon.NewOCRWrapper(
Expand All @@ -128,7 +128,7 @@ func (i *inprocessOracleCreator) CreateBootstrapOracle(config cctypes.OCR3Config
hexutil.Encode(config.Config.OfframpAddress),
synchronization.OCR3CCIPBootstrap,
),
OffchainConfigDigester: ocrimpls2.NewConfigDigester(config.ConfigDigest),
OffchainConfigDigester: ocrimpls.NewConfigDigester(config.ConfigDigest),
}
bootstrapper, err := libocr3.NewBootstrapper(bootstrapperArgs)
if err != nil {
Expand All @@ -154,9 +154,9 @@ func (i *inprocessOracleCreator) CreatePluginOracle(pluginType cctypes.PluginTyp
for _, chain := range i.chains.Slice() {
var chainReaderConfig evmrelaytypes.ChainReaderConfig
if chain.ID().Uint64() == destChainID {
chainReaderConfig = evm2.DestReaderConfig()
chainReaderConfig = evmconfig.DestReaderConfig()
} else {
chainReaderConfig = evm2.SourceReaderConfig()
chainReaderConfig = evmconfig.SourceReaderConfig()
}
cr, err2 := evm.NewChainReaderService(
context.Background(),
Expand Down Expand Up @@ -208,7 +208,7 @@ func (i *inprocessOracleCreator) CreatePluginOracle(pluginType cctypes.PluginTyp
chain.Client(),
chain.TxManager(),
chain.GasEstimator(),
evm2.ChainWriterConfigRaw(fromAddress, chain.Config().EVM().GasEstimator().PriceMaxKey(fromAddress)),
evmconfig.ChainWriterConfigRaw(fromAddress, chain.Config().EVM().GasEstimator().PriceMaxKey(fromAddress)),
)
if err2 != nil {
return nil, fmt.Errorf("failed to create chain writer for chain %s: %w", chain.ID(), err2)
Expand All @@ -235,7 +235,7 @@ func (i *inprocessOracleCreator) CreatePluginOracle(pluginType cctypes.PluginTyp
if !ok {
return nil, fmt.Errorf("no OCR key bundle found for chain family %s, forgot to create one?", destChainFamily)
}
onchainKeyring := ocrimpls2.NewOnchainKeyring[[]byte](keybundle, i.lggr)
onchainKeyring := ocrimpls.NewOnchainKeyring[[]byte](keybundle, i.lggr)

// build the contract transmitter
// assume that we are using the first account in the keybundle as the from account
Expand All @@ -262,13 +262,13 @@ func (i *inprocessOracleCreator) CreatePluginOracle(pluginType cctypes.PluginTyp
Named(fmt.Sprintf("%d", config.Config.ChainSelector)).
Named(hexutil.Encode(config.Config.OfframpAddress)),
ccipreaderpkg.OCR3ConfigWithMeta(config),
ccipevm2.NewCommitPluginCodecV1(),
ccipevm2.NewMessageHasherV1(),
ccipevm.NewCommitPluginCodecV1(),
ccipevm.NewMessageHasherV1(),
i.homeChainReader,
contractReaders,
chainWriters,
)
transmitter = ocrimpls2.NewCommitContractTransmitter[[]byte](destChainWriter,
transmitter = ocrimpls.NewCommitContractTransmitter[[]byte](destChainWriter,
ocrtypes.Account(destFromAccounts[0]),
hexutil.Encode(config.Config.OfframpAddress), // TODO: this works for evm only, how about non-evm?
)
Expand All @@ -279,13 +279,13 @@ func (i *inprocessOracleCreator) CreatePluginOracle(pluginType cctypes.PluginTyp
Named(destRelayID.String()).
Named(hexutil.Encode(config.Config.OfframpAddress)),
ccipreaderpkg.OCR3ConfigWithMeta(config),
ccipevm2.NewExecutePluginCodecV1(),
ccipevm2.NewMessageHasherV1(),
ccipevm.NewExecutePluginCodecV1(),
ccipevm.NewMessageHasherV1(),
i.homeChainReader,
contractReaders,
chainWriters,
)
transmitter = ocrimpls2.NewExecContractTransmitter[[]byte](destChainWriter,
transmitter = ocrimpls.NewExecContractTransmitter[[]byte](destChainWriter,
ocrtypes.Account(destFromAccounts[0]),
hexutil.Encode(config.Config.OfframpAddress), // TODO: this works for evm only, how about non-evm?
)
Expand All @@ -297,7 +297,7 @@ func (i *inprocessOracleCreator) CreatePluginOracle(pluginType cctypes.PluginTyp
BinaryNetworkEndpointFactory: i.peerWrapper.Peer2,
Database: i.db,
V2Bootstrappers: i.bootstrapperLocators,
ContractConfigTracker: ocrimpls2.NewConfigTracker(config),
ContractConfigTracker: ocrimpls.NewConfigTracker(config),
ContractTransmitter: transmitter,
LocalConfig: defaultLocalConfig(),
Logger: ocrcommon.NewOCRWrapper(
Expand All @@ -314,7 +314,7 @@ func (i *inprocessOracleCreator) CreatePluginOracle(pluginType cctypes.PluginTyp
string(config.Config.OfframpAddress),
synchronization.OCR3CCIPCommit,
),
OffchainConfigDigester: ocrimpls2.NewConfigDigester(config.ConfigDigest),
OffchainConfigDigester: ocrimpls.NewConfigDigester(config.ConfigDigest),
OffchainKeyring: keybundle,
OnchainKeyring: onchainKeyring,
ReportingPluginFactory: factory,
Expand Down
3 changes: 1 addition & 2 deletions core/capabilities/ccip/types/mocks/oracle_creator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6f44c5b

Please sign in to comment.