diff --git a/concordium-consensus/src/Concordium/GlobalState/BlockState.hs b/concordium-consensus/src/Concordium/GlobalState/BlockState.hs index 3be3935afa..2a7e90bb92 100644 --- a/concordium-consensus/src/Concordium/GlobalState/BlockState.hs +++ b/concordium-consensus/src/Concordium/GlobalState/BlockState.hs @@ -1105,7 +1105,7 @@ class (BlockStateQuery m) => BlockStateOperations m where -- is (preferentially) reactivated from the inactive stake, updating the global indices -- accordingly. -- - -- 8. If the suspended/resumed flag is set and (>= P8): + -- 8. (>= P8) If the suspended/resumed flag is set: -- (1) Suspend/resume the validator according to the flag. diff --git a/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs b/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs index 5ce202a984..ec89b16fe6 100644 --- a/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs +++ b/concordium-consensus/src/Concordium/GlobalState/Persistent/BlockState.hs @@ -1681,8 +1681,7 @@ updateValidatorChecks :: MTL.ExceptT ValidatorConfigureFailure m () updateValidatorChecks bsp baker ValidatorUpdate{..} = do chainParams <- lookupCurrentParameters (bspUpdates bsp) - let - poolParams = chainParams ^. cpPoolParameters + let poolParams = chainParams ^. cpPoolParameters capitalMin = poolParams ^. ppMinimumEquityCapital ranges = poolParams ^. ppCommissionBounds -- Check if the aggregation key is fresh (or the same as the baker's existing one). @@ -1807,7 +1806,7 @@ updateValidatorChecks bsp baker ValidatorUpdate{..} = do -- index by adding the difference between the new and old capital) and append -- @BakerConfigureStakeIncreased capital@ to @events@. --- 9. If the suspended/resumed flag is set and (>= P8): +-- 9. (>= P8) If the suspended/resumed flag is set: -- (1) Suspend/resume the validator according to the flag. diff --git a/concordium-consensus/tests/globalstate/GlobalStateTests/ConfigureValidator.hs b/concordium-consensus/tests/globalstate/GlobalStateTests/ConfigureValidator.hs index 5c5d725200..bf7dca59d3 100644 --- a/concordium-consensus/tests/globalstate/GlobalStateTests/ConfigureValidator.hs +++ b/concordium-consensus/tests/globalstate/GlobalStateTests/ConfigureValidator.hs @@ -555,8 +555,7 @@ runUpdateValidatorTest spv commissionRanges ValidatorUpdateConfig{vucValidatorUp chainParams = DummyData.dummyChainParameters @(ChainParametersVersionFor pv) & cpPoolParameters . ppMinimumEquityCapital .~ minEquity - & cpPoolParameters - . ppCommissionBounds + & cpPoolParameters . ppCommissionBounds .~ commissionRanges mkInitialState accounts = hpbsPointers diff --git a/concordium-consensus/tests/scheduler/SchedulerTests/ConfigureBaker.hs b/concordium-consensus/tests/scheduler/SchedulerTests/ConfigureBaker.hs index af0496a174..c774ffbece 100644 --- a/concordium-consensus/tests/scheduler/SchedulerTests/ConfigureBaker.hs +++ b/concordium-consensus/tests/scheduler/SchedulerTests/ConfigureBaker.hs @@ -883,8 +883,7 @@ testUpdateBakerOk _spv pvString = . accountBaker %~ (stakedAmount .~ stakeAmount) . (stakeEarnings .~ True) - . ( accountBakerInfo - . bieBakerPoolInfo + . ( accountBakerInfo . bieBakerPoolInfo %~ (poolCommissionRates . transactionCommission .~ makeAmountFraction 1_000) . (poolMetadataUrl .~ emptyUrlText) ) @@ -1127,9 +1126,7 @@ testUpdateBakerRemoveOk spv pvString = updatedAccount1 updateStaking = case sSupportsFlexibleCooldown (sAccountVersionFor spv) of SFalse -> - Transient.accountStaking - . accountBaker - . bakerPendingChange + Transient.accountStaking . accountBaker . bakerPendingChange .~ RemoveStake (PendingChangeEffectiveV1 86400000) STrue -> (Transient.accountStaking .~ AccountStakeNone) @@ -1230,9 +1227,7 @@ testUpdateBakerReduceStakeOk spv pvString = (Transient.accountStakeCooldown . unconditionally .~ emptyCooldowns{prePreCooldown = Present 200_000_000_000}) . (Transient.accountStaking . accountBaker . stakedAmount .~ stakeAmount) ) - . ( Transient.accountStaking - . accountBaker - . accountBakerInfo + . ( Transient.accountStaking . accountBaker . accountBakerInfo %~ (poolCommissionRates . bakingCommission .~ makeAmountFraction 1_000) . (poolCommissionRates . finalizationCommission .~ makeAmountFraction 1_000) . (bakerElectionVerifyKey .~ bkwpElectionVerifyKey keysWithProofs) @@ -1315,9 +1310,10 @@ testUpdateBakerSuspendResumeOk spv pvString suspendOrResume accM = accountBaker f (AccountStakeBaker b) = AccountStakeBaker <$> f b accountBaker _ x = pure x events = - [ BakerResumed{ebrBakerId = 4} | suspendOrResume == Resume + [ if suspendOrResume == Suspend + then BakerSuspended{ebsBakerId = 4} + else BakerResumed{ebrBakerId = 4} ] - ++ [BakerSuspended{ebsBakerId = 4} | suspendOrResume == Suspend] tests :: Spec tests =