Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhen1997 committed Jan 24, 2025
1 parent 046063c commit 391f398
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ccipevm
package common

import (
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"
Expand Down
5 changes: 3 additions & 2 deletions core/capabilities/ccip/oraclecreator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus"
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"

chainsel "github.com/smartcontractkit/chain-selectors"
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"
Expand Down Expand Up @@ -261,7 +262,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(
ccipreaderpkg.OCR3ConfigWithMeta(config),
ccipevm.NewCommitPluginCodecV1(),
ccipevm.NewMessageHasherV1(i.lggr.Named("MessageHasherV1")),
ccipevm.NewExtraDataCodec(),
ccipcommon.NewExtraDataCodec(),
i.homeChainReader,
i.homeChainSelector,
contractReaders,
Expand All @@ -284,7 +285,7 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(
ccipreaderpkg.OCR3ConfigWithMeta(config),
ccipevm.NewExecutePluginCodecV1(),
ccipevm.NewMessageHasherV1(i.lggr.Named("MessageHasherV1")),
ccipevm.NewExtraDataCodec(),
ccipcommon.NewExtraDataCodec(),
i.homeChainReader,
ccipevm.NewEVMTokenDataEncoder(),
ccipevm.NewGasEstimateProvider(),
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/smoke/ccip/ccip_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient/simulated"
"github.com/jmoiron/sqlx"
ccipcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zapcore"
Expand All @@ -33,7 +34,6 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/types"
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"

"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/chains/evm/client"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/headtracker"
Expand Down Expand Up @@ -285,7 +285,7 @@ func TestCCIPReader_GetOffRampConfigDigest(t *testing.T) {
nil,
chainD,
addr.Bytes(),
ccipevm.NewExtraDataCodec(),
ccipcommon.NewExtraDataCodec(),
)

ccipReaderCommitDigest, err := reader.GetOffRampConfigDigest(ctx, consts.PluginTypeCommit)
Expand Down Expand Up @@ -1405,7 +1405,7 @@ func testSetupRealContracts(
contractReaders[chain] = cr
}
contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter)
edc := ccipevm.NewExtraDataCodec()
edc := ccipcommon.NewExtraDataCodec()
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, cciptypes.ChainSelector(destChain), nil, edc)

return reader
Expand Down Expand Up @@ -1521,7 +1521,7 @@ func testSetup(
contractReaders[chain] = cr
}
contractWriters := make(map[cciptypes.ChainSelector]types.ContractWriter)
edc := ccipevm.NewExtraDataCodec()
edc := ccipcommon.NewExtraDataCodec()
reader := ccipreaderpkg.NewCCIPReaderWithExtendedContractReaders(ctx, lggr, contractReaders, contractWriters, params.DestChain, nil, edc)

t.Cleanup(func() {
Expand Down

0 comments on commit 391f398

Please sign in to comment.