feat: promote accepted proposals from API

This commit is contained in:
Josh Creek
2026-09-01 10:29:41 +01:00
parent e0ba6c6ead
commit 03ff8e485e
16 changed files with 270 additions and 49 deletions
+4 -1
View File
@@ -10,7 +10,7 @@ func testFormation(t *testing.T, count int) MatchFormation {
now := time.Unix(1000, 0)
players := make([]Candidate, count)
for i := range players {
players[i] = Candidate{TicketID: string(rune('a' + i)), PlayerID: string(rune('p' + i)), Rating: 1500, EnqueuedAt: now, PredictedRTT: map[string]float64{"EU": 40}}
players[i] = Candidate{TicketID: string(rune('a' + i)), PlayerID: string(rune('p' + i)), ProtocolVersion: 1, Rating: 1500, EnqueuedAt: now, PredictedRTT: map[string]float64{"EU": 40}}
}
selection, err := SelectCandidates(players[0], players[1:], count, now)
if err != nil {
@@ -31,6 +31,9 @@ func TestPrepareProposalBuildsCasualLineupBeforeCreatingProposal(t *testing.T) {
if prepared.Proposal.Playlist != Casual || len(prepared.Proposal.Participants) != 2 || len(prepared.CasualLineup) != 6 {
t.Fatalf("prepared casual proposal = %+v", prepared)
}
if prepared.Proposal.Region != "EU" || prepared.Proposal.Protocol != 1 || prepared.Proposal.Participants[0].Slot == prepared.Proposal.Participants[1].Slot || prepared.Proposal.Participants[0].Team == prepared.Proposal.Participants[1].Team {
t.Fatalf("prepared proposal did not retain deterministic topology: %+v", prepared.Proposal)
}
humans := 0
teams := map[int]bool{}
for _, slot := range prepared.CasualLineup {