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.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Concat(ic *interop.Context) error {
|
|
|
|
return vm.EnumeratorConcat(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|
|
|
|
|
2020-07-20 13:30:19 +00:00
|
|
|
// Create creates an enumerator from an array-like or bytearray-like stack item.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Create(ic *interop.Context) error {
|
|
|
|
return vm.EnumeratorCreate(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Next advances the enumerator, pushes true if is it was successful
|
|
|
|
// and false otherwise.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Next(ic *interop.Context) error {
|
|
|
|
return vm.EnumeratorNext(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Value returns the current value of the enumerator.
|
2020-08-07 11:37:49 +00:00
|
|
|
func Value(ic *interop.Context) error {
|
|
|
|
return vm.EnumeratorValue(ic.VM)
|
2020-04-08 11:08:43 +00:00
|
|
|
}
|