neoneo-go/pkg/core/interop/enumerator/interop.go

28 lines
711 B
Go
Raw Normal View History

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)
}
// 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)
}
// 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)
}
// 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)
}