From 73f983abe1e816671ece58b2a6cfe8bf30de0198 Mon Sep 17 00:00:00 2001 From: RecRanger <168371178+RecRanger@users.noreply.github.com> Date: Thu, 30 May 2024 01:18:14 -0600 Subject: [PATCH] Add sort order and unrestricted flag --- pyproject.toml | 2 +- src/used_addr_check/__init__.py | 2 +- src/used_addr_check/index_search.py | 2 +- src/used_addr_check/scan_file.py | 13 +++++++++++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b66c1fd..926706b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "used_addr_check" -version = "0.1.3" +version = "0.1.4" authors = [ { name="RecRanger", email="RecRanger+package@proton.me" }, ] diff --git a/src/used_addr_check/__init__.py b/src/used_addr_check/__init__.py index ed811a7..99d6532 100644 --- a/src/used_addr_check/__init__.py +++ b/src/used_addr_check/__init__.py @@ -1,4 +1,4 @@ -__VERSION__ = "0.1.3" +__VERSION__ = "0.1.4" __AUTHOR__ = "RecRanger" from .index_create import ( # noqa F401 diff --git a/src/used_addr_check/index_search.py b/src/used_addr_check/index_search.py index 347969b..a62dd90 100644 --- a/src/used_addr_check/index_search.py +++ b/src/used_addr_check/index_search.py @@ -120,5 +120,5 @@ def search_multiple_in_file( logger.info( f"Found {len(found_needles):,}/{len(needles):,} needles in the file" ) - logger.info(f"Needles found: {found_needles}") + logger.info(f"Needles found: {sorted(found_needles)}") return found_needles diff --git a/src/used_addr_check/scan_file.py b/src/used_addr_check/scan_file.py index 6b0be23..42983a3 100644 --- a/src/used_addr_check/scan_file.py +++ b/src/used_addr_check/scan_file.py @@ -52,7 +52,15 @@ def _extract_addresses_from_file_ripgrep(text_file_path: Path) -> List[str]: regex_pattern=BITCOIN_ADDR_REGEX, path=str(text_file_path.absolute()), ) - results = rg.only_matching().json().run().as_dict + results = ( + rg.only_matching() + .json() + .unrestricted() + .unrestricted() + .unrestricted() + .run() + .as_dict + ) matches = [] for result in results: @@ -126,7 +134,8 @@ def scan_file_for_used_addresses( needle_addresses = extract_addresses_from_file(needle_file_path) logger.info( - f"Extracted {len(needle_addresses):,} addresses from the needle file" + f"Extracted {len(needle_addresses):,} addresses from the needle file " + f" ({needle_file_path})" ) # remove duplicates (get distinct addresses)