vm: implement Neo.Enumerator.* interops

This commit is contained in:
Evgenii Stratonikov 2019-11-13 14:34:03 +03:00
parent f92e84c4cf
commit 3ff7fd5262
6 changed files with 204 additions and 4 deletions

View file

@ -155,6 +155,17 @@ func (e *Element) Array() []StackItem {
}
}
// Interop attempts to get the underlying value of the element
// as an interop item.
func (e *Element) Interop() *InteropItem {
switch t := e.value.(type) {
case *InteropItem:
return t
default:
panic("element is not an interop")
}
}
// Stack represents a Stack backed by a double linked list.
type Stack struct {
top Element