Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype OnChainTx = OnChainTx {
- getOnChainTx :: Validated (Tx EmulatorEra)
- eitherTx :: (CardanoTx -> r) -> (CardanoTx -> r) -> OnChainTx -> r
- unOnChain :: OnChainTx -> CardanoTx
- type EmulatorEra = BabbageEra StandardCrypto
- type UtxoIndex = UTxO BabbageEra
- data ValidationError
- _MaxCollateralInputsExceeded :: Prism' ValidationError ()
- _CardanoLedgerValidationError :: Prism' ValidationError Text
- _ScriptFailure :: Prism' ValidationError ScriptError
- _TxOutRefNotFound :: Prism' ValidationError TxIn
- data ValidationPhase
- type ValidationErrorInPhase = (ValidationPhase, ValidationError)
- type ValidationSuccess = (RedeemerReport, Validated (Tx EmulatorEra))
- type RedeemerReport = Map RdmrPtr ([Text], ExUnits)
- data ValidationResult
- _Success :: Prism' ValidationResult (OnChainTx, RedeemerReport)
- _FailPhase2 :: Prism' ValidationResult (OnChainTx, ValidationError, Value)
- _FailPhase1 :: Prism' ValidationResult (CardanoTx, ValidationError)
- data ValidationResultSimple
- toValidationResultSimple :: ValidationResult -> ValidationResultSimple
- cardanoTxFromValidationResult :: ValidationResult -> CardanoTx
- toOnChain :: ValidationResult -> Maybe OnChainTx
- getEvaluationLogs :: ValidationResult -> [Text]
Documentation
A transaction on the blockchain. Invalid transactions are still put on the chain to be able to collect fees.
OnChainTx | |
|
Instances
Eq OnChainTx Source # | |
Show OnChainTx Source # | |
Generic OnChainTx Source # | |
Serialise OnChainTx Source # | |
Defined in Ledger.Index.Internal encode :: OnChainTx -> Encoding encodeList :: [OnChainTx] -> Encoding decodeList :: Decoder s [OnChainTx] | |
type Rep OnChainTx Source # | |
Defined in Ledger.Index.Internal type Rep OnChainTx = D1 ('MetaData "OnChainTx" "Ledger.Index.Internal" "plutus-ledger-1.2.0.0-8dOSOspdVv7Hd909lHBnfn" 'True) (C1 ('MetaCons "OnChainTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "getOnChainTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Validated (Tx EmulatorEra))))) |
type EmulatorEra = BabbageEra StandardCrypto Source #
data ValidationError Source #
A reason why a transaction is invalid.
TxOutRefNotFound TxIn | The transaction output consumed by a transaction input could not be found (either because it was already spent, or because there was no transaction with the given hash on the blockchain). |
ScriptFailure ScriptError | For pay-to-script outputs: evaluation of the validator script failed. |
CardanoLedgerValidationError Text | An error from Cardano.Ledger validation |
MaxCollateralInputsExceeded | Balancing failed, it needed more than the maximum number of collateral inputs |
Instances
_MaxCollateralInputsExceeded :: Prism' ValidationError () Source #
_CardanoLedgerValidationError :: Prism' ValidationError Text Source #
_ScriptFailure :: Prism' ValidationError ScriptError Source #
_TxOutRefNotFound :: Prism' ValidationError TxIn Source #
data ValidationPhase Source #
Instances
Eq ValidationPhase Source # | |
Defined in Ledger.Index.Internal (==) :: ValidationPhase -> ValidationPhase -> Bool Source # (/=) :: ValidationPhase -> ValidationPhase -> Bool Source # | |
Show ValidationPhase Source # | |
Defined in Ledger.Index.Internal | |
Generic ValidationPhase Source # | |
Defined in Ledger.Index.Internal from :: ValidationPhase -> Rep ValidationPhase x Source # to :: Rep ValidationPhase x -> ValidationPhase Source # | |
FromJSON ValidationPhase Source # | |
Defined in Ledger.Index.Internal parseJSON :: Value -> Parser ValidationPhase parseJSONList :: Value -> Parser [ValidationPhase] | |
ToJSON ValidationPhase Source # | |
Defined in Ledger.Index.Internal toJSON :: ValidationPhase -> Value toEncoding :: ValidationPhase -> Encoding toJSONList :: [ValidationPhase] -> Value toEncodingList :: [ValidationPhase] -> Encoding | |
Pretty ValidationPhase Source # | |
Defined in Ledger.Index.Internal pretty :: ValidationPhase -> Doc ann # prettyList :: [ValidationPhase] -> Doc ann # | |
type Rep ValidationPhase Source # | |
type ValidationSuccess = (RedeemerReport, Validated (Tx EmulatorEra)) Source #
type RedeemerReport = Map RdmrPtr ([Text], ExUnits) Source #
data ValidationResult Source #
FailPhase1 !CardanoTx !ValidationError | A transaction failed to validate in phase 1. |
FailPhase2 !OnChainTx !ValidationError !Value | A transaction failed to validate in phase 2. The |
Success !OnChainTx !RedeemerReport |
Instances
_Success :: Prism' ValidationResult (OnChainTx, RedeemerReport) Source #
_FailPhase2 :: Prism' ValidationResult (OnChainTx, ValidationError, Value) Source #
_FailPhase1 :: Prism' ValidationResult (CardanoTx, ValidationError) Source #
data ValidationResultSimple Source #
ValidationFailPhase1 !CardanoTx !ValidationError | |
ValidationFailPhase2 !CardanoTx !ValidationError !Value | |
ValidationSuccess !CardanoTx |
Instances
getEvaluationLogs :: ValidationResult -> [Text] Source #
Get logs from evaluating plutus scripts.