From 2d80761974bf03457af96cccaa96b6d985397bcf Mon Sep 17 00:00:00 2001 From: Owen Kellogg Date: Fri, 15 Sep 2023 21:49:50 +0200 Subject: [PATCH] Correctly join proofs in sql when origin includes _vout --- src/rankings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rankings.ts b/src/rankings.ts index f0a40d6..23264d5 100644 --- a/src/rankings.ts +++ b/src/rankings.ts @@ -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