Skip to content

Check tx index state when trade lookups are empty#76

Closed
alastairong1 wants to merge 1 commit into
implement-trades-tx-hashfrom
fix-trades-tx-index-state
Closed

Check tx index state when trade lookups are empty#76
alastairong1 wants to merge 1 commit into
implement-trades-tx-hashfrom
fix-trades-tx-index-state

Conversation

@alastairong1
Copy link
Copy Markdown
Contributor

Summary

  • keep the existing direct transaction trade lookup in implement-trades-tx-hash
  • add an explicit transaction index-state check when that lookup returns no trades
  • return 202 not yet indexed only when the transaction is still missing from the index, otherwise keep 404 for indexed transactions with no trades

Why

The base branch already uses a direct transaction lookup, so the full lookup speedup from albionlabs/albion.rest.api is not needed here. The remaining gap is correctness: the route documents a 202 response for not-yet-indexed transactions, but an empty direct lookup currently falls through to 404.

Validation

  • local cargo fmt ran successfully
  • full cargo test/cargo check could not be completed in this clone because the nested rain.orderbook workspace is missing generated contract artifacts (out/...json) required by its bindings build

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 4, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 37dab010-6b06-418f-a745-ed033d1e9980

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-trades-tx-index-state

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alastairong1
Copy link
Copy Markdown
Contributor Author

PR #50 already handles NotYetIndexed/202 via RaindexError::TradesIndexingTimeout mapping. Closing in favor of that approach.

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.

1 participant