Skip to content

Commit 32b8f2a

Browse files
committed
fix(#2778): exception when there is no voting power for given stake key
1 parent 5400abe commit 32b8f2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

govtool/backend/src/VVA/AdaHolder.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,9 @@ getStakeKeyVotingPower stakeKey = withPool $ \conn -> do
6060
Text.putStrLn ("couldn't fetch voting power for stake key: " <> stakeKey)
6161
return 0
6262
Right [(votingPower,_)] -> return $ floor votingPower
63-
_ -> error ("multiple voting power entries for stake key: " <> unpack stakeKey)
63+
Right [] -> do
64+
Text.putStrLn ("No voting power found for stake key: " <> stakeKey)
65+
return 0
66+
Right _ -> do
67+
Text.putStrLn ("Unexpected result for stake key: " <> stakeKey)
68+
return 0

0 commit comments

Comments
 (0)