Skip to content

Commit

Permalink
Fix issueRequests vars and make issue order consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Oct 15, 2024
1 parent e1810ff commit 5ff1251
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async function _createIssueRequests({
variables: {
// always include globals but allow local override
globals: variables.globals,
...r.variables
...vars
}
};
}));
Expand Down Expand Up @@ -125,10 +125,8 @@ async function _issue({workflow, issueRequests, format} = {}) {
'/issue' : '/credentials/issue';
}

const issuedVCs = [];

// issue VCs in parallel
await Promise.all(issueRequests.map(async issueRequest => {
return Promise.all(issueRequests.map(async issueRequest => {
/* Note: Issue request formats can be any one of these:
1. `{credential, options?}`
Expand All @@ -141,8 +139,6 @@ async function _issue({workflow, issueRequests, format} = {}) {
const {
data: {verifiableCredential}
} = await zcapClient.write({url, capability, json});
issuedVCs.push(verifiableCredential);
return verifiableCredential;
}));

return issuedVCs;
}

0 comments on commit 5ff1251

Please sign in to comment.