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: Multiple Block Ranges #1384

Open
wants to merge 14 commits into
base: v0.9
Choose a base branch
from

Conversation

khaidarkairbek
Copy link
Collaborator

Relates to #1377. Handles multiple block ranges by pointing each resolved block range to its separate source.

@khaidarkairbek khaidarkairbek marked this pull request as ready for review January 9, 2025 07:34
import { buildLogFactory } from "./factory.js";

type BlockRange = [number | "latest", number | "realtime" | "latest"];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you add some comments here about what each of these values mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added in the last commit

Comment on lines 70 to 83
const rawBlockRanges: [number, number | "realtime"][] =
blocks === undefined || blocks.length === 0
? [[0, "realtime"]]
: blocks.every((b) => Array.isArray(b))
? blocks.map(([fromBlock, toBlock]) => [
fromBlock === "latest" ? latest : fromBlock,
toBlock === "latest" ? latest : toBlock,
])
: [
[
blocks[0] === "latest" ? latest : blocks[0],
blocks[1] === "latest" ? latest : blocks[1],
],
];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like there is a type error in here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed it

Comment on lines 154 to 156
const latest: Hex = await network.transport({ chain }).request({
method: "eth_blockNumber",
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this request happen even if there are no tags used in blocks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed it

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