-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support multi status entries #40
Conversation
Signed-off-by: Patrick <[email protected]>
Signed-off-by: Patrick <[email protected]>
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, and excellent work just have a few little concerns and some javascript related comments.
…facts Signed-off-by: Patrick <[email protected]>
Signed-off-by: Patrick <[email protected]>
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 provided the typos can be fixed.
tests/10-issue.js
Outdated
statusEntry.should.have.own.property( | ||
'statusMessage'); | ||
} else { | ||
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { |
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.
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { | |
if(statusEntry === statusEntries[statusEntries.length - 1]) { |
tests/10-issue.js
Outdated
an('array').length.should.be. | ||
equal(statusEntry.statusSize); | ||
} else { | ||
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { |
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.
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { | |
if(statusEntry === statusEntries[statusEntries.length - 1]) { |
tests/10-issue.js
Outdated
statusEntry.statusMessage.should.be. | ||
an('array').length.should.be. | ||
equal(statusEntry.statusSize, | ||
'Expected statusMessage lenght to be equal to ' + |
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.
'Expected statusMessage lenght to be equal to ' + | |
'Expected statusMessage length to be equal to ' + |
tests/10-issue.js
Outdated
'Expected statusMessage lenght to be equal to ' + | ||
'statusSize.'); | ||
} else { | ||
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { |
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.
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { | |
if(statusEntry === statusEntries[statusEntries.length - 1]) { |
tests/10-issue.js
Outdated
statusEntry.should.have.own.property( | ||
'statusMessage'); | ||
} else { | ||
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { |
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.
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { | |
if(statusEntry === statusEntries[statusEntries.length - 1]) { |
tests/10-issue.js
Outdated
'be processed as 1.', | ||
async function() { | ||
this.test.link = 'https://www.w3.org/TR/vc-bitstring-status-list/#:~:text=If%20statusSize%20is%20not%20present%20as%20a%20property%20of%20the%20credentialStatus%2C%20then%20statusSize%20MUST%20be%20processed%20as%201.'; | ||
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { |
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.
if(statusEntry === statusEntries[statusEntries.lenght - 1]) { | |
if(statusEntry === statusEntries[statusEntries.length - 1]) { |
tests/10-issue.js
Outdated
statusListCredential.credentialSubject; | ||
const {encodedList} = credentialSubject; | ||
// Uncompress encodedList | ||
const decoded = await sl.decodeList({encodedList}); |
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.
might want to do something like:
let decoded;
let error;
try {
decoded = await sl.decodedList({encodedList});
} catch(e) {
error = e;
}
should.not.exist(error)
You get the idea. while it would definitely be outside of the scope of this PR, we have existing assertions for multibase encoding.
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.
Blocking merge until those lenght
typos are fixed.
Those also highlight that those particular lines weren't run...and that you probably need a better editor/IDE which would have complained more loudly.
Signed-off-by: Patrick <[email protected]>
Signed-off-by: Patrick <[email protected]>
Signed-off-by: Patrick <[email protected]>
issuedVc.credentialStatus.statusMessage.should.be. | ||
an('array').length.should.be. | ||
equal(issuedVc.credentialStatus.statusSize, | ||
'Expected statusMessage lenght to be equal to ' + |
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.
still got lenght
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.
This is in the removed sections!
I believe he doesn't have any test data that makes those statements fire. |
@aljones15 correct, most of these statements are in the |
I use VSCode with the ESLint plugin from Microsoft, always happy to hear better tooling suggestions |
It's weird that didn't catch this. No worries. Just suggestions. 😄 Sadly, we can't test the tests without stuff to test against... |
This is to support testing the DB BitstringstatusList implementation.
This isn't transforming the original credential but creating a new variable
statusEntries