Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Currently this uses the trace mechanism to check that computing rewards has a required set of properties. It works only in the Shelley Era. It could be generalized, and then moved to the GeneratorTrace directory which computes property tests in all eras.
Synopsis
- tests ∷ TestTree
- type C = ShelleyEra
- defaultMain ∷ TestTree → IO ()
- newEpochProp ∷ Word64 → (NewEpochState C → Property) → Property
- newEpochEventsProp ∷ Word64 → ([ChainEvent C] → NewEpochState C → Property) → Property
- data RewardUpdateOld = RewardUpdateOld {}
- createRUpdOld ∷ ∀ era. EraGov era ⇒ EpochSize → BlocksMade → EpochState era → Coin → ShelleyBase RewardUpdateOld
- createRUpdOld_ ∷ ∀ era. EraPParams era ⇒ EpochSize → BlocksMade → SnapShots → Coin → PParams era → Coin → Set (Credential 'Staking) → NonMyopic → ShelleyBase RewardUpdateOld
Documentation
type C = ShelleyEra Source #
defaultMain ∷ TestTree → IO () Source #
Parse the command line arguments and run the tests.
When the tests finish, this function calls exitWith
with the exit code
that indicates whether any tests have failed. Most external systems
(stack, cabal, travis-ci, jenkins etc.) rely on the exit code to detect
whether the tests pass. If you want to do something else after
defaultMain
returns, you need to catch the exception and then re-throw
it. Example:
import Test.Tasty import Test.Tasty.HUnit import System.Exit import Control.Exception test = testCase "Test 1" (2 @?= 3) main = defaultMain test `catch` (\e -> do if e == ExitSuccess then putStrLn "Yea" else putStrLn "Nay" throwIO e)
Since: tasty-0.1
newEpochProp ∷ Word64 → (NewEpochState C → Property) → Property Source #
Provide a legitimate NewEpochState to make an test Property
newEpochEventsProp ∷ Word64 → ([ChainEvent C] → NewEpochState C → Property) → Property Source #
Given a NewEpochState and [ChainEvent], test a Property at every Epoch Boundary
data RewardUpdateOld Source #
Instances
Show RewardUpdateOld Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rewards | |
Eq RewardUpdateOld Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rewards |
createRUpdOld ∷ ∀ era. EraGov era ⇒ EpochSize → BlocksMade → EpochState era → Coin → ShelleyBase RewardUpdateOld Source #
createRUpdOld_ ∷ ∀ era. EraPParams era ⇒ EpochSize → BlocksMade → SnapShots → Coin → PParams era → Coin → Set (Credential 'Staking) → NonMyopic → ShelleyBase RewardUpdateOld Source #