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
This commit is contained in:
@@ -21,7 +21,7 @@ import internalDecode from './decode';
|
||||
* decode(new Uint8Array([0x83, 0x64, 0x6f, 0x67])); // => 'dog' as Uint8Array
|
||||
* ```
|
||||
*/
|
||||
export default function decoder (input?: Uint8Array): Uint8Array | Array<any> {
|
||||
export default function decoder (input?: null | Uint8Array): Uint8Array | Array<any> {
|
||||
try {
|
||||
if (!input || input.length === 0) {
|
||||
return new Uint8Array([]);
|
||||
|
||||
Reference in New Issue
Block a user