@@ -31,6 +31,7 @@ import (
3131 "github.com/smartcontractkit/chainlink-evm/pkg/logpoller"
3232 "github.com/smartcontractkit/chainlink-evm/pkg/monitor"
3333 "github.com/smartcontractkit/chainlink-evm/pkg/txmgr"
34+ evmtypes "github.com/smartcontractkit/chainlink-evm/pkg/types"
3435 ubig "github.com/smartcontractkit/chainlink-evm/pkg/utils/big"
3536 trontxm "github.com/smartcontractkit/chainlink-tron/relayer/txm"
3637)
@@ -64,33 +65,43 @@ var (
6465
6566// LegacyChains implements [LegacyChainContainer]
6667type LegacyChains struct {
67- * chains.ChainsKV [types.ChainService ]
68+ * chains.ChainsKV [Chain ]
69+
70+ cfgs toml.EVMConfigs
6871}
6972
70- // LegacyChainContainer is container for EVM chains of type [types.ChainService], which may be castable to [Chain].
71- // The cast will fail if the chain is running in LOOPP mode, in which case the legacy API is limited to the overlapping set
72- // defined by [types.ChainService].
73+ // LegacyChainContainer is container for EVM chains.
7374type LegacyChainContainer interface {
74- Get (id string ) (types. ChainService , error )
75+ Get (id string ) (Chain , error )
7576 Len () int
76- List (ids ... string ) ([]types.ChainService , error )
77- Slice () []types.ChainService
77+ List (ids ... string ) ([]Chain , error )
78+ Slice () []Chain
79+
80+ // BCF-2516: this is only used for EVMORM. When we delete that
81+ // we can promote/move the needed funcs from it to LegacyChainContainer
82+ // so instead of EVMORM().XYZ() we'd have something like legacyChains.XYZ()
83+ ChainNodeConfigs () evmtypes.Configs
7884}
7985
8086var _ LegacyChainContainer = & LegacyChains {}
8187
82- func NewLegacyChains (m map [string ]types. ChainService ) * LegacyChains {
88+ func NewLegacyChains (m map [string ]Chain , evmCfgs toml. EVMConfigs ) * LegacyChains {
8389 return & LegacyChains {
84- ChainsKV : chains.NewChainsKV [types.ChainService ](m ),
90+ ChainsKV : chains.NewChainsKV [Chain ](m ),
91+ cfgs : evmCfgs ,
8592 }
8693}
8794
95+ func (c * LegacyChains ) ChainNodeConfigs () evmtypes.Configs {
96+ return c .cfgs
97+ }
98+
8899// backward compatibility.
89100// eth keys are represented as multiple types in the code base;
90101// *big.Int, string, and int64.
91102//
92103// TODO BCF-2507 unify the type system
93- func (c * LegacyChains ) Get (id string ) (types. ChainService , error ) {
104+ func (c * LegacyChains ) Get (id string ) (Chain , error ) {
94105 if id == nilBigInt .String () || id == emptyString {
95106 return nil , fmt .Errorf ("invalid chain id requested: %q" , id )
96107 }
0 commit comments