Skip to content

Commit

Permalink
Fix multihash from dag.toJSON() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Maniewski committed Dec 7, 2018
1 parent e014c2b commit 7265aa9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/db-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const createDBManifest = (name, type, accessControllerAddress, publicKey) => {

const uploadDBManifest = async (ipfs, manifest) => {
const dag = await ipfs.object.put(encodeManifest(manifest))
return dag.toJSON().multihash.toString()
return dag.toJSON().hash.toString()
}

const signDBManifest = async (manifest, identity, identityProvider) => {
Expand Down
5 changes: 2 additions & 3 deletions src/ipfs-access-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ class IPFSAccessController extends AbstractAccessController {
}

async save () {
let hash
try {
const access = JSON.stringify(this._access, null, 2)
const dag = await this._ipfs.object.put(new Buffer(access))
hash = dag.toJSON().multihash.toString()
const hash = dag.toJSON().hash.toString()
return path.join('/ipfs', hash)
} catch (e) {
console.log("ACCESS ERROR:", e)
}
return path.join('/ipfs', hash)
}

async setup ({ accessControllerAddress: address }) {
Expand Down

0 comments on commit 7265aa9

Please sign in to comment.