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 authored and victorb committed Jan 31, 2018
1 parent 3b6ffc9 commit 8e6ec75
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 8e6ec75

Please sign in to comment.