From 953904db5b099a94f1bd85657cb1588361a9aa02 Mon Sep 17 00:00:00 2001 From: erhant Date: Wed, 17 Jun 2026 18:05:14 +0300 Subject: [PATCH] chore: docstrings for optional `before` --- src/i_lez_indexer_module.h | 3 +++ src/lez_indexer_module.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/i_lez_indexer_module.h b/src/i_lez_indexer_module.h index 906754c..8e66025 100644 --- a/src/i_lez_indexer_module.h +++ b/src/i_lez_indexer_module.h @@ -36,8 +36,11 @@ public: virtual QString getBlockById(const QString& block_id) = 0; virtual QString getBlockByHash(const QString& hash) = 0; virtual QString getTransaction(const QString& hash) = 0; + // `before` is the optional pagination cursor: a block id to page back from, + // or an empty string to start from the tip. `limit` caps the result count. virtual QString getBlocks(const QString& before, const QString& limit) = 0; virtual QString getLastFinalizedBlockId() = 0; + // `offset` and `limit` are both required (the paging window). virtual QString getTransactionsByAccount( const QString& account_id, const QString& offset, diff --git a/src/lez_indexer_module.cpp b/src/lez_indexer_module.cpp index 60c9352..24e299b 100644 --- a/src/lez_indexer_module.cpp +++ b/src/lez_indexer_module.cpp @@ -389,7 +389,8 @@ QString LezIndexerModule::getBlocks(const QString& before, const QString& limit) return {}; } - // `before` is optional: an empty string means "from the tip". `beforeVal` + // `before` is the optional pagination cursor: an empty string means "from + // the tip", a non-empty value that fails to parse is an error. `beforeVal` // must outlive the call since FfiOption_u64 borrows its address. uint64_t beforeVal = 0; bool hasBefore = false;