Library
Module
Module type
Parameter
Class
Class type
type delegate_selection =
(Tezos_protocol_013_PtJakart.Protocol.Raw_level_repr.t
* (Tezos_protocol_013_PtJakart.Protocol.Round_repr.t
* Tezos_crypto.Signature.public_key_hash)
list)
list
The type of desired delegate selection. For each level, and each round, one can provide a public key hash that would be the proposer. All non- specified level and rounds are not constrained.
val bruteforce :
?show_progress:bool ->
?random_seed:int ->
?max:int ->
?parameters:Tezos_client_013_PtJakart.Mockup.Protocol_parameters.t ->
?constants_overrides_json:Data_encoding.json ->
?bootstrap_accounts_json:Data_encoding.json ->
delegate_selection ->
Tezos_protocol_013_PtJakart.Protocol.State_hash.t option
Tezos_base.TzPervasives.tzresult
Lwt.t
Brute-force an initial seed nonce for the desired delegate selection. When found, the seed nonce is returned as a byte sequence of size 32. If no nonce is necessary to obtain the desired selection, None
is returned (there won't be any brute-forcing then).
Note: When using this function in your tests, take care of saving the nonce once it is found locallty (in this case call check_seed_nonce
to ensure it yields the desired selection) to avoid unnecessary computation (in particular this function should not be called in the CI).
val check_seed :
?parameters:Tezos_client_013_PtJakart.Mockup.Protocol_parameters.t ->
?constants_overrides_json:Data_encoding.json ->
?bootstrap_accounts_json:Data_encoding.json ->
seed:Tezos_protocol_013_PtJakart.Protocol.State_hash.t option ->
delegate_selection ->
bool Tezos_base.TzPervasives.tzresult Lwt.t
Check that an initial seed nonce yields to the desired delegate selection. See bruteforce
for the arguments.