Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
drsk committed Sep 27, 2024
1 parent 6b0ebbe commit 14e2c48
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,7 @@ testUpdateBakerOk _spv pvString =
. accountBaker
%~ (stakedAmount .~ stakeAmount)
. (stakeEarnings .~ True)
. ( accountBakerInfo
. bieBakerPoolInfo
. ( accountBakerInfo . bieBakerPoolInfo
%~ (poolCommissionRates . transactionCommission .~ makeAmountFraction 1_000)
. (poolMetadataUrl .~ emptyUrlText)
)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 14e2c48

Please sign in to comment.