From 1eadd313b4897c457d79edf0ad2be734df2a8f6e Mon Sep 17 00:00:00 2001 From: Gui Iribarren Date: Mon, 9 Sep 2024 18:05:51 +0200 Subject: [PATCH] hotfix CountBlocks --- vochain/indexer/block.go | 6 +++++- vochain/indexer/migrations/0018_dummy.sql | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 vochain/indexer/migrations/0018_dummy.sql diff --git a/vochain/indexer/block.go b/vochain/indexer/block.go index 59cdc4d54..9987e9543 100644 --- a/vochain/indexer/block.go +++ b/vochain/indexer/block.go @@ -85,7 +85,11 @@ func (idx *Indexer) BlockList(limit, offset int, chainID, hash, proposerAddress // CountBlocks returns how many blocks are indexed. func (idx *Indexer) CountBlocks() (uint64, error) { results, err := idx.readOnlyQuery.SearchBlocks(context.TODO(), indexerdb.SearchBlocksParams{ - Limit: 1, + ChainID: "", + HashSubstr: "", + ProposerAddress: "", + Offset: 0, + Limit: 1, }) if err != nil { return 0, err diff --git a/vochain/indexer/migrations/0018_dummy.sql b/vochain/indexer/migrations/0018_dummy.sql new file mode 100644 index 000000000..358e65d31 --- /dev/null +++ b/vochain/indexer/migrations/0018_dummy.sql @@ -0,0 +1,5 @@ +-- +goose Up +-- intentionally does nothing + +-- This is a no-op command in SQLite, used just to have a valid SQL statement. +SELECT 1;