Update for multihash anchors

This commit is contained in:
Alexis Sellier
2021-06-10 12:33:17 +02:00
parent 76e7b8dc4d
commit f35c989a13
6 changed files with 68 additions and 18 deletions
+10 -8
View File
@@ -11,8 +11,7 @@ const GetProjects = `
projects(where: { org: $org }) {
id
anchor {
stateHash
stateHashFormat
stateMultihash
timestamp
}
}
@@ -81,12 +80,15 @@ export class Org {
for (const p of result.projects) {
try {
p.id = utils.formatRadicleId(ethers.utils.arrayify(p.id));
p.anchor.stateHash = utils.formatProjectHash(
ethers.utils.arrayify(p.anchor.stateHash),
p.anchor.stateHashFormat
);
projects.push(p);
const proj: Project = {
id: utils.formatRadicleId(ethers.utils.arrayify(p.id)),
anchor: {
stateHash: utils.formatProjectHash(
ethers.utils.arrayify(p.anchor.stateMultihash),
)
},
};
projects.push(proj);
} catch (e) {
console.error(e);
}