Commit Graph
59 Commits
Author SHA1 Message Date
Amaury Martiny 7a43354ece isString true for String object (#245)
* Fix isString

* value is

* Fix isHex too

* Fix isHex

* Add hex test with String
2018-11-12 16:23:18 +01: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 57eddba598 Remove from* variants, move fromString to stringTo (#233)
* Remove from* variants, move fromString to stringTo

* Bump
2018-10-18 10:30:14 +02:00
Amaury Martiny b73ca86982 Fix camel case (#220) 2018-09-28 15:17:30 +02:00
Amaury Martiny 9a6a02ce46 Add stringLowerFirst, stringUpperFirst, stringCamelCase (#219)
* Add stringLowerFirst

* Add stringUpperFirst

* Change test description

* Add camelcase

* Add header
2018-09-28 13:38:36 +02:00
Jaco Greeff adea971ee1 Expose logger format (#216) 2018-09-13 13:21:40 +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 b21940d5b4 toU8a allows Array<number> 2018-08-15 13:17:45 +02:00
Jaco Greeff 141bed8320 Format log date with moment (#181) 2018-07-27 15:22:05 +02:00
Jaco Greeff cf570fd729 Make isLe required in conversion (#180)
* Make isLe required in conversion

* Update logger Date format

* Fallback encoding sizes
2018-07-27 12:03:11 +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 2d4af33715 submitExtrinsic returns hash (#154) 2018-06-28 13:02:22 +02:00
Jaco Greeff f0c34bea09 Use bn types from @types (#153)
* Use bn.js definitions from @types

* Update isHex & isObservable
2018-06-27 15:05:55 +02:00
Jaco Greeff 73477a2809 Add tslint (#151) 2018-06-27 10:15:46 +02:00
Jaco Greeff 2f1aebe908 Update @polkadot/dev, finsing deasync jest resolution 2018-06-26 16:49:17 +02:00
Jaco Greeff 69239d56e6 Use Jest default files as fallback 2018-06-26 16:38:24 +02:00
Jaco Greeff 5759a61689 Re-introduce ip4/ip6 checks 2018-06-26 13:22:01 +02:00
Jaco Greeff ae814c646d ExtError doesn't require any arguments 2018-06-24 14:41:16 +02:00
Jaco Greeff 4470dfa7b9 TypeScript conversion (#142)
* Auto-conversion

* Cleanup type conversion errors

* Inching closer, resolution sorted

* Additional cleanups

* TS, TS everywhere

* Minor version for TS release

* Last roundups
2018-06-22 21:17:50 +02:00
Jaco Greeff 99b86d9849 Use ES6 import/export (#139)
* Use ES6 import/export

* Fix tests
2018-06-20 16:36:07 +02:00
Jaco Greeff 29d635d913 Allow u8aToU8a to convert buffers (#138)
* Allow u8aToU8a to convert buffers

* Cater for utf8 -> u8a strings
2018-06-15 11:53:18 +02:00
Jaco Greeff 461dde7c3c Copyright project authors (#137)
* Copyright project authors

* Add contributors
2018-06-13 22:24:48 +02:00
Jaco Greeff 9186a46bf9 Handle u8a null inputs in formatters (#134) 2018-06-11 10:16:03 +02:00
Jaco Greeff ece9480c94 Allow logging with colors (based on type) (#133) 2018-06-08 10:29:26 +02:00
Jaco Greeff db1a6adfc5 Cleanup hex functions (#130) 2018-05-25 10:27:53 +02:00
Jaco Greeff f1c7553a4f Update isHex check & toHex with shortening (#129)
* Update isHex check & toHex with shortening

* Basic cleanups
2018-05-24 15:00:59 +02:00
Jaco Greeff 1d35c7c3ef Remove util/jsonrpc utility functions (move to origin) (#127) 2018-05-17 19:44:34 +02:00
Jaco Greeff f8e07bada9 Add pair to/fromJson (#123) 2018-05-08 12:46:04 +02:00
Jaco Greeff 05f4754857 Add keyring publicKey <-> address (#122)
* Add keyring publicKey <-> address

* Add isObservable utility
2018-05-05 20:09:14 +02:00
Jaco Greeff a24ac88f13 Format short hex with ellipsis (#120) 2018-04-27 16:56:34 +02:00
Jaco Greeff 68e77f3abb toHexShort utility (#119) 2018-04-23 09:34:31 +02:00
Jaco Greeff 6da140a6d3 Correct u8aConcat with hex inputs (#117)
* Correct u8aConcat with hex inputs

* Add test
2018-04-17 13:45:56 +02:00
Jaco Greeff 0a7ac8a89b u8a to u8a convenience function (#116)
* Convenience u8aToU8a conversion

* u8aConcat take u8a | hex
2018-04-17 11:20:23 +02:00
Jaco Greeff 985ea40b45 Remove unneeded 0 constant (#113) 2018-04-11 10:55:19 +02:00
Jaco Greeff ac501317af Update @polkadot/api-jsonrpc (dev) (#110)
* Split parameter formatting

* Modularise triehash encodiung further
2018-03-19 13:17:26 +01:00
Jaco Greeff 827012783f Avoid u8a -> string conversion costs (#106)
* Avoid u8a -> string conversion for pair keys

* Update hexToBn tests
2018-03-12 15:18:32 +01:00
Jaco Greeff 2279c9550e Update u8aConcat call signature (#105)
* Change u8aConcat calling format

* Simplify utilkeyring test harness
2018-03-08 16:21:37 +01:00
Jaco Greeff 4b65a59c2b Fix LE hex conversion for BN (#104) 2018-03-08 12:47:54 +01:00
Jaco Greeff 3199c79ce5 Allow lazy Logger execution (#103) 2018-02-28 13:17:14 +01:00
Jaco Greeff 54fb67c597 Test for valid hex in conversions (#102) 2018-02-28 09:20:44 +01:00
Jaco Greeff f542d9d2a0 bnToU8a with bitLength on 0 (#98)
* bnToU8a with bitLength on 0

* Extra 0 check
2018-02-22 12:29:28 +01:00
Jaco Greeff be7d5842de Add u8a <-> BN endian (#95) 2018-02-21 10:59:58 +01:00
Jaco Greeff ff5396e2ec Use u8a.toString as u8aToString (#93)
* Use u8a.toString as u8aToString

* Fix lint
2018-02-20 14:37:28 +01:00
Jaco Greeff 532c526bc7 Add basic u8aToString (#92) 2018-02-20 14:01:02 +01:00
Jaco Greeff 6f8c54337b Remove {from,to}Buffer methods (#89)
* Remove all {from,to}Buffer utility methods

* Fix check & test

* Updsate docs

* Bump minor
2018-02-15 10:32:05 +01:00
Jaco Greeff 037da5a666 Show logger.debug in NODE_ENV=test (#88) 2018-02-14 09:19:14 +01:00
Jaco Greeff f79d7fe68e bnToU8a supports endian (#87)
* bnToU8a supports endian

* Update with new bn.js flow
2018-02-13 14:30:10 +01:00
Jaco Greeff 950fa51214 Ad bnToBn (convenience) (#85)
* Ad bnToBn (convenience)

* Fix flow
2018-02-12 17:50:57 +01:00
Jaco Greeff 5c270164ec Add u8aFixLength (#84) 2018-02-12 17:10:40 +01:00