2020-04-08 11:08:43 +00:00
|
|
|
package iterator
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/interop"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/vm"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Concat concatenates 2 iterators into a single one.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Concat(ic *interop.Context) error {
|
|
|
|
return vm.IteratorConcat(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Create creates an iterator from array-like or map stack item.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Create(ic *interop.Context) error {
|
|
|
|
return vm.IteratorCreate(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Key returns current iterator key.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Key(ic *interop.Context) error {
|
|
|
|
return vm.IteratorKey(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Keys returns keys of the iterator.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Keys(ic *interop.Context) error {
|
|
|
|
return vm.IteratorKeys(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Values returns values of the iterator.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Values(ic *interop.Context) error {
|
|
|
|
return vm.IteratorValues(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|