feat(BonsaiStorage): added new methods for retrieving key-value pairs and change id for BonsaiStorage
#25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request type
What is the current behavior?
This Pr aims to add functionality around key-value and change id retrieval for
BonsaiStrorage
.What is the new behavior?
get_keys
now ignores empty keys and skips the size byte after the identifier. Note that this introduces issues with the handling ofHashMapDb
as pertains toHashMapDB
does not differenciate between leaf and branch nodes #26. Given that this is an error related to the structure and not this methods directly, I believe this update is still pertinent as it makes key retrieval more intuitive for the end user.get_key_value_pairs
has been added which works pretty much as the name indicates, with the same drawbacks as stated above forget_keys
wihthHashMapDb
.get_latest_id
has been added which returns the latest id committed to a db, orNone
if no commit has occurred. This is mainly useful for creatingtransactional_state
based on the latest commit to the db.Does this introduce a breaking change?
Yes.
get_keys
will no longer:In practice though, this just means the function should now be easier to use.