git ssb

0+

wanderer🌟 / js-dfinity-radix-tree



Commit fa788f1f38095991b7a6daf763f3844bd335be19

fixed ipld-graph-builder

wanderer committed on 3/22/2018, 3:15:53 AM
Parent: 4fe6af79637c7ada713ce5ddce656ae7a400a7d9

Files changed

datastore.jschanged
package-lock.jsonchanged
package.jsonchanged
tests/index.jschanged
datastore.jsView
@@ -5,11 +5,8 @@
55 const cbor = require('borc')
66
77 module.exports = class TreeDAG extends DAG {
88 async put (val) {
9- if (TreeDAG.isValidLink(val)) {
10- return val
11- }
129 const encoded = cbor.encode(val)
1310 const key = await TreeDAG.getMerkleLink(encoded)
1411
1512 return new Promise((resolve, reject) => {
package-lock.jsonView
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.jsonView
@@ -27,9 +27,9 @@
2727 "tape": "^4.6.3"
2828 },
2929 "dependencies": {
3030 "borc": "^2.0.2",
31- "ipld-graph-builder": "^1.3.7",
31+ "ipld-graph-builder": "^1.3.8",
3232 "text-encoding": "^0.6.4",
3333 "uint1array": "^1.0.5"
3434 },
3535 "standard": {
tests/index.jsView
@@ -3,16 +3,15 @@
33 const level = require('level-browserify')
44 const RadixTree = require('../')
55 const db = level('./testdb')
66
7-tape('set and get', async t => {
7+tape('should generate the same stateRoot', async t => {
88 let tree = new RadixTree({
99 db: db
1010 })
1111 const stateRoot = await tree.flush()
12- console.log(stateRoot)
1312 const stateRoot2 = await tree.flush()
14- console.log(stateRoot2)
13+ t.deepEquals(stateRoot2, stateRoot)
1514 t.end()
1615 })
1716
1817 tape('set and get', async t => {

Built with git-ssb-web