Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat: remove rm from dag api
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Feb 1, 2017
1 parent dd3396b commit 0a5d629
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
14 changes: 0 additions & 14 deletions API/dag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,3 @@ If no `callback` is passed, a [promise][] is returned.
`callback` must follow `function (err, dagNode) {}` signature, where `err` is an error if the operation was not successful and `dagNode` is the IPLD format DAG node retrieved.

If no `callback` is passed, a [promise][] is returned.

#### `dag.remove`

> Deletes an IPLD node
##### `Go` **WIP**

##### `JavaScript` - ipfs.dag.rm(cid, callback)

- `cid` is a [CID][https://github.com/ipfs/js-cid] instance.

`callback` must follow `function (err) {}` signature, where `err` is an error if the operation was not successful.

If no `callback` is passed, a [promise][] is returned.
30 changes: 0 additions & 30 deletions src/dag.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,41 +131,11 @@ module.exports = (common) => {
})
})
})

describe('.rm', () => {
let pbNode

before((done) => {
const someData = new Buffer('some other data')

pbNode = DAGNode.create(someData, (err, node) => {
expect(err).to.not.exist
pbNode = node
done()
})
})

it('dag-pb node', (done) => {
ipfs.dag.put(pbNode, 'dag-pb', 'sha2-256', (err) => {
expect(err).to.not.exist
dagPB.util.cid(pbNode, (err, cid) => {
expect(err).to.not.exist
ipfs.dag.get(cid, (err, node) => {
expect(err).to.not.exist
ipfs.dag.rm(cid, done)
// TODO When we get timeouts in js-ipfs, try to fetch again
// and observe it timeout without the node
})
})
})
})
})
})

describe('promise API', () => {
describe('.put', () => {})
describe('.get', () => {})
describe('.rm', () => {})
})
})
}

0 comments on commit 0a5d629

Please sign in to comment.