vm: implement ASSERT/ABORT opcodes
Rename THROWIFNOT to ASSERT, add ABORT opcode. ABORT cannot be caught, but the implementation should be postponed until exception handling is implemented.
This commit is contained in:
parent
963a70d54a
commit
977c431bf1
9 changed files with 104 additions and 98 deletions
|
@ -105,7 +105,7 @@ func (c *Client) TransferNEP5(acc *wallet.Account, to util.Uint160, token *walle
|
|||
// 2 round trips instead of one.
|
||||
w := io.NewBufBinWriter()
|
||||
emit.AppCallWithOperationAndArgs(w.BinWriter, token.Hash, "transfer", from, to, amount)
|
||||
emit.Opcode(w.BinWriter, opcode.THROWIFNOT)
|
||||
emit.Opcode(w.BinWriter, opcode.ASSERT)
|
||||
|
||||
tx := transaction.NewInvocationTX(w.Bytes(), gas)
|
||||
tx.Sender = from
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue