From 0d79bd59105a5b3e81063b8a292ce46a58790113 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Tue, 7 Nov 2023 23:18:16 -0400 Subject: [PATCH] fixed linter errors --- chainio/constructor/constructor.go | 4 ++++ chainio/utils/bindings.go | 12 ++++++++++++ metrics/eigenmetrics_example_test.go | 2 -- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/chainio/constructor/constructor.go b/chainio/constructor/constructor.go index 785a2efd..5c64e9c2 100644 --- a/chainio/constructor/constructor.go +++ b/chainio/constructor/constructor.go @@ -128,6 +128,10 @@ func (config *Config) buildElClients( ethHttpClient, logger, ) + if err != nil { + logger.Error("Failed to create EigenlayerContractBindings", "err", err) + return nil, nil, nil, err + } // get the Reader for the EL contracts elChainReader := elcontracts.NewELChainReader( diff --git a/chainio/utils/bindings.go b/chainio/utils/bindings.go index 084fb26a..39b54d14 100644 --- a/chainio/utils/bindings.go +++ b/chainio/utils/bindings.go @@ -119,6 +119,10 @@ func NewAVSRegistryContractBindings( } stakeregistryAddr, err := contractBlsRegistryCoordinator.StakeRegistry(&bind.CallOpts{}) + if err != nil { + logger.Error("Failed to fetch StakeRegistry address", "err", err) + return nil, err + } contractStakeRegistry, err := stakeregistry.NewContractStakeRegistry( stakeregistryAddr, ethclient, @@ -129,6 +133,10 @@ func NewAVSRegistryContractBindings( } blsPubkeyRegistryAddr, err := contractBlsRegistryCoordinator.BlsPubkeyRegistry(&bind.CallOpts{}) + if err != nil { + logger.Error("Failed to fetch BLSPubkeyRegistry address", "err", err) + return nil, err + } contractBlsPubkeyRegistry, err := blspubkeyregistry.NewContractBLSPubkeyRegistry( blsPubkeyRegistryAddr, ethclient, @@ -139,6 +147,10 @@ func NewAVSRegistryContractBindings( } blsPubkeyCompendiumAddr, err := contractBlsPubkeyRegistry.PubkeyCompendium(&bind.CallOpts{}) + if err != nil { + logger.Error("Failed to fetch BLSPublicKeyCompendium address", "err", err) + return nil, err + } contractBlsPubkeyCompendium, err := blspubkeycompendium.NewContractBLSPublicKeyCompendium( blsPubkeyCompendiumAddr, ethclient, diff --git a/metrics/eigenmetrics_example_test.go b/metrics/eigenmetrics_example_test.go index af1a18fc..8d5166ef 100644 --- a/metrics/eigenmetrics_example_test.go +++ b/metrics/eigenmetrics_example_test.go @@ -26,8 +26,6 @@ func ExampleEigenMetrics() { if err != nil { panic(err) } - // reg := prometheus.NewRegistry() - // eigenMetrics := metrics.NewEigenMetrics("exampleAvs", ":9090", reg, logger) chainioConfig := constructor.Config{ EcdsaPrivateKeyString: "0x0",