Skip to content

Commit

Permalink
Merge pull request #444 from HathorNetwork/dev
Browse files Browse the repository at this point in the history
Release v0.49.2
  • Loading branch information
jansegre authored Jul 25, 2022
2 parents da5c19b + b3b9933 commit 1b3e232
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hathor/cli/openapi_files/openapi_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
],
"info": {
"title": "Hathor API",
"version": "0.49.1"
"version": "0.49.2"
},
"consumes": [
"application/json"
Expand Down
7 changes: 5 additions & 2 deletions hathor/indexes/rocksdb_address_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,11 @@ def is_address_empty(self, address: str) -> bool:
self.log.debug('seek to', address=address)
it = self._db.iterkeys(self._cf)
it.seek(self._to_key(address))
key = it.get()
res = it.get()
if not res:
return True
_cf, key = res
addr, _, _ = self._from_key(key)
is_empty = addr == address
is_empty = addr != address
self.log.debug('seek empty', is_empty=is_empty)
return is_empty
2 changes: 1 addition & 1 deletion hathor/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '0.49.1'
__version__ = '0.49.2'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

[tool.poetry]
name = "hathor"
version = "0.49.1"
version = "0.49.2"
description = "Hathor Network full-node"
authors = ["Hathor Team <contact@hathor.network>"]
license = "Apache-2.0"
Expand Down
7 changes: 7 additions & 0 deletions tests/tx/test_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,13 @@ def test_utxo_index_limits(self):
print(']')
self.assertEqual(actual, expected)

def test_addresses_index_empty(self):
addresses_indexes = self.manager.tx_storage.indexes.addresses
address = self.get_address(10)
assert address is not None
self.assertTrue(addresses_indexes.is_address_empty(address))
self.assertEqual(addresses_indexes.get_sorted_from_address(address), [])


class BaseMemoryIndexesTest(BaseIndexesTest):
def setUp(self):
Expand Down

0 comments on commit 1b3e232

Please sign in to comment.