[CI Skip] 0.33.1
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
A re-implementation of a Patricia Trie. Unlike other implementations, this allows for the specification of a hash function as well as encoder/decoder and operates in a sync fashion by default.
|
||||
|
||||
This is a JavaScript port of the [Python Ethereum Trie](https://github.com/ethereum/py-trie) with additions to support transactions (checkpoints) and multiple hashing (npot only Keccak, but also Blake2 as found in Polkadot).
|
||||
This is a JavaScript port of the [Python Ethereum Trie](https://github.com/ethereum/py-trie) with additions to support transactions (checkpoints) and multiple codecs, by default only the Substrate codec.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
* ["constants"](modules/_constants_.md)
|
||||
* ["ethereum.spec"](modules/_ethereum_spec_.md)
|
||||
* ["ethereumCodec"](modules/_ethereumcodec_.md)
|
||||
* ["genesis.spec"](modules/_genesis_spec_.md)
|
||||
* ["index"](modules/_index_.md)
|
||||
* [Trie](classes/_index_.trie.md)
|
||||
* ["index.spec"](modules/_index_spec_.md)
|
||||
* ["snapshot.spec"](modules/_snapshot_spec_.md)
|
||||
* ["subtrate.spec"](modules/_subtrate_spec_.md)
|
||||
* ["types"](modules/_types_.md)
|
||||
* [NodeType](enums/_types_.nodetype.md)
|
||||
* [TrieDb](interfaces/_types_.triedb.md)
|
||||
* ["util/is"](modules/_util_is_.md)
|
||||
* ["util/key"](modules/_util_key_.md)
|
||||
* ["util/nibbles"](modules/_util_nibbles_.md)
|
||||
* ["util/node"](modules/_util_node_.md)
|
||||
|
||||
@@ -25,16 +25,17 @@ Overview
|
||||
|
||||
## constructor
|
||||
|
||||
⊕ **new Trie**(db?: *`TxDb`*, rootHash?: *`Uint8Array`*): [Trie](_index_.trie.md)
|
||||
⊕ **new Trie**(db?: *`TxDb`*, rootHash?: *`Uint8Array`*, codec?: *`Codec`*): [Trie](_index_.trie.md)
|
||||
|
||||
*Defined in [index.ts:33](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L33)*
|
||||
*Defined in [index.ts:36](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L36)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type | Default value |
|
||||
| ------ | ------ | ------ |
|
||||
| `Optional` db | `TxDb` | - |
|
||||
| `Default value` rootHash | `Uint8Array` | EMPTY_HASH |
|
||||
| `Default value` db | `TxDb` | new MemoryDb() |
|
||||
| `Optional` rootHash | `Uint8Array` | - |
|
||||
| `Default value` codec | `Codec` | substrateCodec |
|
||||
|
||||
**Returns:** [Trie](_index_.trie.md)
|
||||
|
||||
@@ -50,7 +51,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[db](../interfaces/_types_.triedb.md#db)*
|
||||
|
||||
*Defined in [index.ts:31](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L31)*
|
||||
*Defined in [index.ts:32](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L32)*
|
||||
|
||||
___
|
||||
|
||||
@@ -64,7 +65,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[close](../interfaces/_types_.triedb.md#close)*
|
||||
|
||||
*Defined in [index.ts:81](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L81)*
|
||||
*Defined in [index.ts:88](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L88)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -77,7 +78,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[del](../interfaces/_types_.triedb.md#del)*
|
||||
|
||||
*Defined in [index.ts:105](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L105)*
|
||||
*Defined in [index.ts:112](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L112)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -96,7 +97,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[drop](../interfaces/_types_.triedb.md#drop)*
|
||||
|
||||
*Defined in [index.ts:89](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L89)*
|
||||
*Defined in [index.ts:96](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L96)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -109,7 +110,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[empty](../interfaces/_types_.triedb.md#empty)*
|
||||
|
||||
*Defined in [index.ts:85](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L85)*
|
||||
*Defined in [index.ts:92](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L92)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -122,7 +123,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[get](../interfaces/_types_.triedb.md#get)*
|
||||
|
||||
*Defined in [index.ts:116](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L116)*
|
||||
*Defined in [index.ts:123](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L123)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -139,7 +140,7 @@ ___
|
||||
|
||||
▸ **getNode**(hash?: *`Uint8Array`*): [Node](../modules/_types_.md#node)
|
||||
|
||||
*Defined in [index.ts:147](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L147)*
|
||||
*Defined in [index.ts:154](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L154)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -158,7 +159,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[getRoot](../interfaces/_types_.triedb.md#getroot)*
|
||||
|
||||
*Defined in [index.ts:137](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L137)*
|
||||
*Defined in [index.ts:144](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L144)*
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
@@ -171,7 +172,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[maintain](../interfaces/_types_.triedb.md#maintain)*
|
||||
|
||||
*Defined in [index.ts:93](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L93)*
|
||||
*Defined in [index.ts:100](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L100)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -190,7 +191,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[open](../interfaces/_types_.triedb.md#open)*
|
||||
|
||||
*Defined in [index.ts:77](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L77)*
|
||||
*Defined in [index.ts:84](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L84)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -203,7 +204,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[put](../interfaces/_types_.triedb.md#put)*
|
||||
|
||||
*Defined in [index.ts:125](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L125)*
|
||||
*Defined in [index.ts:132](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L132)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -223,7 +224,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[rename](../interfaces/_types_.triedb.md#rename)*
|
||||
|
||||
*Defined in [index.ts:97](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L97)*
|
||||
*Defined in [index.ts:104](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L104)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -243,7 +244,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[setRoot](../interfaces/_types_.triedb.md#setroot)*
|
||||
|
||||
*Defined in [index.ts:151](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L151)*
|
||||
*Defined in [index.ts:158](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L158)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -262,7 +263,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[size](../interfaces/_types_.triedb.md#size)*
|
||||
|
||||
*Defined in [index.ts:101](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L101)*
|
||||
*Defined in [index.ts:108](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L108)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -275,7 +276,7 @@ ___
|
||||
|
||||
*Implementation of [TrieDb](../interfaces/_types_.triedb.md).[snapshot](../interfaces/_types_.triedb.md#snapshot)*
|
||||
|
||||
*Defined in [index.ts:156](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L156)*
|
||||
*Defined in [index.ts:163](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L163)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -293,7 +294,7 @@ ___
|
||||
|
||||
▸ **transaction**(fn: *`function`*): `boolean`
|
||||
|
||||
*Defined in [index.ts:57](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/index.ts#L57)*
|
||||
*Defined in [index.ts:64](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/index.ts#L64)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
**BRANCH**: = 3
|
||||
|
||||
*Defined in [types.ts:11](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L11)*
|
||||
*Defined in [types.ts:11](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L11)*
|
||||
|
||||
___
|
||||
<a id="empty"></a>
|
||||
@@ -28,7 +28,7 @@ ___
|
||||
|
||||
**EMPTY**: = 0
|
||||
|
||||
*Defined in [types.ts:8](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L8)*
|
||||
*Defined in [types.ts:8](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L8)*
|
||||
|
||||
___
|
||||
<a id="extension"></a>
|
||||
@@ -37,7 +37,7 @@ ___
|
||||
|
||||
**EXTENSION**: = 2
|
||||
|
||||
*Defined in [types.ts:10](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L10)*
|
||||
*Defined in [types.ts:10](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L10)*
|
||||
|
||||
___
|
||||
<a id="leaf"></a>
|
||||
@@ -46,7 +46,7 @@ ___
|
||||
|
||||
**LEAF**: = 1
|
||||
|
||||
*Defined in [types.ts:9](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L9)*
|
||||
*Defined in [types.ts:9](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L9)*
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@
|
||||
|
||||
<h1 id="polkadottrie-db">@polkadot/trie-db</h1>
|
||||
<p>A re-implementation of a Patricia Trie. Unlike other implementations, this allows for the specification of a hash function as well as encoder/decoder and operates in a sync fashion by default.</p>
|
||||
<p>This is a JavaScript port of the <a href="https://github.com/ethereum/py-trie" target="_blank">Python Ethereum Trie</a> with additions to support transactions (checkpoints) and multiple hashing (npot only Keccak, but also Blake2 as found in Polkadot).</p>
|
||||
<p>This is a JavaScript port of the <a href="https://github.com/ethereum/py-trie" target="_blank">Python Ethereum Trie</a> with additions to support transactions (checkpoints) and multiple codecs, by default only the Substrate codec.</p>
|
||||
<h2 id="usage">Usage</h2>
|
||||
<p>Installation -</p>
|
||||
<pre><code>yarn add @polkadot/trie-db
|
||||
@@ -401,7 +401,7 @@
|
||||
<script>
|
||||
var gitbook = gitbook || [];
|
||||
gitbook.push(function() {
|
||||
gitbook.page.hasChanged({"page":{"title":"trie-db","level":"1.3","depth":1,"next":{"title":"trie-hash","level":"1.4","depth":1,"path":"trie-hash/README.md","ref":"trie-hash/README.md","articles":[]},"previous":{"title":"keyring","level":"1.2","depth":1,"path":"keyring/README.md","ref":"keyring/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/common/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot Common Book","gitbook":">=2.4.0"},"file":{"path":"trie-db/README.md","mtime":"2018-11-21T14:45:06.207Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-21T14:46:09.418Z"},"basePath":"..","book":{"language":""}});
|
||||
gitbook.page.hasChanged({"page":{"title":"trie-db","level":"1.3","depth":1,"next":{"title":"trie-hash","level":"1.4","depth":1,"path":"trie-hash/README.md","ref":"trie-hash/README.md","articles":[]},"previous":{"title":"keyring","level":"1.2","depth":1,"path":"keyring/README.md","ref":"keyring/README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["include-codeblock","insert-logo-link","mermaid-gb3","-highlight","sunlight-highlighter"],"root":"docs","styles":{"website":"styles/website.css"},"pluginsConfig":{"insert-logo-link":{"src":"/common/logo.png","url":"https://polkadot.js.org"},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"mermaid-gb3":{},"include-codeblock":{"check":false,"edit":false,"lang":"","fixlang":false,"template":"default","theme":"chrome","unindent":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"sunlight-highlighter":{"theme":"gitbook","lineNumbers":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Polkadot Common Book","gitbook":">=2.4.0"},"file":{"path":"trie-db/README.md","mtime":"2018-11-22T13:33:24.072Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-11-22T13:34:22.054Z"},"basePath":"..","book":{"language":""}});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
**● db**: *`TxDb`*
|
||||
|
||||
*Defined in [types.ts:37](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L37)*
|
||||
*Defined in [types.ts:37](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L37)*
|
||||
|
||||
___
|
||||
|
||||
@@ -32,7 +32,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.close*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:18](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L18)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:18](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L18)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -45,7 +45,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.del*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:26](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L26)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:26](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L26)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -64,7 +64,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.drop*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:20](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L20)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:20](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L20)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -77,7 +77,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.empty*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:21](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L21)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:21](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L21)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -90,7 +90,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.get*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:27](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L27)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:27](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L27)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -107,7 +107,7 @@ ___
|
||||
|
||||
▸ **getRoot**(): `Uint8Array`
|
||||
|
||||
*Defined in [types.ts:39](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L39)*
|
||||
*Defined in [types.ts:39](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L39)*
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
@@ -120,7 +120,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.maintain*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:22](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L22)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:22](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L22)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -139,7 +139,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.open*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:19](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L19)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:19](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L19)*
|
||||
|
||||
**Returns:** `void`
|
||||
|
||||
@@ -152,7 +152,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.put*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:28](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L28)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:28](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L28)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -172,7 +172,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.rename*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:23](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L23)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:23](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L23)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -190,7 +190,7 @@ ___
|
||||
|
||||
▸ **setRoot**(rootHash: *`Uint8Array`*): `void`
|
||||
|
||||
*Defined in [types.ts:40](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L40)*
|
||||
*Defined in [types.ts:40](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L40)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -209,7 +209,7 @@ ___
|
||||
|
||||
*Inherited from BaseDb.size*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:24](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L24)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:24](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L24)*
|
||||
|
||||
**Returns:** `number`
|
||||
|
||||
@@ -220,7 +220,7 @@ ___
|
||||
|
||||
▸ **snapshot**(dest: *[TrieDb](_types_.triedb.md)*, fn: *`ProgressCb`*): `number`
|
||||
|
||||
*Defined in [types.ts:41](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L41)*
|
||||
*Defined in [types.ts:41](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L41)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -240,7 +240,7 @@ ___
|
||||
|
||||
*Inherited from TxDb.transaction*
|
||||
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:32](https://github.com/polkadot-js/common/blob/477be90/packages/db/src/types.d.ts#L32)*
|
||||
*Defined in [/home/travis/build/polkadot-js/common/packages/db/src/types.d.ts:32](https://github.com/polkadot-js/common/blob/f82092e/packages/db/src/types.d.ts#L32)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -1,2 +1,36 @@
|
||||
|
||||
|
||||
# Type aliases
|
||||
|
||||
<a id="constants"></a>
|
||||
|
||||
## Constants
|
||||
|
||||
**Ƭ Constants**: *`object`*
|
||||
|
||||
*Defined in [constants.ts:9](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/constants.ts#L9)*
|
||||
|
||||
#### Type declaration
|
||||
|
||||
___
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="default"></a>
|
||||
|
||||
## default
|
||||
|
||||
▸ **default**(codec: *`Codec`*): `object`
|
||||
|
||||
*Defined in [constants.ts:14](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/constants.ts#L14)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| codec | `Codec` |
|
||||
|
||||
**Returns:** `object`
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
**Ƭ EncodedPath**: * `Uint8Array` | `null`
|
||||
*
|
||||
|
||||
*Defined in [types.ts:28](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L28)*
|
||||
*Defined in [types.ts:28](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L28)*
|
||||
|
||||
___
|
||||
<a id="node"></a>
|
||||
@@ -42,7 +42,7 @@ ___
|
||||
**Ƭ Node**: * [NodeEmpty](_types_.md#nodeempty) | [NodeNotEmpty](_types_.md#nodenotempty)
|
||||
*
|
||||
|
||||
*Defined in [types.ts:34](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L34)*
|
||||
*Defined in [types.ts:34](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L34)*
|
||||
|
||||
___
|
||||
<a id="nodebranch"></a>
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
**Ƭ NodeBranch**: *[[NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty)]*
|
||||
|
||||
*Defined in [types.ts:20](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L20)*
|
||||
*Defined in [types.ts:20](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L20)*
|
||||
|
||||
___
|
||||
<a id="nodeempty"></a>
|
||||
@@ -60,7 +60,7 @@ ___
|
||||
|
||||
**Ƭ NodeEmpty**: *`null`*
|
||||
|
||||
*Defined in [types.ts:14](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L14)*
|
||||
*Defined in [types.ts:14](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L14)*
|
||||
|
||||
___
|
||||
<a id="nodeencoded"></a>
|
||||
@@ -69,7 +69,7 @@ ___
|
||||
|
||||
**Ƭ NodeEncoded**: *`Uint8Array`*
|
||||
|
||||
*Defined in [types.ts:16](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L16)*
|
||||
*Defined in [types.ts:16](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L16)*
|
||||
|
||||
___
|
||||
<a id="nodeencodedorempty"></a>
|
||||
@@ -79,7 +79,7 @@ ___
|
||||
**Ƭ NodeEncodedOrEmpty**: * [NodeEncoded](_types_.md#nodeencoded) | [NodeEmpty](_types_.md#nodeempty)
|
||||
*
|
||||
|
||||
*Defined in [types.ts:18](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L18)*
|
||||
*Defined in [types.ts:18](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L18)*
|
||||
|
||||
___
|
||||
<a id="nodekv"></a>
|
||||
@@ -88,7 +88,7 @@ ___
|
||||
|
||||
**Ƭ NodeKv**: *[[EncodedPath](_types_.md#encodedpath), [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty)]*
|
||||
|
||||
*Defined in [types.ts:30](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L30)*
|
||||
*Defined in [types.ts:30](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L30)*
|
||||
|
||||
___
|
||||
<a id="nodenotempty"></a>
|
||||
@@ -98,7 +98,7 @@ ___
|
||||
**Ƭ NodeNotEmpty**: * [NodeKv](_types_.md#nodekv) | [NodeBranch](_types_.md#nodebranch)
|
||||
*
|
||||
|
||||
*Defined in [types.ts:32](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/types.ts#L32)*
|
||||
*Defined in [types.ts:32](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/types.ts#L32)*
|
||||
|
||||
___
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
▸ **isBranchNode**(node: *[Node](_types_.md#node)*): `boolean`
|
||||
|
||||
*Defined in [util/is.ts:57](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/is.ts#L57)*
|
||||
*Defined in [util/is.ts:57](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/is.ts#L57)*
|
||||
|
||||
*__name__*: isBranchNode
|
||||
|
||||
@@ -33,7 +33,7 @@ ___
|
||||
|
||||
▸ **isEmptyNode**(node: *[Node](_types_.md#node)*): `boolean`
|
||||
|
||||
*Defined in [util/is.ts:17](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/is.ts#L17)*
|
||||
*Defined in [util/is.ts:17](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/is.ts#L17)*
|
||||
|
||||
*__name__*: isEmptyNode
|
||||
|
||||
@@ -58,7 +58,7 @@ ___
|
||||
|
||||
▸ **isExtensionNode**(node: *[Node](_types_.md#node)*): `boolean`
|
||||
|
||||
*Defined in [util/is.ts:37](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/is.ts#L37)*
|
||||
*Defined in [util/is.ts:37](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/is.ts#L37)*
|
||||
|
||||
*__name__*: isExtensionNode
|
||||
|
||||
@@ -83,7 +83,7 @@ ___
|
||||
|
||||
▸ **isKvNode**(node: *[Node](_types_.md#node)*): `boolean`
|
||||
|
||||
*Defined in [util/is.ts:27](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/is.ts#L27)*
|
||||
*Defined in [util/is.ts:27](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/is.ts#L27)*
|
||||
|
||||
*__name__*: isKvNode
|
||||
|
||||
@@ -108,7 +108,7 @@ ___
|
||||
|
||||
▸ **isLeafNode**(node: *[Node](_types_.md#node)*): `boolean`
|
||||
|
||||
*Defined in [util/is.ts:47](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/is.ts#L47)*
|
||||
*Defined in [util/is.ts:47](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/is.ts#L47)*
|
||||
|
||||
*__name__*: isLeafNode
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
▸ **computeExtensionKey**(nibbles: *`Uint8Array`*): [EncodedPath](_types_.md#encodedpath)
|
||||
|
||||
*Defined in [util/key.ts:50](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/key.ts#L50)*
|
||||
*Defined in [util/key.ts:36](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/key.ts#L36)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -25,7 +25,7 @@ ___
|
||||
|
||||
▸ **computeLeafKey**(nibbles: *`Uint8Array`*): [EncodedPath](_types_.md#encodedpath)
|
||||
|
||||
*Defined in [util/key.ts:54](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/key.ts#L54)*
|
||||
*Defined in [util/key.ts:40](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/key.ts#L40)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -42,7 +42,7 @@ ___
|
||||
|
||||
▸ **consumeCommonPrefix**(left: *`Uint8Array`*, right: *`Uint8Array`*): [`Uint8Array`, `Uint8Array`, `Uint8Array`]
|
||||
|
||||
*Defined in [util/key.ts:70](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/key.ts#L70)*
|
||||
*Defined in [util/key.ts:56](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/key.ts#L56)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -53,23 +53,6 @@ ___
|
||||
|
||||
**Returns:** [`Uint8Array`, `Uint8Array`, `Uint8Array`]
|
||||
|
||||
___
|
||||
<a id="extractkey"></a>
|
||||
|
||||
## extractKey
|
||||
|
||||
▸ **extractKey**(node: *[Node](_types_.md#node)*): `Uint8Array`
|
||||
|
||||
*Defined in [util/key.ts:12](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/key.ts#L12)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| node | [Node](_types_.md#node) |
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
___
|
||||
<a id="getcommonprefixlength"></a>
|
||||
|
||||
@@ -77,7 +60,7 @@ ___
|
||||
|
||||
▸ **getCommonPrefixLength**(left: *`Uint8Array`*, right: *`Uint8Array`*): `number`
|
||||
|
||||
*Defined in [util/key.ts:60](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/key.ts#L60)*
|
||||
*Defined in [util/key.ts:46](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/key.ts#L46)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -95,7 +78,7 @@ ___
|
||||
|
||||
▸ **keyEquals**(key: * `Uint8Array` | `null`*, test: * `Uint8Array` | `null`*): `boolean`
|
||||
|
||||
*Defined in [util/key.ts:24](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/key.ts#L24)*
|
||||
*Defined in [util/key.ts:10](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/key.ts#L10)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
@@ -113,7 +96,7 @@ ___
|
||||
|
||||
▸ **keyStartsWith**(key: * `Uint8Array` | `null`*, partial: * `Uint8Array` | `null`*): `boolean`
|
||||
|
||||
*Defined in [util/key.ts:34](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/key.ts#L34)*
|
||||
*Defined in [util/key.ts:20](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/key.ts#L20)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
|
||||
|
||||
# Functions
|
||||
|
||||
<a id="addnibblesterminator"></a>
|
||||
|
||||
## addNibblesTerminator
|
||||
|
||||
▸ **addNibblesTerminator**(nibbles: *`Uint8Array`*): `Uint8Array`
|
||||
|
||||
*Defined in [util/nibbles.ts:22](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/nibbles.ts#L22)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| nibbles | `Uint8Array` |
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
___
|
||||
<a id="decodenibbles"></a>
|
||||
|
||||
## decodeNibbles
|
||||
|
||||
▸ **decodeNibbles**(value: *[NodeEncodedOrEmpty](_types_.md#nodeencodedorempty)*): `Uint8Array`
|
||||
|
||||
*Defined in [util/nibbles.ts:43](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/nibbles.ts#L43)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| value | [NodeEncodedOrEmpty](_types_.md#nodeencodedorempty) |
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
___
|
||||
<a id="encodenibbles"></a>
|
||||
|
||||
## encodeNibbles
|
||||
|
||||
▸ **encodeNibbles**(nibbles: *`Uint8Array`*): [NodeEncoded](_types_.md#nodeencoded)
|
||||
|
||||
*Defined in [util/nibbles.ts:56](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/nibbles.ts#L56)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| nibbles | `Uint8Array` |
|
||||
|
||||
**Returns:** [NodeEncoded](_types_.md#nodeencoded)
|
||||
|
||||
___
|
||||
<a id="isnibblesterminated"></a>
|
||||
|
||||
## isNibblesTerminated
|
||||
|
||||
▸ **isNibblesTerminated**(nibbles: *`Uint8Array`*): `boolean`
|
||||
|
||||
*Defined in [util/nibbles.ts:18](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/nibbles.ts#L18)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| nibbles | `Uint8Array` |
|
||||
|
||||
**Returns:** `boolean`
|
||||
|
||||
___
|
||||
<a id="removenibblesterminator"></a>
|
||||
|
||||
## removeNibblesTerminator
|
||||
|
||||
▸ **removeNibblesTerminator**(nibbles: *`Uint8Array`*): `Uint8Array`
|
||||
|
||||
*Defined in [util/nibbles.ts:35](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/nibbles.ts#L35)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| nibbles | `Uint8Array` |
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
|
||||
___
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
|
||||
## decodeNode
|
||||
|
||||
▸ **decodeNode**(encoded: * `Uint8Array` | [Node](_types_.md#node)*): [Node](_types_.md#node)
|
||||
▸ **decodeNode**(codec: *`Codec`*, encoded: * `Uint8Array` | [Node](_types_.md#node)*): [Node](_types_.md#node)
|
||||
|
||||
*Defined in [util/node.ts:31](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/node.ts#L31)*
|
||||
*Defined in [util/node.ts:30](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/node.ts#L30)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| codec | `Codec` |
|
||||
| encoded | `Uint8Array` | [Node](_types_.md#node)|
|
||||
|
||||
**Returns:** [Node](_types_.md#node)
|
||||
@@ -23,14 +24,15 @@ ___
|
||||
|
||||
## encodeNode
|
||||
|
||||
▸ **encodeNode**(node: *[Node](_types_.md#node)*): `Uint8Array`
|
||||
▸ **encodeNode**(codec: *`Codec`*, node: *[Node](_types_.md#node)*): `Uint8Array`
|
||||
|
||||
*Defined in [util/node.ts:48](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/node.ts#L48)*
|
||||
*Defined in [util/node.ts:46](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/node.ts#L46)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
| Name | Type |
|
||||
| ------ | ------ |
|
||||
| codec | `Codec` |
|
||||
| node | [Node](_types_.md#node) |
|
||||
|
||||
**Returns:** `Uint8Array`
|
||||
@@ -42,7 +44,7 @@ ___
|
||||
|
||||
▸ **getNodeType**(node: *[Node](_types_.md#node)*): [NodeType](../enums/_types_.nodetype.md)
|
||||
|
||||
*Defined in [util/node.ts:14](https://github.com/polkadot-js/common/blob/477be90/packages/trie-db/src/util/node.ts#L14)*
|
||||
*Defined in [util/node.ts:13](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-db/src/util/node.ts#L13)*
|
||||
|
||||
**Parameters:**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user