Commit Graph
111 Commits
Author SHA1 Message Date
Jaco Greeff e09d0ca5ca Allow with expanded SI unit (m -> milli) (#505) 2020-01-23 16:07:01 +01:00
Jaco Greeff 241febb707 Bump deps (#497) 2020-01-06 13:43:49 +01:00
Jaco Greeff 76a9f2787c assert does asserts conditions (TS 3.7) (#489)
* assert does asserts conditions (TS 3.7)

* Throw in condition

* Fix cleanup
2019-11-11 09:43:05 +01:00
Jaco Greeff f38975d126 Allow forcing of units in formatBalance (#486) 2019-11-05 13:53:49 +01:00
Keith Ingram 2f5df085b6 move SiDef type (#485) 2019-10-31 19:19:56 +02:00
Jaco Greeff 00374effc5 string <-> hex conversion utilities (#470)
* string <-> hex conversion utilities

* Add tests
2019-09-12 13:48:06 +02:00
Jaco Greeff a5d23696e6 Remove ExtError 2019-09-10 17:44:47 +02:00
Jaco Greeff 5e494b7163 Fix ExtError construction 2019-09-10 17:03:21 +02:00
Jaco Greeff 25fc033728 typescript-eslint 2 (#462)
* typescript-eslint 2

* startsWith fixes

* padStart/padEnd
2019-08-30 12:24:16 +02:00
Jaco Greeff ef385913c4 Bump deps (#461)
* Bump deps

* Window & globalThis
2019-08-29 15:50:21 +02:00
Jaco Greeff a8b28a2172 Bump dev (#460)
* Bump dev

* Linting cleanups (stricter rules)
2019-08-27 12:11:26 +02:00
Jaco Greeff 09e0b80dc6 assertSingleton warns, not throws (#455) 2019-08-09 10:13:43 +02:00
WoeOm de7e9f8fba Handing high precision scenes (#450) 2019-07-30 07:21:23 +02:00
Jaco Greeff 5d7ddcb708 Allow bnToBn to handle compact (or any with toBn) (#449) 2019-07-27 21:42:06 +02:00
Jaco Greeff 15555614f6 formatBalance allows Compact inputs (#448) 2019-07-27 07:34:00 +02:00
Jaco Greeff b4e369c166 Align common definitions 2019-07-14 13:46:09 +02:00
Jaco Greeff 80db504a3b Swap to using eslint (#435)
* WIP

* ... and more

* yet more...

* and examples (more-or-less) fixed

* Only problematic promisify left...

* Last batch

* rm config header

* Update

* Use Record

* Bumps
2019-07-14 11:12:46 +02:00
Jaco Greeff 23e3ff0ac3 Some additional small tests (#429)
* Some additional small tests

* Missing MemoryDb from previous commit
2019-07-09 11:07:55 +02:00
Jaco Greeff bb8877894b Cater for negative values in number formats (#415)
* Cater for negative values in number formats

* Handle edge-case where -text is provided
2019-06-04 09:43:11 +02:00
Jaco Greeff 9d4c36de92 Assert on non-integer inputs (#411)
* Assert on non-integer inputs

* Return input value in assert

* alphabetical

* assert after 0 return

* Lint issues (after on-GH fix)
2019-05-27 12:25:22 +02:00
kwingram25 d8b3021776 Fix min max w 1 argument error (#405)
* Add BN min/max

* fixes

* array 2+ type

* assert

* rv hardcoding

* remove list type

* rv import

* fix error w 1 arg
2019-05-09 17:58:51 +02:00
kwingram25 b0d8c85057 Remove BnList type (#402)
* Add BN min/max

* fixes

* array 2+ type

* assert

* rv hardcoding

* remove list type

* rv import
2019-05-08 11:38:44 +02:00
kwingram25 9c03ec82ca Add BN min/max functions (#401)
* Add BN min/max

* fixes

* array 2+ type

* assert

* rv hardcoding
2019-05-07 18:13:41 +02:00
Jaco Greeff b15ae9e2c8 Pull in functions from ui-util (#393) 2019-04-02 14:18:44 +02:00
Jaco Greeff 5d739191f0 use typeof window (for global detection) (#385)
* use typeof window (for global detection)

* ignore always true linting
2019-03-27 09:50:19 +01:00
Jaco Greeff 5bc4ea2fb3 Add singleton package assertion (& add to keyring) (#384)
* Add signleton package assertion (& add to keyring)

* CHANGELOG

* Add test
2019-03-26 16:53:08 +01:00
Jaco Greeff 663b8ca741 Swap crypto to WASM (JS as fallback) (#378) 2019-03-22 11:31:54 +01:00
Jaco Greeff de67a88f45 Remove /index imports (swap to bare) (#362) 2019-03-14 08:41:00 +01:00
Stefanie Doll 2602a43eab Parsing function for JSON objects (#359)
* Added parsin function for JSON objects

* Re-defined wording

* code formatting/ new lines
2019-03-12 11:58:11 +01:00
Jaco Greeff 4f719ce377 Remove syncify (NodeJS only) (#349)
* Remove syncify (NodeJS only)

* Bump version (interface change)
2019-03-04 16:47:55 +01:00
Jaco Greeff 1e6eb2c283 Converts tests to TypeScript (#300) 2019-02-14 10:48:08 +01:00
Jaco Greeff 89030f41b3 2019 (#287)
* 2019

* Bump deps

* Cleanup deps

* Update dev (markdown plugin)

* Bump deps (hopefully finally fixes doc gen)

* Fix inherit plugin
2019-01-04 14:50:50 +01:00
Jaco Greeff d47b865df9 TextEncoder/Decoder polyfill optimisation (#286) 2019-01-03 13:52:03 +01:00
Jaco Greeff 7b9ca4ad6e Minimum number of bytes for compact encoding (#285)
* Minimum number of bytes for compact encoding

* Cleanup comment
2018-12-25 13:29:33 +01:00
Amaury Martiny 0c8547d49c Add tests from Rust (#283)
* Add tests from Rust

* Fix compact encoding
2018-12-21 15:15:59 +01:00
Jaco Greeff f011334152 Add actual real-test data, detect bitLength (#282)
* Add actual real-test data, detect bitLength

* Cleanup misplaced log

* Cleanup test, no length passed
2018-12-21 12:47:40 +01:00
Jaco Greeff 5585a16814 Fix large-value Compact encoding (#281) 2018-12-21 10:04:11 +01:00
Amaury Martiny 74744e694b Fix negative BNs (#280)
* Fix bug fromTwos

* Better default values

* Fix bugs

* Fix tests

* Eth uses BE!

* Add back compat

* Fix test

* Remove useless arg
2018-12-20 17:00:57 +01:00
Jaco Greeff 3988773572 Bump deps (#279)
* Bump deps

* Bump local deps

* Add Uint8Array fill polyfill
2018-12-20 10:53:43 +01:00
Amaury Martiny 0e30c48379 Add conversion to negative BN's (#277)
* Support negative number hexToBn

* Fix u8aToBn

* Update signature

* Update params description
2018-12-19 18:43:44 +01:00
Jaco Greeff 6d8e78840b Expand and organise polyfills (#276) 2018-12-18 15:15:10 +01:00
Jaco Greeff 7188f6b67a Polyfills for RN support (#275)
* Polyfills for RN support

* Expand polyfill tests
2018-12-18 09:59:02 +01:00
Jaco Greeff 30bf357d5d React native support, strengthen TextEncoder/Decoder (#273) 2018-12-17 21:24:02 +01:00
Jaco Greeff cd7f64486b Fallback fallback ascii-only encoder/decoder (#271) 2018-12-17 14:12:52 +01:00
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 2be211cc98 Optimise u8aToHex function (32% of original time) (#265) 2018-12-06 12:04:08 +01:00
Jaco Greeff ccfed2a8b4 Bump @polkadot/dev, expand compact description (#263) 2018-12-03 14:29:30 +01:00
Jaco Greeff e3b45e7617 Rename types.d.ts -> types.ts (#262) 2018-11-29 11:54:25 +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