Skip to content

Commit

Permalink
Verify errors of type SelectionOutputTokenQuantityExceedsLimitError.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Oct 26, 2021
1 parent ad613fa commit a534ad2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/core/src/Cardano/Wallet/Primitive/CoinSelection.hs
Expand Up @@ -834,13 +834,19 @@ verifySelectionOutputSizeExceedsLimitError cs _ps e

outputReportedAsExceedingLimit = e ^. #outputThatExceedsLimit

newtype FailureToVerifySelectionOutputTokenQuantityExceedsLimitError =
FailureToVerifySelectionOutputTokenQuantityExceedsLimitError
{ reportedError :: SelectionOutputTokenQuantityExceedsLimitError }
deriving (Eq, Show)

verifySelectionOutputTokenQuantityExceedsLimitError
:: VerifySelectionError SelectionOutputTokenQuantityExceedsLimitError
verifySelectionOutputTokenQuantityExceedsLimitError _cs _ps _e =
-- TODO: [ADP-1037]
--
-- Verify that the indicated output token quantity is above the limit.
VerificationSuccess
verifySelectionOutputTokenQuantityExceedsLimitError _cs _ps e
| e ^. #quantity <= e ^. #quantityMaxBound =
verificationFailure $
FailureToVerifySelectionOutputTokenQuantityExceedsLimitError e
| otherwise =
VerificationSuccess

--------------------------------------------------------------------------------
-- Selection deltas
Expand Down

0 comments on commit a534ad2

Please sign in to comment.