Skip to content

Commit

Permalink
Add router to Source/Dest ReaderConfig. (#14668)
Browse files Browse the repository at this point in the history
* Add router to DestReaderConfig.

* Add source router config.

* Add changeset file.

* Fix import order.
  • Loading branch information
winder authored Oct 7, 2024
1 parent 176ef4a commit dacb6a8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-starfishes-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#internal ccip contract reader config.
20 changes: 20 additions & 0 deletions core/capabilities/ccip/configs/evm/contract_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/onramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_remote"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/aggregator_v3_interface"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
evmrelaytypes "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types"
Expand All @@ -29,6 +30,7 @@ var (
priceFeedABI = evmtypes.MustGetABI(aggregator_v3_interface.AggregatorV3InterfaceABI)
rmnRemoteABI = evmtypes.MustGetABI(rmn_remote.RMNRemoteABI)
rmnHomeABI = evmtypes.MustGetABI(rmnHomeString)
routerABI = evmtypes.MustGetABI(router.RouterABI)
)

// TODO: replace with generated ABI when the contract will be defined
Expand Down Expand Up @@ -169,6 +171,15 @@ var DestReaderConfig = evmrelaytypes.ChainReaderConfig{
// },
},
},
consts.ContractNameRouter: {
ContractABI: router.RouterABI,
Configs: map[string]*evmrelaytypes.ChainReaderDefinition{
consts.MethodNameRouterGetWrappedNative: {
ChainSpecificName: mustGetMethodName("getWrappedNative", routerABI),
ReadType: evmrelaytypes.Method,
},
},
},
},
}

Expand Down Expand Up @@ -219,6 +230,15 @@ var SourceReaderConfig = evmrelaytypes.ChainReaderConfig{
},
},
},
consts.ContractNameRouter: {
ContractABI: router.RouterABI,
Configs: map[string]*evmrelaytypes.ChainReaderDefinition{
consts.MethodNameRouterGetWrappedNative: {
ChainSpecificName: mustGetMethodName("getWrappedNative", routerABI),
ReadType: evmrelaytypes.Method,
},
},
},
},
}

Expand Down

0 comments on commit dacb6a8

Please sign in to comment.