Optionally pass root through (#183)
This commit is contained in:
@@ -41,8 +41,7 @@ export default class BaseTrie {
|
||||
putRaw: RawPutFn;
|
||||
semaphore: SemaphorePromise;
|
||||
|
||||
// @ts-ignore FIXME, we need to properly check the full file
|
||||
constructor (db, root: Uint8Array, hashing: HashFn) {
|
||||
constructor (db: any, root: Uint8Array, hashing: HashFn) {
|
||||
this.putRaw = this._putRaw;
|
||||
|
||||
this.semaphore = semaphore(1);
|
||||
|
||||
@@ -36,7 +36,7 @@ export default class CheckpointTrie extends BaseTrie {
|
||||
__putDBs: any[]; // tslint:disable-line
|
||||
|
||||
// @ts-ignore FIXME, we need to properly check the full file
|
||||
constructor (db, root: Uint8Array, hashing: HashFn) {
|
||||
constructor (db: any, root: Uint8Array, hashing: HashFn) {
|
||||
super(db, root, hashing);
|
||||
|
||||
this._scratch = null;
|
||||
|
||||
@@ -9,6 +9,7 @@ import { HashFn } from './types';
|
||||
import keccakAsU8a from '@polkadot/util-crypto/keccak/asU8a';
|
||||
|
||||
import CheckpointTrie from './CheckpointTrie';
|
||||
import { EMPTY_ROOT_U8A } from './constants';
|
||||
import { prove, verifyProof } from './proof';
|
||||
|
||||
// const l = logger('trie');
|
||||
@@ -17,8 +18,7 @@ export default class Trie extends CheckpointTrie {
|
||||
static prove = prove;
|
||||
static verifyProof = verifyProof;
|
||||
|
||||
// @ts-ignore FIXME, we need to properly check the full file
|
||||
constructor (db, root, hashing: HashFn = keccakAsU8a) {
|
||||
constructor (db: any, root: Uint8Array = EMPTY_ROOT_U8A, hashing: HashFn = keccakAsU8a) {
|
||||
super(db, root, hashing);
|
||||
|
||||
// l.debug('Created Trie');
|
||||
|
||||
Reference in New Issue
Block a user