@caravan/psbt 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,111 @@
1
+ import { BufferReader, BufferWriter } from "bufio";
2
+
3
+ import { bufferize, readAndSetKeyPairs, serializeMap } from "./functions";
4
+ import { Key, KeyType, Value } from "./types";
5
+ import { PSBT_MAGIC_BYTES } from "../psbt";
6
+ import { PsbtV2 } from "./psbtv2";
7
+
8
+ /**
9
+ * This abstract class is provided for utility to allow for mapping, map
10
+ * copying, and serialization operations for psbts. This does almost no
11
+ * validation, so do not rely on it for ensuring a valid psbt.
12
+ */
13
+ export abstract class PsbtV2Maps {
14
+ // These maps directly correspond to the maps defined in BIP0174 and extended
15
+ // in BIP0370
16
+ protected globalMap: Map<Key, Value> = new Map();
17
+ protected inputMaps: Map<Key, Value>[] = [];
18
+ protected outputMaps: Map<Key, Value>[] = [];
19
+
20
+ constructor(psbt?: Buffer | string) {
21
+ if (!psbt) {
22
+ return;
23
+ }
24
+
25
+ const buf = bufferize(psbt);
26
+ const br = new BufferReader(buf);
27
+ if (!br.readBytes(PSBT_MAGIC_BYTES.length, true).equals(PSBT_MAGIC_BYTES)) {
28
+ throw Error("PsbtV2 magic bytes are incorrect.");
29
+ }
30
+ // Build globalMap
31
+ readAndSetKeyPairs(this.globalMap, br);
32
+ if (
33
+ // Assuming that psbt being passed in is a valid psbtv2
34
+ !this.globalMap.has(KeyType.PSBT_GLOBAL_VERSION) ||
35
+ !this.globalMap.has(KeyType.PSBT_GLOBAL_TX_VERSION) ||
36
+ !this.globalMap.has(KeyType.PSBT_GLOBAL_INPUT_COUNT) ||
37
+ !this.globalMap.has(KeyType.PSBT_GLOBAL_OUTPUT_COUNT) ||
38
+ this.globalMap.has("00") // PsbtV2 must exclude key 0x00
39
+ ) {
40
+ throw Error("Provided PsbtV2 not valid. Missing required global keys.");
41
+ }
42
+
43
+ // Build inputMaps
44
+ const inputCount =
45
+ this.globalMap.get(KeyType.PSBT_GLOBAL_INPUT_COUNT)?.readUInt8(0) ?? 0;
46
+ for (let i = 0; i < inputCount; i++) {
47
+ const map = new Map<Key, Value>();
48
+ readAndSetKeyPairs(map, br);
49
+ this.inputMaps.push(map);
50
+ }
51
+
52
+ // Build outputMaps
53
+ const outputCount =
54
+ this.globalMap.get(KeyType.PSBT_GLOBAL_OUTPUT_COUNT)?.readUInt8(0) ?? 0;
55
+ for (let i = 0; i < outputCount; i++) {
56
+ const map = new Map<Key, Value>();
57
+ readAndSetKeyPairs(map, br);
58
+ this.outputMaps.push(map);
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Return the current state of the psbt as a string in the specified format.
64
+ */
65
+ public serialize(format: "base64" | "hex" = "base64"): string {
66
+ // Build hex string from maps
67
+ const bw = new BufferWriter();
68
+ bw.writeBytes(PSBT_MAGIC_BYTES);
69
+ serializeMap(this.globalMap, bw);
70
+
71
+ for (const map of this.inputMaps) {
72
+ serializeMap(map, bw);
73
+ }
74
+
75
+ for (const map of this.outputMaps) {
76
+ serializeMap(map, bw);
77
+ }
78
+
79
+ return bw.render().toString(format);
80
+ }
81
+
82
+ /**
83
+ * Copies the maps in this PsbtV2 object to another PsbtV2 object.
84
+ *
85
+ * NOTE: This copy method is made available to achieve parity with the PSBT
86
+ * api required by `ledger-bitcoin` for creating merklized PSBTs. HOWEVER, it
87
+ * is not recommended to use this when avoidable as copying maps bypasses the
88
+ * validation defined in the constructor, so it could create a psbtv2 in an
89
+ * invalid psbt state. PsbtV2.serialize is preferable whenever possible.
90
+ */
91
+ public copy(to: PsbtV2) {
92
+ this.copyMap(this.globalMap, to.globalMap);
93
+ this.copyMaps(this.inputMaps, to.inputMaps);
94
+ this.copyMaps(this.outputMaps, to.outputMaps);
95
+ }
96
+
97
+ private copyMaps(
98
+ from: readonly ReadonlyMap<string, Buffer>[],
99
+ to: Map<string, Buffer>[],
100
+ ) {
101
+ from.forEach((m, index) => {
102
+ const to_index = new Map<Key, Value>();
103
+ this.copyMap(m, to_index);
104
+ to[index] = to_index;
105
+ });
106
+ }
107
+
108
+ private copyMap(from: ReadonlyMap<string, Buffer>, to: Map<string, Buffer>) {
109
+ from.forEach((v, k) => to.set(k, Buffer.from(v)));
110
+ }
111
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Hex encoded string containing `<keytype><keydata>`. A string is needed for
3
+ * Map.get() since it matches by identity. Most commonly, a `Key` only contains a
4
+ * keytype byte, however, some with keydata can allow for multiple unique keys
5
+ * of the same type.
6
+ */
7
+ export type Key = string;
8
+
9
+ /**
10
+ * Values can be of various different types or formats. Here we leave them as
11
+ * Buffers so that getters can decide how they should be formatted.
12
+ */
13
+ export type Value = Buffer;
14
+
15
+ export type NonUniqueKeyTypeValue = { key: string; value: string | null };
16
+
17
+ /**
18
+ * KeyTypes are hex bytes, but within this module are used as string enums to
19
+ * assist in Map lookups. See type `Key` for more info.
20
+ */
21
+ export enum KeyType {
22
+ PSBT_GLOBAL_XPUB = "01",
23
+ PSBT_GLOBAL_TX_VERSION = "02",
24
+ PSBT_GLOBAL_FALLBACK_LOCKTIME = "03",
25
+ PSBT_GLOBAL_INPUT_COUNT = "04",
26
+ PSBT_GLOBAL_OUTPUT_COUNT = "05",
27
+ PSBT_GLOBAL_TX_MODIFIABLE = "06",
28
+ PSBT_GLOBAL_VERSION = "fb",
29
+ PSBT_GLOBAL_PROPRIETARY = "fc",
30
+
31
+ PSBT_IN_NON_WITNESS_UTXO = "00",
32
+ PSBT_IN_WITNESS_UTXO = "01",
33
+ PSBT_IN_PARTIAL_SIG = "02",
34
+ PSBT_IN_SIGHASH_TYPE = "03",
35
+ PSBT_IN_REDEEM_SCRIPT = "04",
36
+ PSBT_IN_WITNESS_SCRIPT = "05",
37
+ PSBT_IN_BIP32_DERIVATION = "06",
38
+ PSBT_IN_FINAL_SCRIPTSIG = "07",
39
+ PSBT_IN_FINAL_SCRIPTWITNESS = "08",
40
+ PSBT_IN_POR_COMMITMENT = "09",
41
+ PSBT_IN_RIPEMD160 = "0a",
42
+ PSBT_IN_SHA256 = "0b",
43
+ PSBT_IN_HASH160 = "0c",
44
+ PSBT_IN_HASH256 = "0d",
45
+ PSBT_IN_PREVIOUS_TXID = "0e",
46
+ PSBT_IN_OUTPUT_INDEX = "0f",
47
+ PSBT_IN_SEQUENCE = "10",
48
+ PSBT_IN_REQUIRED_TIME_LOCKTIME = "11",
49
+ PSBT_IN_REQUIRED_HEIGHT_LOCKTIME = "12",
50
+ PSBT_IN_TAP_KEY_SIG = "13",
51
+ PSBT_IN_TAP_SCRIPT_SIG = "14",
52
+ PSBT_IN_TAP_LEAF_SCRIPT = "15",
53
+ PSBT_IN_TAP_BIP32_DERIVATION = "16",
54
+ PSBT_IN_TAP_INTERNAL_KEY = "17",
55
+ PSBT_IN_TAP_MERKLE_ROOT = "18",
56
+ PSBT_IN_PROPRIETARY = "fc",
57
+
58
+ PSBT_OUT_REDEEM_SCRIPT = "00",
59
+ PSBT_OUT_WITNESS_SCRIPT = "01",
60
+ PSBT_OUT_BIP32_DERIVATION = "02",
61
+ PSBT_OUT_AMOUNT = "03",
62
+ PSBT_OUT_SCRIPT = "04",
63
+ PSBT_OUT_TAP_INTERNAL_KEY = "05",
64
+ PSBT_OUT_TAP_TREE = "06",
65
+ PSBT_OUT_TAP_BIP32_DERIVATION = "07",
66
+ PSBT_OUT_PROPRIETARY = "fc",
67
+ }
68
+
69
+ /**
70
+ * Provided to friendly-format the `PSBT_GLOBAL_TX_MODIFIABLE` bitmask from
71
+ * `PsbtV2.PSBT_GLOBAL_TX_MODIFIABLE` which returns
72
+ * `PsbtGlobalTxModifiableBits[]`.
73
+ */
74
+ export enum PsbtGlobalTxModifiableBits {
75
+ INPUTS = "INPUTS", // 0b00000001
76
+ OUTPUTS = "OUTPUTS", // 0b00000010
77
+ SIGHASH_SINGLE = "SIGHASH_SINGLE", // 0b00000100
78
+ }
79
+
80
+ export enum SighashType {
81
+ SIGHASH_ALL = 0x01,
82
+ SIGHASH_NONE = 0x02,
83
+ SIGHASH_SINGLE = 0x03,
84
+ SIGHASH_ANYONECANPAY = 0x80,
85
+ }
@@ -0,0 +1,4 @@
1
+ export { PSBT_MAGIC_BYTES } from "../psbt";
2
+ export const PSBT_MAP_SEPARATOR = Buffer.from([0x00]);
3
+ export const BIP_32_NODE_REGEX = /(\/[0-9]+'?)/gi;
4
+ export const BIP_32_HARDENING_OFFSET = 0x80000000;
@@ -1,258 +0,0 @@
1
-
2
- 
3
- > @caravan/psbt@0.0.0 ci
4
- > npm run lint && npm run test
5
-
6
-
7
- > @caravan/psbt@0.0.0 lint
8
- > eslint src
9
-
10
- 
11
- /Users/atreides/repos/caravan-monorepo/packages/caravan-psbt/src/psbt.ts
12
-  43:54 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
13
-  113:23 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
14
-  268:7 warning 'localPSBT' is never reassigned. Use 'const' instead prefer-const
15
-  376:7 warning 'psbt' is never reassigned. Use 'const' instead prefer-const
16
-  415:7 warning 'psbt' is never reassigned. Use 'const' instead prefer-const
17
-  430:13 warning 'signature' is never reassigned. Use 'const' instead prefer-const
18
- 
19
- /Users/atreides/repos/caravan-monorepo/packages/caravan-psbt/src/psbtv2.test.ts
20
-  1025:42 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
21
-  1025:53 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
22
-  1082:45 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
23
-  1082:56 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
24
- 
25
- /Users/atreides/repos/caravan-monorepo/packages/caravan-psbt/src/psbtv2.ts
26
-  47:3 warning Duplicate enum member value 01 @typescript-eslint/no-duplicate-enum-values
27
-  48:3 warning Duplicate enum member value 02 @typescript-eslint/no-duplicate-enum-values
28
-  49:3 warning Duplicate enum member value 03 @typescript-eslint/no-duplicate-enum-values
29
-  50:3 warning Duplicate enum member value 04 @typescript-eslint/no-duplicate-enum-values
30
-  51:3 warning Duplicate enum member value 05 @typescript-eslint/no-duplicate-enum-values
31
-  52:3 warning Duplicate enum member value 06 @typescript-eslint/no-duplicate-enum-values
32
-  71:3 warning Duplicate enum member value fc @typescript-eslint/no-duplicate-enum-values
33
-  73:3 warning Duplicate enum member value 00 @typescript-eslint/no-duplicate-enum-values
34
-  74:3 warning Duplicate enum member value 01 @typescript-eslint/no-duplicate-enum-values
35
-  75:3 warning Duplicate enum member value 02 @typescript-eslint/no-duplicate-enum-values
36
-  76:3 warning Duplicate enum member value 03 @typescript-eslint/no-duplicate-enum-values
37
-  77:3 warning Duplicate enum member value 04 @typescript-eslint/no-duplicate-enum-values
38
-  78:3 warning Duplicate enum member value 05 @typescript-eslint/no-duplicate-enum-values
39
-  79:3 warning Duplicate enum member value 06 @typescript-eslint/no-duplicate-enum-values
40
-  80:3 warning Duplicate enum member value 07 @typescript-eslint/no-duplicate-enum-values
41
-  81:3 warning Duplicate enum member value fc @typescript-eslint/no-duplicate-enum-values
42
-  296:9 warning 'bw' is never reassigned. Use 'const' instead prefer-const
43
-  438:9 warning 'modifiable' is never reassigned. Use 'const' instead prefer-const
44
-  781:9 warning 'heights' is never reassigned. Use 'const' instead prefer-const
45
-  782:9 warning 'times' is never reassigned. Use 'const' instead prefer-const
46
-  1225:9 warning 'txInputs' is never reassigned. Use 'const' instead prefer-const
47
-  1225:19 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
48
-  1247:9 warning 'txOutputs' is never reassigned. Use 'const' instead prefer-const
49
-  1247:20 warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
50
- 
51
- ✖ 34 problems (0 errors, 34 warnings)
52
-  0 errors and 10 warnings potentially fixable with the `--fix` option.
53
- 
54
-
55
- > @caravan/psbt@0.0.0 test
56
- > jest src
57
-
58
- Determining test suites to run...
59
-
60
- Test Suites: 0 of 2 total
61
- Tests: 0 total
62
- Snapshots: 0 total
63
- Time: 0 s, estimated 6 s
64
- ████████████████████████████████████████
65
-  RUNS  src/psbtv2.test.ts
66
-  RUNS  src/psbt.test.ts
67
-
68
- Test Suites: 0 of 2 total
69
- Tests: 0 total
70
- Snapshots: 0 total
71
- Time: 0 s, estimated 6 s
72
- ████████████████████████████████████████
73
-  RUNS  src/psbtv2.test.ts
74
-  RUNS  src/psbt.test.ts
75
-
76
- Test Suites: 0 of 2 total
77
- Tests: 0 total
78
- Snapshots: 0 total
79
- Time: 1 s, estimated 6 s
80
- ████████████████████████████████████████
81
-  RUNS  src/psbtv2.test.ts
82
-  RUNS  src/psbt.test.ts
83
-
84
- Test Suites: 0 of 2 total
85
- Tests: 0 total
86
- Snapshots: 0 total
87
- Time: 2 s, estimated 6 s
88
- ████████████████████████████████████████
89
-  RUNS  src/psbtv2.test.ts
90
-  RUNS  src/psbt.test.ts
91
-
92
- Test Suites: 0 of 2 total
93
- Tests: 0 total
94
- Snapshots: 0 total
95
- Time: 3 s, estimated 6 s
96
- ████████████████████████████████████████
97
-  RUNS  src/psbtv2.test.ts
98
-  RUNS  src/psbt.test.ts
99
-
100
- Test Suites: 0 of 2 total
101
- Tests: 0 total
102
- Snapshots: 0 total
103
- Time: 4 s, estimated 6 s
104
- ████████████████████████████████████████
105
-  RUNS  src/psbtv2.test.ts
106
-  RUNS  src/psbt.test.ts
107
-
108
- Test Suites: 0 of 2 total
109
- Tests: 0 total
110
- Snapshots: 0 total
111
- Time: 5 s, estimated 6 s
112
- ████████████████████████████████████████
113
-  RUNS  src/psbtv2.test.ts
114
-  RUNS  src/psbt.test.ts
115
-
116
- Test Suites: 0 of 2 total
117
- Tests: 14 passed, 14 total
118
- Snapshots: 0 total
119
- Time: 5 s, estimated 6 s
120
- ████████████████████████████████████████
121
-
122
-  RUNS  src/psbtv2.test.ts
123
-  RUNS  src/psbt.test.ts
124
-
125
- Test Suites: 0 of 2 total
126
- Tests: 14 passed, 14 total
127
- Snapshots: 0 total
128
- Time: 5 s, estimated 6 s
129
- ████████████████████████████████████████
130
-  RUNS  src/psbtv2.test.ts
131
-  RUNS  src/psbt.test.ts
132
-
133
- Test Suites: 0 of 2 total
134
- Tests: 14 passed, 14 total
135
- Snapshots: 0 total
136
- Time: 5 s, estimated 6 s
137
- ████████████████████████████████████████
138
-  RUNS  src/psbtv2.test.ts
139
-
140
- Test Suites: 1 passed, 1 of 2 total
141
- Tests: 24 passed, 24 total
142
- Snapshots: 0 total
143
- Time: 5 s, estimated 6 s
144
- ████████████████████████████████████████
145
-  RUNS  src/psbtv2.test.ts
146
-
147
- Test Suites: 1 passed, 1 of 2 total
148
- Tests: 101 passed, 101 total
149
- Snapshots: 0 total
150
- Time: 5 s, estimated 6 s
151
- ████████████████████████████████████████
152
-
153
-  RUNS  src/psbtv2.test.ts
154
-
155
- Test Suites: 1 passed, 1 of 2 total
156
- Tests: 101 passed, 101 total
157
- Snapshots: 0 total
158
- Time: 5 s, estimated 6 s
159
- ████████████████████████████████████████
160
-
161
- console.warn
162
-  Dangerously setting PsbtV2.PSBT_GLOBAL_TX_VERSION to 1!
163
- 
164
-    892 | // lifecycle defined for PsbtV2.
165
-    893 | public dangerouslySetGlobalTxVersion1() {
166
-  > 894 | console.warn("Dangerously setting PsbtV2.PSBT_GLOBAL_TX_VERSION to 1!");
167
-    | ^
168
-    895 | const bw = new BufferWriter();
169
-    896 | bw.writeI32(1);
170
-    897 | this.globalMap.set(KeyType.PSBT_GLOBAL_TX_VERSION, bw.render());
171
- 
172
-  at PsbtV2.dangerouslySetGlobalTxVersion1 (src/psbtv2.ts:894:13)
173
-  at Function.FromV0 (src/psbtv2.ts:1208:14)
174
-  at t (src/psbtv2.test.ts:947:34)
175
-  at Object.<anonymous> (../../node_modules/expect/build/toThrowMatchers.js:74:11)
176
-  at Object.throwingMatcher [as toThrow] (../../node_modules/expect/build/index.js:320:21)
177
-  at src/psbtv2.test.ts:948:25
178
-
179
- console.warn
180
-  Dangerously setting PsbtV2.PSBT_GLOBAL_TX_VERSION to 1!
181
- 
182
-    892 | // lifecycle defined for PsbtV2.
183
-    893 | public dangerouslySetGlobalTxVersion1() {
184
-  > 894 | console.warn("Dangerously setting PsbtV2.PSBT_GLOBAL_TX_VERSION to 1!");
185
-    | ^
186
-    895 | const bw = new BufferWriter();
187
-    896 | bw.writeI32(1);
188
-    897 | this.globalMap.set(KeyType.PSBT_GLOBAL_TX_VERSION, bw.render());
189
- 
190
-  at PsbtV2.dangerouslySetGlobalTxVersion1 (src/psbtv2.ts:894:13)
191
-  at Function.FromV0 (src/psbtv2.ts:1208:14)
192
-  at t (src/psbtv2.test.ts:947:34)
193
-  at Object.<anonymous> (../../node_modules/expect/build/toThrowMatchers.js:74:11)
194
-  at Object.throwingMatcher [as toThrow] (../../node_modules/expect/build/index.js:320:21)
195
-  at src/psbtv2.test.ts:948:25
196
-
197
- console.warn
198
-  Dangerously setting PsbtV2.PSBT_GLOBAL_TX_VERSION to 1!
199
- 
200
-    892 | // lifecycle defined for PsbtV2.
201
-    893 | public dangerouslySetGlobalTxVersion1() {
202
-  > 894 | console.warn("Dangerously setting PsbtV2.PSBT_GLOBAL_TX_VERSION to 1!");
203
-    | ^
204
-    895 | const bw = new BufferWriter();
205
-    896 | bw.writeI32(1);
206
-    897 | this.globalMap.set(KeyType.PSBT_GLOBAL_TX_VERSION, bw.render());
207
- 
208
-  at PsbtV2.dangerouslySetGlobalTxVersion1 (src/psbtv2.ts:894:13)
209
-  at Function.FromV0 (src/psbtv2.ts:1208:14)
210
-  at src/psbtv2.test.ts:959:25
211
-
212
- console.error
213
-  Error: 
214
-  at PsbtV2.<anonymous> (/Users/atreides/repos/caravan-monorepo/packages/caravan-psbt/src/psbtv2.test.ts:1044:13)
215
-  at /Users/atreides/repos/caravan-monorepo/node_modules/jest-mock/build/index.js:397:39
216
-  at PsbtV2.<anonymous> (/Users/atreides/repos/caravan-monorepo/node_modules/jest-mock/build/index.js:404:13)
217
-  at PsbtV2.mockConstructor [as handleSighashType] (/Users/atreides/repos/caravan-monorepo/node_modules/jest-mock/build/index.js:148:19)
218
-  at PsbtV2.addPartialSig (/Users/atreides/repos/caravan-monorepo/packages/caravan-psbt/src/psbtv2.ts:1120:12)
219
-  at Object.<anonymous> (/Users/atreides/repos/caravan-monorepo/packages/caravan-psbt/src/psbtv2.test.ts:1049:10)
220
-  at Promise.then.completed (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/utils.js:298:28)
221
-  at new Promise (<anonymous>)
222
-  at callAsyncCircusFn (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/utils.js:231:10)
223
-  at _callCircusTest (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/run.js:316:40)
224
-  at processTicksAndRejections (node:internal/process/task_queues:95:5)
225
-  at _runTest (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/run.js:252:3)
226
-  at _runTestsForDescribeBlock (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/run.js:126:9)
227
-  at _runTestsForDescribeBlock (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/run.js:121:9)
228
-  at run (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/run.js:71:3)
229
-  at runAndTransformResultsToJestFormat (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
230
-  at jestAdapter (/Users/atreides/repos/caravan-monorepo/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
231
-  at runTestInternal (/Users/atreides/repos/caravan-monorepo/node_modules/jest-runner/build/runTest.js:367:16)
232
-  at runTest (/Users/atreides/repos/caravan-monorepo/node_modules/jest-runner/build/runTest.js:444:34)
233
-  at Object.worker (/Users/atreides/repos/caravan-monorepo/node_modules/jest-runner/build/testWorker.js:106:12)
234
- 
235
-    1120 | this.handleSighashType(sig);
236
-    1121 | } catch (err) {
237
-  > 1122 | console.error(err);
238
-    | ^
239
-    1123 | // To remain atomic, attempt to reset everything to the way it was.
240
-    1124 | this.inputMaps[inputIndex].delete(key);
241
-    1125 | this.PSBT_GLOBAL_TX_MODIFIABLE = modBackup;
242
- 
243
-  at PsbtV2.addPartialSig (src/psbtv2.ts:1122:15)
244
-  at Object.<anonymous> (src/psbtv2.test.ts:1049:10)
245
-
246
-
247
-  RUNS  src/psbtv2.test.ts
248
-
249
- Test Suites: 1 passed, 1 of 2 total
250
- Tests: 101 passed, 101 total
251
- Snapshots: 0 total
252
- Time: 5 s, estimated 6 s
253
- ████████████████████████████████████████
254
- Test Suites: 2 passed, 2 total
255
- Tests: 177 passed, 177 total
256
- Snapshots: 0 total
257
- Time: 5.726 s, estimated 6 s
258
- Ran all test suites matching /src/i.