examples: extend storage contract

Add method that returns iterator. It's needed for the workshop.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2023-08-08 18:29:32 +03:00
parent b5f17215db
commit 4e6b1c4a38

View file

@ -54,3 +54,9 @@ func Find(value []byte) []string {
}
return result
}
// FindReturnIter returns an iterator over key-value pairs with the key that has the specified prefix.
func FindReturnIter(prefix []byte) iterator.Iterator {
iter := storage.Find(ctx, prefix, storage.None)
return iter
}