Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/wasm/src/services/credential/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ export async function keyDocToKeypair(keyDoc) {
privateKeyBase58 || (privateKeyMultibase && privateKeyMultibase.substr(1));
if (!privateKeyEncoded) {
throw new Error(
`No private key in document found, this should not happen. Got: ${JSON.stringify(
keyDoc,
null,
2,
)}`,
`No private key in document found, this should not happen. keyDoc id: ${
keyDoc.id || '<unknown>'
}, type: ${type || '<unknown>'}`,
);
Comment thread
maycon-mello marked this conversation as resolved.
}

Expand Down
13 changes: 9 additions & 4 deletions packages/wasm/src/wallet/rpc-storage-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ class RpcStorageInterface extends StorageInterface {
Logger.debug('Wallet: no storage found, creating empty wallet');
this.documents = {};
} else {
Logger.debug(`Wallet: existing storage found: ${JSON.stringify(data)}`);
Logger.debug(
`Wallet: existing storage found with ${
Object.keys(this.documents).length
} documents`,
);
}
} catch (err) {
Logger.error(
`error to retrieve data from rpc storage: ${err.toString()}`,
);
Logger.info(JSON.stringify(data));
this.documents = {};

throw err;
Expand Down Expand Up @@ -80,12 +83,14 @@ class RpcStorageInterface extends StorageInterface {
}

async find({has = undefined, equals = undefined} = {}) {
const documentIds = Object.keys(this.documents || {});

Logger.debug('Execute find', {
equals,
documents: this.documents,
documentCount: documentIds.length,
});

const documents = Object.keys(this.documents || {})
const documents = documentIds
.map(docId => {
const content = this.documents[docId];

Expand Down
Loading