Skip to content

Commit

Permalink
Merge pull request #134 from docknetwork/keydocs-hotfix
Browse files Browse the repository at this point in the history
Keydocs hotfix
  • Loading branch information
cykoder authored Jun 10, 2020
2 parents 59b8bcf + 4cf6aa3 commit fecaef0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 0 additions & 1 deletion example/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ async function main() {
'did:jolo:e76fb4b4900e43891f613066b9afca366c6d22f7d87fc9f78a91515be24dfb21',
'did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0',
'did:hcr:0f674e7e-4b49-4898-85f6-96176c1e30de',
'did:neoid:priv:b4eeeb80d20bfb38b23001d0659ce0c1d96be0aa',
'did:elem:EiAS3mqC4OLMKOwcz3ItIL7XfWduPT7q3Fa4vHgiCfSG2A',
'did:ont:AN5g6gz9EoQ3sCNu7514GEghZurrktCMiH',
'did:kilt:5GFs8gCumJcZDDWof5ETFqDFEsNwCsVJUj2bX7y4xBLxN5qT',
Expand Down
9 changes: 6 additions & 3 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,20 @@ class DockAPI {
},
});

await this.initKeyring(keyring);

this.blobModule = new BlobModule(this.api);
this.didModule = new DIDModule(this.api);
this.revocationModule = new RevocationModule(this.api);

await cryptoWaitReady();
return this.api;
}

async initKeyring(keyring = null) {
if (!this.keyring || keyring) {
await cryptoWaitReady();
this.keyring = new Keyring(keyring || { type: 'sr25519' });
}

return this.api;
}

async disconnect() {
Expand Down
5 changes: 4 additions & 1 deletion src/utils/vc.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export function getSuiteFromKeyDoc(keyDoc) {
default:
throw new Error(`Unknown key type ${keyDoc.type}.`);
}
return new Cls({ keypair: keyDoc.keypair, publicKey: keyDoc.publicKey, verificationMethod: keyDoc.id });
return new Cls({
...keyDoc,
verificationMethod: keyDoc.id,
});
}

/**
Expand Down

0 comments on commit fecaef0

Please sign in to comment.