Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
AlonzoEra instances for EraGen and ScriptClass
Synopsis
- vKeyLockedAdaOnly ∷ Crypto c ⇒ TxOut (AlonzoEra c) → Bool
- phase2scripts3Arg ∷ ∀ era. AlonzoEraScript era ⇒ [TwoPhase3ArgInfo era]
- phase2scripts2Arg ∷ ∀ era. AlonzoEraScript era ⇒ [TwoPhase2ArgInfo era]
- phase2scripts3ArgSucceeds ∷ ∀ era. AlonzoEraScript era ⇒ Script era → Bool
- phase2scripts2ArgSucceeds ∷ ∀ era. AlonzoEraScript era ⇒ Script era → Bool
- genPlutus2Arg ∷ AlonzoEraScript era ⇒ Gen (Maybe (TwoPhase2ArgInfo era))
- genAlonzoMint ∷ Crypto c ⇒ MultiAsset c → Gen (MultiAsset c, [AlonzoScript (AlonzoEra c)])
- genPair ∷ Gen a → Gen b → Gen (a, b)
- genPlutusData ∷ Gen Data
- genSet ∷ Ord a ⇒ Gen a → Gen (Set a)
- genAux ∷ ∀ c. Mock c ⇒ Constants → Gen (StrictMaybe (AlonzoTxAuxData (AlonzoEra c)))
- unTime ∷ AlonzoScript era → Timelock era
- okAsCollateral ∷ ∀ c. Mock c ⇒ UTxO (AlonzoEra c) → TxIn c → Bool
- genAlonzoTxBody ∷ ∀ c. Mock c ⇒ GenEnv (AlonzoEra c) → UTxO (AlonzoEra c) → PParams (AlonzoEra c) → SlotNo → Set (TxIn c) → StrictSeq (TxOut (AlonzoEra c)) → StrictSeq (TxCert (AlonzoEra c)) → Withdrawals c → Coin → StrictMaybe (Update (AlonzoEra c)) → StrictMaybe (AuxiliaryDataHash c) → Gen (TxBody (AlonzoEra c), [Script (AlonzoEra c)])
- genSlotAfter ∷ SlotNo → Gen SlotNo
- genAlonzoPParamsUpdate ∷ ∀ c. Crypto c ⇒ Constants → PParams (AlonzoEra c) → Gen (PParamsUpdate (AlonzoEra c))
- genAlonzoPParams ∷ ∀ c. Crypto c ⇒ Constants → Gen (PParams (AlonzoEra c))
- bigMem ∷ Natural
- bigStep ∷ Natural
- genMaxTxExUnits ∷ Gen ExUnits
- genMaxBlockExUnits ∷ Gen ExUnits
- sumCollateral ∷ (EraTx era, AlonzoEraTxBody era) ⇒ Tx era → UTxO era → Coin
- storageCost ∷ ∀ era t. (EraPParams era, EncCBOR t) ⇒ Integer → PParams era → t → Coin
- addRedeemMap ∷ ∀ c. Crypto c ⇒ (Data, Natural, Natural) → AlonzoPlutusPurpose AsIxItem (AlonzoEra c) → Map (AlonzoPlutusPurpose AsIx (AlonzoEra c)) (Data (AlonzoEra c), ExUnits) → Map (AlonzoPlutusPurpose AsIx (AlonzoEra c)) (Data (AlonzoEra c), ExUnits)
- getDataMap ∷ ∀ era. Era era ⇒ ScriptInfo era → Map (ScriptHash (EraCrypto era)) (Script era) → Map (DataHash (EraCrypto era)) (Data era)
- dataFromAddr ∷ ∀ c. Mock c ⇒ Addr c → StrictMaybe (DataHash c)
- dataMapFromTxOut ∷ ∀ c. Mock c ⇒ [TxOut (AlonzoEra c)] → TxDats (AlonzoEra c) → TxDats (AlonzoEra c)
- addMaybeDataHashToTxOut ∷ Mock c ⇒ TxOut (AlonzoEra c) → TxOut (AlonzoEra c)
- someLeaf ∷ ∀ era. (AllegraEraScript era, NativeScript era ~ Timelock era) ⇒ Proxy era → KeyHash 'Witness (EraCrypto era) → AlonzoScript era
- langsUsed ∷ AlonzoEraScript era ⇒ Map (ScriptHash (EraCrypto era)) (Script era) → Set Language
Documentation
vKeyLockedAdaOnly ∷ Crypto c ⇒ TxOut (AlonzoEra c) → Bool Source #
We are choosing new TxOut to pay fees, We want only Key locked addresss with Ada only values.
phase2scripts3Arg ∷ ∀ era. AlonzoEraScript era ⇒ [TwoPhase3ArgInfo era] Source #
phase2scripts2Arg ∷ ∀ era. AlonzoEraScript era ⇒ [TwoPhase2ArgInfo era] Source #
phase2scripts3ArgSucceeds ∷ ∀ era. AlonzoEraScript era ⇒ Script era → Bool Source #
phase2scripts2ArgSucceeds ∷ ∀ era. AlonzoEraScript era ⇒ Script era → Bool Source #
genPlutus2Arg ∷ AlonzoEraScript era ⇒ Gen (Maybe (TwoPhase2ArgInfo era)) Source #
genAlonzoMint ∷ Crypto c ⇒ MultiAsset c → Gen (MultiAsset c, [AlonzoScript (AlonzoEra c)]) Source #
Gen a Mint value in the Alonzo Era, with a 10% chance that it includes an AlonzoScript
genAux ∷ ∀ c. Mock c ⇒ Constants → Gen (StrictMaybe (AlonzoTxAuxData (AlonzoEra c))) Source #
unTime ∷ AlonzoScript era → Timelock era Source #
genAlonzoTxBody ∷ ∀ c. Mock c ⇒ GenEnv (AlonzoEra c) → UTxO (AlonzoEra c) → PParams (AlonzoEra c) → SlotNo → Set (TxIn c) → StrictSeq (TxOut (AlonzoEra c)) → StrictSeq (TxCert (AlonzoEra c)) → Withdrawals c → Coin → StrictMaybe (Update (AlonzoEra c)) → StrictMaybe (AuxiliaryDataHash c) → Gen (TxBody (AlonzoEra c), [Script (AlonzoEra c)]) Source #
genAlonzoPParamsUpdate ∷ ∀ c. Crypto c ⇒ Constants → PParams (AlonzoEra c) → Gen (PParamsUpdate (AlonzoEra c)) Source #
Gen an Alonzo PParamsUpdate, by adding to a Shelley PParamsData
sumCollateral ∷ (EraTx era, AlonzoEraTxBody era) ⇒ Tx era → UTxO era → Coin Source #
storageCost ∷ ∀ era t. (EraPParams era, EncCBOR t) ⇒ Integer → PParams era → t → Coin Source #
addRedeemMap ∷ ∀ c. Crypto c ⇒ (Data, Natural, Natural) → AlonzoPlutusPurpose AsIxItem (AlonzoEra c) → Map (AlonzoPlutusPurpose AsIx (AlonzoEra c)) (Data (AlonzoEra c), ExUnits) → Map (AlonzoPlutusPurpose AsIx (AlonzoEra c)) (Data (AlonzoEra c), ExUnits) Source #
getDataMap ∷ ∀ era. Era era ⇒ ScriptInfo era → Map (ScriptHash (EraCrypto era)) (Script era) → Map (DataHash (EraCrypto era)) (Data era) Source #
dataFromAddr ∷ ∀ c. Mock c ⇒ Addr c → StrictMaybe (DataHash c) Source #
If an Address is script address, we can find a potential data hash for it from genEraTwoPhase3Arg, which contains all known 3 arg plutus scripts in the tests set. If the script has is not in that map, then its data hash is SNothing.
dataMapFromTxOut ∷ ∀ c. Mock c ⇒ [TxOut (AlonzoEra c)] → TxDats (AlonzoEra c) → TxDats (AlonzoEra c) Source #
We can find the data associated with the data hashes in the TxOuts, since genEraTwoPhase3Arg, which contains all known 3 arg plutus scripts stores the data.
someLeaf ∷ ∀ era. (AllegraEraScript era, NativeScript era ~ Timelock era) ⇒ Proxy era → KeyHash 'Witness (EraCrypto era) → AlonzoScript era Source #
langsUsed ∷ AlonzoEraScript era ⇒ Map (ScriptHash (EraCrypto era)) (Script era) → Set Language Source #
given the "txscripts" field of the TxWits, compute the set of languages used in a transaction