Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
ze97286 committed May 7, 2024
1 parent 3ad15f4 commit cdecf06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 0 additions & 5 deletions datanode/api/trading_data_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,18 +298,15 @@ func (t *TradingDataServiceV2) ListGamePartyScore(ctx context.Context, req *v2.L
partyIDs := make([]entities.PartyID, 0, len(req.Filter.PartyIds))
for _, pid := range req.Filter.PartyIds {
partyIDs = append(partyIDs, entities.PartyID(pid))

}
teamIDs := make([]entities.TeamID, 0, len(req.Filter.TeamIds))
for _, tid := range req.Filter.TeamIds {
teamIDs = append(teamIDs, entities.TeamID(tid))

}

gameIDs := make([]entities.GameID, 0, len(req.Filter.GameIds))
for _, gid := range req.Filter.GameIds {
gameIDs = append(gameIDs, entities.GameID(gid))

}

partyScores, pageInfo, err := t.gameScoreService.ListPartyScores(
Expand Down Expand Up @@ -342,13 +339,11 @@ func (t *TradingDataServiceV2) ListGameTeamScore(ctx context.Context, req *v2.Li
teamIDs := make([]entities.TeamID, 0, len(req.Filter.TeamIds))
for _, tid := range req.Filter.TeamIds {
teamIDs = append(teamIDs, entities.TeamID(tid))

}

gameIDs := make([]entities.GameID, 0, len(req.Filter.GameIds))
for _, gid := range req.Filter.GameIds {
gameIDs = append(gameIDs, entities.GameID(gid))

}

teamScores, pageInfo, err := t.gameScoreService.ListTeamScores(
Expand Down
9 changes: 5 additions & 4 deletions datanode/gateway/graphql/game_scores_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import (
v1 "code.vegaprotocol.io/vega/protos/vega/events/v1"
)

type gamePartyScoresResolver VegaResolverRoot
type gameTeamScoresResolver VegaResolverRoot
type (
gamePartyScoresResolver VegaResolverRoot
gameTeamScoresResolver VegaResolverRoot
)

func (g *gamePartyScoresResolver) EpochID(_ context.Context, obj *v1.GamePartyScore) (int, error) {
return int(obj.Epoch), nil
Expand All @@ -36,8 +38,7 @@ func (g *gamePartyScoresResolver) Rank(_ context.Context, obj *v1.GamePartyScore
if obj.Rank == nil {
return nil, nil
}
var rank int
rank = int(*obj.Rank)
rank := int(*obj.Rank)
return &rank, nil
}

Expand Down
1 change: 1 addition & 0 deletions datanode/sqlstore/game_scores_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"code.vegaprotocol.io/vega/datanode/entities"
"code.vegaprotocol.io/vega/datanode/sqlstore"
"code.vegaprotocol.io/vega/libs/num"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down

0 comments on commit cdecf06

Please sign in to comment.