compiler: remove custom logic for util builtins

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgeniy Stratonikov 2021-10-23 16:12:42 +03:00
parent 6fe8f4565d
commit a92bf281c1
5 changed files with 19 additions and 21 deletions

View file

@ -11,7 +11,7 @@ import (
// Abort terminates current execution, unlike exception throwing with panic() it
// can't be recovered from.
func Abort() {
_ = neogointernal.Opcode0("ABORT")
neogointernal.Opcode0NoReturn("ABORT")
}
// FromAddress is an utility function that converts a Neo address to its hash
@ -26,10 +26,11 @@ func FromAddress(address string) interop.Hash160 {
// implemented as an EQUAL VM opcode, so the rules of comparison are those
// of EQUAL.
func Equals(a, b interface{}) bool {
return false
return neogointernal.Opcode2("EQUAL", a, b).(bool)
}
// Remove removes element with index i from slice.
// This is done in place and slice must have type other than `[]byte`.
func Remove(slice interface{}, i int) {
neogointernal.Opcode2NoReturn("REMOVE", slice, i)
}