View on GitHub
File Changes

                      
parseFraction :: String -> String -> Parser Rational
parseFraction optname desc =
-
  option readFraction $
+
  option (toRational <$> readDouble) $
      long optname
-
   <> metavar "INT"
+
   <> metavar "DOUBLE"
   <> help desc
  where

                      
parseFractionWithDefault
  :: String
  -> String
-
  -> Rational
+
  -> Double
  -> Parser Rational
parseFractionWithDefault optname desc w =
-
  option readFraction $
-
      long optname
-
   <> metavar "INT"
-
   <> help desc
-
   <> value w
+
  toRational <$> ( option readDouble
+
                 $ long optname
+
                <> metavar "DOUBLE"
+
                <> help desc
+
                <> value w
+
                )

                      
-
readFraction :: ReadM Rational
-
readFraction = do
+
readDouble :: ReadM Double
+
readDouble = do
  f <- auto
  when (f < 0) $ readerError "fraction must be >= 0"
  when (f > 1) $ readerError "fraction must be <= 1"
m
+10/-10
n_poors=128
n_delegates=7
total_balance=8000000000000000
-
delegate_share=900000000000000
+
delegate_share=0.9
avvm_entries=128
avvm_entry_balance=10000000000000
not_so_secret=2718281828
      --genesis-output-dir           "${tmpdir}"
      --start-time                   "${start_time}"
      --protocol-parameters-file     "${protocol_params}"
-
      --k                            ${parameter_k}
-
      --protocol-magic               ${protocol_magic}
-
      --n-poor-addresses             ${n_poors}
-
      --n-delegate-addresses         ${n_delegates}
-
      --total-balance                ${total_balance}
-
      --delegate-share               ${delegate_share}
-
      --avvm-entry-count             ${avvm_entries}
-
      --avvm-entry-balance           ${avvm_entry_balance}
+
      --k                            "${parameter_k}"
+
      --protocol-magic               "${protocol_magic}"
+
      --n-poor-addresses             "${n_poors}"
+
      --n-delegate-addresses         "${n_delegates}"
+
      --total-balance                "${total_balance}"
+
      --avvm-entry-count             "${avvm_entries}"
+
      --avvm-entry-balance           "${avvm_entry_balance}"
+
      --delegate-share               "${delegate_share}"
      --real-pbft
-
      --secret-seed                  ${not_so_secret}
+
      --secret-seed                  "${not_so_secret}"
)

                      
set -xe