chore: docstrings for optional before

This commit is contained in:
erhant 2026-06-17 18:05:14 +03:00
parent bae2daee2c
commit 953904db5b
2 changed files with 5 additions and 1 deletions

View File

@ -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,

View File

@ -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;