66{-# LANGUAGE ScopedTypeVariables #-}
77{-# LANGUAGE TypeApplications #-}
88{-# LANGUAGE TypeFamilies #-}
9+ {-# LANGUAGE TypeOperators #-}
910
1011module Test.Cardano.Ledger.Shelley.Rules.IncrementalStake (
1112 incrStakeComputationTest ,
@@ -72,13 +73,14 @@ incrStakeComputationTest ::
7273 forall era ledger .
7374 ( EraGen era
7475 , EraStake era
76+ , InstantStake era ~ ShelleyInstantStake era
7577 , TestingLedger era ledger
7678 , ChainProperty era
7779 , QC. HasTrace (CHAIN era ) (GenEnv MockCrypto era )
7880 ) =>
7981 TestTree
8082incrStakeComputationTest =
81- testProperty " incremental stake calc " $
83+ testProperty " instant stake calculation " $
8284 forAllChainTrace @ era longTraceLen defaultConstants $ \ tr -> do
8385 let ssts = sourceSignalTargets tr
8486
@@ -89,7 +91,10 @@ incrStakeComputationTest =
8991
9092incrStakeComp ::
9193 forall era ledger .
92- (ChainProperty era , EraStake era , TestingLedger era ledger ) =>
94+ ( ChainProperty era
95+ , InstantStake era ~ ShelleyInstantStake era
96+ , TestingLedger era ledger
97+ ) =>
9398 SourceSignalTarget (CHAIN era ) ->
9499 Property
95100incrStakeComp SourceSignalTarget {source = chainSt, signal = block} =
@@ -126,10 +131,10 @@ incrStakeComp SourceSignalTarget {source = chainSt, signal = block} =
126131 , show ptrs'
127132 ]
128133 )
129- $ utxoBal === fromCompact incrStakeBal
134+ $ utxoBalanace === fromCompact instantStakeBalanace
130135 where
131- utxoBal = coinBalance u'
132- incrStakeBal = fold (is' ^. instantStakeCredentialsL ) <> fold (is' ^. instantStakeCredentialsL )
136+ utxoBalanace = coinBalance u'
137+ instantStakeBalanace = fold (sisCredentialStake is') <> fold (sisPtrStake is')
133138 ptrs = ptrsMap $ dp ^. certDStateL
134139 ptrs' = ptrsMap $ dp' ^. certDStateL
135140
0 commit comments