From 4e6b1c4a3888aa79bea824fb079f34f1a24e2845 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 8 Aug 2023 18:29:32 +0300 Subject: [PATCH] examples: extend storage contract Add method that returns iterator. It's needed for the workshop. Signed-off-by: Anna Shaleva --- examples/storage/storage.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/storage/storage.go b/examples/storage/storage.go index 42416dd82..2fe5f7305 100644 --- a/examples/storage/storage.go +++ b/examples/storage/storage.go @@ -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 +}