Skip to content
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

New Tenscan APIs #1879

Merged
merged 22 commits into from
Apr 30, 2024
Merged

New Tenscan APIs #1879

merged 22 commits into from
Apr 30, 2024

Conversation

badgersrus
Copy link
Contributor

@badgersrus badgersrus commented Apr 12, 2024

Why this change is needed

Tenscan UI Improvements

API changes described here

What changes were made as part of this PR

  • Get rollup listing /items/rollups/
  • Get batch listing v2 /items/v2/batches/
    • This path can be switched to /items/batches in the same PR that has the new UI but just for backwards compatibility and testing both are here
  • Get rollup by hash/items/rollup/:hash
  • Get batches in rollup /items/rollup/:hash/batches/
  • Get transactions in batch /items/batch/:fullHash/transactions/
  • Get batch by height /items/batch/height/:height
  • Get rollup by batch sequence /items/rollup/batch/:seq
  • Get TX by hash /items/transaction/:hash

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

@badgersrus badgersrus requested a review from tudor-malene April 26, 2024 09:05
Copy link
Collaborator

@tudor-malene tudor-malene left a comment

Choose a reason for hiding this comment

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

Nice one, Will.
LGTM (minor improvement suggested)

selectLatestRollup = "SELECT ext_rollup FROM rollup_host ORDER BY time_stamp DESC LIMIT 1"
selectExtRollup = "SELECT ext_rollup from rollup_host r"
selectLatestRollup = "SELECT ext_rollup FROM rollup_host ORDER BY time_stamp DESC LIMIT 1"
selectRollupBatches = "SELECT b.sequence, b.hash, b.full_hash, b.height, b.ext_batch FROM rollup_host r JOIN batch_host b ON r.start_seq <= b.sequence AND r.end_seq >= b.sequence"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be good to order by b.height desc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot, made the change. Cheers

@badgersrus badgersrus merged commit ac1b90a into main Apr 30, 2024
2 checks passed
@badgersrus badgersrus deleted the will/tenscan_api branch April 30, 2024 10:34
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