Skip to content

Commit ac95c73

Browse files
Merge pull request #5633 from BitGo/BTC-1826.test-tr1of3-tree.2
feat(utxo-core): add taproot with taptree support in test fixtures and templates
2 parents 6801518 + 0133ac9 commit ac95c73

File tree

4 files changed

+1039
-47
lines changed

4 files changed

+1039
-47
lines changed

modules/utxo-core/src/testutil/descriptor/descriptors.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function toDescriptorMap(v: Record<string, string>): DescriptorMap {
4040

4141
export type DescriptorTemplate =
4242
| 'Wsh2Of3'
43+
| 'Tr1Of3-NoKeyPath-Tree'
4344
| 'Tr2Of3-NoKeyPath'
4445
| 'Wsh2Of2'
4546
/*
@@ -71,6 +72,7 @@ export function getPsbtParams(t: DescriptorTemplate): Partial<PsbtParams> {
7172
switch (t) {
7273
case 'Wsh2Of3':
7374
case 'Wsh2Of2':
75+
case 'Tr1Of3-NoKeyPath-Tree':
7476
case 'Tr2Of3-NoKeyPath':
7577
return {};
7678
case 'Wsh2Of3CltvDrop':
@@ -104,6 +106,13 @@ function getDescriptorNode(
104106
return {
105107
tr: [getUnspendableKey(), { multi_a: multiArgs(2, 3, keys, path) }],
106108
};
109+
case 'Tr1Of3-NoKeyPath-Tree':
110+
return {
111+
tr: [
112+
getUnspendableKey(),
113+
[{ pk: toXPub(keys[0], path) }, [{ pk: toXPub(keys[1], path) }, { pk: toXPub(keys[2], path) }]],
114+
],
115+
};
107116
}
108117
throw new Error(`Unknown descriptor template: ${template}`);
109118
}

0 commit comments

Comments
 (0)