diff --git a/examples/iterator/iterator.go b/examples/iterator/iterator.go index a30233fb5..fe53881b8 100644 --- a/examples/iterator/iterator.go +++ b/examples/iterator/iterator.go @@ -8,24 +8,24 @@ import ( // _deploy primes contract's storage with some data to be used later. func _deploy(_ interface{}, _ bool) { - ctx := storage.GetContext() + ctx := storage.GetContext() // RW context. 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 { - iter := storage.Find(storage.GetContext(), []byte("foo"), storage.None) + iter := storage.Find(storage.GetReadOnlyContext(), []byte("foo"), storage.None) for iterator.Next(iter) { - runtime.Notify("found storage key-value pair", iterator.Value(iter)) + runtime.Notify("Key-Value", iterator.Value(iter)) } return true } // NotifyValues sends notification with `foo` storage values. func NotifyValues() bool { - iter := storage.Find(storage.GetContext(), []byte("foo"), storage.ValuesOnly) + iter := storage.Find(storage.GetReadOnlyContext(), []byte("foo"), storage.ValuesOnly) for iterator.Next(iter) { runtime.Notify("Value", iterator.Value(iter)) } diff --git a/examples/iterator/iterator.yml b/examples/iterator/iterator.yml index ddd62c869..61170428c 100644 --- a/examples/iterator/iterator.yml +++ b/examples/iterator/iterator.yml @@ -2,7 +2,7 @@ name: "Iterator example" sourceurl: https://github.com/nspcc-dev/neo-go/ supportedstandards: [] events: - - name: found storage key-value pair + - name: Key-Value parameters: - name: value type: Any