-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update web3.storage API #70
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.
I don't see any obvious problem. I have a few questions and discussion points, but none of that is blocking this PR from being merged & deployed.
This comment was marked as outdated.
This comment was marked as outdated.
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 take that back - I think there is a bug.
bin/spark-evaluate.js
Outdated
@@ -47,7 +47,7 @@ const ieContract = new ethers.Contract( | |||
) | |||
const ieContractWithSigner = ieContract.connect(signer) | |||
const web3Storage = new Web3Storage({ token: WEB3_STORAGE_API_TOKEN }) | |||
const fetchMeasurements = (cid) => fetchMeasurementsViaClient(web3Storage, cid) | |||
const fetchMeasurements = (cid) => fetchMeasurementsTrustless(web3Storage, cid) |
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 looks like a bug to me, fetchMeasurementsTrustless accepts a single argument:
export const fetchMeasurementsTrustless = async cid => {
Can you please add some tests for this function?
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 spotted it as well. How do you propose we test this? This is the binary entry point 🤔
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.
How do you propose we test this? This is the binary entry point 🤔
Ah, you are right. We haven't figured out how to automatically test our binary entry points yet, and I guess we have bigger fish to fry.
How about testing this manually - run the service locally (via npm start?), wait for the first measurement to be committed on the chain, and check it's correctly fetched.
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 Typescript is the most exciting option for bin script validation. Will run manually though for now
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.
LGTM with few suggestions to consider.
spark-api
PR Integrate new web3.storage. Closes #141 spark-api#151Files are now published to the root entry of the CID (vs at
/measurements.json
), therefore this PR and thespark-api
PR need to be merged together.Links: