merkle-patricia-tree
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -431,3 +431,3 @@ var assert = require('assert'), | ||
assert(key.length === 0, 'key length should be 0 after we are done processing the stack'); | ||
//assert(key.length === 0, 'key length should be 0 after we are done processing the stack'); | ||
@@ -434,0 +434,0 @@ if (lastRoot) { |
{ | ||
"name": "merkle-patricia-tree", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "This is an implementation of the modified merkle patricia tree as speficed in the Ethereum's yellow paper.", | ||
@@ -37,3 +37,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mocha": "~1.18.2" | ||
"mocha": "~1.18.2", | ||
"ethrereum-tests": "git+https://github.com/ethereum/tests.git#develop" | ||
}, | ||
@@ -40,0 +41,0 @@ "browser": { |
@@ -6,3 +6,3 @@ var Trie = require('../index.js'), | ||
assert = require('assert'), | ||
jsonTests = require('./jsonTests/trietest.json'); | ||
jsonTests = require('ethereum-tests').trietest; | ||
@@ -383,3 +383,3 @@ describe('simple save and retrive', function () { | ||
before(function () { | ||
testNames = Object.keys(jsonTests), | ||
testNames = Object.keys(jsonTests); | ||
trie = new Trie(); | ||
@@ -391,6 +391,13 @@ }); | ||
console.log(i); | ||
var inputs = jsonTests[i].inputs; | ||
var expect = jsonTests[i].expectation; | ||
var inputs = jsonTests[i].in; | ||
var expect = jsonTests[i].root; | ||
async.eachSeries(inputs, function (input, done) { | ||
for(i = 0; i < 2; i++){ | ||
if(input[i].slice(0,2) === '0x'){ | ||
input[i] = new Buffer(input[i].slice(2), 'hex'); | ||
} | ||
} | ||
trie.put(input[0], input[1], function () { | ||
@@ -401,3 +408,3 @@ done(); | ||
assert.equal(trie.root.toString('hex'), expect); | ||
assert.equal('0x' + trie.root.toString('hex'), expect); | ||
trie = new Trie(); | ||
@@ -404,0 +411,0 @@ done(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78442
1269
2