-
Notifications
You must be signed in to change notification settings - Fork 92
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
Replace snafu
with this_error
and remove global error enum
#1823
Conversation
snafu
with this_error
and remove global error enum
60e58d1
to
a3d173e
Compare
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.
Looks good. I left a couple of comments.
u64::from(chain_config.max_block_size) | ||
.try_into() | ||
.map_err(|_| { | ||
<Self as BlockPayload<SeqTypes>>::Error::Custom("cast u64 to usize".to_string()) |
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.
I don't really see the point of Custom
. If we know we have a potential error, why would we not add it to the enum?
On the other hand, I think this can only ever potentially fail on 32 bit architecture, so the failure case would be something like "too large max block size for architecture". But if that is the case, then user would never be able to build payloads, so maybe instead of returning that error we should panic w/ it...?
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.
Yeah, I agree. I'll remove custom and panic here
Ok so #1539 will remain open for now |
This PR:
This PR does not remove snafu dependency completely, as we need to replace snafu with this_error in hotshot query service