File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ export declare function isTapleaf(o: any): o is Tapleaf;
2626 * The tree has no balancing requirements.
2727 */
2828export type Taptree = [ Taptree | Tapleaf , Taptree | Tapleaf ] | Tapleaf ;
29+ export interface HuffmanTapTreeNode {
30+ /**
31+ * weight is the sum of the weight of all children under this node
32+ */
33+ weight : number ;
34+ node : Taptree ;
35+ }
2936export declare function isTaptree ( scriptTree : any ) : scriptTree is Taptree ;
3037export interface TinySecp256k1Interface {
3138 isXOnlyPoint ( p : Uint8Array ) : boolean ;
Original file line number Diff line number Diff line change @@ -93,6 +93,14 @@ export function isTapleaf(o: any): o is Tapleaf {
9393 */
9494export type Taptree = [ Taptree | Tapleaf , Taptree | Tapleaf ] | Tapleaf ;
9595
96+ export interface HuffmanTapTreeNode {
97+ /**
98+ * weight is the sum of the weight of all children under this node
99+ */
100+ weight : number ;
101+ node : Taptree ;
102+ }
103+
96104export function isTaptree ( scriptTree : any ) : scriptTree is Taptree {
97105 if ( ! Array ( scriptTree ) ) return isTapleaf ( scriptTree ) ;
98106 if ( scriptTree . length !== 2 ) return false ;
You can’t perform that action at this time.
0 commit comments