Divergent
A divergent instruction is an instruction that fails. The effect of a failing instruction is to cancel all modifications (storage, operations) executed by the entrypoint so far. Hence a failing operation does not change anything on the contract state.
The only effect of a failing injected operation is that the operation fee is spent and not paid back. That's why the correct process is to simulate (dry run) the entrypoint before injection to make sure the entrypoint does not fail (as wallets do for example).
fail(e : T)
Aborts entrypoint execution with value
e
.Parameter
fail_some(e : option<T>)
Aborts entrypoint if optional value e
is some
value.
It is equivalent to:
match e with
| some(v) -> fail(v)
| none -> ()
end
Parameter
do_require(t : bool, e : T)
Aborts entrypoint if test expression t
is false
.
It is equivalent to:
if not t then
fail(e)