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

feat(api): add support for fetching blocks by slot #700

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

PJColombo
Copy link
Member

@PJColombo PJColombo commented Jan 30, 2025

Checklist

  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

It adds a new procedure getBySlot which enables consumers to fetch blocks by their slot. It also exposes the procedure as a REST endpoint.

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

Copy link

vercel bot commented Jan 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blobscan-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 5, 2025 1:05am
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
blobscan-docs ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:05am
blobscan-gnosis ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:05am
blobscan-holesky ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:05am
blobscan-mainnet ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:05am
blobscan-sepolia ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 1:05am

Copy link

changeset-bot bot commented Jan 30, 2025

🦋 Changeset detected

Latest commit: ee895a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@blobscan/api Minor
@blobscan/rest-api-server Patch
@blobscan/web Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@PabloCastellano PabloCastellano left a comment

Choose a reason for hiding this comment

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

Instead of expanding the scope of getByBlockId, why not create a new method?

@luis-herasme
Copy link
Member

Instead of expanding the scope of getByBlockId, why not create a new method?

I prefer this too

@PJColombo
Copy link
Member Author

Instead of expanding the scope of getByBlockId, why not create a new method?

Because I want to expose this procedure as a REST endpoint, having two endpoints that essentially perform the same function—returning a block based on an ID—feels redundant.

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 97.95918% with 4 lines in your changes missing coverage. Please review.

Project coverage is 88.59%. Comparing base (74ee125) to head (ee895a3).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
packages/api/src/routers/block/getByBlockId.ts 90.00% 3 Missing ⚠️
packages/api/src/routers/block/common/queries.ts 99.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #700      +/-   ##
==========================================
+ Coverage   88.50%   88.59%   +0.08%     
==========================================
  Files         160      162       +2     
  Lines       10919    11038     +119     
  Branches     1199     1202       +3     
==========================================
+ Hits         9664     9779     +115     
- Misses       1255     1259       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PJColombo PJColombo merged commit b90971b into main Feb 5, 2025
13 of 14 checks passed
@PJColombo PJColombo deleted the feat/api/fetch-block-by-slot branch February 5, 2025 01:06
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.

3 participants