hydra-node-0.16.0: The Hydra node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Ledger

Synopsis

Documentation

class (Eq tx, Show tx, Typeable tx, Arbitrary tx, FromCBOR tx, ToCBOR tx, FromJSON tx, ToJSON tx, Eq (TxIdType tx), Ord (TxIdType tx), Show (TxIdType tx), Typeable (TxIdType tx), Arbitrary (TxIdType tx), FromJSON (TxIdType tx), ToJSON (TxIdType tx), FromCBOR (TxIdType tx), ToCBOR (TxIdType tx), FromJSONKey (TxIdType tx), ToJSONKey (TxIdType tx), Eq (UTxOType tx), Show (UTxOType tx), Arbitrary (UTxOType tx), FromJSON (UTxOType tx), Monoid (UTxOType tx), ToJSON (UTxOType tx), FromCBOR (UTxOType tx), ToCBOR (UTxOType tx)) => IsTx tx where Source #

Associated Types

type UTxOType tx Source #

type TxIdType tx Source #

type ValueType tx Source #

Methods

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).

newtype ChainSlot Source #

A generic description for a chain slot all implementions need to use.

Constructors

ChainSlot Natural 

Instances

Instances details
Arbitrary ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

FromJSON ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

Methods

parseJSON :: Value -> Parser ChainSlot

parseJSONList :: Value -> Parser [ChainSlot]

omittedField :: Maybe ChainSlot

ToJSON ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

Methods

toJSON :: ChainSlot -> Value

toEncoding :: ChainSlot -> Encoding

toJSONList :: [ChainSlot] -> Value

toEncodingList :: [ChainSlot] -> Encoding

omitField :: ChainSlot -> Bool

Generic ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

Associated Types

type Rep ChainSlot :: Type -> Type Source #

Num ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

Show ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

Eq ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

Ord ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

type Rep ChainSlot Source # 
Instance details

Defined in Hydra.Ledger

type Rep ChainSlot = D1 ('MetaData "ChainSlot" "Hydra.Ledger" "hydra-node-0.16.0-C0XGScKIquG5I6dPp21445" 'True) (C1 ('MetaCons "ChainSlot" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)))

nextChainSlot :: ChainSlot -> ChainSlot Source #

Get the next chain slot. Use this instead of giving Enum or Num instances to ChainSlot.

newtype Ledger tx Source #

An abstract interface for a Ledger. Allows to define mock / simpler implementation for testing as well as limiting feature-envy from the business logic by forcing a closed interface.

Constructors

Ledger 

Fields

collectTransactions :: Ledger tx -> ChainSlot -> UTxOType tx -> [tx] -> ([tx], UTxOType tx) Source #

Collect applicable transactions and resulting UTxO. In contrast to $sel:applyTransactions:Ledger, this functions continues on validation errors.

data ValidationResult Source #

Either valid or an error which we get from the ledger-specs tx validation.

Instances

Instances details
FromJSON ValidationResult Source # 
Instance details

Defined in Hydra.Ledger

ToJSON ValidationResult Source # 
Instance details

Defined in Hydra.Ledger

Generic ValidationResult Source # 
Instance details

Defined in Hydra.Ledger

Associated Types

type Rep ValidationResult :: Type -> Type Source #

Show ValidationResult Source # 
Instance details

Defined in Hydra.Ledger

Eq ValidationResult Source # 
Instance details

Defined in Hydra.Ledger

type Rep ValidationResult Source # 
Instance details

Defined in Hydra.Ledger

type Rep ValidationResult = D1 ('MetaData "ValidationResult" "Hydra.Ledger" "hydra-node-0.16.0-C0XGScKIquG5I6dPp21445" 'False) (C1 ('MetaCons "Valid" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Invalid" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ValidationError)))

newtype ValidationError Source #

Constructors

ValidationError 

Fields

Instances

Instances details
Arbitrary ValidationError Source # 
Instance details

Defined in Hydra.Ledger

FromJSON ValidationError Source # 
Instance details

Defined in Hydra.Ledger

ToJSON ValidationError Source # 
Instance details

Defined in Hydra.Ledger

Generic ValidationError Source # 
Instance details

Defined in Hydra.Ledger

Associated Types

type Rep ValidationError :: Type -> Type Source #

Show ValidationError Source # 
Instance details

Defined in Hydra.Ledger

Eq ValidationError Source # 
Instance details

Defined in Hydra.Ledger

type Rep ValidationError Source # 
Instance details

Defined in Hydra.Ledger

type Rep ValidationError = D1 ('MetaData "ValidationError" "Hydra.Ledger" "hydra-node-0.16.0-C0XGScKIquG5I6dPp21445" 'True) (C1 ('MetaCons "ValidationError" 'PrefixI 'True) (S1 ('MetaSel ('Just "reason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))