Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cardano.Ledger.Conway.TxInfo
Contents
Synopsis
- data ConwayContextError era
- = BabbageContextError !(BabbageContextError era)
- | CertificateNotSupported !(TxCert era)
- | PlutusPurposeNotSupported !(PlutusPurpose AsItem era)
- | CurrentTreasuryFieldNotSupported !Coin
- | VotingProceduresFieldNotSupported !(VotingProcedures era)
- | ProposalProceduresFieldNotSupported !(OSet (ProposalProcedure era))
- | TreasuryDonationFieldNotSupported !Coin
- | ReferenceInputsNotDisjointFromInputs !(NonEmpty TxIn)
- class EraPlutusTxInfo l era ⇒ ConwayEraPlutusTxInfo (l ∷ Language) era where
- toPlutusChangedParameters ∷ proxy l → PParamsUpdate era → ChangedParameters
- transTxBodyWithdrawals ∷ EraTxBody era ⇒ TxBody era → Map Credential Lovelace
- transTxCert ∷ (ConwayEraTxCert era, TxCert era ~ ConwayTxCert era) ⇒ ProtVer → TxCert era → TxCert
- transDRepCred ∷ Credential 'DRepRole → DRepCredential
- transColdCommitteeCred ∷ Credential 'ColdCommitteeRole → ColdCommitteeCredential
- transHotCommitteeCred ∷ Credential 'HotCommitteeRole → HotCommitteeCredential
- transDelegatee ∷ Delegatee → Delegatee
- transDRep ∷ DRep → DRep
- transScriptPurpose ∷ (ConwayEraPlutusTxInfo l era, PlutusTxCert l ~ TxCert) ⇒ proxy l → ProtVer → ConwayPlutusPurpose AsIxItem era → Either (ContextError era) ScriptPurpose
- transMap ∷ (t1 → k) → (t2 → v) → Map t1 t2 → Map k v
- transTxInInfoV1 ∷ ∀ era. (Inject (BabbageContextError era) (ContextError era), Value era ~ MaryValue, BabbageEraTxOut era) ⇒ UTxO era → TxIn → Either (ContextError era) TxInInfo
- transTxOutV1 ∷ ∀ era. (Inject (BabbageContextError era) (ContextError era), Value era ~ MaryValue, BabbageEraTxOut era) ⇒ TxOutSource → TxOut era → Either (ContextError era) TxOut
- transMintValue ∷ MultiAsset → MintValue
- transTxBodyId ∷ EraTxBody era ⇒ TxBody era → TxId
- transVotingProcedures ∷ VotingProcedures era → Map Voter (Map GovernanceActionId Vote)
- transProposal ∷ ConwayEraPlutusTxInfo l era ⇒ proxy l → ProposalProcedure era → ProposalProcedure
- toPlutusV3Args ∷ EraPlutusTxInfo 'PlutusV3 era ⇒ proxy 'PlutusV3 → ProtVer → TxInfo → PlutusPurpose AsIxItem era → Maybe (Data era) → Data era → Either (ContextError era) (PlutusArgs 'PlutusV3)
- transTxCertV1V2 ∷ (ConwayEraTxCert era, Inject (ConwayContextError era) (ContextError era)) ⇒ TxCert era → Either (ContextError era) DCert
- transPlutusPurposeV1V2 ∷ (PlutusTxCert l ~ DCert, PlutusPurpose AsItem era ~ ConwayPlutusPurpose AsItem era, EraPlutusTxInfo l era, Inject (ConwayContextError era) (ContextError era)) ⇒ proxy l → ProtVer → ConwayPlutusPurpose AsItem era → Either (ContextError era) ScriptPurpose
- guardConwayFeaturesForPlutusV1V2 ∷ ∀ era. (EraTx era, ConwayEraTxBody era, Inject (ConwayContextError era) (ContextError era)) ⇒ Tx era → Either (ContextError era) ()
- transTxInInfoV3 ∷ ∀ era. (Inject (BabbageContextError era) (ContextError era), Value era ~ MaryValue, BabbageEraTxOut era) ⇒ UTxO era → TxIn → Either (ContextError era) TxInInfo
Documentation
data ConwayContextError era Source #
Constructors
Instances
class EraPlutusTxInfo l era ⇒ ConwayEraPlutusTxInfo (l ∷ Language) era where Source #
A class to compute the changed parameters in the TxInfo given a ToPlutusData instance for PParamsUpdate
Methods
toPlutusChangedParameters ∷ proxy l → PParamsUpdate era → ChangedParameters Source #
Instances
ConwayEraPlutusTxInfo 'PlutusV3 ConwayEra Source # | |
Defined in Cardano.Ledger.Conway.TxInfo Methods toPlutusChangedParameters ∷ proxy 'PlutusV3 → PParamsUpdate ConwayEra → ChangedParameters Source # |
transTxBodyWithdrawals ∷ EraTxBody era ⇒ TxBody era → Map Credential Lovelace Source #
Translate all Withdrawal
s from within a TxBody
transTxCert ∷ (ConwayEraTxCert era, TxCert era ~ ConwayTxCert era) ⇒ ProtVer → TxCert era → TxCert Source #
In protocol version 9, a bug in RegTxCert
and UnRegTxCert
pattern definitions was causing
the deposit in RegDepositTxCert
and UnRegDepositTxCert
to be omitted. We need to keep this
behavior for version 9, so, now that the bug in the patterns has been fixed, we are explicitly
omitting the deposit in these cases. It has been confirmed that this buggy behavior for protocol
version 9 has been exercised on Mainnet, therefore this conditional translation can never be
removed for Conway era (#4863)
transScriptPurpose ∷ (ConwayEraPlutusTxInfo l era, PlutusTxCert l ~ TxCert) ⇒ proxy l → ProtVer → ConwayPlutusPurpose AsIxItem era → Either (ContextError era) ScriptPurpose Source #
In Conway we have Anchor
s in some certificates and all proposals. However, because
we do not translate anchors to plutus context, it is not always possible to deduce
which item the script purpose is responsible for, without also including the index for
that item. For this reason starting with PlutusV3, besides the item, Certifying
and Proposing
also have an index. Moreover, other script purposes rely on Ledger
Ord
instances for types that dictate the order, so it might not be a good idea to pass
that information to Plutus for those purposes.
transTxInInfoV1 ∷ ∀ era. (Inject (BabbageContextError era) (ContextError era), Value era ~ MaryValue, BabbageEraTxOut era) ⇒ UTxO era → TxIn → Either (ContextError era) TxInInfo Source #
Given a TxIn, look it up in the UTxO. If it exists, translate it to the V1 context
transTxOutV1 ∷ ∀ era. (Inject (BabbageContextError era) (ContextError era), Value era ~ MaryValue, BabbageEraTxOut era) ⇒ TxOutSource → TxOut era → Either (ContextError era) TxOut Source #
Given a TxOut, translate it for V2 and return (Right transalation). If the transaction contains any Byron addresses or Babbage features, return Left.
transProposal ∷ ConwayEraPlutusTxInfo l era ⇒ proxy l → ProposalProcedure era → ProposalProcedure Source #
toPlutusV3Args ∷ EraPlutusTxInfo 'PlutusV3 era ⇒ proxy 'PlutusV3 → ProtVer → TxInfo → PlutusPurpose AsIxItem era → Maybe (Data era) → Data era → Either (ContextError era) (PlutusArgs 'PlutusV3) Source #
transTxCertV1V2 ∷ (ConwayEraTxCert era, Inject (ConwayContextError era) (ContextError era)) ⇒ TxCert era → Either (ContextError era) DCert Source #
transPlutusPurposeV1V2 ∷ (PlutusTxCert l ~ DCert, PlutusPurpose AsItem era ~ ConwayPlutusPurpose AsItem era, EraPlutusTxInfo l era, Inject (ConwayContextError era) (ContextError era)) ⇒ proxy l → ProtVer → ConwayPlutusPurpose AsItem era → Either (ContextError era) ScriptPurpose Source #
guardConwayFeaturesForPlutusV1V2 ∷ ∀ era. (EraTx era, ConwayEraTxBody era, Inject (ConwayContextError era) (ContextError era)) ⇒ Tx era → Either (ContextError era) () Source #
transTxInInfoV3 ∷ ∀ era. (Inject (BabbageContextError era) (ContextError era), Value era ~ MaryValue, BabbageEraTxOut era) ⇒ UTxO era → TxIn → Either (ContextError era) TxInInfo Source #
Given a TxIn, look it up in the UTxO. If it exists, translate it to the V3 context