From d35967ce194990f9d264151a9b8d77cad4eb150d Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Tue, 20 Aug 2024 13:39:41 +0200 Subject: [PATCH] fixup! indexer: new method SearchBlocks --- vochain/indexer/db/blocks.sql.go | 2 +- vochain/indexer/queries/blocks.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vochain/indexer/db/blocks.sql.go b/vochain/indexer/db/blocks.sql.go index f9cb75888..dfb269c6d 100644 --- a/vochain/indexer/db/blocks.sql.go +++ b/vochain/indexer/db/blocks.sql.go @@ -91,7 +91,7 @@ WHERE ( OR (LENGTH(?2) < 64 AND INSTR(LOWER(HEX(hash)), LOWER(?2)) > 0) -- TODO: consider keeping an hash_hex column for faster searches ) - AND (?3 = 0 OR LOWER(HEX(proposer_address)) = LOWER(?3)) + AND (?3 = '' OR LOWER(HEX(proposer_address)) = LOWER(?3)) ) ORDER BY height DESC LIMIT ?5 diff --git a/vochain/indexer/queries/blocks.sql b/vochain/indexer/queries/blocks.sql index efa342bc6..834fd9cec 100644 --- a/vochain/indexer/queries/blocks.sql +++ b/vochain/indexer/queries/blocks.sql @@ -27,7 +27,7 @@ WHERE ( OR (LENGTH(sqlc.arg(hash_substr)) < 64 AND INSTR(LOWER(HEX(hash)), LOWER(sqlc.arg(hash_substr))) > 0) -- TODO: consider keeping an hash_hex column for faster searches ) - AND (sqlc.arg(proposer_address) = 0 OR LOWER(HEX(proposer_address)) = LOWER(sqlc.arg(proposer_address))) + AND (sqlc.arg(proposer_address) = '' OR LOWER(HEX(proposer_address)) = LOWER(sqlc.arg(proposer_address))) ) ORDER BY height DESC LIMIT sqlc.arg(limit)