Skip to content

Commit

Permalink
Remove unused function Coin.unsafeToQuantity.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanknowles committed Dec 20, 2023
1 parent 8d8b3f4 commit 7161e5d
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions lib/primitive/lib/Cardano/Wallet/Primitive/Types/Coin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ module Cardano.Wallet.Primitive.Types.Coin

-- * Conversions (Unsafe)
, unsafeFromIntegral
, unsafeToQuantity
, unsafeToWord64

-- * Arithmetic operations
Expand Down Expand Up @@ -239,26 +238,6 @@ unsafeFromIntegral i = fromMaybe onError (fromIntegralMaybe i)
, "is not a natural number."
]

-- | Converts a 'Coin' to a 'Quantity'.
--
-- Callers of this function must take responsibility for checking that the
-- given value will fit within the bounds of the target type.
--
-- Produces a run-time error if the given value is out of bounds.
--
unsafeToQuantity
:: HasCallStack
=> (Bits i, Integral i)
=> Coin
-> Quantity "lovelace" i
unsafeToQuantity c = fromMaybe onError (toQuantityMaybe c)
where
onError = error $ unwords
[ "Coin.unsafeToQuantity:"
, show c
, "does not fit within the bounds of the target type."
]

-- | Converts a 'Coin' to a 'Word64' value.
--
-- Callers of this function must take responsibility for checking that the
Expand Down

0 comments on commit 7161e5d

Please sign in to comment.