2020-04-08 11:08:43 +00:00
|
|
|
package enumerator
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/interop"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/vm"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Concat concatenates 2 enumerators into a single one.
|
|
|
|
func Concat(_ *interop.Context, v *vm.VM) error {
|
|
|
|
return vm.EnumeratorConcat(v)
|
|
|
|
}
|
|
|
|
|
2020-07-20 13:30:19 +00:00
|
|
|
// Create creates an enumerator from an array-like or bytearray-like stack item.
|
2020-04-08 11:08:43 +00:00
|
|
|
func Create(_ *interop.Context, v *vm.VM) error {
|
|
|
|
return vm.EnumeratorCreate(v)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Next advances the enumerator, pushes true if is it was successful
|
|
|
|
// and false otherwise.
|
|
|
|
func Next(_ *interop.Context, v *vm.VM) error {
|
|
|
|
return vm.EnumeratorNext(v)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Value returns the current value of the enumerator.
|
|
|
|
func Value(_ *interop.Context, v *vm.VM) error {
|
|
|
|
return vm.EnumeratorValue(v)
|
|
|
|
}
|