Skip to content

Commit

Permalink
test for suspended ValidatorAdd
Browse files Browse the repository at this point in the history
  • Loading branch information
drsk committed Jan 7, 2025
1 parent ee13c96 commit 51f10ee
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ data ValidatorConditions = ValidatorConditions
vcTransactionFeeNotInRange :: Bool,
vcBakingRewardNotInRange :: Bool,
vcFinalizationRewardNotInRange :: Bool,
vcAggregationKeyDuplicate :: Bool
vcAggregationKeyDuplicate :: Bool,
vcSuspended :: Bool
}
deriving (Show)

Expand All @@ -82,6 +83,7 @@ validatorConditions = do
vcBakingRewardNotInRange <- [True, False]
vcFinalizationRewardNotInRange <- [True, False]
vcAggregationKeyDuplicate <- [True, False]
vcSuspended <- [True, False]
return ValidatorConditions{..}

-- | Derive a 'BakerKeyUpdate' from a seed.
Expand Down Expand Up @@ -143,7 +145,7 @@ testAddValidatorAllCases spv = describe "bsoAddValidator" $ do
_bakingCommission = makeAmountFraction $ if vcBakingRewardNotInRange then 100 else 500,
_transactionCommission = makeAmountFraction $ if vcTransactionFeeNotInRange then 300 else 100
},
vaSuspended = False
vaSuspended = vcSuspended
}
initialAccounts <- mapM makeDummyAccount (addValidatorTestAccounts withCooldown)
initialBS <- mkInitialState initialAccounts
Expand Down Expand Up @@ -190,7 +192,7 @@ testAddValidatorAllCases spv = describe "bsoAddValidator" $ do
_poolMetadataUrl = vaMetadataURL va,
_poolCommissionRates = vaCommissionRates va
},
_bieIsSuspended = conditionally (sSupportsValidatorSuspension (accountVersion @(AccountVersionFor pv))) False
_bieIsSuspended = conditionally (sSupportsValidatorSuspension (accountVersion @(AccountVersionFor pv))) vcSuspended
}
}
bkr <- getAccountBaker (fromJust acc)
Expand Down

0 comments on commit 51f10ee

Please sign in to comment.