Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- class (Eq tx, Show tx, Typeable tx, FromCBOR tx, ToCBOR tx, FromJSON tx, ToJSON tx, Eq (TxIdType tx), Ord (TxIdType tx), Show (TxIdType tx), Typeable (TxIdType tx), FromJSON (TxIdType tx), ToJSON (TxIdType tx), FromCBOR (TxIdType tx), ToCBOR (TxIdType tx), FromJSONKey (TxIdType tx), ToJSONKey (TxIdType tx), Eq (TxOutType tx), Show (TxOutType tx), ToJSON (TxOutType tx), FromJSON (TxOutType tx), Eq (UTxOType tx), Show (UTxOType tx), Monoid (UTxOType tx), FromJSON (UTxOType tx), ToJSON (UTxOType tx), FromCBOR (UTxOType tx), ToCBOR (UTxOType tx)) => IsTx tx where
- type TxIdType tx
- type TxOutType tx = out | out -> tx
- type UTxOType tx = utxo | utxo -> tx
- type ValueType tx
- txId :: tx -> TxIdType tx
- balance :: UTxOType tx -> ValueType tx
- hashUTxO :: UTxOType tx -> ByteString
- txSpendingUTxO :: UTxOType tx -> tx
- utxoFromTx :: tx -> UTxOType tx
- outputsOfUTxO :: UTxOType tx -> [TxOutType tx]
- withoutUTxO :: UTxOType tx -> UTxOType tx -> UTxOType tx
- type ArbitraryIsTx tx = (IsTx tx, Arbitrary tx, Arbitrary (UTxOType tx), Arbitrary (TxIdType tx), Arbitrary (TxOutType tx))
Documentation
class (Eq tx, Show tx, Typeable tx, FromCBOR tx, ToCBOR tx, FromJSON tx, ToJSON tx, Eq (TxIdType tx), Ord (TxIdType tx), Show (TxIdType tx), Typeable (TxIdType tx), FromJSON (TxIdType tx), ToJSON (TxIdType tx), FromCBOR (TxIdType tx), ToCBOR (TxIdType tx), FromJSONKey (TxIdType tx), ToJSONKey (TxIdType tx), Eq (TxOutType tx), Show (TxOutType tx), ToJSON (TxOutType tx), FromJSON (TxOutType tx), Eq (UTxOType tx), Show (UTxOType tx), Monoid (UTxOType tx), FromJSON (UTxOType tx), ToJSON (UTxOType tx), FromCBOR (UTxOType tx), ToCBOR (UTxOType tx)) => IsTx tx where Source #
Types of transactions that can be used by the Head protocol. The associated types and methods of this type class represent the whole interface of what the Head protocol needs from a transaction. This ensure the off-chain protocol stays fairly independent of a concrete transaction type.
Type which identifies a transaction
type TxOutType tx = out | out -> tx Source #
Type for individual transaction outputs.
type UTxOType tx = utxo | utxo -> tx Source #
Type for a set of unspent transaction outputs.
Type representing a value on the ledger.
txId :: tx -> TxIdType tx Source #
balance :: UTxOType tx -> ValueType tx Source #
hashUTxO :: UTxOType tx -> ByteString Source #
Hash a utxo set to be able to sign (off-chain) and verify it (on-chain).
txSpendingUTxO :: UTxOType tx -> tx Source #
utxoFromTx :: tx -> UTxOType tx Source #
Get the UTxO produced by given transaction.
outputsOfUTxO :: UTxOType tx -> [TxOutType tx] Source #
Get only the outputs in given UTxO.
withoutUTxO :: UTxOType tx -> UTxOType tx -> UTxOType tx Source #
Return the left-hand side without the right-hand side.
Instances
IsTx Tx Source # | |
Defined in Hydra.Tx.IsTx txId :: Tx -> TxIdType Tx Source # balance :: UTxOType Tx -> ValueType Tx Source # hashUTxO :: UTxOType Tx -> ByteString Source # txSpendingUTxO :: UTxOType Tx -> Tx Source # utxoFromTx :: Tx -> UTxOType Tx Source # outputsOfUTxO :: UTxOType Tx -> [TxOutType Tx] Source # withoutUTxO :: UTxOType Tx -> UTxOType Tx -> UTxOType Tx Source # |
Constraint synonyms
type ArbitraryIsTx tx = (IsTx tx, Arbitrary tx, Arbitrary (UTxOType tx), Arbitrary (TxIdType tx), Arbitrary (TxOutType tx)) Source #
Cardano Tx
Orphan instances
FromJSON Tx Source # | |
FromCBOR UTxO Source # | |
FromCBOR Tx Source # | |
ToCBOR UTxO Source # | |
toCBOR :: UTxO -> Encoding encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy UTxO -> Size encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [UTxO] -> Size | |
IsShelleyBasedEra era => ToJSON (Tx era) Source # | |
toJSON :: Tx era -> Value toEncoding :: Tx era -> Encoding toJSONList :: [Tx era] -> Value toEncodingList :: [Tx era] -> Encoding | |
IsShelleyBasedEra era => ToCBOR (Tx era) Source # | |
toCBOR :: Tx era -> Encoding encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (Tx era) -> Size encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Tx era] -> Size |