Add fetchValueFromStorage
This commit is contained in:
parent
ceccbb0df3
commit
f400139052
@ -546,14 +546,24 @@ export default class Services {
|
|||||||
if (state.merkle_root === "") {
|
if (state.merkle_root === "") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!state.encrypted_pcd) {
|
||||||
|
console.warn('Empty encrypted pcd, skipping...');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (const [field, hash] of Object.entries(state.pcd_commitment)) {
|
for (const [field, hash] of Object.entries(state.pcd_commitment)) {
|
||||||
// get the encrypted value with the field name
|
// get the encrypted value with the field name
|
||||||
const value = state.encrypted_pcd[field];
|
const value = state.encrypted_pcd[field];
|
||||||
await storeData(storages, hash, value, null);
|
await storeData(storages, hash, value, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async fetchValueFromStorage(hash: string): Promise<any | null> {
|
||||||
|
const storages = [storageUrl];
|
||||||
|
|
||||||
|
return await retrieveData(storages, hash);
|
||||||
|
}
|
||||||
|
|
||||||
public async saveDiffs(diffs: UserDiff[]) {
|
public async saveDiffs(diffs: UserDiff[]) {
|
||||||
const db = await Database.getInstance();
|
const db = await Database.getInstance();
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user