Safe Haskell | None |
---|---|
Language | Haskell2010 |
The chain index' version of a transaction
Synopsis
-
data
ChainIndexTx
=
ChainIndexTx
{
- _citxTxId :: TxId
- _citxInputs :: [TxIn]
- _citxOutputs :: ChainIndexTxOutputs
- _citxValidRange :: !SlotRange
- _citxData :: Map DatumHash Datum
- _citxRedeemers :: Redeemers
- _citxScripts :: Map ScriptHash (Versioned Script )
- _citxCardanoTx :: Maybe CardanoTx
-
data
ChainIndexTxOutputs
- = InvalidTx ( Maybe ChainIndexTxOut )
- | ValidTx [ ChainIndexTxOut ]
-
data
ChainIndexTxOut
=
ChainIndexTxOut
{
- citoAddress :: CardanoAddress
- citoValue :: Value
- citoDatum :: OutputDatum
- citoRefScript :: ReferenceScript
- data ReferenceScript
- data Address = Address { }
- data OutputDatum
- newtype Value = Value { }
- fromOnChainTx :: OnChainTx -> ChainIndexTx
- txOuts :: ChainIndexTx -> [ ChainIndexTxOut ]
- txOutRefs :: ChainIndexTx -> [ TxOutRef ]
- txOutsWithRef :: ChainIndexTx -> [( ChainIndexTxOut , TxOutRef )]
- txOutRefMap :: ChainIndexTx -> Map TxOutRef ( ChainIndexTxOut , ChainIndexTx )
- txOutRefMapForAddr :: CardanoAddress -> ChainIndexTx -> Map TxOutRef ( ChainIndexTxOut , ChainIndexTx )
- txRedeemersWithHash :: ChainIndexTx -> Map RedeemerHash Redeemer
- validityFromChainIndex :: ChainIndexTx -> TxValidity
- citxTxId :: Lens' ChainIndexTx TxId
- citxInputs :: Lens' ChainIndexTx [TxIn]
- citxOutputs :: Lens' ChainIndexTx ChainIndexTxOutputs
- citxValidRange :: Lens' ChainIndexTx SlotRange
- citxData :: Lens' ChainIndexTx ( Map DatumHash Datum )
- citxRedeemers :: Lens' ChainIndexTx Redeemers
- citxScripts :: Lens' ChainIndexTx ( Map ScriptHash (Versioned Script ))
- citxCardanoTx :: Lens' ChainIndexTx ( Maybe CardanoTx)
- _InvalidTx :: Prism' ChainIndexTxOutputs ( Maybe ChainIndexTxOut )
- _ValidTx :: Prism' ChainIndexTxOutputs [ ChainIndexTxOut ]
Documentation
data ChainIndexTx Source #
ChainIndexTx | |
|
Instances
data ChainIndexTxOutputs Source #
List of outputs of a transaction. There is only an optional collateral output if the transaction is invalid.
InvalidTx ( Maybe ChainIndexTxOut ) |
The transaction is invalid so there is maybe a collateral output. |
ValidTx [ ChainIndexTxOut ] |
Instances
data ChainIndexTxOut Source #
ChainIndexTxOut | |
|
Instances
data ReferenceScript Source #
Instances
Address with two kinds of credentials, normal and staking.
Instances
data OutputDatum Source #
The datum attached to an output: either nothing; a datum hash; or the datum itself (an "inline datum").
Instances
A cryptocurrency value. This is a map from
CurrencySymbol
s to a
quantity of that currency.
Operations on currencies are usually implemented
pointwise
. That is,
we apply the operation to the quantities for each currency in turn. So
when we add two
Value
s the resulting
Value
has, for each currency,
the sum of the quantities of
that particular
currency in the argument
Value
. The effect of this is that the currencies in the
Value
are "independent",
and are operated on separately.
Whenever we need to get the quantity of a currency in a
Value
where there
is no explicit quantity of that currency in the
Value
, then the quantity is
taken to be zero.
See note [Currencies] for more details.
Instances
fromOnChainTx :: OnChainTx -> ChainIndexTx Source #
Convert a
OnChainTx
to a
ChainIndexTx
. An invalid
OnChainTx
will not
produce any
ChainIndexTx
outputs and the collateral inputs of the
OnChainTx
will be the inputs of the
ChainIndexTx
.
Cardano api transactions store validity internally. Our emulated blockchain stores validity outside of the transactions, so we need to make sure these match up.
txOuts :: ChainIndexTx -> [ ChainIndexTxOut ] Source #
Get tx outputs from tx.
txOutRefs :: ChainIndexTx -> [ TxOutRef ] Source #
Get tx output references from tx.
txOutsWithRef :: ChainIndexTx -> [( ChainIndexTxOut , TxOutRef )] Source #
Get tx output references and tx outputs from tx.
txOutRefMap :: ChainIndexTx -> Map TxOutRef ( ChainIndexTxOut , ChainIndexTx ) Source #
Get
Map
of tx outputs references to tx.
txOutRefMapForAddr :: CardanoAddress -> ChainIndexTx -> Map TxOutRef ( ChainIndexTxOut , ChainIndexTx ) Source #
Get
Map
of tx outputs from tx for a specific address.
Lenses
citxInputs :: Lens' ChainIndexTx [TxIn] Source #
citxValidRange :: Lens' ChainIndexTx SlotRange Source #
citxScripts :: Lens' ChainIndexTx ( Map ScriptHash (Versioned Script )) Source #
citxCardanoTx :: Lens' ChainIndexTx ( Maybe CardanoTx) Source #