Tezos_alpha_test_helpers.Consensus_helpers
val craft_consensus_operation :
?delegate:Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
?slot:Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t ->
?level:Tezos_protocol_alpha.Protocol.Alpha_context.Raw_level.t ->
?round:Tezos_protocol_alpha.Protocol.Alpha_context.Round.t ->
?block_payload_hash:Tezos_protocol_alpha.Protocol.Block_payload_hash.t ->
?branch:Tezos_base.TzPervasives.Block_hash.t ->
attested_block:Block.t ->
kind ->
Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed
Tezos_base.TzPervasives.tzresult
Lwt.t
Crafts a consensus operation.
By default, a (pre)attestation is for the first slot, whereas an attestations aggregate is for all the level's attesters that are using a BLS consensus key.
Moreover, the operation points to the given attested_block
: in other words, it has that block's level, round, payload hash, and its branch is the predecessor of that block.
Optional arguments allow to override these default parameters.
val test_consensus_operation :
?delegate:Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
?slot:Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t ->
?level:Tezos_protocol_alpha.Protocol.Alpha_context.Raw_level.t ->
?round:Tezos_protocol_alpha.Protocol.Alpha_context.Round.t ->
?block_payload_hash:Tezos_protocol_alpha.Protocol.Block_payload_hash.t ->
?branch:Tezos_base.TzPervasives.Block_hash.t ->
attested_block:Block.t ->
?predecessor:Block.t ->
?error:(Tezos_protocol_alpha.Environment.Error_monad.error -> bool) ->
loc:string ->
kind ->
Op.tested_mode ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val test_consensus_operation_all_modes_different_outcomes :
?delegate:Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
?slot:Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t ->
?level:Tezos_protocol_alpha.Protocol.Alpha_context.Raw_level.t ->
?round:Tezos_protocol_alpha.Protocol.Alpha_context.Round.t ->
?block_payload_hash:Tezos_protocol_alpha.Protocol.Block_payload_hash.t ->
?branch:Tezos_base.TzPervasives.Block_hash.t ->
attested_block:Block.t ->
?predecessor:Block.t ->
loc:string ->
?application_error:
(Tezos_protocol_alpha.Environment.Error_monad.error -> bool) ->
?construction_error:
(Tezos_protocol_alpha.Environment.Error_monad.error -> bool) ->
?mempool_error:(Tezos_protocol_alpha.Environment.Error_monad.error -> bool) ->
kind ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val test_consensus_operation_all_modes :
?delegate:Tezos_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
?slot:Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t ->
?level:Tezos_protocol_alpha.Protocol.Alpha_context.Raw_level.t ->
?round:Tezos_protocol_alpha.Protocol.Alpha_context.Round.t ->
?block_payload_hash:Tezos_protocol_alpha.Protocol.Block_payload_hash.t ->
?branch:Tezos_base.TzPervasives.Block_hash.t ->
attested_block:Block.t ->
?predecessor:Block.t ->
?error:(Tezos_protocol_alpha.Environment.Error_monad.error -> bool) ->
loc:string ->
kind ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t
val delegate_of_first_slot :
Context.t ->
(Tezos_protocol_alpha.Environment.Signature.public_key_hash
* Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
val delegate_of_slot :
?different_slot:bool ->
Tezos_protocol_alpha.Protocol.Alpha_context.Slot.t ->
Context.t ->
(Tezos_protocol_alpha.Environment.Signature.public_key_hash,
Tezos_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
val test_consensus_op_for_next :
genesis:Block.t ->
kind:[< `Attestation | `Preattestation ] ->
next:[< `Level | `Round ] ->
(unit, Tezos_base.TzPervasives.tztrace) Stdlib.result Lwt.t