diff --git a/lib/index.js b/lib/index.js index be5db11..f402d9c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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({ @@ -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}; } /** diff --git a/tests/20-main.spec.js b/tests/20-main.spec.js index 8f8c345..b29473a 100644 --- a/tests/20-main.spec.js +++ b/tests/20-main.spec.js @@ -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}]); }); it('should use default value when "verifyStatusListCredential" is not ' +