mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-24 09:25:21 +00:00
80fd427517
- Add PushNBytes OPcode
19 lines
403 B
Go
19 lines
403 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) error {
|
|
|
|
val, err := ctx.ReadBytes(int(op))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
ba := stack.NewByteArray(val)
|
|
ctx.Estack.Push(ba)
|
|
return nil
|
|
}
|