1 {-# LANGUAGE NoMonomorphismRestriction #-}
2 {-# LANGUAGE OverloadedStrings #-}
3 {-# LANGUAGE StrictData #-}
4 {-# OPTIONS_GHC -Wno-missing-signatures #-}
5 module Hjugement.CLI.MkElection where
7 import Control.Applicative (Applicative(..))
8 import Control.Monad (Monad(..))
10 import Data.Maybe (Maybe(..))
11 import Data.Function (($))
12 import Data.Functor ((<$>))
13 import Data.Semigroup (Semigroup(..))
14 import Data.String (String)
15 import Symantic.CLI as CLI
16 import System.IO (FilePath)
17 import Text.Show (Show)
18 import qualified Symantic.Document as Doc
19 import qualified Voting.Protocol as VP
21 import Hjugement.CLI.Utils
23 data MkElection_Options = MkElection_Options
24 { mkelection_crypto :: VP.FFC
25 , mkelection_template :: FilePath
26 , mkelection_uuid :: VP.UUID
30 "This command reads and checks "<>fileRef"public_keys.jsons"<>"\
31 \ (or "<>fileRef"threshold.json"<>" if it exists).\
32 \ It then computes the global election public key\
33 \ and generates an "<>fileRef"election.json"<>" file."
35 command "mkelection" $
44 run_mkelection MkElection_Options{..} =