Merge pull request #1375 from nspcc-dev/compiler/types

Smartcontract types definition in interops
This commit is contained in:
Roman Khimov 2020-09-16 14:43:50 +03:00 committed by GitHub
commit 5f22bdfecf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 189 additions and 111 deletions

View file

@ -1396,10 +1396,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.