core: add flags to Storage.Find

It can be iterated over keys, values or both.
Prefix can be stripped.
This commit is contained in:
Evgeniy Stratonikov 2021-01-12 13:39:31 +03:00 committed by Roman Khimov
parent 2130e17f0c
commit 7fc0c04dba
8 changed files with 148 additions and 24 deletions

View file

@ -8,7 +8,7 @@ import (
// NotifyKeysAndValues sends notification with `foo` storage keys and values
func NotifyKeysAndValues() bool {
iter := storage.Find(storage.GetContext(), []byte("foo"))
iter := storage.Find(storage.GetContext(), []byte("foo"), storage.None)
for iterator.Next(iter) {
runtime.Notify("found storage key-value pair", iterator.Value(iter))
}