Module Tezos_alpha_test_helpers.Error_helpers

Helpers to check expected errors.

val check_error_constructor_name : loc:string -> expected:'a -> Tezos_base.TzPervasives.Error_monad.tztrace -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Identifies the Inconsistent_sources error.

To be used as the expect_failure argument of Incremental.add_operation when expecting the Inconsistent_sources error.

Identifies the Inconsistent_counters error.

To be used as the expect_failure argument of Incremental.add_operation when expecting the Inconsistent_counters error.

val expect_inconsistent_counters_int : loc:string -> source:Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t -> previous_counter:int -> counter:int -> Tezos_base.TzPervasives.Error_monad.tztrace -> unit Tezos_base.TzPervasives.tzresult Lwt.t

Same as expect_inconsistent_counters but with int arguments for counters.

val expect_incorrect_reveal_position : loc:string -> Tezos_base.TzPervasives.Error_monad.tztrace -> unit Tezos_base.TzPervasives.tzresult Lwt.t

To be used as the expect_failure argument of Incremental.add_operation when expecting the Incorrect_reveal_position error.

val expect_outdated_denunciation_state : loc:string -> state:State.t -> Tezos_base.TzPervasives.Error_monad.tztrace -> unit Tezos_base.TzPervasives.tzresult Lwt.t
val expect_balance_too_low : loc:string -> Tezos_base.TzPervasives.Error_monad.tztrace -> unit Tezos_base.TzPervasives.tzresult Lwt.t
val expect_failwith : loc:string -> ?str:Str.regexp -> Tezos_base.TzPervasives.tztrace -> unit Tezos_base.TzPervasives.tzresult Lwt.t

expect_failwith str err checks whether err is a failwith error containing a string that matches the regular expression str.

For example, in case of a failure, Assert.equal a b prints a string saying that a is not equal to b, replacing a and b with their actual values. In this case, Str.regexp ".*\n.*is not equal to.*" is constructed to check for such kind of errors.

val expect_empty_implicit_delegated_contract : loc:string -> contract:Tezos_protocol_alpha.Protocol.Alpha_context.Contract.t -> Tezos_base.TzPervasives.Error_monad.tztrace -> unit Tezos_base.TzPervasives.tzresult Lwt.t