Skip to content

Commit

Permalink
remove panics
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Jun 23, 2024
1 parent a0df8de commit 6e4a4f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chainio/clients/avsregistry/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6e4a4f3

Please sign in to comment.