Export TriedDb type
This commit is contained in:
@@ -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<Uint8Array> {
|
||||
export default class Trie implements TrieDb {
|
||||
private db: TxDb;
|
||||
private txRoot: Uint8Array;
|
||||
private rootHash: Uint8Array;
|
||||
|
||||
@@ -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<Uint8Array> {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user