mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
c177e5577e
refactor handlers to have rstack as argument
19 lines
455 B
Go
19 lines
455 B
Go
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 {
|
|
return FAULT, err
|
|
}
|
|
ba := stack.NewByteArray(val)
|
|
ctx.Estack.Push(ba)
|
|
return NONE, nil
|
|
}
|