From 4c4e9c03717c7c3d866d55873f91801af742c9d6 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 23 Mar 2022 22:02:19 +0300 Subject: [PATCH] examples: add something to the storage for iterator example --- examples/iterator/iterator.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/iterator/iterator.go b/examples/iterator/iterator.go index 03ffccee9..4c830cf6f 100644 --- a/examples/iterator/iterator.go +++ b/examples/iterator/iterator.go @@ -6,6 +6,14 @@ import ( "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 func NotifyKeysAndValues() bool { iter := storage.Find(storage.GetContext(), []byte("foo"), storage.None)