Skip to content

Commit

Permalink
Issue #473: removes the PairSet type after rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Dimjašević committed May 31, 2019
1 parent 2848298 commit f2c28ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions byron/ledger/executable-spec/src/Ledger/Update/Generators.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ where

import Control.State.Transition (Environment, State, Signal)
import Data.Map.Strict (Map)
import Data.Set (Set)
import Data.Word (Word64)
import Hedgehog
import Hedgehog.Gen.Aux (doubleInc)
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Ledger.Core (Slot(..), SlotCount(..), BlockCount(..), VKeyGenesis(..), PairSet(..), minusSlot)
import Ledger.Core (Slot(..), SlotCount(..), BlockCount(..), VKeyGenesis(..), minusSlot)
import qualified Ledger.Core.Generators as CG
import Ledger.GlobalParams (k)
import Ledger.Update (ProtVer(..), PParams(..), PVBUMP, ApName(..), ApVer(..), Metadata(..), UpId(..), UPIState, UPIEC)
Expand Down Expand Up @@ -230,13 +231,13 @@ cps = Gen.map (Range.linear 0 10) m where

-- | Generates a set for the 'vts' field of an @UPIState@, i.e.,
-- proposal votes
vts :: Gen (PairSet UpId VKeyGenesis)
vts = PairSet <$> Gen.set (Range.linear 0 10) ((,) <$> upId <*> CG.vkgenesis)
vts :: Gen (Set (UpId, VKeyGenesis))
vts = Gen.set (Range.linear 0 10) ((,) <$> upId <*> CG.vkgenesis)

-- | Generates a set for the 'bvs' field of an @UPIState@, i.e.,
-- endorsement-key pairs
bvs :: Gen (PairSet ProtVer VKeyGenesis)
bvs = PairSet <$> Gen.set (Range.linear 0 10) ((,) <$> protVer <*> CG.vkgenesis)
bvs :: Gen (Set (ProtVer, VKeyGenesis))
bvs = Gen.set (Range.linear 0 10) ((,) <$> protVer <*> CG.vkgenesis)

-- | Generates a map for the 'pws' field of an @UPIState@, i.e.,
-- proposal timestamps
Expand Down
6 changes: 3 additions & 3 deletions byron/ledger/executable-spec/test/Ledger/Upiec/Properties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Control.State.Transition (applySTS, TRC(..))
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
import Ledger.Core (Slot, PairSet(..))
import Ledger.Core (Slot)
import Ledger.Update (UpId)
import qualified Ledger.Update.Generators as G
import Hedgehog
Expand Down Expand Up @@ -122,7 +122,7 @@ protVerChangeEmptyComponents = property $ do
assert $ null fads'
assert $ Map.null rpus'
assert $ Map.null cps'
assert $ Set.null . unPairSet $ vts'
assert $ Set.null . unPairSet $ bvs'
assert $ Set.null vts'
assert $ Set.null bvs'
assert $ Map.null pws'
Left _ -> failure

0 comments on commit f2c28ce

Please sign in to comment.