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.
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 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_keys :
(Mavryk_base.TzPervasives.Signature.public_key_hash
* Mavryk_base.TzPervasives.Signature.public_key
* Mavryk_base.TzPervasives.Signature.secret_key)
QCheck2.Gen.t
val random_mv1 :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash
QCheck2.Gen.t
val random_mv2 :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash
QCheck2.Gen.t
val random_mv3 :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash
QCheck2.Gen.t
val random_tz4 :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash
QCheck2.Gen.t
val random_pkh :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash
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 block_headers :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Block_header.block_header
list
val random_block_header :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Block_header.block_header
QCheck2.Gen.t
val random_sc_rollup :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Sc_rollup.Address.t
QCheck2.Gen.t
val random_proto : Mavryk_base.TzPervasives.Protocol_hash.t QCheck2.Gen.t
val random_code :
Mavryk_protocol_001_PtAtLas.Protocol.Blinded_public_key_hash.activation_code
QCheck2.Gen.t
val random_shell : Mavryk_base.Operation.shell_header QCheck2.Gen.t
val gen_level :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Raw_level.raw_level
QCheck2.Gen.t
val gen_round :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Round.t QCheck2.Gen.t
val generate_consensus_content :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.consensus_content
QCheck2.Gen.t
val gen_tez :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Tez.mav QCheck2.Gen.t
val gen_fee :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Tez.mav QCheck2.Gen.t
val gen_amount :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Tez.mav QCheck2.Gen.t
val random_contract :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Contract.t QCheck2.Gen.t
val gen_ticket_amounts :
Mavryk_protocol_001_PtAtLas.Protocol.Ticket_amount.t QCheck2.Gen.t
val gen_gas_limit :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Gas.Arith.integral
QCheck2.Gen.t
val nonces :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Nonce.nonce list
val random_nonce :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Nonce.nonce QCheck2.Gen.t
val vdf_solutions :
(Mavryk_protocol_001_PtAtLas.Environment.Vdf.result
* Mavryk_protocol_001_PtAtLas.Environment.Vdf.proof)
list
val generate_op :
'kind Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t ->
'kind0 Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.operation
QCheck2.Gen.t
val generate_preattestation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.preattestation
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_attestation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.attestation
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_dal_attestation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.dal_attestation
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_vdf_revelation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.vdf_revelation
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_seed_nonce_revelation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.seed_nonce_revelation
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_double_preattestation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.double_preattestation_evidence
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_double_attestation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.double_attestation_evidence
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_double_baking :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.double_baking_evidence
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_activate_account :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.activate_account
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_proposals :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.proposals
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_ballot :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.ballot
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_manager_aux :
?source:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash ->
'a Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t ->
'b Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.manager
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.contents
QCheck2.Gen.t
val generate_manager :
?source:Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.public_key_hash ->
'a Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t ->
'a Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.manager
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.operation
QCheck2.Gen.t
val generate_reveal :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.reveal
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_transaction :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.transaction
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_origination :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.origination
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_delegation :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.delegation
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_increase_paid_storage :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.increase_paid_storage
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_set_deposits_limit :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.set_deposits_limit
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_register_global_constant :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.register_global_constant
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_transfer_ticket :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.transfer_ticket
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_dal_publish_slot_header :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.dal_publish_slot_header
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_sc_rollup_originate :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_originate
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_sc_rollup_add_messages :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_add_messages
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val sc_dummy_commitment :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Sc_rollup.Commitment.t
val generate_sc_rollup_cement :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_cement
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_sc_rollup_publish :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_publish
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_sc_rollup_refute :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_refute
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_sc_rollup_timeout :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_timeout
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_sc_rollup_execute_outbox_message :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_execute_outbox_message
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
val generate_sc_rollup_recover_bond :
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.Kind.sc_rollup_recover_bond
Mavryk_protocol_001_PtAtLas.Protocol.Alpha_context.manager_operation
QCheck2.Gen.t
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
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