-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix solver competition loading for multiple winners #3049
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nice tests. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
WITH competition AS ( | ||
SELECT sc.id | ||
FROM solver_competitions sc | ||
JOIN settlements s ON sc.id = s.auction_id | ||
WHERE s.tx_hash = $1 | ||
) | ||
SELECT sc.json, sc.id, COALESCE(ARRAY_AGG(s.tx_hash) FILTER (WHERE s.tx_hash IS NOT NULL), '{}') AS tx_hashes | ||
FROM solver_competitions sc | ||
JOIN settlements s ON sc.id = s.auction_id | ||
WHERE s.tx_hash = $1 | ||
WHERE sc.id = (SELECT id FROM competition) | ||
GROUP BY sc.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, I thought the query could be simplified, but it looks like this is not the case.
Description
A breaking change of SolverCompetitionAPI, which now potentially returns more than 1 transaction associated with the competition (will notify all teams on slack soon).
Resolves one of the points from #2830 (comment)
Changes
Vec<TransactionHash>
, instead ofOption<TransactionHash>
How to test
Refactored unit test to prove it works and that no regression issues were introduced.
Existing e2e test for solver competition proves that competition is properly returned.