neoneo-go/pkg/vm/vm_ops_stackmani.go

20 lines
455 B
Go
Raw Normal View History

package vm
import (
"github.com/CityOfZion/neo-go/pkg/vm/stack"
)
// Stack Manipulation Opcodes
// PushNBytes will Read N Bytes from the script and push it onto the stack
func PushNBytes(op stack.Instruction, ctx *stack.Context, istack *stack.Invocation, rstack *stack.RandomAccess) (Vmstate, error) {
val, err := ctx.ReadBytes(int(op))
if err != nil {
2019-03-16 22:09:23 +00:00
return FAULT, err
}
ba := stack.NewByteArray(val)
ctx.Estack.Push(ba)
2019-03-16 22:09:23 +00:00
return NONE, nil
}