diff --git a/chainio/clients/builder.go b/chainio/clients/builder.go index c3f4b320..120a2ec7 100644 --- a/chainio/clients/builder.go +++ b/chainio/clients/builder.go @@ -104,7 +104,7 @@ func BuildAll( } // creating EL clients: Reader, Writer and EigenLayer Contract Bindings - elChainReader, elChainWriter, elContractBindings, err := elcontracts.BuildClients( + elChainReader, elChainWriter, elContractBindings, err := elcontracts.BuildClientsFromConfig( elcontracts.Config{ DelegationManagerAddress: avsRegistryContractBindings.DelegationManagerAddr, AvsDirectoryAddress: avsRegistryContractBindings.AvsDirectoryAddr, diff --git a/chainio/clients/elcontracts/wire_builder.go b/chainio/clients/elcontracts/wire_builder.go index b4379fb8..47a4075e 100644 --- a/chainio/clients/elcontracts/wire_builder.go +++ b/chainio/clients/elcontracts/wire_builder.go @@ -42,12 +42,12 @@ type ClientsAndBindings struct { ContractBindings *ContractBindings } -func BuildClientsFromConfig( +func buildClientsFromConfig( cfg Config, ethClient eth.Client, + txMgr txmgr.TxManager, logger logging.Logger, eigenMetrics *metrics.EigenMetrics, - txMgr txmgr.TxManager, ) (*ClientsAndBindings, error) { wire.Build( NewBindingsFromConfig, @@ -59,3 +59,17 @@ func BuildClientsFromConfig( ) return &ClientsAndBindings{}, nil } + +func BuildClientsFromConfig( + cfg Config, + ethClient eth.Client, + txMgr txmgr.TxManager, + logger logging.Logger, + eigenMetrics *metrics.EigenMetrics, +) (*ChainReader, *ChainWriter, *ContractBindings, error) { + clientsAndBindings, err := buildClientsFromConfig(cfg, ethClient, txMgr, logger, eigenMetrics) + if err != nil { + return nil, nil, nil, err + } + return clientsAndBindings.ChainReader, clientsAndBindings.ChainWriter, clientsAndBindings.ContractBindings, nil +} diff --git a/chainio/clients/elcontracts/wire_gen.go b/chainio/clients/elcontracts/wire_gen.go index dc5861a3..454de766 100644 --- a/chainio/clients/elcontracts/wire_gen.go +++ b/chainio/clients/elcontracts/wire_gen.go @@ -34,7 +34,7 @@ func NewWriterFromConfig(cfg Config, ethClient eth.Client, logger logging.Logger return chainWriter, nil } -func BuildClientsFromConfig(cfg Config, ethClient eth.Client, logger logging.Logger, eigenMetrics *metrics.EigenMetrics, txMgr txmgr.TxManager) (*ClientsAndBindings, error) { +func buildClientsFromConfig(cfg Config, ethClient eth.Client, txMgr txmgr.TxManager, logger logging.Logger, eigenMetrics *metrics.EigenMetrics) (*ClientsAndBindings, error) { contractBindings, err := NewBindingsFromConfig(cfg, ethClient, logger) if err != nil { return nil, err @@ -56,3 +56,17 @@ type ClientsAndBindings struct { ChainWriter *ChainWriter ContractBindings *ContractBindings } + +func BuildClientsFromConfig( + cfg Config, + ethClient eth.Client, + txMgr txmgr.TxManager, + logger logging.Logger, + eigenMetrics *metrics.EigenMetrics, +) (*ChainReader, *ChainWriter, *ContractBindings, error) { + clientsAndBindings, err := buildClientsFromConfig(cfg, ethClient, txMgr, logger, eigenMetrics) + if err != nil { + return nil, nil, nil, err + } + return clientsAndBindings.ChainReader, clientsAndBindings.ChainWriter, clientsAndBindings.ContractBindings, nil +}