Commit fa788f1f38095991b7a6daf763f3844bd335be19
fixed ipld-graph-builder
wanderer committed on 3/22/2018, 3:15:53 AMParent: 4fe6af79637c7ada713ce5ddce656ae7a400a7d9
Files changed
datastore.js | changed |
package-lock.json | changed |
package.json | changed |
tests/index.js | changed |
datastore.js | ||
---|---|---|
@@ -5,11 +5,8 @@ | ||
5 | 5 | const cbor = require('borc') |
6 | 6 | |
7 | 7 | module.exports = class TreeDAG extends DAG { |
8 | 8 | async put (val) { |
9 | - if (TreeDAG.isValidLink(val)) { | |
10 | - return val | |
11 | - } | |
12 | 9 | const encoded = cbor.encode(val) |
13 | 10 | const key = await TreeDAG.getMerkleLink(encoded) |
14 | 11 | |
15 | 12 | return new Promise((resolve, reject) => { |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 358162 bytes New file size: 357982 bytes |
package.json | ||
---|---|---|
@@ -27,9 +27,9 @@ | ||
27 | 27 | "tape": "^4.6.3" |
28 | 28 | }, |
29 | 29 | "dependencies": { |
30 | 30 | "borc": "^2.0.2", |
31 | - "ipld-graph-builder": "^1.3.7", | |
31 | + "ipld-graph-builder": "^1.3.8", | |
32 | 32 | "text-encoding": "^0.6.4", |
33 | 33 | "uint1array": "^1.0.5" |
34 | 34 | }, |
35 | 35 | "standard": { |
tests/index.js | ||
---|---|---|
@@ -3,16 +3,15 @@ | ||
3 | 3 | const level = require('level-browserify') |
4 | 4 | const RadixTree = require('../') |
5 | 5 | const db = level('./testdb') |
6 | 6 | |
7 | -tape('set and get', async t => { | |
7 | +tape('should generate the same stateRoot', async t => { | |
8 | 8 | let tree = new RadixTree({ |
9 | 9 | db: db |
10 | 10 | }) |
11 | 11 | const stateRoot = await tree.flush() |
12 | - console.log(stateRoot) | |
13 | 12 | const stateRoot2 = await tree.flush() |
14 | - console.log(stateRoot2) | |
13 | + t.deepEquals(stateRoot2, stateRoot) | |
15 | 14 | t.end() |
16 | 15 | }) |
17 | 16 | |
18 | 17 | tape('set and get', async t => { |
Built with git-ssb-web