Skip to content

Commit

Permalink
hotfix CountBlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Sep 9, 2024
1 parent 34e816b commit 1eadd31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vochain/indexer/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions vochain/indexer/migrations/0018_dummy.sql
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 1eadd31

Please sign in to comment.