package octez-protocol-018-Proxford-libs

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

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 : Tezos_base.TzPervasives.Block_hash.t QCheck2.Gen.t
val random_payload_hash : Tezos_protocol_018_Proxford.Protocol.Block_payload_hash.t QCheck2.Gen.t
val gen_algo : Tezos_base.TzPervasives.Signature.algo QCheck2.Gen.t
val random_seed : bytes QCheck2.Gen.t
val random_pk : Tezos_base.TzPervasives.Signature.public_key QCheck2.Gen.t
val random_signature : Tezos_base.TzPervasives.Signature.t QCheck2.Gen.t
val random_contract_hash : Tezos_protocol_018_Proxford.Protocol.Contract_hash.t QCheck2.Gen.t
val random_proto : Tezos_base.TzPervasives.Protocol_hash.t QCheck2.Gen.t

Operations parameters generators

val random_shell : Tezos_base.Operation.shell_header QCheck2.Gen.t
val gen_slot : Tezos_raw_protocol_018_Proxford__Alpha_context.Slot.t QCheck2.Gen.t
val generate_consensus_content : Tezos_protocol_018_Proxford.Protocol.Alpha_context.consensus_content QCheck2.Gen.t
val gen_amount_in_bytes : Z.t QCheck2.Gen.t
val gen_counters : Tezos_raw_protocol_018_Proxford__Alpha_context.Manager_counter.t QCheck2.Gen.t
val gen_ticket_amounts : Tezos_protocol_018_Proxford.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:Tezos_protocol_018_Proxford.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 ] -> Tezos_raw_protocol_018_Proxford__Alpha_context.packed_operation QCheck2.Gen.t
val generate_non_manager_operation : Tezos_raw_protocol_018_Proxford__Alpha_context.packed_operation QCheck2.Gen.t
val generate_manager_operation : int -> Tezos_raw_protocol_018_Proxford__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 Octez 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 ] * (Tezos_protocol_environment_018_Proxford.Operation_hash.t * Tezos_raw_protocol_018_Proxford__Alpha_context.packed_operation)) QCheck2.Gen.t
OCaml

Innovation. Community. Security.