From e23c652ccd3d61488df5f64c24e361567ad4591a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Landabaso=20D=C3=ADaz?= Date: Fri, 28 Jun 2024 19:32:51 +0200 Subject: [PATCH] fix: correct txo validation in getDescriptor and bump version - Fixed txo validation to correctly handle cases with two or three parts - Bumped version to 1.2.4 --- package-lock.json | 4 ++-- package.json | 2 +- src/discovery.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ccecbb2..8e1dbb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@bitcoinerlab/discovery", - "version": "1.2.3", + "version": "1.2.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@bitcoinerlab/discovery", - "version": "1.2.3", + "version": "1.2.4", "license": "MIT", "dependencies": { "@bitcoinerlab/descriptors": "^2.1.0", diff --git a/package.json b/package.json index 6264047..d3828a5 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@bitcoinerlab/discovery", "description": "A TypeScript library for retrieving Bitcoin funds from ranged descriptors, leveraging @bitcoinerlab/explorer for standardized access to multiple blockchain explorers.", "homepage": "https://github.com/bitcoinerlab/discovery", - "version": "1.2.3", + "version": "1.2.4", "author": "Jose-Luis Landabaso", "license": "MIT", "prettier": "@bitcoinerlab/configs/prettierConfig.json", diff --git a/src/discovery.ts b/src/discovery.ts index 92823c9..698671e 100644 --- a/src/discovery.ts +++ b/src/discovery.ts @@ -1190,7 +1190,7 @@ export function DiscoveryFactory( const split = txo.split(':'); if (utxo && split.length !== 2) throw new Error(`Error: invalid utxo: ${utxo}`); - if (!utxo && split.length !== 3) + if (!utxo && split.length !== 2 && split.length !== 3) throw new Error(`Error: invalid txo: ${txo}`); const txId = split[0]; if (!txId) throw new Error(`Error: invalid txo: ${txo}`);