Skip to content

Commit

Permalink
Change type of outputThatExceedsLimit to (Address, TokenBundle).
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Mar 1, 2022
1 parent d6e300f commit a50b6b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/core/src/Cardano/Wallet/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4328,9 +4328,9 @@ instance IsServerError SelectionOutputSizeExceedsLimitError where
[ "One of the outputs you've specified contains too many assets. "
, "Try splitting these assets across two or more outputs. "
, "Destination address: "
, pretty (output ^. #address)
, pretty (fst output)
, ". Asset count: "
, pretty (TokenMap.size $ output ^. (#tokens . #tokens))
, pretty (TokenMap.size $ snd output ^. #tokens)
, "."
]
where
Expand Down
7 changes: 4 additions & 3 deletions lib/core/src/Cardano/Wallet/CoinSelection/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,8 @@ verifySelectionOutputSizeExceedsLimitError cs _ps e =
where
bundle = outputReportedAsExceedingLimit ^. #tokens

outputReportedAsExceedingLimit = e ^. #outputThatExceedsLimit
outputReportedAsExceedingLimit = uncurry TxOut
(e ^. #outputThatExceedsLimit)

--------------------------------------------------------------------------------
-- Selection error verification: output token quantity errors
Expand Down Expand Up @@ -1404,7 +1405,7 @@ data SelectionOutputError

newtype SelectionOutputSizeExceedsLimitError =
SelectionOutputSizeExceedsLimitError
{ outputThatExceedsLimit :: TxOut
{ outputThatExceedsLimit :: (Address, TokenBundle)
}
deriving (Eq, Generic, Show)

Expand All @@ -1421,7 +1422,7 @@ verifyOutputSize cs out
| withinLimit =
Nothing
| otherwise =
Just $ SelectionOutputSizeExceedsLimitError (uncurry TxOut out)
Just $ SelectionOutputSizeExceedsLimitError out
where
withinLimit :: Bool
withinLimit =
Expand Down

0 comments on commit a50b6b1

Please sign in to comment.