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
This commit is contained in:
Evgenii Stratonikov 2020-05-21 09:28:41 +03:00
parent 86c4f1abc5
commit 16bf72f9cc

View file

@ -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
}