From 29267b22803c94e6f5c113c15e1c4f92d55c6a35 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Fri, 23 Aug 2024 15:38:34 -0400 Subject: [PATCH] Set nonce manager config for chain reader. --- .../ccip/configs/evm/contract_reader.go | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/core/capabilities/ccip/configs/evm/contract_reader.go b/core/capabilities/ccip/configs/evm/contract_reader.go index fd5cc49fa31..18cb829e1b0 100644 --- a/core/capabilities/ccip/configs/evm/contract_reader.go +++ b/core/capabilities/ccip/configs/evm/contract_reader.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/smartcontractkit/chainlink-ccip/pkg/consts" + "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/nonce_manager" evmtypes "github.com/smartcontractkit/chainlink/v2/core/chains/evm/types" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config" @@ -22,6 +23,7 @@ var ( capabilitiesRegsitryABI = evmtypes.MustGetABI(kcr.CapabilitiesRegistryABI) ccipConfigABI = evmtypes.MustGetABI(ccip_config.CCIPConfigABI) priceRegistryABI = evmtypes.MustGetABI(price_registry.PriceRegistryABI) + nonceManagerABI = evmtypes.MustGetABI(nonce_manager.NonceManagerABI) ) // MustSourceReaderConfig returns a ChainReaderConfig that can be used to read from the onramp. @@ -142,40 +144,53 @@ var SourceReaderConfig = evmrelaytypes.ChainReaderConfig{ Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ // TODO: update with the consts from https://github.com/smartcontractkit/chainlink-ccip/pull/39 // in a followup. - "GetStaticConfig": { + consts.MethodNamePriceRegistryGetStaticConfig: { ChainSpecificName: mustGetMethodName("getStaticConfig", priceRegistryABI), ReadType: evmrelaytypes.Method, }, - "GetDestChainConfig": { + consts.MethodNameGetDestChainConfig: { ChainSpecificName: mustGetMethodName("getDestChainConfig", priceRegistryABI), ReadType: evmrelaytypes.Method, }, - "GetPremiumMultiplierWeiPerEth": { + consts.MethodNameGetPremiumMultiplierWeiPerEth: { ChainSpecificName: mustGetMethodName("getPremiumMultiplierWeiPerEth", priceRegistryABI), ReadType: evmrelaytypes.Method, }, - "GetTokenTransferFeeConfig": { + consts.MethodNameGetTokenTransferFeeConfig: { ChainSpecificName: mustGetMethodName("getTokenTransferFeeConfig", priceRegistryABI), ReadType: evmrelaytypes.Method, }, - "ProcessMessageArgs": { + consts.MethodNameProcessMessageArgs: { ChainSpecificName: mustGetMethodName("processMessageArgs", priceRegistryABI), ReadType: evmrelaytypes.Method, }, - "ValidatePoolReturnData": { + consts.MethodNameValidatePoolReturnData: { ChainSpecificName: mustGetMethodName("validatePoolReturnData", priceRegistryABI), ReadType: evmrelaytypes.Method, }, - "GetValidatedTokenPrice": { + consts.MethodNameGetValidatedTokenPrice: { ChainSpecificName: mustGetMethodName("getValidatedTokenPrice", priceRegistryABI), ReadType: evmrelaytypes.Method, }, - "GetFeeTokens": { + consts.MethodNameGetFeeTokens: { ChainSpecificName: mustGetMethodName("getFeeTokens", priceRegistryABI), ReadType: evmrelaytypes.Method, }, }, }, + consts.ContractNameNonceManager: { + ContractABI: nonce_manager.NonceManagerABI, + Configs: map[string]*evmrelaytypes.ChainReaderDefinition{ + consts.MethodNameGetInboundNonce: { + ChainSpecificName: mustGetMethodName("getInboundNonce", nonceManagerABI), + ReadType: evmrelaytypes.Method, + }, + consts.MethodNameGetOutboundNonce: { + ChainSpecificName: mustGetMethodName("getOutboundNonce", nonceManagerABI), + ReadType: evmrelaytypes.Method, + }, + }, + }, }, }