-
Notifications
You must be signed in to change notification settings - Fork 1
feat(eigen-cllient-extra-features): Address more comments #386
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(eigen-cllient-extra-features): Address more comments #386
Conversation
let response = reqwest::get(url) | ||
.await | ||
.map_err(|e| VerificationError::LinkError(e.to_string())) | ||
.unwrap(); |
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 unwrap should not be here
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.
Removed all unwrap
s left over on the file, I'm unsure about this one tho:
impl PointFile {
fn path(&self) -> &str {
match self {
PointFile::Temp(file) => file.path().to_str().unwrap_or_default(), // Safe unwrap because NamedTempFile guarantees a valid path
PointFile::Path(path) => path,
}
}
}
Should we keep the unwrap
with the comment, use unwrap_or_default
or do anything different?
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 think it's better to change the function's return type to std::Path
since what you want is a path.
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.
see comments
@@ -316,9 +287,9 @@ impl RawEigenClient { | |||
|
|||
match disperser::BlobStatus::try_from(resp.status)? { | |||
disperser::BlobStatus::Processing | disperser::BlobStatus::Dispersing => Ok(None), | |||
disperser::BlobStatus::Failed => Err(anyhow::anyhow!("Blob dispatch failed")), | |||
disperser::BlobStatus::Failed => anyhow::bail!("Blob dispatch failed"), |
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.
we should not use anyhow here.
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 think it is better to have a rich error type that can be matched and handled appropriately by the caller of this module.
Anyhow is more for CLIs, end-user errors.
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 think a good approach would be to apply the same type of error handling as we are doing now with the external client library, which uses thiserror
, do you agree?
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.
yes
@@ -331,17 +302,12 @@ impl RawEigenClient { | |||
let blob_info = resp.info.context("No blob header in response")?; | |||
Ok(Some(blob_info)) | |||
} | |||
|
|||
_ => Err(anyhow::anyhow!("Received unknown blob status")), | |||
_ => anyhow::bail!("Received unknown blob status"), |
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.
remove anyhow usage
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.
same as before.
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.
Ditto last comment
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.
yes
We should probably add |
LGTM , I approved provided you fix the remaining ones |
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.
Reviewed latest changes. LGTM
0575785
into
eigen-client-extra-features
What ❔
Why ❔
Checklist
zkstack dev fmt
andzkstack dev lint
.