neoneo-go/examples/iterator/iterator.go

17 lines
478 B
Go
Raw Normal View History

package iteratorcontract
import (
"github.com/nspcc-dev/neo-go/pkg/interop/iterator"
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
"github.com/nspcc-dev/neo-go/pkg/interop/storage"
)
2020-08-10 10:42:02 +00:00
// NotifyKeysAndValues sends notification with `foo` storage keys and values
func NotifyKeysAndValues() bool {
iter := storage.Find(storage.GetContext(), []byte("foo"))
for iterator.Next(iter) {
runtime.Notify("found storage key-value pair", iterator.Value(iter))
}
return true
}