Skip to content
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

Pres submission test vectors #109

Merged
merged 5 commits into from
Jan 26, 2024
Merged

Pres submission test vectors #109

merged 5 commits into from
Jan 26, 2024

Conversation

nitro-neal
Copy link
Contributor

No description provided.

Copy link
Member

@decentralgabe decentralgabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great stuff!

@@ -0,0 +1,150 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was under the impression that we want to have 1 JSON per test vector, so we can do something like

read 1 test vector file -> parse 1 JSON object -> testCase(JSON)

with this structure, how do you parse out and use for multiple test cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the web5-* we have formatting like this:
https://github.com/TBD54566975/web5-spec/blob/main/test-vectors/README.md

you take the array of test vectors, they will all attempt to parse in the object and run the feature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will want to consolidate and have tbdex be the same, otherwise we will have 100s of json files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually after discussion with Diane it makes sense to leave tbdex vectors the way they are

@@ -0,0 +1,150 @@
{
"description": "did:dht create",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to double check that you wanted to include did:dht test vectors with this PR. Didn't see it mentioned in the PR title or description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup i found that these were not included from the old repo so I threw them in

},
{
"description":"valid presentation definition 2",
"input":{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Input is slightly different than the other test vectors for presentation_exchange. Worth adding to the README?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is the input different?

Copy link
Collaborator

@amika-sq amika-sq Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input for these vectors is presentationDefinition (and presentationSubmission in the validate_submisstion.json vector below), and there's no output. Current README specifies only the input/output for CreatePresentationFromCredentials, which has completely different input/output.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right those READMEs need to be updated,

it basically needs to comply with the parent readme - https://github.com/TBD54566975/web5-spec/blob/main/test-vectors/README.md

@@ -0,0 +1,434 @@
{
"description":"Validate definition",
"vectors":[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each of these vectors don't have an output, but they do specify that there should/shouldn't be errors. Does that mean the validation should pass? If so, should the output be true to make that clearer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right so these are testing a function called

PresentationExchange.validateDefinition()

so if errors is false, then this should be a valid definition. (and not throw)

if errors is true, then this should be an invalid definition json (and throw)

Copy link
Collaborator

@amika-sq amika-sq Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@frankhinek I'd like to get your thoughts on this approach. I know that in the crypto test vectors you added (ex: crypto_edd25519/verify.json), we also have a verify vector, with the output of true/false accordingly.

I think in some languages, it makes sense to return a boolean value for validate/verify operations, in addition to producing an error when things go horribly wrong. Wondering if we can capture that somehow.

Or maybe I'm way off, and validate/verify are completely separate concepts to others. I've always thought of them as similar concepts in my head 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea this has been the point of discussion lately,
Across the sdks we have some verify functions that return true / false, other that throw and exception or not, and others that give a Results object

I'm capturing requirements here: and then I hope we can come to consensus on a global "Results" object (or not) to be used across all these verify functions - TBD54566975/web5-js#386

@@ -0,0 +1,243 @@
{
"description":"Validate submission",
"vectors":[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These vectors also don't have output. What would an "errors": false represent for these vectors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output is optional, errors false means that this input does not throw an exception

Copy link
Collaborator

@amika-sq amika-sq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that my comments in https://github.com/TBD54566975/web5-spec/pull/109/files#r1467053239 are blocking at all, just wanted to continue the thread a little bit. Maybe there's something there, maybe not.

👍 from me for bringing it

@nitro-neal nitro-neal merged commit c778d31 into main Jan 26, 2024
4 checks passed
@nitro-neal nitro-neal deleted the pres-submission-test-vectors branch January 26, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants