From 16bf72f9cc027b86192fd2a50a001630313f8056 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 21 May 2020 09:28:41 +0300 Subject: [PATCH] vm/tests: do not load empty script In case we load a zero-length script, VM should end in HALT state. https://github.com/neo-project/neo-vm/blob/master/tests/neo-vm.Tests/Tests/Others/OtherCases.json#L22 --- pkg/vm/vm_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/vm/vm_test.go b/pkg/vm/vm_test.go index dcb949e54..cb14a0fa7 100644 --- a/pkg/vm/vm_test.go +++ b/pkg/vm/vm_test.go @@ -2455,7 +2455,9 @@ func makeProgram(opcodes ...opcode.Opcode) []byte { func load(prog []byte) *VM { vm := New() - vm.LoadScript(prog) + if len(prog) != 0 { + vm.LoadScript(prog) + } return vm }