Skip to content

Commit

Permalink
Rename bieAccountIsSuspended (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
drsk0 authored Dec 10, 2024
1 parent 182a32b commit d189872
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion concordium-base
Original file line number Diff line number Diff line change
Expand Up @@ -393,5 +393,5 @@ genesisBakerInfoEx spv cp GenesisBaker{..} = case spv of
_poolMetadataUrl = emptyUrlText,
_poolCommissionRates = cp ^. cpPoolParameters . ppCommissionBounds . to maximumCommissionRates
},
_bieAccountIsSuspended = conditionally (sSupportsValidatorSuspension (sAccountVersionFor spv)) False
_bieIsSuspended = conditionally (sSupportsValidatorSuspension (sAccountVersionFor spv)) False
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ migratePersistentBakerInfoEx StateMigrationParametersP6ToP7{} = migrateReference
(AVSupportsDelegation av1, AVSupportsDelegation av2, SupportsValidatorSuspension av2 ~ 'False, Monad m') =>
BakerInfoEx av1 ->
m' (BakerInfoEx av2)
migrateBakerInfoExV1 BakerInfoExV1{..} = return BakerInfoExV1{_bieAccountIsSuspended = CFalse, ..}
migrateBakerInfoExV1 BakerInfoExV1{..} = return BakerInfoExV1{_bieIsSuspended = CFalse, ..}
migratePersistentBakerInfoEx StateMigrationParametersP7ToP8{} = error "TODO(drsk) github #1220. Implement migratePersistenBakerInfoEx p7 -> p8"

-- | Migrate a 'V0.PersistentBakerInfoEx' to a 'PersistentBakerInfoEx'.
Expand Down Expand Up @@ -1489,7 +1489,7 @@ setValidatorSuspended ::
setValidatorSuspended isSusp = updateStake $ \case
baker@PersistentAccountStakeEnduringBaker{} -> do
oldInfo <- refLoad (paseBakerInfo baker)
let newInfo = oldInfo & bieAccountIsSuspended .~ isSusp
let newInfo = oldInfo & bieIsSuspended .~ isSusp
newInfoRef <- refMake $! newInfo
return $! baker{paseBakerInfo = newInfoRef}
PersistentAccountStakeEnduringDelegator{} ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ doGetActiveBakersAndDelegators pbs = do
activeBakerDelegators = abd,
activeBakerIsSuspended =
fromCondDef
( BaseAccounts._bieAccountIsSuspended $
( BaseAccounts._bieIsSuspended $
BaseAccounts._accountBakerInfo $
theBaker
)
Expand Down Expand Up @@ -1632,7 +1632,7 @@ newAddValidator pbs ai va@ValidatorAdd{..} = do
BaseAccounts.BakerInfoExV1
{ _bieBakerPoolInfo = poolInfo,
_bieBakerInfo = bakerInfo,
_bieAccountIsSuspended = conditionally hasValidatorSuspension False
_bieIsSuspended = conditionally hasValidatorSuspension False
}
-- The precondition guaranties that the account exists
acc <- fromJust <$> Accounts.indexedAccount ai (bspAccounts bsp)
Expand Down Expand Up @@ -3570,7 +3570,7 @@ doSuspendValidators pbs ais =
Just ba
-- The validator is not yet suspended
| False <-
uncond $ BaseAccounts._bieAccountIsSuspended $ _accountBakerInfo ba -> do
uncond $ BaseAccounts._bieIsSuspended $ _accountBakerInfo ba -> do
newAcc <- setAccountValidatorSuspended True acc
newAccounts <- Accounts.setAccountAtIndex ai newAcc (bspAccounts bsp)
address <- accountCanonicalAddress newAcc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ dummyBakerStake compStake accIndex pc =
_bakerAggregationVerifyKey =
Bls.derivePublicKey (bakerAggregationKey seed)
},
_bieAccountIsSuspended = CFalse
_bieIsSuspended = CFalse
}
}
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ setAccountStakeDetails ai StakeDetailsBaker{..} mPoolInfo acc =
BakerInfoExV1
{ _bieBakerInfo = fulBaker ^. bakerInfo,
_bieBakerPoolInfo = poolInfo,
_bieAccountIsSuspended = conditionally hasValidatorSuspension False
_bieIsSuspended = conditionally hasValidatorSuspension False
}
fulBaker = DummyData.mkFullBaker (fromIntegral ai) (BakerId ai) ^. _1
poolInfo = fromMaybe dummyBakerPoolInfo mPoolInfo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ testAddValidatorAllCases spv = describe "bsoAddValidator" $ do
_poolMetadataUrl = vaMetadataURL va,
_poolCommissionRates = vaCommissionRates va
},
_bieAccountIsSuspended = conditionally (sSupportsValidatorSuspension (accountVersion @(AccountVersionFor pv))) False
_bieIsSuspended = conditionally (sSupportsValidatorSuspension (accountVersion @(AccountVersionFor pv))) False
}
}
bkr <- getAccountBaker (fromJust acc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ makeTestBakerV1FromSeed amount stake bakerId seed suspend = do
BakerInfoExV1
{ _bieBakerInfo = fulBaker ^. theBakerInfo,
_bieBakerPoolInfo = poolInfo,
_bieAccountIsSuspended = conditionally (sSupportsValidatorSuspension (accountVersion @av)) suspend
_bieIsSuspended = conditionally (sSupportsValidatorSuspension (accountVersion @av)) suspend
}
BS.addAccountBakerV1 bakerInfoEx stake True account
where
Expand Down Expand Up @@ -338,7 +338,7 @@ testDelegatorToBakerOk spv pvString =
_transactionCommission = makeAmountFraction 1_000
}
},
_bieAccountIsSuspended = conditionally (sSupportsValidatorSuspension (sAccountVersionFor spv)) False
_bieIsSuspended = conditionally (sSupportsValidatorSuspension (sAccountVersionFor spv)) False
}
updateStaking keysWithProofs = case sSupportsFlexibleCooldown (sAccountVersionFor spv) of
SFalse -> id
Expand Down Expand Up @@ -604,7 +604,7 @@ testAddBakerOk spv pvString =
_transactionCommission = makeAmountFraction 1_000
}
},
_bieAccountIsSuspended = conditionally (sSupportsValidatorSuspension (sAccountVersionFor spv)) False
_bieIsSuspended = conditionally (sSupportsValidatorSuspension (sAccountVersionFor spv)) False
}
updateStaking keysWithProofs =
( Transient.accountStaking
Expand Down Expand Up @@ -1304,7 +1304,7 @@ testUpdateBakerSuspendResumeOk spv pvString suspendOrResume accM =
Transient.accountStaking
. accountBaker
. accountBakerInfo
. bieAccountIsSuspended
. bieIsSuspended
.~ (suspendOrResume == Suspend)
SFalse -> id
accountBaker f (AccountStakeBaker b) = AccountStakeBaker <$> f b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ makeTestBakerV1FromSeed amount stake bakerId seed = do
BakerInfoExV1
{ _bieBakerInfo = fulBaker ^. theBakerInfo,
_bieBakerPoolInfo = poolInfo,
_bieAccountIsSuspended =
_bieIsSuspended =
conditionally (sSupportsValidatorSuspension (accountVersion @av)) False
}
BS.addAccountBakerV1 bakerInfoEx stake True account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ makePersistentAccountStakeEnduring StakeDetailsBaker{..} ai = do
BakerInfoExV1
{ _bieBakerInfo = fulBaker ^. bakerInfo,
_bieBakerPoolInfo = poolInfo,
_bieAccountIsSuspended = conditionally hasValidatorSuspension False
_bieIsSuspended = conditionally hasValidatorSuspension False
}
return
( SV1.PersistentAccountStakeEnduringBaker
Expand Down

0 comments on commit d189872

Please sign in to comment.