2019-03-15 23:37:54 +00:00
|
|
|
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
|
2019-03-18 21:14:03 +00:00
|
|
|
func PushNBytes(op stack.Instruction, ctx *stack.Context, istack *stack.Invocation, rstack *stack.RandomAccess) (Vmstate, error) {
|
2019-03-15 23:37:54 +00:00
|
|
|
|
|
|
|
val, err := ctx.ReadBytes(int(op))
|
|
|
|
if err != nil {
|
2019-03-16 22:09:23 +00:00
|
|
|
return FAULT, err
|
2019-03-15 23:37:54 +00:00
|
|
|
}
|
|
|
|
ba := stack.NewByteArray(val)
|
|
|
|
ctx.Estack.Push(ba)
|
2019-03-16 22:09:23 +00:00
|
|
|
return NONE, nil
|
2019-03-15 23:37:54 +00:00
|
|
|
}
|