compiler: implement engine.AppCall interop

This commit is contained in:
Evgenii Stratonikov 2020-01-27 10:59:57 +03:00
parent ead0b8ff94
commit 330db36168
4 changed files with 129 additions and 2 deletions

View file

@ -14,7 +14,7 @@ var (
builtinFuncs = []string{
"len", "append", "SHA256",
"SHA1", "Hash256", "Hash160",
"VerifySignature",
"VerifySignature", "AppCall",
"FromAddress", "Equals",
}
)
@ -180,6 +180,11 @@ func isBuiltin(expr ast.Expr) bool {
return false
}
func isAppCall(expr ast.Expr) bool {
t, ok := expr.(*ast.SelectorExpr)
return ok && t.Sel.Name == "AppCall"
}
func isByteArray(lit *ast.CompositeLit, tInfo *types.Info) bool {
if len(lit.Elts) == 0 {
return false