-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add external Wasm modules #1232
Conversation
.context("Couldn't parse URL")?; | ||
|
||
debug!("Downloading module from: {}", url); | ||
let response = reqwest::get(url) |
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 guess at some point we need to have a cache of modules, since this will re-download them every time, perhaps add a TODO + issue?
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.
Added an issue #1240
Fix URL Fix hash Change after review Fix Cargo.lock Change after review Change after review
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.
neat
fn get_sha256(data: &[u8]) -> String { | ||
let mut hasher = Sha256::new(); | ||
hasher.update(data); | ||
hex::encode(hasher.finalize().as_slice().to_vec()) |
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.
Not sure if this works
hex::encode(hasher.finalize().as_slice().to_vec()) | |
hex::encode(hasher.finalize().collect()) |
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.
Finalize returns a GenericArray
and it doesn't have collect
.
|
||
debug!("Downloading module from: {}", url); | ||
// TODO(#1240): Add a Wasm module cache. | ||
let response = reqwest::get(url.clone()) |
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.
Why can url
not be passed by reference?
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.
It's used in .with_context(|| format!("Couldn't download module from {}", url))?;
that moves it in the context of lambda.
Codecov Report
@@ Coverage Diff @@
## main #1232 +/- ##
=======================================
Coverage 31.39% 31.39%
=======================================
Files 61 61
Lines 7521 7521
Branches 3542 3542
=======================================
Hits 2361 2361
Misses 2929 2929
Partials 2231 2231 Continue to review full report at Codecov.
|
Reproducibility Index:
Reproducibility Index diff: |
This change:
oak_config_serializer
Ref #1183
Checklist