Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INDY-1138] Added get_equal_or_prev into parent class #570

Merged
merged 5 commits into from
Mar 14, 2018

Conversation

lampkin-diet
Copy link

No description provided.

@@ -23,3 +23,22 @@ def compare(a, b):
def open(self):
self._db = leveldb.LevelDB(self.db_path, comparator=(
'IntegerComparator', self.compare))

def get_equal_or_prev(self, key):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for this

@@ -75,5 +75,8 @@ def _has_key(self, key):
except KeyError:
return False

def get_equal_or_prev(self, key):
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to either make it @AbstractMethod or raise NotImplementedException by default

@lampkin-diet lampkin-diet changed the title Added get_equal_or_prev into parent class [INDY-1138] Added get_equal_or_prev into parent class Mar 14, 2018
return storage, ts_list


def test_none_if_key_less_then_minimal_key(storage_with_ts_root_hashes):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may consider having the same tests for RocksDB implementation as well (adding parameters to the tests), but I think it can be done with RocksDB support.

@@ -75,5 +75,8 @@ def _has_key(self, key):
except KeyError:
return False

def get_equal_or_prev(self, key):
raise NotImplemented()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it needs to be NotImplementedError

@ashcherbakov ashcherbakov merged commit e3148f9 into hyperledger:master Mar 14, 2018
lampkin-diet pushed a commit to lampkin-diet/indy-plenum that referenced this pull request Apr 9, 2018
* [INDY-1138] Added get_equal_or_prev into KeyValue storages

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Added abstract method for get_equal_or_prev

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Remove @AbstractMethod decorator

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Move test for storage from indy-node

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Fix NotImplemented raise

Signed-off-by: Andrew Nikitin <[email protected]>
lampkin-diet pushed a commit to lampkin-diet/indy-plenum that referenced this pull request Apr 10, 2018
* [INDY-1138] Added get_equal_or_prev into KeyValue storages

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Added abstract method for get_equal_or_prev

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Remove @AbstractMethod decorator

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Move test for storage from indy-node

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1138] Fix NotImplemented raise

Signed-off-by: Andrew Nikitin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants