Skip to content

Commit

Permalink
chore: self-review improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite authored Nov 25, 2024
1 parent 7728ac8 commit 3188f86
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion x/service/keeper/msg_update_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func (k msgServer) UpdateParams(ctx context.Context, req *types.MsgUpdateParams)
}

if err := k.SetParams(ctx, req.Params); err != nil {
logger.Error(fmt.Sprintf("unable to set params: %+v", err))
err = fmt.Errorf("unable to set params: %w", err)
logger.Error(err.Error())
return nil, status.Error(codes.Internal, err.Error())
}

Expand Down
3 changes: 2 additions & 1 deletion x/service/keeper/query_relay_mining_difficulty.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ func (k Keeper) RelayMiningDifficultyAll(ctx context.Context, req *types.QueryAl
pageRes, err := query.Paginate(relayMiningDifficultyStore, req.Pagination, func(key []byte, value []byte) error {
var relayMiningDifficulty types.RelayMiningDifficulty
if err := k.cdc.Unmarshal(value, &relayMiningDifficulty); err != nil {
logger.Error(fmt.Sprintf("unable to unmarshal relayMiningDifficulty with key (hex): %x: %+v", key, err))
err = fmt.Errorf("unable to unmarshal relayMiningDifficulty with key (hex): %x: %w", key, err)
logger.Error(err.Error())
return status.Error(codes.Internal, err.Error())
}

Expand Down
3 changes: 2 additions & 1 deletion x/service/keeper/query_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func (k Keeper) AllServices(ctx context.Context, req *types.QueryAllServicesRequ
pageRes, err := query.Paginate(serviceStore, req.Pagination, func(key []byte, value []byte) error {
var service sharedtypes.Service
if err := k.cdc.Unmarshal(value, &service); err != nil {
logger.Error(fmt.Sprintf("unable to unmarshal service with key (hex): %x: %+v", key, err))
err = fmt.Errorf("unable to unmarshal service with key (hex): %x: %w", key, err)
logger.Error(err.Error())
return status.Error(codes.Internal, err.Error())
}

Expand Down

0 comments on commit 3188f86

Please sign in to comment.