Skip to content

Commit

Permalink
Correctly join proofs in sql when origin includes _vout
Browse files Browse the repository at this point in the history
  • Loading branch information
21e8sl committed Sep 15, 2023
1 parent 34d1ed7 commit 2d80761
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rankings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function rankSmartContractsByCumulativeDifficulty(contractType: string, st
const query = `
SELECT s.origin, SUM(p.difficulty) AS totalDifficulty
FROM "SmartContracts" AS s
INNER JOIN boost_job_proofs AS p ON p.content LIKE CONCAT(s.origin, '%')
INNER JOIN boost_job_proofs AS p ON p.content = SUBSTRING(s.origin FOR LENGTH(p.content))
AND s.class_name = :contractType
GROUP BY s.origin
Expand Down

0 comments on commit 2d80761

Please sign in to comment.