Mavryk_alpha_test_helpers.Incremental
type incremental = t
val predecessor : incremental -> Block.t
val rev_tickets :
incremental ->
Mavryk_protocol_alpha.Protocol.operation_receipt list
val validation_state :
incremental ->
Mavryk_protocol_alpha.Protocol.validation_state
val level : incremental -> int32
val begin_construction :
?timestamp:Mavryk_base.TzPervasives.Time.Protocol.t ->
?seed_nonce_hash:Mavryk_protocol_alpha.Protocol.Nonce_hash.t ->
?mempool_mode:bool ->
?policy:Block.baker_policy ->
?liquidity_baking_toggle_vote:
Mavryk_protocol_alpha.Protocol.Per_block_votes_repr.per_block_vote ->
?adaptive_issuance_vote:
Mavryk_protocol_alpha.Protocol.Per_block_votes_repr.per_block_vote ->
Block.t ->
incremental Mavryk_base.TzPervasives.tzresult Lwt.t
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
.val validate_operation :
?expect_failure:
(Mavryk_base.TzPervasives.error list ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t) ->
?check_size:bool ->
incremental ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.packed ->
incremental Mavryk_base.TzPervasives.tzresult Lwt.t
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.val add_operation :
?expect_failure:
(Mavryk_base.TzPervasives.error list ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t) ->
?expect_apply_failure:
(Mavryk_base.TzPervasives.error list ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t) ->
?allow_manager_failure:bool ->
?check_size:bool ->
incremental ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.packed ->
incremental Mavryk_base.TzPervasives.tzresult Lwt.t
add_operation ?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
. Otherwise raise the error from the validation of op
.
Optional arguments allow to override defaults:
val finalize_block :
incremental ->
Block.t Mavryk_base.TzPervasives.tzresult Lwt.t
finalize_block 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.
val assert_validate_operation_fails :
(Mavryk_base.TzPervasives.tztrace ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t) ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.packed ->
Block.t ->
unit Mavryk_base.TzPervasives.tzresult Lwt.t
assert_validate_operation_fails expect_failure operation block
calls begin_construction
on top of block
, then validate_operation
with ~expect_failure
.
val rpc_ctxt : incremental Mavryk_protocol_alpha.Environment.RPC_context.simple
val alpha_ctxt :
incremental ->
Mavryk_protocol_alpha.Protocol.Alpha_context.context
val set_alpha_ctxt :
incremental ->
Mavryk_protocol_alpha.Protocol.Alpha_context.context ->
incremental