From 410aabe7a1106755c5094d6ff38927b8692333a3 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 12 Nov 2021 17:15:54 +0300 Subject: [PATCH] compiler: drop some useless NOPs They're all obsolete and not needed. --- cli/nep17_test.go | 2 +- cli/testdata/wallet1_solo.json | 2 +- pkg/compiler/codegen.go | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cli/nep17_test.go b/cli/nep17_test.go index 3dc095543..bc86b0bca 100644 --- a/cli/nep17_test.go +++ b/cli/nep17_test.go @@ -85,7 +85,7 @@ func TestNEP17Balance(t *testing.T) { } e.checkNextLine(t, "^\\s*$") - addr4, err := address.StringToUint160("NU4CTk9H2fgNCuC3ZPqX4LjUX3MHt3Rh6p") // deployed verify.go contract + addr4, err := address.StringToUint160("NQ3nAdFQXzemHC9uvr4af2Ysap6aZJpqgN") // deployed verify.go contract require.NoError(t, err) e.checkNextLine(t, "^Account "+address.Uint160ToString(addr4)) e.checkEOF(t) diff --git a/cli/testdata/wallet1_solo.json b/cli/testdata/wallet1_solo.json index 1e51ca921..cbd28e3b9 100644 --- a/cli/testdata/wallet1_solo.json +++ b/cli/testdata/wallet1_solo.json @@ -61,7 +61,7 @@ "isDefault": false }, { - "address": "NU4CTk9H2fgNCuC3ZPqX4LjUX3MHt3Rh6p", + "address": "NQ3nAdFQXzemHC9uvr4af2Ysap6aZJpqgN", "key": "6PYSATFztBa3CHjSR6sLAKungUEAbQUCVE16KzmaQQ38gLeYGZ9Knd5mGv", "label": "verify", "contract": { diff --git a/pkg/compiler/codegen.go b/pkg/compiler/codegen.go index e295498e1..7a5922856 100644 --- a/pkg/compiler/codegen.go +++ b/pkg/compiler/codegen.go @@ -1571,10 +1571,6 @@ func (c *codegen) convertSyscall(f *funcScope, expr *ast.CallExpr) { if strings.HasPrefix(f.name, "Syscall") { c.emitReverse(len(expr.Args) - 1) emit.Syscall(c.prog.BinWriter, name) - - // This NOP instruction is basically not needed, but if we do, we have a - // one to one matching avm file with neo-python which is very nice for debugging. - emit.Opcodes(c.prog.BinWriter, opcode.NOP) } else { op, err := opcode.FromString(name) if err != nil { @@ -1824,7 +1820,6 @@ func (c *codegen) convertStruct(lit *ast.CompositeLit, ptr bool) { return } - emit.Opcodes(c.prog.BinWriter, opcode.NOP) keyedLit := len(lit.Elts) > 0 if keyedLit { _, ok := lit.Elts[0].(*ast.KeyValueExpr)