Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class EraScript era ⇒ ScriptClass era where
- basescript ∷ Proxy era → KeyHash 'Witness → Script era
- isKey ∷ Proxy era → Script era → Maybe (KeyHash 'Witness)
- isOnePhase ∷ Proxy era → Script era → Bool
- quantify ∷ Proxy era → Script era → Quantifier (Script era)
- unQuantify ∷ Proxy era → Quantifier (Script era) → Script era
- data Quantifier t
- exponential ∷ Integer → Integer → Gen Integer
- anyOf ∷ ∀ era. ScriptClass era ⇒ Proxy era → [Script era] → Script era
- allOf ∷ ∀ era. ScriptClass era ⇒ Proxy era → [Script era] → Script era
- mOf ∷ ∀ era. ScriptClass era ⇒ Proxy era → Int → [Script era] → Script era
- keyPairs ∷ Constants → KeyPairs
- mkPayScriptHashMap ∷ ∀ era. ScriptClass era ⇒ [(Script era, Script era)] → Map ScriptHash (Script era, Script era)
- mkStakeScriptHashMap ∷ ∀ era. ScriptClass era ⇒ [(Script era, Script era)] → Map ScriptHash (Script era, Script era)
- mkScriptsFromKeyPair ∷ ∀ era. ScriptClass era ⇒ (KeyPair 'Payment, KeyPair 'Staking) → (Script era, Script era)
- mkKeyPairs ∷ Word64 → (KeyPair kr, KeyPair kr')
- mkScripts ∷ ∀ era. ScriptClass era ⇒ KeyPairs → [(Script era, Script era)]
- mkScriptCombinations ∷ ∀ era. ScriptClass era ⇒ [(Script era, Script era)] → [(Script era, Script era)]
- combinedScripts ∷ ∀ era. ScriptClass era ⇒ Constants → [(Script era, Script era)]
- baseScripts ∷ ∀ era. ScriptClass era ⇒ Constants → [(Script era, Script era)]
- scriptKeyCombinations ∷ ∀ era. ScriptClass era ⇒ Proxy era → Script era → [[KeyHash 'Witness]]
- scriptKeyCombination ∷ ∀ era. ScriptClass era ⇒ Proxy era → Script era → [KeyHash 'Witness]
Documentation
class EraScript era ⇒ ScriptClass era where Source #
basescript ∷ Proxy era → KeyHash 'Witness → Script era Source #
isKey ∷ Proxy era → Script era → Maybe (KeyHash 'Witness) Source #
isOnePhase ∷ Proxy era → Script era → Bool Source #
quantify ∷ Proxy era → Script era → Quantifier (Script era) Source #
unQuantify ∷ Proxy era → Quantifier (Script era) → Script era Source #
Instances
data Quantifier t Source #
Instances
Functor Quantifier Source # | |
Defined in Test.Cardano.Ledger.Shelley.Generator.ScriptClass fmap ∷ (a → b) → Quantifier a → Quantifier b Source # (<$) ∷ a → Quantifier b → Quantifier a Source # |
keyPairs ∷ Constants → KeyPairs Source #
Constant list of KeyPairs intended to be used in the generators.
mkPayScriptHashMap ∷ ∀ era. ScriptClass era ⇒ [(Script era, Script era)] → Map ScriptHash (Script era, Script era) Source #
mkStakeScriptHashMap ∷ ∀ era. ScriptClass era ⇒ [(Script era, Script era)] → Map ScriptHash (Script era, Script era) Source #
Generate a mapping from stake script hash to script pair.
mkScriptsFromKeyPair ∷ ∀ era. ScriptClass era ⇒ (KeyPair 'Payment, KeyPair 'Staking) → (Script era, Script era) Source #
mkScripts ∷ ∀ era. ScriptClass era ⇒ KeyPairs → [(Script era, Script era)] Source #
make Scripts based on the given key pairs
mkScriptCombinations ∷ ∀ era. ScriptClass era ⇒ [(Script era, Script era)] → [(Script era, Script era)] Source #
Combine a list of script pairs into hierarchically structured multi-sig scripts, list must have at least length 3. Be careful not to call with too many pairs in order not to create too many of the possible combinations.
combinedScripts ∷ ∀ era. ScriptClass era ⇒ Constants → [(Script era, Script era)] Source #
Make a list of script pairs (payment,staking). Each of these are combined scripts. I.e. All, Any, MofN, etc. These come from combining the the first N (numBaseScripts) baseScripts When N==3, we get about 150 combined scripts.
baseScripts ∷ ∀ era. ScriptClass era ⇒ Constants → [(Script era, Script era)] Source #
Make list of script pairs (payment,staking). These are non-combined scripts Ie NO quantifer like All, Any, MofN, etc.) scripts. In post Shelley Eras, either Keylock or Require Start-Finish scripts.
scriptKeyCombinations ∷ ∀ era. ScriptClass era ⇒ Proxy era → Script era → [[KeyHash 'Witness]] Source #
Return all valid lists of KeyHashes that appear in a Script used in testing.
scriptKeyCombination ∷ ∀ era. ScriptClass era ⇒ Proxy era → Script era → [KeyHash 'Witness] Source #
Produce a valid list of key hashes that appear in a Script. Note: in the case of AnyOf, we just take the first script in the expression. This only works if we generate AnyOf scripts such that all script options are valid scripts (that is, valid in the context of a transaction, at generation time and execution/spend time).