Commit 9dbe5b04 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Put all arguments of Web_election.make in a record

parent a75e9b72
......@@ -142,12 +142,10 @@ let process_datadir dir =
)
in
let featured = item.datadir_featured in
let election = Web_election.make
raw_election metadata
~featured
~params_fname
~public_keys_fname
in
let election = Web_election.(make {
raw_election; metadata; featured;
params_fname; public_keys_fname;
}) in
let module X = (val election : WEB_ELECTION) in
X.B.inject_creds public_creds >>
return election
......
......@@ -28,6 +28,14 @@ open Serializable_t
open Web_serializable_t
open Web_common
type config = {
raw_election : string;
metadata : metadata;
featured : bool;
params_fname : string;
public_keys_fname : string;
}
let can_read m user =
match m.e_readers with
| None -> false
......@@ -44,7 +52,7 @@ let can_vote m user =
| None -> false (* voters must log in *)
| Some u -> check_acl (Some acls) u.user_user
let make raw_election metadata ~featured ~params_fname ~public_keys_fname =
let make {raw_election; metadata; featured; params_fname; public_keys_fname} =
let e_fingerprint = sha256_b64 raw_election in
let wrapped_params = Serializable_j.params_of_string
......
......@@ -24,10 +24,12 @@ open Serializable_t
open Web_serializable_t
open Web_signatures
val make :
string ->
metadata ->
featured:bool ->
params_fname:string ->
public_keys_fname:string ->
(module WEB_ELECTION)
type config = {
raw_election : string;
metadata : metadata;
featured : bool;
params_fname : string;
public_keys_fname : string;
}
val make : config -> (module WEB_ELECTION)
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