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

Hydra.Ledger.Cardano

Synopsis

Documentation

adjustUTxO :: Tx -> UTxO -> UTxO Source #

Utility function to "adjust" a UTxO' set given a Tx

The inputs from the Tx are removed from the internal map of the UTxO' and the outputs added, correctly indexed by the TxIn. This function is useful to manually maintain a UTxO' set without caring too much about the Ledger rules.

fromChainSlot :: ChainSlot -> SlotNo Source #

Simple conversion from a generic slot to a specific local one.

cardanoLedger :: Globals -> LedgerEnv LedgerEra -> Ledger Tx Source #

Use the cardano-ledger as an in-hydra Ledger.

newLedgerEnv :: PParams LedgerEra -> LedgerEnv LedgerEra Source #

Create a new ledger env from given protocol parameters.

mkTransferTx :: MonadFail m => NetworkId -> UTxO -> SigningKey PaymentKey -> VerificationKey PaymentKey -> m Tx Source #

Build a zero-fee transaction which spends the first output owned by given signing key and transfers it in full to given verification key.

mkSimpleTx Source #

Arguments

:: (TxIn, TxOut CtxUTxO) 
-> (AddressInEra, Value)

Recipient address and amount.

-> SigningKey PaymentKey

Sender's signing key.

-> Either TxBodyError Tx 

Build a zero-fee payment transaction.

mkRangedTx Source #

Arguments

:: (TxIn, TxOut CtxUTxO) 
-> (AddressInEra, Value)

Recipient address and amount.

-> SigningKey PaymentKey

Sender's signing key.

-> (Maybe TxValidityLowerBound, Maybe TxValidityUpperBound) 
-> Either TxBodyError Tx 

Create a zero-fee, payment cardano transaction with validity range.

genSequenceOfSimplePaymentTransactions :: Gen (UTxO, [Tx]) Source #

Generates a sequence of simple "transfer" transactions for a single key.

data ShelleyGenesis c #

Constructors

ShelleyGenesis 

Fields

Instances

Instances details
Crypto c => FromJSON (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

parseJSON :: Value -> Parser (ShelleyGenesis c)

parseJSONList :: Value -> Parser [ShelleyGenesis c]

omittedField :: Maybe (ShelleyGenesis c)

Crypto c => ToJSON (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toJSON :: ShelleyGenesis c -> Value

toEncoding :: ShelleyGenesis c -> Encoding

toJSONList :: [ShelleyGenesis c] -> Value

toEncodingList :: [ShelleyGenesis c] -> Encoding

omitField :: ShelleyGenesis c -> Bool

Generic (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Associated Types

type Rep (ShelleyGenesis c) :: Type -> Type Source #

Crypto c => Show (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c => FromCBOR (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

fromCBOR :: Decoder s (ShelleyGenesis c)

label :: Proxy (ShelleyGenesis c) -> Text

Crypto c => ToCBOR (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

toCBOR :: ShelleyGenesis c -> Encoding

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

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

Crypto c => DecCBOR (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

decCBOR :: Decoder s (ShelleyGenesis c)

dropCBOR :: Proxy (ShelleyGenesis c) -> Decoder s ()

label :: Proxy (ShelleyGenesis c) -> Text

Crypto c => EncCBOR (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

encCBOR :: ShelleyGenesis c -> Encoding

encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy (ShelleyGenesis c) -> Size

encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [ShelleyGenesis c] -> Size

Crypto c => Eq (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Crypto c => NoThunks (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

Methods

noThunks :: Context -> ShelleyGenesis c -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> ShelleyGenesis c -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy (ShelleyGenesis c) -> String

type Rep (ShelleyGenesis c) 
Instance details

Defined in Cardano.Ledger.Shelley.Genesis

type Rep (ShelleyGenesis c) = D1 ('MetaData "ShelleyGenesis" "Cardano.Ledger.Shelley.Genesis" "cardano-ledger-shelley-1.13.1.0-o3mJ5dyFPF19pt5MIUFUd" 'False) (C1 ('MetaCons "ShelleyGenesis" 'PrefixI 'True) (((S1 ('MetaSel ('Just "sgSystemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "sgNetworkMagic") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word32) :*: S1 ('MetaSel ('Just "sgNetworkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network))) :*: ((S1 ('MetaSel ('Just "sgActiveSlotsCoeff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PositiveUnitInterval) :*: S1 ('MetaSel ('Just "sgSecurityParam") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64)) :*: (S1 ('MetaSel ('Just "sgEpochLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 EpochSize) :*: S1 ('MetaSel ('Just "sgSlotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64)))) :*: (((S1 ('MetaSel ('Just "sgMaxKESEvolutions") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgSlotLength") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTimeMicro)) :*: (S1 ('MetaSel ('Just "sgUpdateQuorum") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "sgMaxLovelaceSupply") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64))) :*: ((S1 ('MetaSel ('Just "sgProtocolParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams (ShelleyEra c))) :*: S1 ('MetaSel ('Just "sgGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'Genesis c) (GenDelegPair c)))) :*: (S1 ('MetaSel ('Just "sgInitialFunds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ListMap (Addr c) Coin)) :*: S1 ('MetaSel ('Just "sgStaking") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ShelleyGenesisStaking c)))))))

data Globals #

Instances

Instances details
Generic Globals 
Instance details

Defined in Cardano.Ledger.BaseTypes

Associated Types

type Rep Globals :: Type -> Type Source #

Show Globals 
Instance details

Defined in Cardano.Ledger.BaseTypes

NFData Globals 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

rnf :: Globals -> () Source #

NoThunks Globals 
Instance details

Defined in Cardano.Ledger.BaseTypes

Methods

noThunks :: Context -> Globals -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> Globals -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy Globals -> String

Crypto c => DecCBOR (Pulser c) 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

decCBOR :: Decoder s (Pulser c)

dropCBOR :: Proxy (Pulser c) -> Decoder s ()

label :: Proxy (Pulser c) -> Text

Crypto c => EncCBOR (Pulser c) 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

encCBOR :: Pulser c -> Encoding

encodedSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy (Pulser c) -> Size

encodedListSizeExpr :: (forall t. EncCBOR t => Proxy t -> Size) -> Proxy [Pulser c] -> Size

NFData (Pulser c) 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

rnf :: Pulser c -> () Source #

Typeable c => NoThunks (Pulser c) 
Instance details

Defined in Cardano.Ledger.Shelley.RewardUpdate

Methods

noThunks :: Context -> Pulser c -> IO (Maybe ThunkInfo)

wNoThunks :: Context -> Pulser c -> IO (Maybe ThunkInfo)

showTypeOf :: Proxy (Pulser c) -> String

type Rep Globals 
Instance details

Defined in Cardano.Ledger.BaseTypes

type Rep Globals = D1 ('MetaData "Globals" "Cardano.Ledger.BaseTypes" "cardano-ledger-core-1.14.1.0-AarYWlp879QLZ1nsBNS4Om" 'False) (C1 ('MetaCons "Globals" 'PrefixI 'True) (((S1 ('MetaSel ('Just "epochInfo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (EpochInfo (Either Text))) :*: (S1 ('MetaSel ('Just "slotsPerKESPeriod") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "stabilityWindow") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64))) :*: (S1 ('MetaSel ('Just "randomnessStabilisationWindow") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: (S1 ('MetaSel ('Just "securityParameter") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: S1 ('MetaSel ('Just "maxKESEvo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64)))) :*: ((S1 ('MetaSel ('Just "quorum") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64) :*: (S1 ('MetaSel ('Just "maxMajorPV") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Version) :*: S1 ('MetaSel ('Just "maxLovelaceSupply") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Word64))) :*: (S1 ('MetaSel ('Just "activeSlotCoeff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ActiveSlotCoeff) :*: (S1 ('MetaSel ('Just "networkId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network) :*: S1 ('MetaSel ('Just "systemStart") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SystemStart))))))

data LedgerEnv era #

Instances

Instances details
Generic (LedgerEnv era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

Associated Types

type Rep (LedgerEnv era) :: Type -> Type Source #

Methods

from :: LedgerEnv era -> Rep (LedgerEnv era) x Source #

to :: Rep (LedgerEnv era) x -> LedgerEnv era Source #

Show (PParams era) => Show (LedgerEnv era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

NFData (PParams era) => NFData (LedgerEnv era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

Methods

rnf :: LedgerEnv era -> () Source #

Eq (PParams era) => Eq (LedgerEnv era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

Methods

(==) :: LedgerEnv era -> LedgerEnv era -> Bool Source #

(/=) :: LedgerEnv era -> LedgerEnv era -> Bool Source #

type Rep (LedgerEnv era) 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

type Rep (LedgerEnv era) = D1 ('MetaData "LedgerEnv" "Cardano.Ledger.Shelley.Rules.Ledger" "cardano-ledger-shelley-1.13.1.0-o3mJ5dyFPF19pt5MIUFUd" 'False) (C1 ('MetaCons "LedgerEnv" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ledgerSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "ledgerIx") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 TxIx)) :*: (S1 ('MetaSel ('Just "ledgerPp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)) :*: S1 ('MetaSel ('Just "ledgerAccount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AccountState))))

type Tx = Tx Era #

Orphan instances

Arbitrary (Hash PaymentKey) Source # 
Instance details

Methods

arbitrary :: Gen (Hash PaymentKey)

shrink :: Hash PaymentKey -> [Hash PaymentKey]