Skip to content

Commit

Permalink
[Easy] Make legacy solver competition data parseable (#2209)
Browse files Browse the repository at this point in the history
# Description
We've been seeing error message alerts when loading very competition
data from the db. This is expected (cf. #2143) however it is pertubating
on-call. The alternative would be to downgrade the warning to an error,
however I feel we may be losing signal of future breakages in this case.

# Changes
<!-- List of detailed changes (how the change is accomplished) -->

- [x] use serde[(default)] where possible
- [x] for score, which is a flattened enum that doesn't support defaults
(cf. this [open issue](serde-rs/serde#1626)),
we go back to making it an optional. This is fine since with
rank-by-surplus we likely no longer need mandatory score anymore
anyways.

## How to test
Unit test for old transactions data
  • Loading branch information
fleupold authored Dec 25, 2023
1 parent 23148dd commit d8ab692
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/autopilot/src/run_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl RunLoop {
let mut settlement = SolverSettlement {
solver: participant.driver.name.clone(),
solver_address: participant.solution.account,
score: Score::Solver(participant.solution.score.get()),
score: Some(Score::Solver(participant.solution.score.get())),
ranking: solutions.len() - index,
orders: participant
.solution
Expand Down
Loading

0 comments on commit d8ab692

Please sign in to comment.