Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
fix: export multicodec property
Browse files Browse the repository at this point in the history
The public `multicodec` property is needed to make it work with js-ipld.
  • Loading branch information
vmx committed Jan 26, 2018
1 parent 3b6ffc9 commit 2284762
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/resolver.js
Expand Up @@ -134,6 +134,7 @@ const resolveField = (dagNode, field) => {
}

module.exports = {
multicodec: 'bitcoin-block',
resolve: resolve,
tree: tree
}
7 changes: 7 additions & 0 deletions test/resolver.spec.js
Expand Up @@ -130,6 +130,13 @@ describe('IPLD format resolver API tree()', () => {
})
})

describe('IPLD format resolver API properties', () => {
it('should have `multicodec` defined correctly', (done) => {
expect(IpldBitcoin.resolver.multicodec).to.equal('bitcoin-block')
done()
})
})

const verifyPath = (block, path, expected, done) => {
IpldBitcoin.resolver.resolve(block, path, (err, value) => {
expect(err).to.not.exist()
Expand Down

0 comments on commit 2284762

Please sign in to comment.