Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class (EraScript era, Eq (TxWits era), EqRaw (TxWits era), Show (TxWits era), Monoid (TxWits era), NoThunks (TxWits era), ToCBOR (TxWits era), EncCBOR (TxWits era), DecCBOR (Annotator (TxWits era))) ⇒ EraTxWits era where
- mkBasicTxWits ∷ EraTxWits era ⇒ TxWits era
- addrTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Set (WitVKey 'Witness))
- data KeyRole = Witness
- data WitVKey (kr ∷ KeyRole) where
- pattern WitVKey ∷ Typeable kr ⇒ VKey kr → SignedDSIGN DSIGN (Hash HASH EraIndependentTxBody) → WitVKey kr
- witVKeyBytes ∷ ∀ (kr ∷ KeyRole). WitVKey kr → ByteString
- witVKeyHash ∷ ∀ (kr ∷ KeyRole). WitVKey kr → KeyHash 'Witness
- bootAddrTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Set BootstrapWitness)
- data BootstrapWitness
- scriptTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Map ScriptHash (Script era))
- hashScriptTxWitsL ∷ EraTxWits era ⇒ Lens (TxWits era) (TxWits era) (Map ScriptHash (Script era)) [Script era]
- class (EraTxWits era, AlonzoEraScript era) ⇒ AlonzoEraTxWits era
- datsTxWitsL ∷ AlonzoEraTxWits era ⇒ Lens' (TxWits era) (TxDats era)
- hashDataTxWitsL ∷ AlonzoEraTxWits era ⇒ Lens (TxWits era) (TxWits era) (TxDats era) [Data era]
- data TxDats era where
- unTxDats ∷ TxDats era → Map DataHash (Data era)
- rdmrsTxWitsL ∷ AlonzoEraTxWits era ⇒ Lens' (TxWits era) (Redeemers era)
- data Redeemers era where
- pattern Redeemers ∷ AlonzoEraScript era ⇒ Map (PlutusPurpose AsIx era) (Data era, ExUnits) → Redeemers era
- unRedeemers ∷ Redeemers era → Map (PlutusPurpose AsIx era) (Data era, ExUnits)
- type family PlutusPurpose (f ∷ Type → Type → Type) era = (r ∷ Type) | r → era
- data AlonzoPlutusPurpose (f ∷ Type → Type → Type) era
- = AlonzoSpending !(f Word32 TxIn)
- | AlonzoMinting !(f Word32 PolicyID)
- | AlonzoCertifying !(f Word32 (TxCert era))
- | AlonzoRewarding !(f Word32 RewardAccount)
- newtype AsIx ix it = AsIx {
- unAsIx ∷ ix
- newtype AsItem ix it = AsItem {
- unAsItem ∷ it
- data ConwayPlutusPurpose (f ∷ Type → Type → Type) era
- = ConwaySpending !(f Word32 TxIn)
- | ConwayMinting !(f Word32 PolicyID)
- | ConwayCertifying !(f Word32 (TxCert era))
- | ConwayRewarding !(f Word32 RewardAccount)
- | ConwayVoting !(f Word32 Voter)
- | ConwayProposing !(f Word32 (ProposalProcedure era))
Shelley onwards
class (EraScript era, Eq (TxWits era), EqRaw (TxWits era), Show (TxWits era), Monoid (TxWits era), NoThunks (TxWits era), ToCBOR (TxWits era), EncCBOR (TxWits era), DecCBOR (Annotator (TxWits era))) ⇒ EraTxWits era Source #
A collection of witnesses in a Tx
mkBasicTxWits ∷ EraTxWits era ⇒ TxWits era Source #
Address witness
The role of a key.
All key roles are fixed and unique, except for the Witness
role. In particular,
keys can be cast to a Witness
role with the help of asWitness
, because same witness
can be valid for many roles.
In fact, it is perfectly allowable for a key to be used in many roles by the end user; there is nothing prohibiting somebody using the same underlying key or a script as their payment and staking credential, as well as the key for their stake pool. However, in the ledger code mixing up keys with different roles could be catastrophic, that is why we have this separation.
WitVKey
data WitVKey (kr ∷ KeyRole) where Source #
Proof/Witness that a transaction is authorized by the given key holder.
pattern WitVKey ∷ Typeable kr ⇒ VKey kr → SignedDSIGN DSIGN (Hash HASH EraIndependentTxBody) → WitVKey kr |
Instances
witVKeyBytes ∷ ∀ (kr ∷ KeyRole). WitVKey kr → ByteString Source #
Access CBOR encoded representation of the witness. Evaluated lazily
witVKeyHash ∷ ∀ (kr ∷ KeyRole). WitVKey kr → KeyHash 'Witness Source #
Access computed hash. Evaluated lazily
Byron address witness
bootAddrTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Set BootstrapWitness) Source #
data BootstrapWitness Source #
Instances
Script witness
scriptTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Map ScriptHash (Script era)) Source #
hashScriptTxWitsL ∷ EraTxWits era ⇒ Lens (TxWits era) (TxWits era) (Map ScriptHash (Script era)) [Script era] Source #
This is a helper lens that will hash the scripts when adding as witnesses.
Alonzo onwards
class (EraTxWits era, AlonzoEraScript era) ⇒ AlonzoEraTxWits era Source #
datsTxWitsL ∷ AlonzoEraTxWits era ⇒ Lens' (TxWits era) (TxDats era) Source #
hashDataTxWitsL ∷ AlonzoEraTxWits era ⇒ Lens (TxWits era) (TxWits era) (TxDats era) [Data era] Source #
This is a convenience Lens that will hash the Data
when it is being added to the
TxWits
. See datsTxWitsL
for a version that aloows setting TxDats
instead.
data TxDats era where Source #
Note that TxDats
are based on MemoBytes
since we must preserve
the original bytes for the ScriptIntegrity
.
Since the TxDats
exist outside of the transaction body,
this is how we ensure that they are not manipulated.
pattern TxDats ∷ Era era ⇒ Map DataHash (Data era) → TxDats era | |
pattern TxDats' ∷ Map DataHash (Data era) → TxDats era |
Instances
rdmrsTxWitsL ∷ AlonzoEraTxWits era ⇒ Lens' (TxWits era) (Redeemers era) Source #
data Redeemers era where Source #
Note that Redeemers
are based on MemoBytes
since we must preserve
the original bytes for the ScriptIntegrity
.
Since the Redeemers
exist outside of the transaction body,
this is how we ensure that they are not manipulated.
pattern Redeemers ∷ AlonzoEraScript era ⇒ Map (PlutusPurpose AsIx era) (Data era, ExUnits) → Redeemers era |
Instances
Memoized Redeemers | |
AlonzoEraScript era ⇒ Monoid (Redeemers era) | |
AlonzoEraScript era ⇒ Semigroup (Redeemers era) | |
Generic (Redeemers era) | |
AlonzoEraScript era ⇒ Show (Redeemers era) | |
Typeable era ⇒ ToCBOR (Redeemers era) | |
AlonzoEraScript era ⇒ DecCBOR (Annotator (Redeemers era)) | |
AlonzoEraScript era ⇒ EncCBOR (Redeemers era) | Encodes memoized bytes created upon construction. |
SafeToHash (Redeemers era) | |
Defined in Cardano.Ledger.Alonzo.TxWits originalBytes ∷ Redeemers era → ByteString Source # originalBytesSize ∷ Redeemers era → Int Source # makeHashWithExplicitProxys ∷ Proxy i → Redeemers era → SafeHash i Source # | |
AlonzoEraScript era ⇒ NFData (Redeemers era) | |
Defined in Cardano.Ledger.Alonzo.TxWits | |
AlonzoEraScript era ⇒ Eq (Redeemers era) | |
AlonzoEraScript era ⇒ NoThunks (Redeemers era) | |
type RawType Redeemers | |
Defined in Cardano.Ledger.Alonzo.TxWits | |
type Rep (Redeemers era) | |
Defined in Cardano.Ledger.Alonzo.TxWits |
unRedeemers ∷ Redeemers era → Map (PlutusPurpose AsIx era) (Data era, ExUnits) Source #
type family PlutusPurpose (f ∷ Type → Type → Type) era = (r ∷ Type) | r → era Source #
Instances
type PlutusPurpose f AlonzoEra | |
Defined in Cardano.Ledger.Alonzo.Scripts | |
type PlutusPurpose f BabbageEra | |
Defined in Cardano.Ledger.Babbage.Scripts | |
type PlutusPurpose f ConwayEra | |
Defined in Cardano.Ledger.Conway.Scripts |
data AlonzoPlutusPurpose (f ∷ Type → Type → Type) era Source #
AlonzoSpending !(f Word32 TxIn) | |
AlonzoMinting !(f Word32 PolicyID) | |
AlonzoCertifying !(f Word32 (TxCert era)) | |
AlonzoRewarding !(f Word32 RewardAccount) |
Instances
Instances
Instances
Conway
data ConwayPlutusPurpose (f ∷ Type → Type → Type) era Source #
ConwaySpending !(f Word32 TxIn) | |
ConwayMinting !(f Word32 PolicyID) | |
ConwayCertifying !(f Word32 (TxCert era)) | |
ConwayRewarding !(f Word32 RewardAccount) | |
ConwayVoting !(f Word32 Voter) | |
ConwayProposing !(f Word32 (ProposalProcedure era)) |