mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-02 15:44:41 +00:00
Draft of iterator and enumerator (CityOfZion/neo-storm#26)
* Draft of iterator and enumerator * Added iterator API to the syscall mapping * Added draft of the enumerator.go file * Added enumerator interop API. * Updated the changelog Imported from CityOfZion/neo-storm (156093318b8612e810965bb1ea26e1babfb46cdd).
This commit is contained in:
parent
3fc25e1431
commit
55966c7e07
5 changed files with 85 additions and 2 deletions
18
examples/iterator/iterator.go
Normal file
18
examples/iterator/iterator.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package iterator_contract
|
||||
|
||||
import (
|
||||
"github.com/CityOfZion/neo-storm/interop/iterator"
|
||||
"github.com/CityOfZion/neo-storm/interop/runtime"
|
||||
"github.com/CityOfZion/neo-storm/interop/storage"
|
||||
)
|
||||
|
||||
func Main() bool {
|
||||
iter := storage.Find(storage.GetContext(), []byte("foo"))
|
||||
values := iterator.Values(iter)
|
||||
keys := iterator.Keys(iter)
|
||||
|
||||
runtime.Notify("found storage values", values)
|
||||
runtime.Notify("found storage keys", keys)
|
||||
|
||||
return true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue