From 1106579164ba68f51ccbd19953cd67c5c91a18ec Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sat, 1 Sep 2018 23:31:20 +0200 Subject: [PATCH] Export TriedDb type --- packages/trie-db/src/index.ts | 4 ++-- packages/trie-db/src/types.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/trie-db/src/index.ts b/packages/trie-db/src/index.ts index b529f51c9..ecf84dd92 100644 --- a/packages/trie-db/src/index.ts +++ b/packages/trie-db/src/index.ts @@ -3,7 +3,7 @@ // of the ISC license. See the LICENSE file for details. import { TxDb, ProgressCb } from '@polkadot/db/types'; -import { Node, NodeBranch, NodeEncodedOrEmpty, NodeKv, NodeNotEmpty, NodeType } from './types'; +import { TrieDb, Node, NodeBranch, NodeEncodedOrEmpty, NodeKv, NodeNotEmpty, NodeType } from './types'; import MemoryDb from '@polkadot/db/Memory'; import isNull from '@polkadot/util/is/null'; @@ -20,7 +20,7 @@ import { EMPTY_HASH, EMPTY_U8A } from './constants'; const l = logger('trie/db'); -export default class Trie implements TxDb { +export default class Trie implements TrieDb { private db: TxDb; private txRoot: Uint8Array; private rootHash: Uint8Array; diff --git a/packages/trie-db/src/types.ts b/packages/trie-db/src/types.ts index 9000a048a..8be33991d 100644 --- a/packages/trie-db/src/types.ts +++ b/packages/trie-db/src/types.ts @@ -2,6 +2,8 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. +import { TxDb } from '@polkadot/db/types'; + export enum NodeType { EMPTY = 0, LEAF = 1, @@ -30,3 +32,6 @@ export type NodeKv = [EncodedPath, NodeEncodedOrEmpty]; export type NodeNotEmpty = NodeKv | NodeBranch; export type Node = NodeEmpty | NodeNotEmpty; + +export interface TrieDb extends TxDb { +}