From 6e4a4f313b1fdf1f4c25c32761d3d6b7cf2734a7 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Sun, 23 Jun 2024 06:52:57 -0700 Subject: [PATCH] remove panics --- chainio/clients/avsregistry/writer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chainio/clients/avsregistry/writer.go b/chainio/clients/avsregistry/writer.go index 494b304d..703adeca 100644 --- a/chainio/clients/avsregistry/writer.go +++ b/chainio/clients/avsregistry/writer.go @@ -336,16 +336,16 @@ func (w *AvsRegistryChainWriter) RegisterOperator( var operatorToAvsRegistrationSigSalt [32]byte _, err = rand.Read(operatorToAvsRegistrationSigSalt[:]) if err != nil { - panic(err) + return nil, err } curBlockNum, err := w.ethClient.BlockNumber(context.Background()) if err != nil { - panic(err) + return nil, err } curBlock, err := w.ethClient.BlockByNumber(context.Background(), big.NewInt(int64(curBlockNum))) if err != nil { - panic(err) + return nil, err } sigValidForSeconds := int64(60 * 60) // 1 hour operatorToAvsRegistrationSigExpiry := big.NewInt(int64(curBlock.Time()) + sigValidForSeconds)