Module Mavryk_001_PtAtLas_test_helpers.Operation_generator

These generators aims at generating operations which are not necessary correct. The goal is to tests functions such as Operation.compare with as much as possible parameters that play a role in operation weight computation.

When adding a new operation, one should also add its weight computation, hence knows which kind of generator should be provided for this new operation.

Operations kind labelling.

val consensus_pass : [> `PConsensus ]
val anonymous_pass : [> `PAnonymous ]
val vote_pass : [> `PVote ]
val manager_pass : [> `PManager ]
val all_passes : [> `PAnonymous | `PConsensus | `PManager | `PVote ] list
val all_non_manager_passes : [> `PAnonymous | `PConsensus | `PVote ] list
val consensus_kinds : [> `KAttestation | `KDal_attestation | `KPreattestation ] list
val anonymous_kinds : [> `KActivate_account | `KDouble_attestation | `KDouble_baking | `KDouble_preattestation | `KSeed_nonce_revelation | `KVdf_revelation ] list
val vote_kinds : [> `KBallot | `KProposals ] list
val manager_kinds : [> `KDal_publish_slot_header | `KDelegation | `KIncrease_paid_storage | `KOrigination | `KRegister_global_constant | `KReveal | `KSc_rollup_add_messages | `KSc_rollup_cement | `KSc_rollup_execute_outbox_message | `KSc_rollup_originate | `KSc_rollup_publish | `KSc_rollup_recover_bond | `KSc_rollup_refute | `KSc_rollup_timeout | `KSet_deposits_limit | `KTransaction | `KTransfer_ticket ] list
val pass_to_operation_kinds : [< `PAnonymous | `PConsensus | `PManager | `PVote ] -> [> `KActivate_account | `KAttestation | `KBallot | `KDal_attestation | `KDouble_attestation | `KDouble_baking | `KDouble_preattestation | `KManager | `KPreattestation | `KProposals | `KSeed_nonce_revelation | `KVdf_revelation ] list
val pp_kind : Stdlib.Format.formatter -> [< `KActivate_account | `KAttestation | `KBallot | `KDal_attestation | `KDouble_attestation | `KDouble_baking | `KDouble_preattestation | `KManager | `KPreattestation | `KProposals | `KSeed_nonce_revelation | `KVdf_revelation ] -> unit

Generators

module Gen_hash (H : sig ... end) : sig ... end

Selection in hashes list

val gen_block_hash : Mavryk_base.TzPervasives.Block_hash.t QCheck2.Gen.t
val random_payload_hash : Mavryk_protocol_001_PtAtLas.Protocol.Block_payload_hash.t QCheck2.Gen.t
val gen_algo : Mavryk_base.TzPervasives.Signature.algo QCheck2.Gen.t
val random_seed : bytes QCheck2.Gen.t
val random_pk : Mavryk_base.TzPervasives.Signature.public_key QCheck2.Gen.t
val random_signature : Mavryk_base.TzPervasives.Signature.t QCheck2.Gen.t
val random_contract_hash : Mavryk_protocol_001_PtAtLas.Protocol.Contract_hash.t QCheck2.Gen.t
val random_proto : Mavryk_base.TzPervasives.Protocol_hash.t QCheck2.Gen.t

Operations parameters generators

val random_shell : Mavryk_base.Operation.shell_header QCheck2.Gen.t
val gen_slot : Mavryk_raw_protocol_001_PtAtLas__Alpha_context.Slot.t QCheck2.Gen.t
val generate_consensus_content : Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.consensus_content QCheck2.Gen.t
val gen_amount_in_bytes : Z.t QCheck2.Gen.t
val gen_counters : Mavryk_raw_protocol_001_PtAtLas__Alpha_context.Manager_counter.t QCheck2.Gen.t
val gen_ticket_amounts : Mavryk_protocol_001_PtAtLas.Protocol.Ticket_amount.t QCheck2.Gen.t
val gen_storage_limit : Z.t QCheck2.Gen.t

Generators for each Operation Kind

val random_period : int32 QCheck2.Gen.t

By Kind Operation Generator

val generator_of : ?source:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash -> [< `KDal_publish_slot_header | `KDelegation | `KIncrease_paid_storage | `KOrigination | `KRegister_global_constant | `KReveal | `KSc_rollup_add_messages | `KSc_rollup_cement | `KSc_rollup_execute_outbox_message | `KSc_rollup_originate | `KSc_rollup_publish | `KSc_rollup_recover_bond | `KSc_rollup_refute | `KSc_rollup_timeout | `KSet_deposits_limit | `KTransaction | `KTransfer_ticket ] -> Mavryk_raw_protocol_001_PtAtLas__Alpha_context.packed_operation QCheck2.Gen.t
val generate_non_manager_operation : Mavryk_raw_protocol_001_PtAtLas__Alpha_context.packed_operation QCheck2.Gen.t
val generate_manager_operation : int -> Mavryk_raw_protocol_001_PtAtLas__Alpha_context.packed_operation QCheck2.Gen.t
val max_batch_size : int

The default upper bound on the number of manager operations in a batch.

As of December 2022, there is no batch maximal size enforced anywhere in the protocol. However, the Mavkit Shell only accepts batches of at most operations_batch_size operations, which has a default value of 50 in src/lib_shell_services/shell_limits.ml. The protocol tests do not necessarily have to align with this value, but there is no reason either to choose a different one. Therefore, they use the same bound, but decremented once to account for some tests adding a reveal at the front of the batch as needed.

val generate_operation : ([ `KActivate_account | `KAttestation | `KBallot | `KDal_attestation | `KDouble_attestation | `KDouble_baking | `KDouble_preattestation | `KManager | `KPreattestation | `KProposals | `KSeed_nonce_revelation | `KVdf_revelation ] * (Mavryk_protocol_environment_001_PtAtLas.Operation_hash.t * Mavryk_raw_protocol_001_PtAtLas__Alpha_context.packed_operation)) QCheck2.Gen.t