From 5498785e940cb8599ec8f6ac8f9a0dc14217beaa Mon Sep 17 00:00:00 2001 From: Jian Xiao Date: Wed, 11 Dec 2024 23:32:02 +0000 Subject: [PATCH] fix --- disperser/dataapi/operator_handler.go | 6 +++--- disperser/dataapi/server.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/disperser/dataapi/operator_handler.go b/disperser/dataapi/operator_handler.go index bd66e0fea..5335a7b29 100644 --- a/disperser/dataapi/operator_handler.go +++ b/disperser/dataapi/operator_handler.go @@ -112,11 +112,11 @@ func (oh *operatorHandler) getOperatorsStake(ctx context.Context, operatorId str func (s *operatorHandler) scanOperatorsHostInfo(ctx context.Context) (*SemverReportResponse, error) { currentBlock, err := s.indexedChainState.GetCurrentBlockNumber() if err != nil { - return nil, fmt.Errorf("failed to fetch current block number - %s", err) + return nil, fmt.Errorf("failed to fetch current block number: %s", err) } operators, err := s.indexedChainState.GetIndexedOperators(context.Background(), currentBlock) if err != nil { - return nil, fmt.Errorf("failed to fetch indexed operator info - %s", err) + return nil, fmt.Errorf("failed to fetch indexed operator info: %s", err) } // check operator socket registration against the indexed state @@ -134,7 +134,7 @@ func (s *operatorHandler) scanOperatorsHostInfo(ctx context.Context) (*SemverRep s.logger.Info("Queried indexed operators", "operators", len(operators), "block", currentBlock) operatorState, err := s.chainState.GetOperatorState(context.Background(), currentBlock, []core.QuorumID{0, 1, 2}) if err != nil { - return nil, fmt.Errorf("failed to fetch operator state - %s", err) + return nil, fmt.Errorf("failed to fetch operator state: %s", err) } nodeInfoWorkers := 20 diff --git a/disperser/dataapi/server.go b/disperser/dataapi/server.go index 722f05a9c..eb6ee4f7e 100644 --- a/disperser/dataapi/server.go +++ b/disperser/dataapi/server.go @@ -733,7 +733,7 @@ func (s *server) OperatorsStake(c *gin.Context) { operatorsStakeResponse, err := s.operatorHandler.getOperatorsStake(c.Request.Context(), operatorId) if err != nil { s.metrics.IncrementFailedRequestNum("OperatorsStake") - errorResponse(c, fmt.Errorf("failed to get operator stake - %s", err)) + errorResponse(c, fmt.Errorf("failed to get operator stake: %w", err)) return }