* 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?)
21 lines
573 B
TypeScript
21 lines
573 B
TypeScript
// Copyright 2017-2018 @polkadot/trie-db authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the ISC license. See the LICENSE file for details.
|
|
|
|
import hashing from '@polkadot/util-crypto/keccak/asU8a';
|
|
import trieRoot from '@polkadot/trie-hash/root';
|
|
|
|
const EMPTY_NODE = new Uint8Array();
|
|
const EMPTY_U8A = trieRoot([]);
|
|
const EMPTY_U8A_STR = trieRoot([]);
|
|
const EMPTY_HASH = hashing(EMPTY_U8A);
|
|
const EMPTY_HASH_STR = EMPTY_HASH.toString();
|
|
|
|
export {
|
|
EMPTY_NODE,
|
|
EMPTY_HASH,
|
|
EMPTY_HASH_STR,
|
|
EMPTY_U8A,
|
|
EMPTY_U8A_STR
|
|
};
|