-
Notifications
You must be signed in to change notification settings - Fork 105
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: add timestamps parameter #126
Conversation
looking great. thanks for taking this on |
some important edge cases to check:
|
the formatting error gets fixed with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice job. this is looking really good and it will be a very useful feature. I like that you implemented the full parsing grammar in the block style syntax
I think it's ready to merge after the 2 small points I highlighted
Motivation
Be able to filter for data by using a timestamp parameter. Initially this will be a unix timestamp.
Example usage:
cryo logs --timestamps 1700080000:1700090000
Solution
timestamp
toargs.rs
timestamp_to_block_number()
function that gives the nearest block number for a given timestamp.parse_timestamp()
and related functions that parse an inputted timestamp.timestamp_to_block_number()
to be strictly<=
instead of closest block or<=
if two blocks are equidistant.get_latest_block_number()
intoblocks.rs