From 77ea3d361bf6d7922bc085ccc522d7a8463aba4d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Sat, 22 Aug 2020 22:36:10 +0300 Subject: [PATCH] vm: update neo-vm tests, simplify parsing We no longer have "*N" notation, see neo-project/neo-vm#326. --- pkg/vm/json_test.go | 20 +------------------- pkg/vm/testdata/neo-vm | 2 +- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/pkg/vm/json_test.go b/pkg/vm/json_test.go index 36fb7660a..d41b6cd96 100644 --- a/pkg/vm/json_test.go +++ b/pkg/vm/json_test.go @@ -11,8 +11,6 @@ import ( "math/big" "os" "path/filepath" - "regexp" - "strconv" "strings" "testing" @@ -330,23 +328,7 @@ func (v *vmUTScript) UnmarshalJSON(data []byte) error { if b, ok := decodeSingle(ops[i]); ok { script = append(script, b...) } else { - const regex = `(?P(?:0x)?[0-9a-zA-Z]+)\*(?P[0-9]+)` - re := regexp.MustCompile(regex) - ss := re.FindStringSubmatch(ops[i]) - if len(ss) != 3 { - return fmt.Errorf("invalid script part: %s", ops[i]) - } - b, ok := decodeSingle(ss[1]) - if !ok { - return fmt.Errorf("invalid script part: %s", ops[i]) - } - num, err := strconv.Atoi(ss[2]) - if err != nil { - return fmt.Errorf("invalid script part: %s", ops[i]) - } - for i := 0; i < num; i++ { - script = append(script, b...) - } + return fmt.Errorf("invalid script part: %s", ops[i]) } } diff --git a/pkg/vm/testdata/neo-vm b/pkg/vm/testdata/neo-vm index 377464ed4..8476d0abb 160000 --- a/pkg/vm/testdata/neo-vm +++ b/pkg/vm/testdata/neo-vm @@ -1 +1 @@ -Subproject commit 377464ed475a3de108e1bf9c834bd2279b72624e +Subproject commit 8476d0abba10b2efdc94e8d4dc27f5c30c8b66e1