interop: return struct pointers where needed

`Transaction`, `Block` and `Contract` are represented as
`Array`s in VM, so we must return pointers.

Revert a1f98f92.
This commit is contained in:
Evgenii Stratonikov 2020-09-08 13:41:47 +03:00
parent 25f8545cdf
commit 37f7363386
5 changed files with 71 additions and 80 deletions

View file

@ -1392,10 +1392,7 @@ func (c *codegen) convertSyscall(expr *ast.CallExpr, api, name string) {
c.prog.Err = fmt.Errorf("unknown VM syscall api: %s.%s", api, name)
return
}
emit.Syscall(c.prog.BinWriter, syscall.API)
if syscall.ConvertResultToStruct {
c.emitConvert(stackitem.StructT)
}
emit.Syscall(c.prog.BinWriter, syscall)
// 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.