compiler: move SHA256 from builtins to syscalls
Now it can be processed as a normal syscall.
This commit is contained in:
parent
b8d82b49ec
commit
2bbe218547
3 changed files with 2 additions and 3 deletions
|
@ -16,7 +16,7 @@ var (
|
||||||
goBuiltins = []string{"len", "append", "panic"}
|
goBuiltins = []string{"len", "append", "panic"}
|
||||||
// Custom builtin utility functions.
|
// Custom builtin utility functions.
|
||||||
customBuiltins = []string{
|
customBuiltins = []string{
|
||||||
"SHA256", "AppCall",
|
"AppCall",
|
||||||
"FromAddress", "Equals",
|
"FromAddress", "Equals",
|
||||||
"ToBool", "ToByteArray", "ToInteger",
|
"ToBool", "ToByteArray", "ToInteger",
|
||||||
}
|
}
|
||||||
|
|
|
@ -1220,8 +1220,6 @@ func (c *codegen) convertBuiltin(expr *ast.CallExpr) {
|
||||||
typ = stackitem.BooleanT
|
typ = stackitem.BooleanT
|
||||||
}
|
}
|
||||||
c.emitConvert(typ)
|
c.emitConvert(typ)
|
||||||
case "SHA256":
|
|
||||||
emit.Syscall(c.prog.BinWriter, "Neo.Crypto.SHA256")
|
|
||||||
case "AppCall":
|
case "AppCall":
|
||||||
c.emitReverse(len(expr.Args))
|
c.emitReverse(len(expr.Args))
|
||||||
buf := c.getByteArray(expr.Args[0])
|
buf := c.getByteArray(expr.Args[0])
|
||||||
|
|
|
@ -36,6 +36,7 @@ var syscalls = map[string]map[string]Syscall{
|
||||||
"ECDsaSecp256r1Verify": {"Neo.Crypto.VerifyWithECDsaSecp256r1", false},
|
"ECDsaSecp256r1Verify": {"Neo.Crypto.VerifyWithECDsaSecp256r1", false},
|
||||||
"ECDSASecp256r1CheckMultisig": {"Neo.Crypto.CheckMultisigWithECDsaSecp256r1", false},
|
"ECDSASecp256r1CheckMultisig": {"Neo.Crypto.CheckMultisigWithECDsaSecp256r1", false},
|
||||||
"RIPEMD160": {"Neo.Crypto.RIPEMD160", false},
|
"RIPEMD160": {"Neo.Crypto.RIPEMD160", false},
|
||||||
|
"SHA256": {"Neo.Crypto.SHA256", false},
|
||||||
},
|
},
|
||||||
"enumerator": {
|
"enumerator": {
|
||||||
"Concat": {"System.Enumerator.Concat", false},
|
"Concat": {"System.Enumerator.Concat", false},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue