diff --git a/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs b/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs index ce1fecd7bf6..890b9de354c 100644 --- a/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs +++ b/cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs @@ -2192,7 +2192,11 @@ pProtocolVersion = -- parseLovelace :: Atto.Parser Lovelace -parseLovelace = Lovelace <$> Atto.decimal +parseLovelace = do + i <- Atto.decimal + if i > toInteger (maxBound :: Word64) + then fail $ show i <> " lovelace exceeds the Word64 upper bound" + else return $ Lovelace i parseAddress :: Atto.Parser (Address Shelley) parseAddress = do