Skip to content

Commit

Permalink
Fixes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
landabaso committed Jun 6, 2023
1 parent 5ddf5d2 commit 2c220d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@bitcoinerlab/descriptors",
"homepage": "https://github.com/bitcoinerlab/descriptors",
"version": "0.2.1",
"version": "0.2.2",
"description": "This library parses and creates Bitcoin Miniscript Descriptors and generates Partially Signed Bitcoin Transactions (PSBTs). It provides PSBT finalizers and signers for single-signature, BIP32 and Hardware Wallets.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/miniscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ function substituteAsm({
//enclosed in <>, since <> represents hex code already encoded.
//The regex below will match one or more digits within a string,
//except if the sequence is surrounded by "<" and ">"
.replace(/(?<![<])\b\d+\b(?![>])/g, (num: string) =>
numberEncodeAsm(Number(num))
.replace(/(<\d+>)|\b\d+\b/g, match =>
match.startsWith('<') ? match : numberEncodeAsm(Number(match))
)
//we don't have numbers anymore, now it's safe to remove < and > since we
//know that every remaining is either an op_code or a hex encoded number
Expand Down

0 comments on commit 2c220d4

Please sign in to comment.