Skip to content

fix: return waitForIndexer when latest lastValid is reached #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented Jun 2, 2025

Proposed Changes

Fix for #363

Basically avoids waiting for 20 seconds once it becomes impossible for the transaction to get indexed

@joe-p joe-p requested a review from Copilot June 2, 2025 15:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a fix for #363 by ensuring that waitForIndexer returns as soon as the last valid round is reached, avoiding an unnecessary 20-second wait.

  • Introduces a new private helper method (_pushTxn) to update the _latestLastValidRound and log transaction IDs.
  • Modifies logRawTransaction to use _pushTxn for both single and multiple transactions.
  • Updates waitForIndexer to catch lookup errors and conditionally check the last valid round, and refreshes documentation accordingly.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/testing/transaction-logger.ts Refactored transaction logging and indexer waiting logic.
docs/code/classes/testing.TransactionLogger.md Updated documentation to include new private members and methods.

// If that round exists, then we know indexer is caught up
if (this._latestLastValidRound) {
await indexer.lookupBlock(this._latestLastValidRound).do()
console.debug(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.debug(
Config.getLogger().debug(

Will also need the Config import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants