Commit c20e23a4 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Remove Web_election.REGISTRABLE

That functor layer was there to delay the initialization of
authentication, but now that authentication has been moved out of
Web_election, it is no longer needed.
parent 4f187e8e
......@@ -32,13 +32,7 @@ open Web_services
let ( / ) = Filename.concat
module type REGISTRABLE = sig
module Register (X : EMPTY) : WEB_ELECTION
end
module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
module Register (X : EMPTY) : WEB_ELECTION = struct
module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : WEB_ELECTION = struct
let uuid = Uuidm.to_string D.election.e_params.e_uuid
......@@ -242,6 +236,4 @@ module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE = struct
end
end
end
......@@ -25,8 +25,4 @@ open Signatures
open Web_serializable_t
open Web_signatures
module type REGISTRABLE = sig
module Register (X : EMPTY) : WEB_ELECTION
end
module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : REGISTRABLE
module Make (D : ELECTION_DATA) (P : WEB_PARAMS) : WEB_ELECTION
......@@ -88,11 +88,10 @@ let register_election params web_params =
}
end in
let module P = (val web_params : WEB_PARAMS) in
let module R = Web_election.Make (D) (P) in
(module R : Web_election.REGISTRABLE), fun () ->
(* starting from here, we do side-effects on the running server *)
let module W = R.Register (struct end) in
let module W = Web_election.Make (D) (P) in
let election = (module W : WEB_ELECTION) in
fun () ->
(* starting from here, we do side-effects on the running server *)
election_table := SMap.add uuid election !election_table;
election
......@@ -136,8 +135,7 @@ let import_election f =
let state = ref `Open
end in
let web_params = (module X : WEB_PARAMS) in
let r, do_register = register_election params web_params in
let module R = (val r : Web_election.REGISTRABLE) in
let do_register = register_election params web_params in
let module G = P.G in
let module KG = Election.MakeSimpleDistKeyGen (G) (LwtRandom) in
let public_keys = Lwt_io.lines_of_file f.f_public_keys in
......@@ -219,7 +217,7 @@ let import_election f =
lwt () =
Ocsipersist.iter_step (fun uuid (raw_election, web_params) ->
let params = Group.election_params_of_string raw_election in
let _, do_register = register_election params web_params in
let do_register = register_election params web_params in
let election = do_register () in
let module W = (val election : WEB_ELECTION) in
assert (uuid = Uuidm.to_string W.election.e_params.e_uuid);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment