From 04c66eb7d6cf473e83628697658a98fa11f7b70e Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 26 Jan 2022 11:18:50 -0500 Subject: [PATCH] fix lower bound --- lbry/wallet/server/db/prefixes.py | 5 +---- tests/unit/wallet/server/test_revertable.py | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/lbry/wallet/server/db/prefixes.py b/lbry/wallet/server/db/prefixes.py index f555e83dd..701661ebb 100644 --- a/lbry/wallet/server/db/prefixes.py +++ b/lbry/wallet/server/db/prefixes.py @@ -77,11 +77,8 @@ class PrefixRow(metaclass=PrefixRowType): else: value_getter = lambda v: v - lower_bound = None if not (start or prefix) else ( - int.from_bytes(start or prefix, byteorder='big') - 1 - ).to_bytes(len(start or prefix), byteorder='big') it = self._db.iterator( - start or prefix, self._column_family, iterate_lower_bound=lower_bound, + start or prefix, self._column_family, iterate_lower_bound=(start or prefix), iterate_upper_bound=stop, reverse=reverse, include_key=include_key, include_value=include_value, fill_cache=fill_cache, prefix_same_as_start=False ) diff --git a/tests/unit/wallet/server/test_revertable.py b/tests/unit/wallet/server/test_revertable.py index 2c9e04f26..9dbba3220 100644 --- a/tests/unit/wallet/server/test_revertable.py +++ b/tests/unit/wallet/server/test_revertable.py @@ -221,7 +221,6 @@ class TestRevertablePrefixDB(unittest.TestCase): self.db.unsafe_commit() def get_active_amount_as_of_height(claim_hash: bytes, height: int) -> int: - print(f"\t\tget_active_amount_as_of_height {claim_hash.hex()} @ {height}") for v in self.db.active_amount.iterate( start=(claim_hash, 1, 0), stop=(claim_hash, 1, height + 1), include_key=False, reverse=True):