Skip to content

Commit

Permalink
simply return results array in result
Browse files Browse the repository at this point in the history
Signed-off-by: F-Node-Karlsruhe <[email protected]>
  • Loading branch information
F-Node-Karlsruhe authored and dlongley committed Nov 20, 2023
1 parent e2c12e7 commit 4098816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
10 changes: 2 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ async function _checkStatus({

// check VC's SL index for the status
const verified = !list.getStatus(index);
return {verified, purpose: slCredentialStatusPurpose};
return {verified, credentialStatus};
}

async function _checkStatuses({
Expand Down Expand Up @@ -289,13 +289,7 @@ async function _checkStatuses({
})));
const verified = results.every(
({verified = false} = {}) => verified === true);
const revocation = results.find(r => r.purpose == 'revocation')
const suspension = results.find(r => r.purpose == 'suspension')
return {
verified,
...(revocation && { revocation }),
...(suspension && { suspension })
};
return {verified, results};
}

/**
Expand Down
7 changes: 3 additions & 4 deletions tests/20-main.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,9 @@ describe('checkStatus', () => {
});
should.not.exist(result.error);
result.verified.should.equal(true);
should.exist(result.revocation);
result.revocation.verified.should.equal(true);
result.revocation.purpose.should.equal('revocation');
should.not.exist(result.suspension);
should.exist(result.results);
result.results.should.be.lengthOf(1);
result.results.should.have.deep.members([{verified: true, credentialStatus: credential.credentialStatus}]);

Check failure on line 316 in tests/20-main.spec.js

View workflow job for this annotation

GitHub Actions / lint (16.x)

This line has a length of 111. Maximum allowed is 80
});

it('should use default value when "verifyStatusListCredential" is not ' +
Expand Down

0 comments on commit 4098816

Please sign in to comment.