Skip to content

Commit

Permalink
refactor: explicit failure of empty socket string
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Nov 26, 2024
1 parent 7714367 commit f73deb2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/eth/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,14 @@ func (t *Reader) GetReservationWindow(ctx context.Context) (uint32, error) {
}

func (t *Reader) GetOperatorSocket(ctx context.Context, operatorId core.OperatorID) (string, error) {
return t.bindings.SocketRegistry.GetOperatorSocket(&bind.CallOpts{
socket, err := t.bindings.SocketRegistry.GetOperatorSocket(&bind.CallOpts{
Context: ctx,
}, [32]byte(operatorId))
if err != nil {
return "", err
}
if socket == "" {
return "", errors.New("operator socket string is empty, check operator with id: " + operatorId.Hex())
}
return socket, nil
}

0 comments on commit f73deb2

Please sign in to comment.