Skip to content

Commit

Permalink
Bump common and fix Chain Writer to match common CW name (#15429)
Browse files Browse the repository at this point in the history
* Bump chainlink-common and fix Chain Writer to match common Contract Writer

* Generate mocks and add changeset

* Disable generated bindings GetLatestValue tests

* Bump solana
  • Loading branch information
ilija42 authored Dec 4, 2024
1 parent c1ee7ab commit 030fd7c
Show file tree
Hide file tree
Showing 31 changed files with 609 additions and 603 deletions.
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

0 comments on commit 030fd7c

Please sign in to comment.