package octez-protocol-alpha-libs
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-protocol-alpha-libs.test-helpers/Tezos_alpha_test_helpers/Dal_helpers/Make/index.html
Module Dal_helpers.MakeSource
Some global constants.
Parameters
module P : sig ... endSignature
val genesis_history_cache :
Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.History_cache.tHelper functions.
val get_history :
Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.History_cache.t ->
Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.hash ->
Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.t option Lwt.tRetrieves the history from a given cache.
val dal_mk_polynomial_from_slot :
bytes ->
Tezos_crypto_dal.Cryptobox.polynomial Tezos_base.TzPervasives.tzresultReturns the slot's polynomial from the given slot's data.
val dal_mk_prove_page :
Tezos_crypto_dal.Cryptobox.polynomial ->
Tezos_protocol_alpha.Protocol.Dal_slot_repr.Page.t ->
Tezos_crypto_dal.Cryptobox.page_proof Tezos_base.TzPervasives.tzresultUsing the given slot's polynomial, this function computes the page proof of the page whose ID is provided.
val mk_slot :
?level:Tezos_protocol_alpha.Protocol.Raw_level_repr.t ->
?index:Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t ->
?fill_function:(int -> char) ->
unit ->
(bytes
* Tezos_crypto_dal.Cryptobox.polynomial
* Tezos_protocol_alpha.Protocol.Dal_slot_repr.Header.t)
Tezos_base.TzPervasives.tzresultConstructs a slot whose ID is defined from the given level and given index, and whose data are built using the given fill function. The function returns the slot's data, polynomial, and header (in the sense: ID + kate commitment).
val mk_page_id :
Tezos_protocol_alpha.Protocol.Raw_level_repr.t ->
Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t ->
int ->
Tezos_protocol_alpha.Protocol.Dal_slot_repr.Page.tConstructs a record value of type Page.id.
val mk_page_info :
?default_char:char ->
?level:Tezos_protocol_alpha.Protocol.Raw_level_repr.t ->
?page_index:int ->
?custom_data:(default_char:char -> int -> bytes option) option ->
Tezos_protocol_alpha.Protocol.Dal_slot_repr.Header.t ->
Tezos_crypto_dal.Cryptobox.polynomial ->
((bytes * Tezos_crypto_dal.Cryptobox.page_proof) option
* Tezos_protocol_alpha.Protocol.Dal_slot_repr.Page.t,
Tezos_base.TzPervasives.error Tezos_base.TzPervasives.trace)
resultConstructs a page whose level and slot indexes are those of the given slot (except if level is redefined via ?level), and whose page index and data are given by arguments page_index and mk_data. If mk_data is set to No, the function returns the pair (None, page_id). Otherwise, the page's data and proof is computed, and the function returns Some (data, proof), page_id.
Returns the char after c. Restarts from the char whose code is 0 if c's code is 255.
val succ_slot_index :
Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.t ->
Tezos_protocol_alpha.Protocol.Dal_slot_index_repr.tIncrement the given slot index. Returns zero in case of overflow.
val produce_and_verify_proof :
check_produce:
((Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.proof * bytes option)
Tezos_base.TzPervasives.tzresult ->
(bytes * Tezos_crypto_dal.Cryptobox.page_proof) option ->
(unit, Tezos_base.TzPervasives.tztrace) result Lwt.t) ->
?check_verify:
(bytes option Tezos_base.TzPervasives.tzresult ->
(bytes * Tezos_crypto_dal.Cryptobox.page_proof) option ->
(unit, Tezos_base.TzPervasives.tztrace) result Lwt.t) ->
get_history:
(Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.hash ->
Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.t option Lwt.t) ->
Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.t ->
page_info:(bytes * Tezos_crypto_dal.Cryptobox.page_proof) option ->
page_id:Tezos_protocol_alpha.Protocol.Dal_slot_repr.Page.t ->
(unit, Tezos_base.TzPervasives.tztrace) result Lwt.tAuxiliary test function used by both unit and PBT tests: This function produces a proof from the given information and verifies the produced result, if any. The result of each step is checked with check_produce_result and check_verify_result, respectively.
val eq_page_proof :
Tezos_crypto_dal.Cryptobox.page_proof ->
Tezos_crypto_dal.Cryptobox.page_proof ->
boolCheck if two page proofs are equal.
val successful_check_produce_result :
__LOC__:string ->
[ `Confirmed | `Unconfirmed ] ->
(Tezos_protocol_alpha.Protocol.Dal_slot_repr.History.proof * bytes option)
Tezos_base.TzPervasives.tzresult ->
(bytes * 'a) option ->
(unit, Tezos_base.TzPervasives.tztrace) result Lwt.tHelper for the case where produce_proof is expected to succeed.
val successful_check_verify_result :
__LOC__:string ->
[> `Confirmed ] ->
bytes option Tezos_base.TzPervasives.tzresult ->
(bytes * 'a) option ->
(unit, Tezos_base.TzPervasives.tztrace) result Lwt.tHelper for the case where verify_proof is expected to succeed.
val slot_confirmed_but_page_data_not_provided :
__LOC__:string ->
'a Tezos_base.TzPervasives.tzresult ->
'b ->
unit Tezos_base.TzPervasives.tzresult Lwt.tHelper for the case where produce_proof is expected to fail because the slot is confirmed but no page information are provided.
val slot_not_confirmed_but_page_data_provided :
__LOC__:string ->
'a Tezos_base.TzPervasives.tzresult ->
'b ->
unit Tezos_base.TzPervasives.tzresult Lwt.tHelper for the case where produce_proof is expected to fail because the slot is not confirmed but page_info are provided.
val failing_check_produce_result :
__LOC__:string ->
expected_error:Tezos_protocol_alpha.Environment.Error_monad.error ->
'a Tezos_base.TzPervasives.tzresult ->
'b ->
unit Tezos_base.TzPervasives.tzresult Lwt.tHelper for the case where produce_proof is expected to fail.