fix lower bound
This commit is contained in:
parent
fb4dc8342a
commit
7c46cc0805
2 changed files with 1 additions and 5 deletions
|
@ -77,11 +77,8 @@ class PrefixRow(metaclass=PrefixRowType):
|
||||||
else:
|
else:
|
||||||
value_getter = lambda v: v
|
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(
|
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,
|
iterate_upper_bound=stop, reverse=reverse, include_key=include_key,
|
||||||
include_value=include_value, fill_cache=fill_cache, prefix_same_as_start=False
|
include_value=include_value, fill_cache=fill_cache, prefix_same_as_start=False
|
||||||
)
|
)
|
||||||
|
|
|
@ -221,7 +221,6 @@ class TestRevertablePrefixDB(unittest.TestCase):
|
||||||
self.db.unsafe_commit()
|
self.db.unsafe_commit()
|
||||||
|
|
||||||
def get_active_amount_as_of_height(claim_hash: bytes, height: int) -> int:
|
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(
|
for v in self.db.active_amount.iterate(
|
||||||
start=(claim_hash, 1, 0), stop=(claim_hash, 1, height + 1),
|
start=(claim_hash, 1, 0), stop=(claim_hash, 1, height + 1),
|
||||||
include_key=False, reverse=True):
|
include_key=False, reverse=True):
|
||||||
|
|
Loading…
Add table
Reference in a new issue