1
1
# SYNOPSIS
2
2
3
- [ ![ NPM Package] ( https://img.shields.io/npm/v/merkle-patricia-tree.svg?style=flat-square )] ( https://www.npmjs.org/package/merkle-patricia-tree )
4
- [ ![ Build Status] ( https://img.shields.io/travis/ethereumjs/merkle-patricia-tree.svg?branch= master&style=flat-square )] ( https://travis-ci.org/ethereumjs/merkle-patricia-tree )
5
- [ ![ Coverage Status] ( https://img.shields.io/coveralls/ethereumjs/merkle-patricia-tree.svg?style=flat-square )] ( https://coveralls.io/r/ethereumjs/merkle-patricia-tree )
6
- [ ![ Gitter] ( https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square )] ( https://gitter.im/ethereum/ethereumjs-lib ) or #ethereumjs on freenode
3
+ [ ![ NPM Package] ( https://img.shields.io/npm/v/merkle-patricia-tree )] ( https://www.npmjs.org/package/merkle-patricia-tree )
4
+ [ ![ Build Status] ( https://img.shields.io/travis/ethereumjs/merkle-patricia-tree/ master )] ( https://travis-ci.org/ethereumjs/merkle-patricia-tree )
5
+ [ ![ Coverage Status] ( https://img.shields.io/coveralls/ethereumjs/merkle-patricia-tree.svg )] ( https://coveralls.io/r/ethereumjs/merkle-patricia-tree )
6
+ [ ![ Gitter] ( https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg )] ( https://gitter.im/ethereum/ethereumjs-lib )
7
7
8
8
[ ![ js-standard-style] ( https://cdn.rawgit.com/feross/standard/master/badge.svg )] ( https://github.com/feross/standard )
9
9
@@ -30,8 +30,8 @@ const Trie = require('merkle-patricia-tree').BaseTrie,
30
30
db = level (' ./testdb' ),
31
31
trie = new Trie (db)
32
32
33
- trie .put (' test' , ' one' , function () {
34
- trie .get (' test' , function (err , value ) {
33
+ trie .put (Buffer . from ( ' test' ), Buffer . from ( ' one' ) , function () {
34
+ trie .get (Buffer . from ( ' test' ) , function (err , value ) {
35
35
if (value) console .log (value .toString ())
36
36
})
37
37
})
@@ -40,9 +40,9 @@ trie.put('test', 'one', function() {
40
40
## Merkle Proofs
41
41
42
42
``` javascript
43
- Trie .prove (trie, ' test' , function (err , prove ) {
43
+ Trie .prove (trie, Buffer . from ( ' test' ) , function (err , prove ) {
44
44
if (err) return cb (err)
45
- Trie .verifyProof (trie .root , ' test' , prove, function (err , value ) {
45
+ Trie .verifyProof (trie .root , Buffer . from ( ' test' ) , prove, function (err , value ) {
46
46
if (err) return cb (err)
47
47
console .log (value .toString ())
48
48
cb ()
@@ -117,7 +117,7 @@ trie.get(address, function(err, data) {
117
117
118
118
# API
119
119
120
- [ ./docs/ ] ( ./docs/index .md )
120
+ [ Documentation ] ( ./docs/README .md )
121
121
122
122
# TESTING
123
123
0 commit comments