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;
26
26
* The tree has no balancing requirements.
27
27
*/
28
28
export 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
+ }
29
36
export declare function isTaptree ( scriptTree : any ) : scriptTree is Taptree ;
30
37
export interface TinySecp256k1Interface {
31
38
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 {
93
93
*/
94
94
export type Taptree = [ Taptree | Tapleaf , Taptree | Tapleaf ] | Tapleaf ;
95
95
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
+
96
104
export function isTaptree ( scriptTree : any ) : scriptTree is Taptree {
97
105
if ( ! Array ( scriptTree ) ) return isTapleaf ( scriptTree ) ;
98
106
if ( scriptTree . length !== 2 ) return false ;
You can’t perform that action at this time.
0 commit comments