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

Implement the endpoint GET /v2/block-headers #1638

Merged
merged 19 commits into from
Dec 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Lints
agodnic committed Nov 21, 2024
commit 0fa808b442679c8c874787d5912c1fcd4a277984
2 changes: 1 addition & 1 deletion api/handlers.go
Original file line number Diff line number Diff line change
@@ -1002,7 +1002,7 @@ func (si *ServerImplementation) LookupTransaction(ctx echo.Context, txid string)
return ctx.JSON(http.StatusOK, response)
}

// SearchForBlocks returns block headers matching the provided parameters
// SearchForBlockHeaders returns block headers matching the provided parameters
// (GET /v2/blocks)
func (si *ServerImplementation) SearchForBlockHeaders(ctx echo.Context, params generated.SearchForBlockHeadersParams) error {
// Validate query parameters
2 changes: 1 addition & 1 deletion idb/postgres/postgres.go
Original file line number Diff line number Diff line change
@@ -1068,7 +1068,7 @@ func (db *IndexerDb) yieldBlockHeaders(ctx context.Context, tx pgx.Tx, bf idb.Bl
db.yieldBlocksThreadSimple(rows, out)
}

// Blocks is part of idb.IndexerDB
// BlockHeaders is part of idb.IndexerDB
func (db *IndexerDb) BlockHeaders(ctx context.Context, bf idb.BlockFilter) (<-chan idb.BlockRow, uint64) {
out := make(chan idb.BlockRow, 1)