Skip to content

Commit

Permalink
fix chain family logic
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhen1997 committed Dec 2, 2024
1 parent 86d5f99 commit cbe3922
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/capabilities/ccip/oraclecreator/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ func (i *pluginOracleCreator) createReadersAndWriters(
pluginType cctypes.PluginType,
config cctypes.OCR3ConfigWithMeta,
publicCfg ocr3confighelper.PublicConfig,
chainFamily string,
destChainFamily string,
) (
map[cciptypes.ChainSelector]types.ContractReader,
map[cciptypes.ChainSelector]types.ChainWriter,
Expand Down Expand Up @@ -328,8 +328,8 @@ func (i *pluginOracleCreator) createReadersAndWriters(
chainWriters := make(map[cciptypes.ChainSelector]types.ChainWriter)
for relayID, relayer := range i.relayers {
chainID := relayID.ChainID

chainSelector, err1 := i.getChainSelector(chainID, chainFamily)
relayChainFamily := relayID.Network
chainSelector, err1 := i.getChainSelector(chainID, relayChainFamily)
if err1 != nil {
return nil, nil, fmt.Errorf("failed to get chain selector from chain ID %s: %w", chainID, err1)
}
Expand All @@ -344,7 +344,7 @@ func (i *pluginOracleCreator) createReadersAndWriters(
return nil, nil, err1
}

if chainID == destChainID {
if chainID == destChainID && destChainFamily == relayChainFamily {
offrampAddressHex := common.BytesToAddress(config.Config.OfframpAddress).Hex()
err2 := cr.Bind(ctx, []types.BoundContract{
{
Expand All @@ -367,7 +367,7 @@ func (i *pluginOracleCreator) createReadersAndWriters(
relayer,
i.transmitters,
execBatchGasLimit,
chainFamily)
relayChainFamily)
if err1 != nil {
return nil, nil, err1
}
Expand Down

0 comments on commit cbe3922

Please sign in to comment.