Skip to content

Commit

Permalink
Added the map from (Credential 'Staking c) to (KeyHash 'Voting c) to …
Browse files Browse the repository at this point in the history
…the UMap. touches many files
  • Loading branch information
TimSheard committed Mar 27, 2023
1 parent 6079218 commit f30072d
Show file tree
Hide file tree
Showing 17 changed files with 523 additions and 168 deletions.
Expand Up @@ -116,7 +116,7 @@ reapRewards ::
UMap c
reapRewards (UMap tmap ptrmap) withdrawals = UMap (Map.mapWithKey g tmap) ptrmap
where
g k (Triple x y z) = Triple (fmap (removeRewards k) x) y z
g k (Triple x y z w) = Triple (fmap (removeRewards k) x) y z w
removeRewards k v@(RDPair _ d) =
if k `Map.member` withdrawals then RDPair (CompactCoin 0) d else v

Expand Down
Expand Up @@ -265,7 +265,7 @@ delegsTransition = do
| (RewardAcnt _ cred, coin) <- Map.toList withdrawals_
]
f :: Coin -> Trip (EraCrypto era) -> Bool
f coin1 (Triple (SJust (UM.RDPair coin2 _)) _ _) = coin1 == (fromCompact coin2)
f coin1 (Triple (SJust (UM.RDPair coin2 _)) _ _ _) = coin1 == (fromCompact coin2)
f _ _ = False

instance
Expand Down
2 changes: 1 addition & 1 deletion eras/shelley/test-suite/bench/BenchUTxOAggregate.hs
Expand Up @@ -91,7 +91,7 @@ makeStatePair ::
(DState c, PState c)
makeStatePair rewards' delegs ptrs' poolParams =
( DState
(UM.unify (Map.map rdPair rewards') delegs ptrs')
(UM.unify (Map.map rdPair rewards') delegs ptrs' Map.empty)
Map.empty
(GenDelegs Map.empty)
(InstantaneousRewards Map.empty Map.empty mempty mempty)
Expand Down
Expand Up @@ -241,6 +241,7 @@ registerGenesisStaking
(Map.map pairWithDepositsButNoRewards . Map.mapKeys KeyHashObj . LM.toMap $ sgsStake)
(Map.mapKeys KeyHashObj $ LM.toMap sgsStake)
(UM.ptrView (dsUnified (dpsDState oldDPState)))
Map.empty
}

-- We consider pools as having been registered in slot 0
Expand Down

0 comments on commit f30072d

Please sign in to comment.