Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cardano-cli/src/Cardano/CLI/EraBased/Run/Governance/Poll.hs
Original file line number Diff line number Diff line change
@@ -129,7 +129,8 @@ runGovernanceAnswerPoll _ pollFile maybeChoice mOutFile = do
validateChoice :: GovernancePoll -> Word -> ExceptT GovernanceCmdError IO ()
validateChoice GovernancePoll{govPollAnswers} ix = do
let maxAnswerIndex = length govPollAnswers - 1
when (fromIntegral ix > maxAnswerIndex) $ left $
ixInt = fromIntegral ix
when (ixInt < 0 || ixInt > maxAnswerIndex) $ left $
GovernanceCmdPollOutOfBoundAnswer maxAnswerIndex

askInteractively :: GovernancePoll -> ExceptT GovernanceCmdError IO Word

0 comments on commit 3d3736e

Please sign in to comment.