Skip to content

Commit

Permalink
add is_valid
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgriffin committed Aug 20, 2024
1 parent 1034fab commit 19ede7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions bitcoin_qr_tools/multipath_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ def get_equal_derivation_path(cls, descriptor_str: str) -> Optional[str]:
else:
return None

@classmethod
def is_valid(cls, descriptor_str: str, network: bdk.Network) -> bool:
try:
cls.from_descriptor_str(descriptor_str=descriptor_str, network=network)
except:
return False
return True

@classmethod
def from_descriptor_str(cls, descriptor_str: str, network: bdk.Network) -> "MultipathDescriptor":
derivation_path = cls.get_equal_derivation_path(descriptor_str)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ disable_error_code = "assignment"

[tool.poetry]
name = "bitcoin-qr-tools"
version = "0.10.10"
version = "0.10.11"
authors = ["andreasgriffin <[email protected]>"]
license = "GPL-3.0"
readme = "README.md"
Expand Down

0 comments on commit 19ede7f

Please sign in to comment.