-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: better conversion error handling in block_hash_ref
#5870
Conversation
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.
this still panics, no?
True, was thinking wrong, this is better now no @mattsse ? |
uint_try_to
method with error handling in block_hash_ref
block_hash_ref
crates/revm/src/database.rs
Outdated
// Attempt to convert U256 to u64 | ||
let block_number = match number.try_into() { | ||
Ok(value) => value, | ||
Err(_) => return Err(Self::Error::ConversionError(number)), | ||
}; |
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.
wasn't there another case of try_into?
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.
Just found another one in the same file which is fixed now. I searched the rest of the codebase and couldn't find any others.
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.
pending @DaniPopes
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Related to #5864 (review)