Skip to content

Commit

Permalink
Replace ecdsa2022 w/ jcs2019Proofs.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Nov 13, 2024
1 parent 9b8bbca commit 565007b
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/suites/algorithms-jcs.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export function ecdsaJcs2019Algorithms() {
const [issuer] = endpoints;
let issuedVc;
let proofs;
let ecdsa2022Proofs = [];
let jcs2019Proofs = [];
before(async function() {
issuedVc = await createInitialVc({issuer, vc: validCredential});
proofs = getProofs(issuedVc);
if(proofs?.length) {
ecdsa2022Proofs = proofs.filter(
jcs2019Proofs = proofs.filter(
proof => proof?.cryptosuite === cryptosuite);
}
});
Expand All @@ -52,7 +52,7 @@ export function ecdsaJcs2019Algorithms() {
should.exist(issuedVc, 'Expected issuer to have issued a ' +
'credential.');
should.exist(proofs, 'Expected credential to have a proof.');
ecdsa2022Proofs.length.should.be.gte(1, 'Expected at least one ' +
jcs2019Proofs.length.should.be.gte(1, 'Expected at least one ' +
'ecdsa-jcs-2019 cryptosuite.');
};
it('The transformation options MUST contain a type identifier ' +
Expand All @@ -61,7 +61,7 @@ export function ecdsaJcs2019Algorithms() {
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#transformation-ecdsa-jcs-2019';
assertBefore();
for(const proof of ecdsa2022Proofs) {
for(const proof of jcs2019Proofs) {
should.exist(proof.type, 'Expected a type identifier on ' +
'the proof.');
should.exist(proof.cryptosuite,
Expand All @@ -73,7 +73,7 @@ export function ecdsaJcs2019Algorithms() {
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#transformation-ecdsa-jcs-2019';
assertBefore();
for(const proof of ecdsa2022Proofs) {
for(const proof of jcs2019Proofs) {
should.exist(proof?.proofValue,
'Expected proofValue to exist.');
isValidUtf8(proof.proofValue).should.equal(
Expand All @@ -89,7 +89,7 @@ export function ecdsaJcs2019Algorithms() {
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#transformation-ecdsa-jcs-2019';
assertBefore();
for(const proof of ecdsa2022Proofs) {
for(const proof of jcs2019Proofs) {
should.exist(proof.type,
'Expected a type identifier on the proof.');
should.exist(proof.cryptosuite,
Expand All @@ -116,12 +116,12 @@ export function ecdsaJcs2019Algorithms() {
const [issuer] = endpoints;
let issuedVc;
let proofs;
let ecdsa2022Proofs = [];
let jcs2019Proofs = [];
before(async function() {
issuedVc = await createInitialVc({issuer, vc: validCredential});
proofs = getProofs(issuedVc);
if(proofs?.length) {
ecdsa2022Proofs = proofs.filter(
jcs2019Proofs = proofs.filter(
proof => proof?.cryptosuite === cryptosuite);
}
});
Expand All @@ -130,7 +130,7 @@ export function ecdsaJcs2019Algorithms() {
should.exist(issuedVc, 'Expected issuer to have issued a ' +
'credential.');
should.exist(proofs, 'Expected credential to have a proof.');
ecdsa2022Proofs.length.should.be.gte(1, 'Expected at least one ' +
jcs2019Proofs.length.should.be.gte(1, 'Expected at least one ' +
'ecdsa-jcs-2019 cryptosuite.');
};
it('The proof options MUST contain a type identifier for the ' +
Expand All @@ -139,7 +139,7 @@ export function ecdsaJcs2019Algorithms() {
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-jcs-2019';
assertBefore();
for(const proof of ecdsa2022Proofs) {
for(const proof of jcs2019Proofs) {
should.exist(proof.type,
'Expected a type identifier on the proof.');
should.exist(proof.cryptosuite,
Expand All @@ -153,7 +153,7 @@ export function ecdsaJcs2019Algorithms() {
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-jcs-2019';
assertBefore();
for(const proof of ecdsa2022Proofs) {
for(const proof of jcs2019Proofs) {
should.exist(proof.type,
'Expected a type identifier on the proof.');
should.exist(proof.cryptosuite,
Expand All @@ -169,7 +169,7 @@ export function ecdsaJcs2019Algorithms() {
'SHOULD convey an error type of PROOF_GENERATION_ERROR.',
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-configuration-ecdsa-jcs-2019';
for(const proof of ecdsa2022Proofs) {
for(const proof of jcs2019Proofs) {
if(proof?.created) {
isValidDatetime(proof.created).should.equal(
true,
Expand All @@ -194,12 +194,12 @@ export function ecdsaJcs2019Algorithms() {
const [issuer] = endpoints;
let issuedVc;
let proofs;
let ecdsa2022Proofs = [];
let jcs2019Proofs = [];
before(async function() {
issuedVc = await createInitialVc({issuer, vc: validCredential});
proofs = getProofs(issuedVc);
if(proofs?.length) {
ecdsa2022Proofs = proofs.filter(
jcs2019Proofs = proofs.filter(
proof => proof?.cryptosuite === cryptosuite);
}
});
Expand All @@ -208,7 +208,7 @@ export function ecdsaJcs2019Algorithms() {
should.exist(issuedVc, 'Expected issuer to have issued a ' +
'credential.');
should.exist(proofs, 'Expected credential to have a proof.');
ecdsa2022Proofs.length.should.be.gte(1, 'Expected at least one ' +
jcs2019Proofs.length.should.be.gte(1, 'Expected at least one ' +
'ecdsa-jcs-2019 cryptosuite.');
};
it('The proof options MUST contain a type identifier for the ' +
Expand All @@ -217,7 +217,7 @@ export function ecdsaJcs2019Algorithms() {
async function() {
this.test.link = 'https://www.w3.org/TR/vc-di-ecdsa/#proof-serialization-ecdsa-jcs-2019';
assertBefore();
for(const proof of ecdsa2022Proofs) {
for(const proof of jcs2019Proofs) {
should.exist(proof.type,
'Expected a type identifier on the proof.');
}
Expand Down

0 comments on commit 565007b

Please sign in to comment.