Skip to content

Commit

Permalink
Fixups in Pools
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Jul 28, 2020
1 parent c683960 commit bfeefe5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/shelley/src/Cardano/Wallet/Shelley/Pools.hs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ newStakePoolLayer
=> NetworkLayer IO (IO Shelley) (CardanoBlock sc)
-> DBLayer IO
-> StakePoolLayer
newStakePoolLayer gp nl db@DBLayer {..} =
newStakePoolLayer nl db@DBLayer {..} =
StakePoolLayer
{ getPoolLifeCycleStatus = _getPoolLifeCycleStatus
, knownPools = _knownPools
Expand Down Expand Up @@ -193,12 +193,12 @@ newStakePoolLayer gp nl db@DBLayer {..} =
-- TODO:
-- Use a more efficient way of filtering out retired pools.
-- See: https://jira.iohk.io/projects/ADP/issues/ADP-383
liftIO
. sortByReward seed
liftIO $
sortByReward seed
. filter (not . poolIsRetired)
. map snd
. Map.toList
$ combineDbAndLsqData (timeInterpreter, pp) lsqData dbData
<$> combineDbAndLsqData (timeInterpreter nl) pp lsqData dbData
where
fromErrCurrentNodeTip :: ErrCurrentNodeTip -> ErrNetworkUnavailable
fromErrCurrentNodeTip = \case
Expand Down Expand Up @@ -269,13 +269,13 @@ data PoolDbData = PoolDbData

-- | Top level combine-function that merges DB and LSQ data.
combineDbAndLsqData
:: forall m. Monad m
=> (TimeInterpreter m, ProtocolParameters)
:: (SlotParameters, ProtocolParameters)
:: forall m. (Monad m)
=> TimeInterpreter m
-> ProtocolParameters
-> Map PoolId PoolLsqData
-> Map PoolId PoolDbData
-> m (Map PoolId Api.ApiStakePool)
combineDbAndLsqData (ti, pp) lsqData =
combineDbAndLsqData ti pp lsqData =
Map.mergeA lsqButNoDb dbButNoLsq bothPresent lsqData
where
bothPresent = zipWithAMatched mkApiPool
Expand Down

0 comments on commit bfeefe5

Please sign in to comment.