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 C_Crypto
- defaultMain ∷ TestTree → IO ()
- newEpochProp ∷ Word64 → (NewEpochState C → Property) → Property
- newEpochEventsProp ∷ Word64 → ([ChainEvent C] → NewEpochState C → Property) → Property
- data RewardUpdateOld c = RewardUpdateOld {}
- createRUpdOld ∷ ∀ era. EraGov era ⇒ EpochSize → BlocksMade (EraCrypto era) → EpochState era → Coin → ShelleyBase (RewardUpdateOld (EraCrypto era))
- createRUpdOld_ ∷ ∀ era. EraPParams era ⇒ EpochSize → BlocksMade (EraCrypto era) → SnapShots (EraCrypto era) → Coin → PParams era → Coin → Set (Credential 'Staking (EraCrypto era)) → NonMyopic (EraCrypto era) → ShelleyBase (RewardUpdateOld (EraCrypto era))
Documentation
type C = ShelleyEra C_Crypto 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 c Source #
Instances
Show (RewardUpdateOld c) Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rewards | |
Eq (RewardUpdateOld c) Source # | |
Defined in Test.Cardano.Ledger.Shelley.Rewards (==) ∷ RewardUpdateOld c → RewardUpdateOld c → Bool Source # (/=) ∷ RewardUpdateOld c → RewardUpdateOld c → Bool Source # |
createRUpdOld ∷ ∀ era. EraGov era ⇒ EpochSize → BlocksMade (EraCrypto era) → EpochState era → Coin → ShelleyBase (RewardUpdateOld (EraCrypto era)) Source #
createRUpdOld_ ∷ ∀ era. EraPParams era ⇒ EpochSize → BlocksMade (EraCrypto era) → SnapShots (EraCrypto era) → Coin → PParams era → Coin → Set (Credential 'Staking (EraCrypto era)) → NonMyopic (EraCrypto era) → ShelleyBase (RewardUpdateOld (EraCrypto era)) Source #