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

make timestamp numeric #3902

Merged
merged 2 commits into from
Sep 7, 2022
Merged

make timestamp numeric #3902

merged 2 commits into from
Sep 7, 2022

Conversation

mangas
Copy link
Contributor

@mangas mangas commented Sep 5, 2022

No description provided.

@mangas mangas marked this pull request as ready for review September 5, 2022 17:16
Copy link
Contributor

@evaporei evaporei left a comment

Choose a reason for hiding this comment

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

LGTM, but since this is a Scalar value change, perhaps there's something missing, I would be more confident if @lutter takes a look too

Copy link
Collaborator

@lutter lutter left a comment

Choose a reason for hiding this comment

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

Looks good - two comments that should be addressed before merging, but other than that ok.


let radix = if ts.starts_with("0x") { 16 } else { 10 };

u64::from_str_radix(&ts[2..], radix)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't right when the string is base 10 - there we don't want to skip the first two chars

"Timestamp of the block if available, format depends on the chain"
timestamp: String
"Timestamp of the block if available"
timestamp: Int
Copy link
Collaborator

Choose a reason for hiding this comment

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

The comment should also say something about how to interpret that number - maybe add Integer representation of the timestamp stored in blocks for the chain to tell people that we don't do any other processing

@mangas mangas force-pushed the filipe/fix-timestamp-format branch 2 times, most recently from 6ee6a71 to beaaf61 Compare September 6, 2022 21:14
@mangas mangas merged commit 2f9a82d into master Sep 7, 2022
@mangas mangas deleted the filipe/fix-timestamp-format branch September 7, 2022 17:55
kaiwetlesen pushed a commit to kaiwetlesen/graph-node that referenced this pull request Sep 7, 2022
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