Module Tezos_alpha_test_helpers.Incremental

type t
type incremental = t
val predecessor : incremental -> Block.t
val delegate : incremental -> Account.t
val level : incremental -> int32

begin_construction ?mempool_mode predecessor uses Main.begin_validation_and_application to create a validation and application state on top of predecessor for the construction of a new block.

Optional arguments allow to override defaults:

  • ?mempool_mode:bool: when true, use Partial_construction mode. By default, it is false and the mode is Construction.

validate_operation ?expect_failure ?check_size i op tries to validate op in the validation state of i. If the validation succeeds, the function returns the incremental value with a validation state updated after the validate. Otherwise raise the error from the validation of op.

Optional arguments allow to override defaults:

  • ?expect_failure:(error list -> unit tzresult Lwt.t): validation of op is expected to fail and expect_failure should handle the error. In case validate does not fail and an expect_failure is provided, validate_operation fails.
  • ?check_size:bool: enable the check that an operation size should not exceed Constants_repr.max_operation_data_length. Enabled (set to true) by default.

add_operation_with_metadata ?expect_failure ?expect_apply_failure ?allow_manager_failure ?check_size i op tries to validate then apply op in the validation and application state of i. If the validation of op succeeds, the function returns the incremental value with a validation state updated after the application of op, and the operation metadata associated to the operation. Otherwise raise the error from the validation of op.

Optional arguments allow to override defaults:

  • parameter expect_failure

    validation of op is expected to fail and expect_failure should handle the error. In case validate does not fail and expect_failure is provided, validate_operation fails.

  • parameter expect_apply_failure

    application of op is expected to fail and expect_apply_failure should handle the errror. In case the application of op does not fail and expect_apply_failure is provided, add_operation fails.

  • parameter allow_manager_failure

    marks that manager operation failures after fee taken are ignored.

  • parameter check_size

    enable the check that an operation size should not exceed Constants_repr.max_operation_data_length. Enabled (set to true) by default.

val add_operation : ?expect_failure: (Tezos_base.TzPervasives.error list -> unit Tezos_base.TzPervasives.tzresult Lwt.t) -> ?expect_apply_failure: (Tezos_base.TzPervasives.error list -> unit Tezos_base.TzPervasives.tzresult Lwt.t) -> ?allow_manager_failure:bool -> ?check_size:bool -> incremental -> Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed -> incremental Tezos_base.TzPervasives.tzresult Lwt.t

Same as add_operation_with_metadata, but without returning the metadata. The metadata is still added in the incremental state.

finalize_block_with_metadata i creates a Block.t based on the protocol states and the operations contained in i. The function calls Main.finalize_application to compute a new context.

Same as finalize_block_with_metadata, but without the metadata

assert_validate_operation_fails expect_failure operation block calls begin_construction on top of block, then validate_operation with ~expect_failure.