Skip to content

Commit 7265aa9

Browse files
author
Christian Maniewski
committed
Fix multihash from dag.toJSON() usage
1 parent e014c2b commit 7265aa9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/db-manifest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const createDBManifest = (name, type, accessControllerAddress, publicKey) => {
1212

1313
const uploadDBManifest = async (ipfs, manifest) => {
1414
const dag = await ipfs.object.put(encodeManifest(manifest))
15-
return dag.toJSON().multihash.toString()
15+
return dag.toJSON().hash.toString()
1616
}
1717

1818
const signDBManifest = async (manifest, identity, identityProvider) => {

src/ipfs-access-controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ class IPFSAccessController extends AbstractAccessController {
3434
}
3535

3636
async save () {
37-
let hash
3837
try {
3938
const access = JSON.stringify(this._access, null, 2)
4039
const dag = await this._ipfs.object.put(new Buffer(access))
41-
hash = dag.toJSON().multihash.toString()
40+
const hash = dag.toJSON().hash.toString()
41+
return path.join('/ipfs', hash)
4242
} catch (e) {
4343
console.log("ACCESS ERROR:", e)
4444
}
45-
return path.join('/ipfs', hash)
4645
}
4746

4847
async setup ({ accessControllerAddress: address }) {

0 commit comments

Comments
 (0)