Skip to content

Commit

Permalink
Remove Quantity
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Apr 15, 2021
1 parent c56c058 commit f097d4a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions cardano-cli/src/Cardano/CLI/Slot.hs
@@ -1,12 +1,9 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE RankNTypes #-}

module Cardano.CLI.Slot
Expand Down Expand Up @@ -77,11 +74,6 @@ data TimeInterpreter m = forall eras. TimeInterpreter
, blockchainStartTime :: StartTime
}

newtype Quantity (unit :: Symbol) a = Quantity { getQuantity :: a }
deriving stock (Generic, Show, Eq, Ord)
deriving newtype (Bounded, Enum, Hashable)
deriving newtype NFData

newtype Hash (tag :: Symbol) = Hash { getHash :: ByteString }
deriving stock (Generic, Eq, Ord)
deriving (Read, Show) via (Quiet (Hash tag))
Expand All @@ -92,7 +84,7 @@ newtype SyncTolerance = SyncTolerance NominalDiffTime

data SyncProgress
= Ready
| Syncing !(Quantity "percent" Percentage)
| Syncing Percentage
| NotResponding
deriving (Generic, Eq, Show)

Expand Down Expand Up @@ -196,7 +188,6 @@ syncProgress (SyncTolerance tolerance) ti tipSlotNo now = do
return
. Right
. Syncing
. Quantity
. fromRight (error (errMsg progress))
. mkPercentage
. toRational
Expand Down

0 comments on commit f097d4a

Please sign in to comment.