tests
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Model.Payment

Description

A simplistic type of transactions useful for modelling purpose. a Payment is a simple transaction type that moves some amount of ADAs between to CardanoSigningKey.

Synopsis

Documentation

newtype CardanoSigningKey Source #

Constructors

CardanoSigningKey 

Fields

Instances

Instances details
Arbitrary CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

FromJSON CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

ToJSON CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

Show CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

FromCBOR CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

ToCBOR CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

Methods

toCBOR :: CardanoSigningKey -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy CardanoSigningKey -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [CardanoSigningKey] -> Size

Eq CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

Ord CardanoSigningKey Source # 
Instance details

Defined in Hydra.Model.Payment

data Payment Source #

A single Ada-payment only transaction in our model.

Constructors

Payment 

Instances

Instances details
Arbitrary Payment Source # 
Instance details

Defined in Hydra.Model.Payment

Methods

arbitrary :: Gen Payment

shrink :: Payment -> [Payment]

FromJSON Payment Source # 
Instance details

Defined in Hydra.Model.Payment

Methods

parseJSON :: Value -> Parser Payment

parseJSONList :: Value -> Parser [Payment]

omittedField :: Maybe Payment

ToJSON Payment Source # 
Instance details

Defined in Hydra.Model.Payment

Methods

toJSON :: Payment -> Value

toEncoding :: Payment -> Encoding

toJSONList :: [Payment] -> Value

toEncodingList :: [Payment] -> Encoding

omitField :: Payment -> Bool

Generic Payment Source # 
Instance details

Defined in Hydra.Model.Payment

Associated Types

type Rep Payment :: Type -> Type Source #

Show Payment Source # 
Instance details

Defined in Hydra.Model.Payment

FromCBOR Payment Source # 
Instance details

Defined in Hydra.Model.Payment

Methods

fromCBOR :: Decoder s Payment

label :: Proxy Payment -> Text

ToCBOR Payment Source # 
Instance details

Defined in Hydra.Model.Payment

Methods

toCBOR :: Payment -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy Payment -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Payment] -> Size

Eq Payment Source # 
Instance details

Defined in Hydra.Model.Payment

IsTx Payment Source #

Making Payment an instance of IsTx allows us to use it with HeadLogic's messages.

Instance details

Defined in Hydra.Model.Payment

Associated Types

type TxIdType Payment

type TxOutType Payment = (out :: Type)

type UTxOType Payment = (utxo :: Type)

type ValueType Payment

Methods

txId :: Payment -> TxIdType Payment

balance :: UTxOType Payment -> ValueType Payment

hashUTxO :: UTxOType Payment -> ByteString

txSpendingUTxO :: UTxOType Payment -> Payment

utxoFromTx :: Payment -> UTxOType Payment

outputsOfUTxO :: UTxOType Payment -> [TxOutType Payment]

withoutUTxO :: UTxOType Payment -> UTxOType Payment -> UTxOType Payment

HasVariables Payment Source # 
Instance details

Defined in Hydra.Model.Payment

Methods

getAllVariables :: Payment -> Set (Any Var)

type Rep Payment Source # 
Instance details

Defined in Hydra.Model.Payment

type TxIdType Payment Source # 
Instance details

Defined in Hydra.Model.Payment

type TxIdType Payment = Int
type TxOutType Payment Source # 
Instance details

Defined in Hydra.Model.Payment

type TxOutType Payment = (CardanoSigningKey, Value)
type UTxOType Payment Source # 
Instance details

Defined in Hydra.Model.Payment

type UTxOType Payment = [(CardanoSigningKey, Value)]
type ValueType Payment Source # 
Instance details

Defined in Hydra.Model.Payment

type ValueType Payment = Value

applyTx :: UTxOType Payment -> Payment -> UTxOType Payment Source #

genAdaValue :: Gen Value Source #

Orphans

Orphan instances

Arbitrary Value Source # 
Instance details

Methods

arbitrary :: Gen Value

shrink :: Value -> [Value]

FromCBOR Value Source # 
Instance details

Methods

fromCBOR :: Decoder s Value

label :: Proxy Value -> Text

ToCBOR Value Source # 
Instance details

Methods

toCBOR :: Value -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy Value -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [Value] -> Size