Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
feat: add defaultHashAlg
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider authored and vmx committed Jun 26, 2018
1 parent 0fdf316 commit e767312
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eth-account-snapshot/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 4 additions & 0 deletions eth-block-list/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 4 additions & 0 deletions eth-block/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
4 changes: 4 additions & 0 deletions eth-state-trie/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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['']
Expand Down
4 changes: 4 additions & 0 deletions eth-storage-trie/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions eth-tx-trie/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 4 additions & 0 deletions eth-tx/test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions util/createResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit e767312

Please sign in to comment.