cardano-ledger-shelley-test-1.4.0.3: Test helpers from cardano-ledger-shelley exposed to other packages
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Shelley.Utils

Synopsis

Documentation

mkSeedFromWordsRawSeedSeed Source #

Construct a seed from a bunch of Word64s

We multiply these words by some extra stuff to make sure they contain enough bits for our seed.

mkCertifiedVRF ∷ (Signable v a, VRFAlgorithm v, ContextVRF v ~ (), Coercible b (CertifiedVRF v a)) ⇒ a → SignKeyVRF v → b Source #

For testing purposes, create a VRF value

evolveKESUntil Source #

Arguments

∷ (KESAlgorithm v, ContextKES v ~ ()) 
SignKeyKES v 
KESPeriod

Current KES period

KESPeriod

Target KES period

Maybe (SignKeyKES v) 

Try to evolve KES key until specific KES period is reached, given the current KES period.

mkHash ∷ ∀ a h. HashAlgorithm h ⇒ IntHash h a Source #

mkKeyPair ∷ ∀ c kd. DSIGNAlgorithm (DSIGN c) ⇒ RawSeed → (SignKeyDSIGN (DSIGN c), VKey kd c) Source #

For testing purposes, generate a deterministic key pair given a seed.

mkKeyPair'DSIGNAlgorithm (DSIGN c) ⇒ RawSeedKeyPair kd c Source #

For testing purposes, generate a deterministic key pair given a seed.

mkGenKeyDSIGNAlgorithm (DSIGN c) ⇒ RawSeed → (SignKeyDSIGN (DSIGN c), VKey kd c) Source #

For testing purposes, generate a deterministic genesis key pair given a seed.

mkKESKeyPairCrypto c ⇒ RawSeedKESKeyPair c Source #

For testing purposes, generate a deterministic KES key pair given a seed.

mkVRFKeyPairCrypto c ⇒ RawSeedVRFKeyPair c Source #

For testing purposes, generate a deterministic VRF key pair given a seed.

testSTS ∷ ∀ s. (BaseM s ~ ShelleyBase, STS s, Eq (State s), Show (State s), ToExpr (State s)) ⇒ Environment s → State s → Signal s → Either (NonEmpty (PredicateFailure s)) (State s) → Assertion Source #

applySTSTest ∷ ∀ s m (rtype ∷ RuleType). (STS s, RuleTypeRep rtype, m ~ BaseM s) ⇒ RuleContext rtype s → m (Either (NonEmpty (PredicateFailure s)) (State s)) Source #

Apply STS checking assertions.

getBlockNonce ∷ ∀ era. Era era ⇒ Block (BHeader (EraCrypto era)) era → Nonce Source #

type ChainProperty era = (Mock (EraCrypto era), ApplyBlock era, GetLedgerView era, EraTx era) Source #

data RawSeed Source #

Instances

Instances details
Arbitrary RawSeed 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Arbitrary

Show RawSeed 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Arbitrary

EncCBOR RawSeed Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Utils

Methods

encCBORRawSeedEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy RawSeedSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [RawSeed] → Size Source #

Eq RawSeed 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Arbitrary

Methods

(==)RawSeedRawSeedBool Source #

(/=)RawSeedRawSeedBool Source #

class Split v where Source #

Methods

vsplit ∷ v → Integer → ([v], Coin) Source #

Instances

Instances details
Split Coin Source # 
Instance details

Defined in Test.Cardano.Ledger.Shelley.Utils

Methods

vsplitCoinInteger → ([Coin], Coin) Source #

Orphan instances

EncCBOR RawSeed Source # 
Instance details

Methods

encCBORRawSeedEncoding Source #

encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy RawSeedSize Source #

encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [RawSeed] → Size Source #