diff --git a/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.ml b/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.ml index da5b328b9aa2e693c459eec4025b458593d039be..baaf738154cc47c69557ab97d7f8579f7e813eda 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.ml +++ b/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.ml @@ -33,10 +33,6 @@ let void = (fun _ -> Error "void has no inhabitant") unit) -type t = Context_binary.t - -type tree = Context_binary.tree - let empty_tree () = Context_binary.(make_empty_context () |> Tree.empty) module Context_no_proofs = struct @@ -57,22 +53,26 @@ module Context_no_proofs = struct let proof_encoding = void end -module type S = Sc_rollup_PVM_sig.PROTO_ORIGINATION with type state = tree +module type S = sig + include Sc_rollup_PVM_sig.PROTO_ORIGINATION -module Arith : S = Sc_rollup_arith.Make (Context_no_proofs) + val empty_state : unit -> state +end -module Wasm : S = - Sc_rollup_wasm.V2_0_0.Make (Wasm_2_0_0.Make) (Context_no_proofs) +module Arith : S = struct + include Sc_rollup_arith.Make (Context_no_proofs) -module Riscv : S = struct - type state = tree + let empty_state = empty_tree +end - type hash = Smart_rollup.State_hash.t +module Wasm : S = struct + include Sc_rollup_wasm.V2_0_0.Make (Wasm_2_0_0.Make) (Context_no_proofs) - let state_hash _state = - Sc_rollup_riscv.(Protocol_implementation.state_hash (make_empty_state ())) + let empty_state = empty_tree +end - let initial_state ~empty = Lwt.return empty +module Riscv : S = struct + include Sc_rollup_riscv.Protocol_implementation - let install_boot_sector state _bs = Lwt.return state + let empty_state = Sc_rollup_riscv.make_empty_state end diff --git a/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.mli b/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.mli index 0e3b7add1fe8816b7700d6069818e8da3c8ecb44..85f4aa7f53486212f4c5f6a2a0a9956fbc18d348 100644 --- a/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.mli +++ b/src/proto_alpha/lib_protocol/sc_rollup_origination_machine.mli @@ -28,15 +28,11 @@ be used to perform rollup origination, {b but} cannot be used to compute proofs or run computations. *) -type void = | +module type S = sig + include Sc_rollup_PVM_sig.PROTO_ORIGINATION -type t = Context_binary.t - -type tree = Context_binary.tree - -val empty_tree : unit -> tree - -module type S = Sc_rollup_PVM_sig.PROTO_ORIGINATION with type state = tree + val empty_state : unit -> state +end module Arith : S diff --git a/src/proto_alpha/lib_protocol/sc_rollups.ml b/src/proto_alpha/lib_protocol/sc_rollups.ml index 6058c4661aced88d02dc6332d48f72dcc953bce4..30ae99ccc450f140949bdec84f6fd2e221d97529 100644 --- a/src/proto_alpha/lib_protocol/sc_rollups.ml +++ b/src/proto_alpha/lib_protocol/sc_rollups.ml @@ -107,7 +107,7 @@ end let genesis_state_hash_of ~boot_sector kind = let open Lwt_syntax in let (module Machine) = Kind.no_proof_machine_of kind in - let empty = Sc_rollup_origination_machine.empty_tree () in + let empty = Machine.empty_state () in let* tree = Machine.initial_state ~empty in let* tree = Machine.install_boot_sector tree boot_sector in Machine.state_hash tree