Commit Graph
37 Commits
Author SHA1 Message Date
Jaco Greeff cab0713f33 Make exports consistent (#269)
* Make exports consistent

* Cleanup trie impl
2018-12-09 13:25:14 +01:00
Jaco Greeff fbd6c1e9bf Cleanup more Codeclimate issues (#267)
* Cleanup more Codeclimate issues

* Cleanup unused imports
2018-12-08 14:34:36 +01:00
Jaco Greeff 3de334c966 Cleanup some Codeclimate smells (#266) 2018-12-08 12:40:48 +01:00
Jaco Greeff f82092e603 Allow blake2 & parity-codec in trie (#251)
* Start codec implementation

* Expose all constants

* NodeHeader encoding/decoding

* Encoding in NodeHeader

* Constants for Node types

* Moce codec to trie-codec

* Encode/decode in place (untested)

* WIP, tests starting to be put in place

* One passing test :)

* Another test bites the dust...

* One more test down...

* One more down

* Additional tests

* Formatting

* Long keys passing

* Trie tests

* Follow the script, no all-in-all encoder

* First simple trie test passing

* Another one down

* Extra checks remove (debug)

* 80% there with tests...

* One more, one left

* Trie tests passing

* ISC -> Apache-2.0

* Add compact util functions

* Tests to TypeScript

* Remove @polkadot/types deps, ethereum stub

* Bump

* Genesis tests with chainspecs

* Cleanup tests (ease of debugging)

* Substrate test passes, branch fails (again)

* Checks passing, tests passing

* Re-add Ethereum & snapshot tests (not passing atm)

* Re-add index test (also not 100%)

* Mid-way in generic trie-root

* Cleanup ethereumjs-testing definitions

* Update deps

* Less intrusive renames in trie-hash

* Self-review cleanups #1

* asNibbles -> toNibbles

* Cleanups

* Expand tests

* Cleanup imports

* Fix logger test (fly-by refactor)

* Update snapshot test
2018-11-22 14:29:34 +01:00
Jaco Greeff 3bc1b7541b LICENSE and README updates (#254)
* LICENSE and README updates

* Remove duplicated definition

* Remove duplicated file
2018-11-21 12:26:38 +01:00
Jaco Greeff 5130f4c78a Remove debug logging (MemoryDb) 2018-10-24 16:27:58 +02:00
Luke Schoen 1fb1f9d743 docs: Fixes #157. Add Gitbook documentation for Polkadot-JS Common (#231)
* fix: Remove prior docs attempt files

* docs: Add Gitbook docs for common repo with examples. See detailed comments

* Remove old attempt at docs in docs/ folders

* Add Typedoc config typedoc.js

* Add .nvmrc for easily switching Node.js version with NVM

* Add ESLint config .eslintrc.json and .eslintignore

* Fix in tsconfig.json so is keyring not util-keyring

* Update package.json with dependencies and script same as in polkadot-js/api

* Update root README fixing CI icons, adding guide same as in polkadot-js/api, and fixing link to keyring, not util-keyring

* Update root .gitignore with Gitbook build files same as in polkadot-js/api

* Add Gitbook docs structure same as in polkadot-js/api

* Add Gitbook examples for keyring, trie-db, util-crypto

* Add Gitbook outer summary for the menu, Readme, logo and styles same as in polkadot-js/api

* Add Gitbook config book.json

* docs: Remove db and util-rlp from Gitbook summary menu since RLP not in PoC-3

* docs: Add Typedocs with examples for db MemoryDb and DiskDb

* docs: Update db/ Readme with CI icons fixed, and indicating that no methods exposed in Common Docs

* docs: Update keyring Readme with CI icons fixed and link to Common Docs

* fix: Fix keyring package.json info to refer to common, not client

* fix: Updates license in 4x files in keyring/address folder with keyring, not util-keyring

* docs: Add Typedocs to Keyring class, pair function, and testKeyring function

* docs: Update keyring Readme with CI icons fixed and link to Common Docs

* fix: Update package.json moving @polkadot/db from devDependencies to dependencies

* fix: Update test to iterate array not object with forEach

* fix: Use semicolon instead of comma in tests to fix linting errors. Fix typo

* docs: Add Typedoc to Trie class

* docs: Add Typedoc to is functions

* docs: Update keyring Readme with CI icons fixed and link to Common Docs

* fix: Add return type to encodeAux function

* docs: Add Typedoc to encode function

* fix: Fix formatting of Typedoc example for root

* docs: Add Typedoc for genRoot

* docs: Add Typedoc for pairsUniq

* docs: Add Typedoc for getSharedLength

* docs: Add Typedoc for sharedPrefixLength

* fix: Fix formatting of Typedoc example for rootOrdered, asNibbles, fromNibbles

* fix: Various fixes to util-crypto. See commit detail comments

* Update root Readme with class and function info
* Fix typos and Typedoc examples
* Expose mnemonic by exporting it in an index.ts
* Fix naming from naclKeypair to naclKeypairFromRandom
* Fix typos
* Fix randomAsU8s to be randomAsU8a
* Fix spelling of bitLength

* fix: Various fixes to util-rlp. See detailed commit comments

* Update keyring Readme with CI icons fixed and link to Common Docs mentioning since RLP not in PoC-3 nothing exposed in Common Docs
* Add Typedocs
* Move Typedocs to different file so they appear in Common Docs

* fix: Various fixes to util. See detailed commit comments

* Update root Readme to use Yarn and list and explain exposed Common Docs methods
* Fix typos and Typedoc examples

* fix: Restore tests back using variable they were iterating over before

* docs: Move nested part of Summary to individual package Readme. Add Usage to Readmes

* fix: Add missing semicolon to existing test

* fix: Remove docs/gitbook folder and files since generated by CI

* feat: Update Gitignore to ignore CI-generated files like .html and docs/gitbook/ folder

* docs: Remove CI-icons from all packages within polkadot-js/common, except its root Readme

* fix: Update to incorporate changes from PR #233 and #229

* fix: Ignore build directories in Jest tests using modulePathIgnorePatterns

* fix: Remove useless docs/html from .gitignore since there is no html subdirectory

* fix: Update util-crypto README with link to mnemonicToSeed instead of toSecret

* docs: Update keyring create account example to show result to user

* fix: Update dependencies in examples so the examples work again

* fix: Update keyring example 02 load accounts not to use addFromAddress

* fix: Update .gitignore so it is suitable for both polkadot-js common and api

* fix: Adjust .gitignore after testing changes that work with polkadot-js api too

* fix: Resolve .gitignore to overcome FileNotFoundError: No README file (or is ignored)

* fix: Remove from Git tracking docs/.nojekyll since generated

* fix: Add lerna to gitignore to match api repo

* Revert to original .gitignore. Does not work without Gitbooks files Git tracked

* docs: Hide trie-db Examples since have limited use
2018-10-19 17:33:58 +02:00
Jaco Greeff 65b8468e5b Import util via {...} (#236)
* Import util via {...}

* Fix test failures
2018-10-18 15:24:13 +02:00
Jaco Greeff daf84b850d Mark FlatDb as closed when closed 2018-09-07 10:44:44 +02:00
Jaco Greeff 769e745e20 Progress calculation (snapshot) 2018-09-07 09:57:32 +02:00
Jaco Greeff 61357fb289 Add drop() to BaseDb 2018-09-07 09:29:01 +02:00
Jaco Greeff b5c466c410 Add size compare for before/after snapshot 2018-09-06 22:53:58 +02:00
Jaco Greeff c056480c28 Add size() to BaseDb 2018-09-06 22:48:51 +02:00
Jaco Greeff ea8ff283fc Rename snapshot method 2018-09-06 22:28:48 +02:00
Jaco Greeff 0707a238d5 Export rename(base, file) on BaseDb 2018-09-06 22:15:11 +02:00
Jaco Greeff 72bb79fdbd Show snapshot completion info 2018-09-06 21:30:10 +02:00
Jaco Greeff 6bb0f77c09 Return key count from snapshot creation 2018-09-06 21:09:32 +02:00
Jaco Greeff 56f80aa79b Update (linting) 2018-09-06 20:58:17 +02:00
Jaco Greeff d08f7832fd Write snapshot directly to destination Trie 2018-09-06 20:37:39 +02:00
Jaco Greeff 1149d8836b Cleanup/speedup snapshot creation entries 2018-09-06 18:03:57 +02:00
Jaco Greeff 0369450ff1 Expose snapshot methods in type 2018-09-06 17:52:20 +02:00
Jaco Greeff cc7227846e Add ability for the Trie to snapshot current root (#214)
* Add ability for the Trie to snapshot current root

* Allow ability to empty/drop database
2018-09-06 17:22:30 +02:00
Jaco Greeff 3b6407f9b7 LevelDb interface update (#207)
* LevelDb interface update

* Update disk interfaces to base + name
2018-09-02 11:00:39 +02:00
Jaco Greeff d15172d0b1 Log RLP failures with full input 2018-09-01 23:51:12 +02:00
Jaco Greeff 3bcd45cb28 Add getRoot/setRoot to interface 2018-09-01 23:42:55 +02:00
Jaco Greeff 1106579164 Export TriedDb type 2018-09-01 23:31:20 +02:00
Jaco Greeff 130163b74e Trie implements TxDb interface fully 2018-09-01 22:44:45 +02:00
Jaco Greeff e1135a665b Re-implementation of Patricia-Merkle Trie (#203)
* Start of trie-db re-implementation

* WIP commit

* More WIP

* WIP, seems complete, untested

* Ported trie-db operational

* Add Ethereum trie tests

* Use u8aConcat to construct u8a

* Basic RocksDb interface

* Combine engines into DB, expand tests

* Update Trie with transaction wrapper

* LevelDb (sync) interface

* Remove unused (for now) package (compatibility)

* trie-d -> trie-db-old, trie-db-ext -> trie-db

* Version bump

* Skip old trie tests (package to be removed)

* Skip tests (fixed)

* Remove non-used RocksDb spec

* Skip FileFlat tests (deprecated?)
2018-09-01 22:17:57 +02:00
Jaco Greeff 0c896363c5 Move trieRoot default to inheritance root (#184) 2018-07-30 11:50:19 +02:00
Jaco Greeff 07522512b3 Optionally pass root through (#183) 2018-07-30 10:46:19 +02:00
Jaco Greeff 43031d659a Disable debug logs in trie-db (#163)
* Disable logs in trie-db

* FRix unused imports

* Unused imports (part II)

* Ummm, yes.
2018-07-04 13:38:44 +02:00
Jaco Greeff 439a61a593 Keey trie-db package as async library (#162) 2018-07-03 22:03:02 +02:00
Jaco Greeff 0f6d43f62c Remove temp db interface, cleanup logging (#161) 2018-07-03 16:09:48 +02:00
Jaco Greeff 538069c24b Add basic hashdb (wrong package) (#160) 2018-07-03 15:06:38 +02:00
Jaco Greeff 243df6d030 Add MemoryDb Trie-wrapper (#159)
* Pass along hashing function (keccak or blake2)

* Allow syncify to handle Promises with no return values

* Add sync MemoryDb interface
2018-07-03 14:31:01 +02:00
Jaco Greeff 73477a2809 Add tslint (#151) 2018-06-27 10:15:46 +02:00
Jaco Greeff 78e01a0e16 Combine util, types & trie into common (#150)
* Pull in trie repo

* Bring in types repo
2018-06-26 21:26:51 +02:00