Refactor PushNBytes Opcode

This commit is contained in:
BlockChainDev 2019-03-16 22:09:23 +00:00
parent 7b519eba0d
commit c7e32e7eb3

View file

@ -7,13 +7,13 @@ import (
// 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 {
func PushNBytes(op stack.Instruction, ctx *stack.Context, istack *stack.Invocation) (Vmstate, error) {
val, err := ctx.ReadBytes(int(op))
if err != nil {
return err
return FAULT, err
}
ba := stack.NewByteArray(val)
ctx.Estack.Push(ba)
return nil
return NONE, nil
}