Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump common and fix Chain Writer to match common CW name #15429

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/wet-bags-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": minor
---

Change ChainWriter naming to ContractWriter to consolidate Relayer chain interfaces #internal
2 changes: 1 addition & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ packages:
Codec:
config:
dir: core/services/relay/evm/mocks
ChainWriter:
ContractWriter:
github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp:
config:
dir: core/gethwrappers/ccip/mocks/
Expand Down
8 changes: 4 additions & 4 deletions core/capabilities/ccip/ocrimpls/contract_transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func ToExecCalldata(rawReportCtx [3][32]byte, report []byte, _, _ [][32]byte, _
var _ ocr3types.ContractTransmitter[[]byte] = &commitTransmitter[[]byte]{}

type commitTransmitter[RI any] struct {
cw commontypes.ChainWriter
cw commontypes.ContractWriter
fromAccount ocrtypes.Account
contractName string
method string
Expand All @@ -65,7 +65,7 @@ type commitTransmitter[RI any] struct {
}

func XXXNewContractTransmitterTestsOnly[RI any](
cw commontypes.ChainWriter,
cw commontypes.ContractWriter,
fromAccount ocrtypes.Account,
contractName string,
method string,
Expand All @@ -83,7 +83,7 @@ func XXXNewContractTransmitterTestsOnly[RI any](
}

func NewCommitContractTransmitter[RI any](
cw commontypes.ChainWriter,
cw commontypes.ContractWriter,
fromAccount ocrtypes.Account,
offrampAddress string,
) ocr3types.ContractTransmitter[RI] {
Expand All @@ -98,7 +98,7 @@ func NewCommitContractTransmitter[RI any](
}

func NewExecContractTransmitter[RI any](
cw commontypes.ChainWriter,
cw commontypes.ContractWriter,
fromAccount ocrtypes.Account,
offrampAddress string,
) ocr3types.ContractTransmitter[RI] {
Expand Down
12 changes: 6 additions & 6 deletions core/capabilities/ccip/oraclecreator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ func (i *pluginOracleCreator) createFactoryAndTransmitter(
config cctypes.OCR3ConfigWithMeta,
destRelayID types.RelayID,
contractReaders map[cciptypes.ChainSelector]types.ContractReader,
chainWriters map[cciptypes.ChainSelector]types.ChainWriter,
destChainWriter types.ChainWriter,
chainWriters map[cciptypes.ChainSelector]types.ContractWriter,
destChainWriter types.ContractWriter,
destFromAccounts []string,
publicConfig ocr3confighelper.PublicConfig,
) (ocr3types.ReportingPluginFactory[[]byte], ocr3types.ContractTransmitter[[]byte], error) {
Expand Down Expand Up @@ -302,7 +302,7 @@ func (i *pluginOracleCreator) createReadersAndWriters(
chainFamily string,
) (
map[cciptypes.ChainSelector]types.ContractReader,
map[cciptypes.ChainSelector]types.ChainWriter,
map[cciptypes.ChainSelector]types.ContractWriter,
error,
) {
ofc, err := decodeAndValidateOffchainConfig(pluginType, publicCfg)
Expand All @@ -325,7 +325,7 @@ func (i *pluginOracleCreator) createReadersAndWriters(
}

contractReaders := make(map[cciptypes.ChainSelector]types.ContractReader)
chainWriters := make(map[cciptypes.ChainSelector]types.ChainWriter)
chainWriters := make(map[cciptypes.ChainSelector]types.ContractWriter)
for relayID, relayer := range i.relayers {
chainID := relayID.ChainID

Expand Down Expand Up @@ -481,7 +481,7 @@ func createChainWriter(
transmitters map[types.RelayID][]string,
execBatchGasLimit uint64,
chainFamily string,
) (types.ChainWriter, error) {
) (types.ContractWriter, error) {
var fromAddress common.Address
transmitter, ok := transmitters[types.NewRelayID(chainFamily, chainID)]
if ok {
Expand All @@ -503,7 +503,7 @@ func createChainWriter(
return nil, fmt.Errorf("failed to marshal chain writer config: %w", err)
}

cw, err := relayer.NewChainWriter(ctx, chainWriterConfig)
cw, err := relayer.NewContractWriter(ctx, chainWriterConfig)
if err != nil {
return nil, fmt.Errorf("failed to create chain writer for chain %s: %w", chainID, err)
}
Expand Down
Loading
Loading