interop: support ABORTMSG, ASSERT, ASSERTMSG opcodes
Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
e7f77e052f
commit
11bb733f1a
2 changed files with 24 additions and 1 deletions
|
@ -13,6 +13,25 @@ func Abort() {
|
|||
neogointernal.Opcode0NoReturn("ABORT")
|
||||
}
|
||||
|
||||
// AbortMsg terminates current execution with the specified message. Unlike
|
||||
// exception throwing with panic() it can't be recovered from.
|
||||
func AbortMsg(msg string) {
|
||||
neogointernal.Opcode1NoReturn("ABORTMSG", msg)
|
||||
}
|
||||
|
||||
// Assert terminates current execution if the condition specified is false. Unlike
|
||||
// exception throwing with panic() it can't be recovered from.
|
||||
func Assert(ok bool) {
|
||||
neogointernal.Opcode1NoReturn("ASSERT", ok)
|
||||
}
|
||||
|
||||
// AssertMsg terminates current execution with the specified message if the
|
||||
// condition specified is false. Unlike exception throwing with panic() it can't
|
||||
// be recovered from.
|
||||
func AssertMsg(ok bool, msg string) {
|
||||
neogointernal.Opcode2NoReturn("ASSERTMSG", ok, msg)
|
||||
}
|
||||
|
||||
// Equals compares a with b and will return true when a and b are equal. It's
|
||||
// implemented as an EQUAL VM opcode, so the rules of comparison are those
|
||||
// of EQUAL.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue