examples: add something to the storage for iterator example

This commit is contained in:
Roman Khimov 2022-03-23 22:02:19 +03:00
parent 479eda6786
commit 4c4e9c0371

View file

@ -6,6 +6,14 @@ import (
"github.com/nspcc-dev/neo-go/pkg/interop/storage" "github.com/nspcc-dev/neo-go/pkg/interop/storage"
) )
// _deploy primes contract's storage with some data to be used later.
func _deploy(_ interface{}, _ bool) {
ctx := storage.GetContext()
storage.Put(ctx, "foo1", "1")
storage.Put(ctx, "foo2", "2")
storage.Put(ctx, "foo3", "3")
}
// NotifyKeysAndValues sends notification with `foo` storage keys and values // NotifyKeysAndValues sends notification with `foo` storage keys and values
func NotifyKeysAndValues() bool { func NotifyKeysAndValues() bool {
iter := storage.Find(storage.GetContext(), []byte("foo"), storage.None) iter := storage.Find(storage.GetContext(), []byte("foo"), storage.None)