neo-go/pkg/core/interop/enumerator/interop.go
Anna Shaleva 459ac34839 core: adjust System.Enumerator.Create interop
Part of #1201.

It should be able to create enumerator from primitive byte-array-like
stack items too.
2020-07-23 07:51:24 +03:00

27 lines
731 B
Go

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)
}
// Create creates an enumerator from an array-like or bytearray-like stack item.
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)
}