Skip to content

Commit

Permalink
Use when in validateWitnessCounts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed May 16, 2024
1 parent ac48c37 commit 78ceba7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/api/src/Cardano/Wallet/Api/Http/Shelley/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3715,14 +3715,13 @@ validateWitnessCounts
-> Int
-- ^ detected number of key witnesses
-> ExceptT ErrSubmitTransaction m ()
validateWitnessCounts expected detected
| expected > detected = throwE $
validateWitnessCounts expected detected =
when (expected > detected) $ throwE $
ErrSubmitTransactionMissingWitnesses $
ErrSubmitTransactionMissingWitnessCounts
{ expectedNumberOfKeyWits = toNatural expected
, detectedNumberOfKeyWits = toNatural detected
}
| otherwise = pure ()
where
toNatural :: Int -> Natural
toNatural = fromJustNote "validateWitnessCounts.toNatural" . intCastMaybe
Expand Down

0 comments on commit 78ceba7

Please sign in to comment.