Skip to content

Commit

Permalink
Merge pull request #2779 from IntersectMBO/fix/2778-exception-multipl…
Browse files Browse the repository at this point in the history
…e-voting-power-entries-for-stake-key-e12dc5c13fc0d978cc770a34cf170428a7ca3234f8

fix(#2778): exception when there is no voting power for given stake key
  • Loading branch information
MSzalowski authored Jan 28, 2025
2 parents 5400abe + 32b8f2a commit 7859cc2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion govtool/backend/src/VVA/AdaHolder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ getStakeKeyVotingPower stakeKey = withPool $ \conn -> do
Text.putStrLn ("couldn't fetch voting power for stake key: " <> stakeKey)
return 0
Right [(votingPower,_)] -> return $ floor votingPower
_ -> error ("multiple voting power entries for stake key: " <> unpack stakeKey)
Right [] -> do
Text.putStrLn ("No voting power found for stake key: " <> stakeKey)
return 0
Right _ -> do
Text.putStrLn ("Unexpected result for stake key: " <> stakeKey)
return 0

0 comments on commit 7859cc2

Please sign in to comment.