Skip to content

Commit

Permalink
Improve lovelace parser failure in the cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed Nov 12, 2020
1 parent 8fe51ae commit bd63271
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,12 @@ pProtocolVersion =
--

parseLovelace :: Atto.Parser Lovelace
parseLovelace = Lovelace <$> Atto.decimal
parseLovelace = do
i <- Atto.decimal
case i > toInteger (maxBound :: Word64) of
True -> fail $ show i
<> " lovelace exceeds the Word64 upper bound"
False -> return $ Lovelace i

parseAddress :: Atto.Parser (Address Shelley)
parseAddress = do
Expand Down

0 comments on commit bd63271

Please sign in to comment.