diff --git a/eth-account-snapshot/test/resolver.spec.js b/eth-account-snapshot/test/resolver.spec.js index 1e2fbd6..b1f375f 100644 --- a/eth-account-snapshot/test/resolver.spec.js +++ b/eth-account-snapshot/test/resolver.spec.js @@ -29,6 +29,10 @@ describe('IPLD format resolver (local)', () => { expect(resolver.multicodec).to.equal('eth-account-snapshot') }) + it('defaultHashAlg is keccak-256', () => { + expect(resolver.defaultHashAlg).to.equal('keccak-256') + }) + describe('resolver.resolve', () => { it('path within scope', () => { resolver.resolve(testBlob, 'nonce', (err, result) => { diff --git a/eth-block-list/test/resolver.spec.js b/eth-block-list/test/resolver.spec.js index 501f190..e7ea340 100644 --- a/eth-block-list/test/resolver.spec.js +++ b/eth-block-list/test/resolver.spec.js @@ -28,6 +28,10 @@ describe('IPLD format resolver (local)', () => { expect(resolver.multicodec).to.equal('eth-block-list') }) + it('defaultHashAlg is keccak-256', () => { + expect(resolver.defaultHashAlg).to.equal('keccak-256') + }) + describe('resolver.resolve', () => { it('uncle #0', (done) => { resolver.resolve(testBlob, '0', (err, result) => { diff --git a/eth-block/test/resolver.spec.js b/eth-block/test/resolver.spec.js index ce0ecd6..64fff4a 100644 --- a/eth-block/test/resolver.spec.js +++ b/eth-block/test/resolver.spec.js @@ -54,6 +54,10 @@ describe('IPLD format resolver (local)', () => { expect(resolver.multicodec).to.equal('eth-block') }) + it('defaultHashAlg is keccak-256', () => { + expect(resolver.defaultHashAlg).to.equal('keccak-256') + }) + it('can parse the cid', (done) => { const testEthBlock = new EthBlockHeader(testData) ipldEthBlock.util.cid(testEthBlock, (err, cid) => { diff --git a/eth-state-trie/test/resolver.spec.js b/eth-state-trie/test/resolver.spec.js index 674e5c1..7a8209e 100644 --- a/eth-state-trie/test/resolver.spec.js +++ b/eth-state-trie/test/resolver.spec.js @@ -92,6 +92,10 @@ describe('IPLD format resolver (local)', () => { expect(resolver.multicodec).to.equal('eth-state-trie') }) + it('defaultHashAlg is keccak-256', () => { + expect(resolver.defaultHashAlg).to.equal('keccak-256') + }) + describe('resolver.resolve', () => { it('root node resolves to branch', (done) => { let rootNode = dagNodes[''] diff --git a/eth-storage-trie/test/resolver.spec.js b/eth-storage-trie/test/resolver.spec.js index 74e1553..d72f1d7 100644 --- a/eth-storage-trie/test/resolver.spec.js +++ b/eth-storage-trie/test/resolver.spec.js @@ -60,6 +60,10 @@ describe('IPLD format resolver (local)', () => { expect(resolver.multicodec).to.equal('eth-storage-trie') }) + it('defaultHashAlg is keccak-256', () => { + expect(resolver.defaultHashAlg).to.equal('keccak-256') + }) + describe('resolver.resolve', () => { it('root node resolves to neck', (done) => { let rootNode = dagNodes[0] diff --git a/eth-tx-trie/test/resolver.spec.js b/eth-tx-trie/test/resolver.spec.js index 6ecf11d..2df6290 100644 --- a/eth-tx-trie/test/resolver.spec.js +++ b/eth-tx-trie/test/resolver.spec.js @@ -93,6 +93,10 @@ describe('IPLD format resolver (local)', () => { expect(resolver.multicodec).to.equal('eth-tx-trie') }) + it('defaultHashAlg is keccak-256', () => { + expect(resolver.defaultHashAlg).to.equal('keccak-256') + }) + describe('resolver.resolve', () => { it('root node resolving first tx value', (done) => { let rootNode = dagNodes[0] diff --git a/eth-tx/test/resolver.spec.js b/eth-tx/test/resolver.spec.js index cd62ed7..869889d 100644 --- a/eth-tx/test/resolver.spec.js +++ b/eth-tx/test/resolver.spec.js @@ -33,6 +33,10 @@ describe('IPLD format resolver (local)', () => { expect(resolver.multicodec).to.equal('eth-tx') }) + it('defaultHashAlg is keccak-256', () => { + expect(resolver.defaultHashAlg).to.equal('keccak-256') + }) + describe('resolver.resolve', () => { it('path within scope', () => { resolver.resolve(testIpfsBlob, 'nonce', (err, result) => { diff --git a/util/createResolver.js b/util/createResolver.js index ac22e15..302f3c4 100644 --- a/util/createResolver.js +++ b/util/createResolver.js @@ -9,6 +9,7 @@ function createResolver (multicodec, EthObjClass, mapFromEthObject) { const util = createUtil(multicodec, EthObjClass) const resolver = { multicodec: multicodec, + defaultHashAlg: 'keccak-256', resolve: resolve, tree: tree, isLink: createIsLink(resolve),