Module Octez_riscv_api

type repo
type state
type mut_state
type id
type status =
  1. | Evaluating
  2. | Waiting_for_input
  3. | Waiting_for_reveal
type input =
  1. | Inbox_message of {
    1. inbox_level : int32;
    2. message_counter : int64;
    3. payload : bytes;
    }
  2. | Reveal of bytes
type input_request =
  1. | No_input_required
  2. | Initial
  3. | First_after of {
    1. level : int32;
    2. counter : int64;
    }
  4. | Needs_reveal of bytes
type output_info = {
  1. message_index : int64;
  2. outbox_level : int32;
}
type output = {
  1. info : output_info;
  2. encoded_message : bytes;
}
type output_proof
type proof
val octez_riscv_from_imm : state -> mut_state
val octez_riscv_to_imm : mut_state -> state
val octez_riscv_id_unsafe_of_raw_bytes : bytes -> id
val octez_riscv_storage_id_to_raw_bytes : id -> bytes
val octez_riscv_storage_id_equal : id -> id -> bool
val octez_riscv_storage_state_equal : state -> state -> bool
val octez_riscv_storage_state_empty : unit -> state
val octez_riscv_storage_load : string -> repo
val octez_riscv_storage_close : repo -> unit
val octez_riscv_storage_commit : repo -> state -> id
val octez_riscv_storage_checkout : repo -> id -> state option
val octez_riscv_get_status : state -> status
val octez_riscv_mut_get_status : mut_state -> status
val octez_riscv_string_of_status : status -> string
val octez_riscv_compute_step : state -> state
val octez_riscv_compute_step_with_debug : state -> (bytes -> unit) -> state
val octez_riscv_compute_step_many : int64 -> state -> state * int64
val octez_riscv_mut_compute_step_many : int64 -> mut_state -> int64
val octez_riscv_compute_step_many_with_debug : int64 -> state -> (bytes -> unit) -> state * int64
val octez_riscv_mut_compute_step_many_with_debug : int64 -> mut_state -> (bytes -> unit) -> int64
val octez_riscv_get_tick : state -> int64
val octez_riscv_mut_get_tick : mut_state -> int64
val octez_riscv_get_level : state -> int32 option
val octez_riscv_mut_get_level : mut_state -> int32 option
val octez_riscv_install_boot_sector : state -> bytes -> state
val octez_riscv_state_hash : state -> bytes
val octez_riscv_mut_state_hash : mut_state -> bytes
val octez_riscv_set_input : state -> input -> state
val octez_riscv_mut_set_input : mut_state -> input -> unit
val octez_riscv_get_message_counter : state -> int64
val octez_riscv_mut_get_message_counter : mut_state -> int64
val octez_riscv_storage_export_snapshot : repo -> id -> string -> (unit, [ `Msg of string ]) Stdlib.result
val octez_riscv_proof_start_state : proof -> bytes
val octez_riscv_proof_stop_state : proof -> bytes
val octez_riscv_produce_proof : input option -> state -> proof option
val octez_riscv_verify_proof : input option -> proof -> input_request option
val octez_riscv_serialise_proof : proof -> bytes
val octez_riscv_deserialise_proof : bytes -> (proof, string) Stdlib.Result.t
val octez_riscv_output_info_of_output_proof : output_proof -> output_info
val octez_riscv_state_of_output_proof : output_proof -> bytes
val octez_riscv_verify_output_proof : output_proof -> output option
val octez_riscv_serialise_output_proof : output_proof -> bytes
val octez_riscv_deserialise_output_proof : bytes -> (output_proof, string) Stdlib.result
val octez_riscv_get_reveal_request : state -> bytes
val octez_riscv_mut_get_reveal_request : mut_state -> bytes
val octez_riscv_insert_failure : state -> state
val octez_riscv_mut_insert_failure : mut_state -> unit
val octez_riscv_test_status : status -> status
val octez_riscv_test_input : input -> input
val octez_riscv_test_input_request : input_request -> input_request
val octez_riscv_test_output_info : output_info -> output_info
val octez_riscv_test_output : output -> output