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 (EraCrypto era)))
- data KeyRole = Witness
- data WitVKey (kr ∷ KeyRole) c where
- pattern WitVKey ∷ (Typeable kr, Crypto c) ⇒ VKey kr c → SignedDSIGN c (Hash c EraIndependentTxBody) → WitVKey kr c
- witVKeyBytes ∷ ∀ (kr ∷ KeyRole) c. WitVKey kr c → ByteString
- witVKeyHash ∷ ∀ (kr ∷ KeyRole) c. WitVKey kr c → KeyHash 'Witness c
- bootAddrTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Set (BootstrapWitness (EraCrypto era)))
- data BootstrapWitness c
- scriptTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Map (ScriptHash (EraCrypto era)) (Script era))
- hashScriptTxWitsL ∷ EraTxWits era ⇒ Lens (TxWits era) (TxWits era) (Map (ScriptHash (EraCrypto era)) (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 (EraCrypto era)) (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 (EraCrypto era)))
- | AlonzoMinting !(f Word32 (PolicyID (EraCrypto era)))
- | AlonzoCertifying !(f Word32 (TxCert era))
- | AlonzoRewarding !(f Word32 (RewardAccount (EraCrypto era)))
- 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 (EraCrypto era)))
- | ConwayMinting !(f Word32 (PolicyID (EraCrypto era)))
- | ConwayCertifying !(f Word32 (TxCert era))
- | ConwayRewarding !(f Word32 (RewardAccount (EraCrypto era)))
- | ConwayVoting !(f Word32 (Voter (EraCrypto era)))
- | 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.
Note that a role is not _fixed_, nor is it unique. In particular, keys may
variously be used as witnesses, and so in many case we will change the role
of a key to the Witness
role.
It is also perfectly allowable for a key to be used in many roles; there is nothing prohibiting somebody using the same underlying key as their payment and staking key, as well as the key for their stake pool. So these roles are more intended for two purposes:
- To make explicit how we are using a key in the specifications
- To provide a guide to downstream implementors, for whom the profusion of keys may be confusing.
WitVKey
data WitVKey (kr ∷ KeyRole) c where Source #
Proof/Witness that a transaction is authorized by the given key holder.
pattern WitVKey ∷ (Typeable kr, Crypto c) ⇒ VKey kr c → SignedDSIGN c (Hash c EraIndependentTxBody) → WitVKey kr c |
Instances
witVKeyBytes ∷ ∀ (kr ∷ KeyRole) c. WitVKey kr c → ByteString Source #
Access CBOR encoded representation of the witness. Evaluated lazily
witVKeyHash ∷ ∀ (kr ∷ KeyRole) c. WitVKey kr c → KeyHash 'Witness c Source #
Access computed hash. Evaluated lazily
Byron address witness
bootAddrTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Set (BootstrapWitness (EraCrypto era))) Source #
data BootstrapWitness c Source #
Instances
Script witness
scriptTxWitsL ∷ EraTxWits era ⇒ Lens' (TxWits era) (Map (ScriptHash (EraCrypto era)) (Script era)) Source #
hashScriptTxWitsL ∷ EraTxWits era ⇒ Lens (TxWits era) (TxWits era) (Map (ScriptHash (EraCrypto era)) (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 (EraCrypto era)) (Data era) → TxDats era | |
pattern TxDats' ∷ Map (DataHash (EraCrypto era)) (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 ∷ HashAlgorithm (HASH c) ⇒ Proxy c → Proxy index → Redeemers era → SafeHash c index 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 c) | |
Defined in Cardano.Ledger.Alonzo.Scripts | |
type PlutusPurpose f (BabbageEra c) | |
Defined in Cardano.Ledger.Babbage.Scripts | |
type PlutusPurpose f (ConwayEra c) | |
Defined in Cardano.Ledger.Conway.Scripts |
data AlonzoPlutusPurpose (f ∷ Type → Type → Type) era Source #
AlonzoSpending !(f Word32 (TxIn (EraCrypto era))) | |
AlonzoMinting !(f Word32 (PolicyID (EraCrypto era))) | |
AlonzoCertifying !(f Word32 (TxCert era)) | |
AlonzoRewarding !(f Word32 (RewardAccount (EraCrypto era))) |
Instances
Instances
Instances
Conway
data ConwayPlutusPurpose (f ∷ Type → Type → Type) era Source #
ConwaySpending !(f Word32 (TxIn (EraCrypto era))) | |
ConwayMinting !(f Word32 (PolicyID (EraCrypto era))) | |
ConwayCertifying !(f Word32 (TxCert era)) | |
ConwayRewarding !(f Word32 (RewardAccount (EraCrypto era))) | |
ConwayVoting !(f Word32 (Voter (EraCrypto era))) | |
ConwayProposing !(f Word32 (ProposalProcedure era)) |