|
1 | 1 | {-# LANGUAGE AllowAmbiguousTypes #-} |
| 2 | +{-# LANGUAGE BangPatterns #-} |
2 | 3 | {-# LANGUAGE DataKinds #-} |
3 | 4 | {-# LANGUAGE FlexibleContexts #-} |
4 | 5 | {-# LANGUAGE LambdaCase #-} |
5 | 6 | {-# LANGUAGE ScopedTypeVariables #-} |
6 | 7 | {-# LANGUAGE TypeApplications #-} |
7 | 8 | {-# LANGUAGE TypeFamilies #-} |
8 | 9 | {-# LANGUAGE TypeOperators #-} |
| 10 | +{-# OPTIONS_GHC -Wno-redundant-constraints #-} |
9 | 11 |
|
10 | 12 | module Test.Cardano.Ledger.Api.State.QuerySpec (spec) where |
11 | 13 |
|
@@ -65,20 +67,24 @@ spec = do |
65 | 67 | queryStakePoolDelegsAndRewardsSpec @MaryEra |
66 | 68 | queryStakePoolDelegsAndRewardsSpec @AlonzoEra |
67 | 69 | queryStakePoolDelegsAndRewardsSpec @BabbageEra |
68 | | - queryStakePoolDelegsAndRewardsSpec @ConwayEra |
| 70 | + -- queryStakePoolDelegsAndRewardsSpec @ConwayEra -- See comment about queryStakePoolDelegsAndRewardsSpec and eras |
69 | 71 | describe "GetCommitteeMembersState" $ do |
70 | 72 | committeeMembersStateSpec @ConwayEra |
71 | 73 |
|
72 | | -queryStakePoolDelegsAndRewardsSpec :: forall era. ShelleyEraTest era => Spec |
| 74 | +-- | This does not make sense for Eras after Babbage. It requires only (ShelleyEraTest era) |
| 75 | +-- which pretends that from every era, one can extract a UMap. |
| 76 | +-- One cannot extract a UMap from the ConwayEra |
| 77 | +queryStakePoolDelegsAndRewardsSpec :: |
| 78 | + forall era. (AtMostEra BabbageEra era, ShelleyEraTest era) => Spec |
73 | 79 | queryStakePoolDelegsAndRewardsSpec = |
74 | 80 | describe (eraName @era) $ do |
75 | 81 | describe "GetFilteredDelegationsAndRewardAccounts" $ do |
76 | 82 | prop "queryStakePoolDelegsAndRewards same as getFilteredDelegationsAndRewardAccounts" $ |
77 | 83 | forAll (genValidUMapWithCreds @era) $ \(umap :: UMap, creds) -> |
78 | 84 | let nes :: NewEpochState era |
79 | 85 | nes = def & nesEsL . esLStateL . lsCertStateL . certDStateL . accountsL .~ accountsFromUMap umap |
80 | | - in queryStakePoolDelegsAndRewards nes creds |
81 | | - `shouldBe` getFilteredDelegationsAndRewardAccounts umap creds |
| 86 | + in (queryStakePoolDelegsAndRewards nes creds) |
| 87 | + `shouldBe` (getFilteredDelegationsAndRewardAccounts umap creds) |
82 | 88 |
|
83 | 89 | committeeMembersStateSpec :: |
84 | 90 | forall era. |
|
0 commit comments