Skip to content

Commit 7859cc2

Browse files
authored
Merge pull request #2779 from IntersectMBO/fix/2778-exception-multiple-voting-power-entries-for-stake-key-e12dc5c13fc0d978cc770a34cf170428a7ca3234f8
fix(#2778): exception when there is no voting power for given stake key
2 parents 5400abe + 32b8f2a commit 7859cc2

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)