shelley-spec-ledger-0.1.0.0
Safe HaskellNone
LanguageHaskell98

Shelley.Spec.Ledger.LedgerState

Description

This module implements the operation rules for treating UTxO transactions (Tx) as state transformations on a ledger state (LedgerState), as specified in A Simplified Formal Specification of a UTxO Ledger.

Synopsis

Documentation

data AccountState Source #

Constructors

AccountState 

Fields

Instances

Instances details
Eq AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Show AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Generic AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep AccountState :: Type -> Type #

NFData AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: AccountState -> () #

ToCBOR AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

FromCBOR AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep AccountState Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep AccountState = D1 ('MetaData "AccountState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "AccountState" 'PrefixI 'True) (S1 ('MetaSel ('Just "_treasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "_reserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))

data DPState crypto Source #

The state associated with the current stake delegation.

Constructors

DPState 

Fields

Instances

Instances details
Eq (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: DPState crypto -> DPState crypto -> Bool #

(/=) :: DPState crypto -> DPState crypto -> Bool #

Show (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> DPState crypto -> ShowS #

show :: DPState crypto -> String #

showList :: [DPState crypto] -> ShowS #

Generic (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (DPState crypto) :: Type -> Type #

Methods

from :: DPState crypto -> Rep (DPState crypto) x #

to :: Rep (DPState crypto) x -> DPState crypto #

NFData (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: DPState crypto -> () #

Crypto crypto => ToCBOR (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: DPState crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (DPState crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [DPState crypto] -> Size Source #

Crypto crypto => FromCBOR (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

fromCBOR :: Decoder s (DPState crypto) Source #

label :: Proxy (DPState crypto) -> Text Source #

NoThunks (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (DPState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (DPState crypto) = D1 ('MetaData "DPState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "DPState" 'PrefixI 'True) (S1 ('MetaSel ('Just "_dstate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (DState crypto)) :*: S1 ('MetaSel ('Just "_pstate") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PState crypto))))

data DState crypto Source #

State of staking pool delegations and rewards

Constructors

DState 

Fields

Instances

Instances details
Eq (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: DState crypto -> DState crypto -> Bool #

(/=) :: DState crypto -> DState crypto -> Bool #

Show (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> DState crypto -> ShowS #

show :: DState crypto -> String #

showList :: [DState crypto] -> ShowS #

Generic (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (DState crypto) :: Type -> Type #

Methods

from :: DState crypto -> Rep (DState crypto) x #

to :: Rep (DState crypto) x -> DState crypto #

NFData (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: DState crypto -> () #

Crypto crypto => ToCBOR (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: DState crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (DState crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [DState crypto] -> Size Source #

Crypto crypto => FromCBOR (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

fromCBOR :: Decoder s (DState crypto) Source #

label :: Proxy (DState crypto) -> Text Source #

NoThunks (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (DState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (DState crypto) = D1 ('MetaData "DState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "DState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_rewards") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (RewardAccounts crypto)) :*: (S1 ('MetaSel ('Just "_delegations") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking crypto) (KeyHash 'StakePool crypto))) :*: S1 ('MetaSel ('Just "_ptrs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Bimap Ptr (Credential 'Staking crypto))))) :*: (S1 ('MetaSel ('Just "_fGenDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (FutureGenDeleg crypto) (GenDelegPair crypto))) :*: (S1 ('MetaSel ('Just "_genDelegs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (GenDelegs crypto)) :*: S1 ('MetaSel ('Just "_irwd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (InstantaneousRewards crypto))))))

data EpochState era Source #

Constructors

EpochState 

Fields

Instances

Instances details
ShelleyBased era => Eq (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: EpochState era -> EpochState era -> Bool #

(/=) :: EpochState era -> EpochState era -> Bool #

ShelleyBased era => Show (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> EpochState era -> ShowS #

show :: EpochState era -> String #

showList :: [EpochState era] -> ShowS #

Generic (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (EpochState era) :: Type -> Type #

Methods

from :: EpochState era -> Rep (EpochState era) x #

to :: Rep (EpochState era) x -> EpochState era #

Era era => NFData (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: EpochState era -> () #

ShelleyBased era => ToCBOR (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: EpochState era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (EpochState era) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [EpochState era] -> Size Source #

ShelleyBased era => FromCBOR (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (EpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (EpochState era) = D1 ('MetaData "EpochState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "EpochState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "esAccountState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AccountState) :*: (S1 ('MetaSel ('Just "esSnapshots") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (SnapShots (Crypto era))) :*: S1 ('MetaSel ('Just "esLState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (LedgerState era)))) :*: (S1 ('MetaSel ('Just "esPrevPp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)) :*: (S1 ('MetaSel ('Just "esPp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)) :*: S1 ('MetaSel ('Just "esNonMyopic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonMyopic (Crypto era)))))))

data FutureGenDeleg crypto Source #

Constructors

FutureGenDeleg 

Instances

Instances details
Eq (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> Bool #

(/=) :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> Bool #

Ord (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

compare :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> Ordering #

(<) :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> Bool #

(<=) :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> Bool #

(>) :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> Bool #

(>=) :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> Bool #

max :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> FutureGenDeleg crypto #

min :: FutureGenDeleg crypto -> FutureGenDeleg crypto -> FutureGenDeleg crypto #

Show (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> FutureGenDeleg crypto -> ShowS #

show :: FutureGenDeleg crypto -> String #

showList :: [FutureGenDeleg crypto] -> ShowS #

Generic (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (FutureGenDeleg crypto) :: Type -> Type #

Methods

from :: FutureGenDeleg crypto -> Rep (FutureGenDeleg crypto) x #

to :: Rep (FutureGenDeleg crypto) x -> FutureGenDeleg crypto #

NFData (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: FutureGenDeleg crypto -> () #

Crypto crypto => ToCBOR (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: FutureGenDeleg crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (FutureGenDeleg crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [FutureGenDeleg crypto] -> Size Source #

Crypto crypto => FromCBOR (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (FutureGenDeleg crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (FutureGenDeleg crypto) = D1 ('MetaData "FutureGenDeleg" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "FutureGenDeleg" 'PrefixI 'True) (S1 ('MetaSel ('Just "fGenDelegSlot") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "fGenDelegGenKeyHash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (KeyHash 'Genesis crypto))))

data InstantaneousRewards crypto Source #

Constructors

InstantaneousRewards 

Fields

Instances

Instances details
Eq (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Show (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Generic (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (InstantaneousRewards crypto) :: Type -> Type #

Methods

from :: InstantaneousRewards crypto -> Rep (InstantaneousRewards crypto) x #

to :: Rep (InstantaneousRewards crypto) x -> InstantaneousRewards crypto #

NFData (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: InstantaneousRewards crypto -> () #

Crypto crypto => ToCBOR (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: InstantaneousRewards crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (InstantaneousRewards crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [InstantaneousRewards crypto] -> Size Source #

Crypto crypto => FromCBOR (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (InstantaneousRewards crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (InstantaneousRewards crypto) = D1 ('MetaData "InstantaneousRewards" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "InstantaneousRewards" 'PrefixI 'True) (S1 ('MetaSel ('Just "iRReserves") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking crypto) Coin)) :*: S1 ('MetaSel ('Just "iRTreasury") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking crypto) Coin))))

type KeyPairs crypto = [(KeyPair 'Payment crypto, KeyPair 'Staking crypto)] Source #

Representation of a list of pairs of key pairs, e.g., pay and stake keys

data LedgerState era Source #

The state associated with a Ledger.

Constructors

LedgerState 

Fields

Instances

Instances details
ShelleyBased era => Eq (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: LedgerState era -> LedgerState era -> Bool #

(/=) :: LedgerState era -> LedgerState era -> Bool #

ShelleyBased era => Show (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> LedgerState era -> ShowS #

show :: LedgerState era -> String #

showList :: [LedgerState era] -> ShowS #

Generic (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (LedgerState era) :: Type -> Type #

Methods

from :: LedgerState era -> Rep (LedgerState era) x #

to :: Rep (LedgerState era) x -> LedgerState era #

Era era => NFData (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: LedgerState era -> () #

ShelleyBased era => ToCBOR (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: LedgerState era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (LedgerState era) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [LedgerState era] -> Size Source #

ShelleyBased era => FromCBOR (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (LedgerState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (LedgerState era) = D1 ('MetaData "LedgerState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "LedgerState" 'PrefixI 'True) (S1 ('MetaSel ('Just "_utxoState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (UTxOState era)) :*: S1 ('MetaSel ('Just "_delegationState") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (DPState (Crypto era)))))

data PPUPState era Source #

Constructors

PPUPState 

Instances

Instances details
Eq (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: PPUPState era -> PPUPState era -> Bool #

(/=) :: PPUPState era -> PPUPState era -> Bool #

Show (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> PPUPState era -> ShowS #

show :: PPUPState era -> String #

showList :: [PPUPState era] -> ShowS #

Generic (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (PPUPState era) :: Type -> Type #

Methods

from :: PPUPState era -> Rep (PPUPState era) x #

to :: Rep (PPUPState era) x -> PPUPState era #

NFData (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: PPUPState era -> () #

Era era => ToCBOR (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: PPUPState era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (PPUPState era) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [PPUPState era] -> Size Source #

Era era => FromCBOR (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (PPUPState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (PPUPState era) = D1 ('MetaData "PPUPState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "PPUPState" 'PrefixI 'True) (S1 ('MetaSel ('Just "proposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ProposedPPUpdates era)) :*: S1 ('MetaSel ('Just "futureProposals") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (ProposedPPUpdates era))))

data PState crypto Source #

Current state of staking pools and their certificate counters.

Constructors

PState 

Fields

Instances

Instances details
Eq (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: PState crypto -> PState crypto -> Bool #

(/=) :: PState crypto -> PState crypto -> Bool #

Show (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> PState crypto -> ShowS #

show :: PState crypto -> String #

showList :: [PState crypto] -> ShowS #

Generic (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (PState crypto) :: Type -> Type #

Methods

from :: PState crypto -> Rep (PState crypto) x #

to :: Rep (PState crypto) x -> PState crypto #

NFData (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: PState crypto -> () #

Crypto crypto => ToCBOR (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: PState crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (PState crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [PState crypto] -> Size Source #

Crypto crypto => FromCBOR (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

fromCBOR :: Decoder s (PState crypto) Source #

label :: Proxy (PState crypto) -> Text Source #

NoThunks (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (PState crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (PState crypto) = D1 ('MetaData "PState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "PState" 'PrefixI 'True) (S1 ('MetaSel ('Just "_pParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool crypto) (PoolParams crypto))) :*: (S1 ('MetaSel ('Just "_fPParams") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool crypto) (PoolParams crypto))) :*: S1 ('MetaSel ('Just "_retiring") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool crypto) EpochNo)))))

type RewardAccounts crypto = Map (Credential 'Staking crypto) Coin Source #

data RewardUpdate crypto Source #

Constructors

RewardUpdate 

Fields

Instances

Instances details
Eq (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: RewardUpdate crypto -> RewardUpdate crypto -> Bool #

(/=) :: RewardUpdate crypto -> RewardUpdate crypto -> Bool #

Show (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> RewardUpdate crypto -> ShowS #

show :: RewardUpdate crypto -> String #

showList :: [RewardUpdate crypto] -> ShowS #

Generic (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (RewardUpdate crypto) :: Type -> Type #

Methods

from :: RewardUpdate crypto -> Rep (RewardUpdate crypto) x #

to :: Rep (RewardUpdate crypto) x -> RewardUpdate crypto #

NFData (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: RewardUpdate crypto -> () #

Crypto crypto => ToCBOR (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: RewardUpdate crypto -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (RewardUpdate crypto) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [RewardUpdate crypto] -> Size Source #

Crypto crypto => FromCBOR (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

fromCBOR :: Decoder s (RewardUpdate crypto) Source #

label :: Proxy (RewardUpdate crypto) -> Text Source #

NoThunks (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (RewardUpdate crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (RewardUpdate crypto) = D1 ('MetaData "RewardUpdate" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "RewardUpdate" 'PrefixI 'True) ((S1 ('MetaSel ('Just "deltaT") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('Just "deltaR") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin)) :*: (S1 ('MetaSel ('Just "rs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (Credential 'Staking crypto) Coin)) :*: (S1 ('MetaSel ('Just "deltaF") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('Just "nonMyopic") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonMyopic crypto))))))

data UTxOState era Source #

Constructors

UTxOState 

Fields

Instances

Instances details
ShelleyBased era => Eq (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: UTxOState era -> UTxOState era -> Bool #

(/=) :: UTxOState era -> UTxOState era -> Bool #

ShelleyBased era => Show (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> UTxOState era -> ShowS #

show :: UTxOState era -> String #

showList :: [UTxOState era] -> ShowS #

Generic (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (UTxOState era) :: Type -> Type #

Methods

from :: UTxOState era -> Rep (UTxOState era) x #

to :: Rep (UTxOState era) x -> UTxOState era #

Era era => NFData (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: UTxOState era -> () #

ShelleyBased era => ToCBOR (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: UTxOState era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (UTxOState era) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [UTxOState era] -> Size Source #

ShelleyBased era => FromCBOR (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (UTxOState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (UTxOState era) = D1 ('MetaData "UTxOState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "UTxOState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_utxo") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (UTxO era)) :*: S1 ('MetaSel ('Just "_deposited") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "_fees") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "_ppups") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PPUPState era)))))

depositPoolChange :: HasField "certs" (TxBody era) (StrictSeq (DCert (Crypto era))) => LedgerState era -> PParams era -> TxBody era -> Coin Source #

Calculate the change to the deposit pool for a given transaction.

updatePpup :: UTxOState era -> PParams era -> UTxOState era Source #

Update the protocol parameter updates by clearing out the proposals and making the future proposals become the new proposals, provided the new proposals can follow (otherwise reset them).

state transitions

Genesis State

genesisState :: Map (KeyHash 'Genesis (Crypto era)) (GenDelegPair (Crypto era)) -> UTxO era -> LedgerState era Source #

Creates the ledger state for an empty ledger which contains the specified transaction outputs.

Validation

newtype WitHashes crypto Source #

Constructors

WitHashes 

Fields

Instances

Instances details
Eq (WitHashes crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: WitHashes crypto -> WitHashes crypto -> Bool #

(/=) :: WitHashes crypto -> WitHashes crypto -> Bool #

Show (WitHashes crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

showsPrec :: Int -> WitHashes crypto -> ShowS #

show :: WitHashes crypto -> String #

showList :: [WitHashes crypto] -> ShowS #

Generic (WitHashes crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (WitHashes crypto) :: Type -> Type #

Methods

from :: WitHashes crypto -> Rep (WitHashes crypto) x #

to :: Rep (WitHashes crypto) x -> WitHashes crypto #

NoThunks (WitHashes crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (WitHashes crypto) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (WitHashes crypto) = D1 ('MetaData "WitHashes" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'True) (C1 ('MetaCons "WitHashes" 'PrefixI 'True) (S1 ('MetaSel ('Just "unWitHashes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set (KeyHash 'Witness crypto)))))

nullWitHashes :: WitHashes crypto -> Bool Source #

Check if a set of witness hashes is empty.

diffWitHashes :: WitHashes crypto -> WitHashes crypto -> WitHashes crypto Source #

Extract the difference between two sets of witness hashes.

minfee :: PParams era -> Tx era -> Coin Source #

Minimum fee calculation

minfeeBound :: forall era. (ShelleyBased era, HasField "outputs" (TxBody era) (StrictSeq (TxOut era)), HasField "inputs" (TxBody era) (Set (TxIn (Crypto era)))) => PParams era -> Tx era -> Coin Source #

Minimum fee bound using txsizeBound

txsize :: Tx era -> Integer Source #

Implementation of abstract transaction size

txsizeBound :: forall era. (ShelleyBased era, HasField "outputs" (TxBody era) (StrictSeq (TxOut era)), HasField "inputs" (TxBody era) (Set (TxIn (Crypto era)))) => Tx era -> Integer Source #

Convenience Function to bound the txsize function. | It can be helpful for coin selection.

produced :: (ShelleyBased era, HasField "certs" (TxBody era) (StrictSeq (DCert (Crypto era))), HasField "outputs" (TxBody era) (StrictSeq (TxOut era)), HasField "txfee" (TxBody era) Coin) => PParams era -> Map (KeyHash 'StakePool (Crypto era)) (PoolParams (Crypto era)) -> TxBody era -> Value era Source #

Compute the lovelace which are created by the transaction

consumed :: forall era. (ShelleyBased era, HasField "certs" (TxBody era) (StrictSeq (DCert (Crypto era))), HasField "inputs" (TxBody era) (Set (TxIn (Crypto era))), HasField "wdrls" (TxBody era) (Wdrl (Crypto era))) => PParams era -> UTxO era -> TxBody era -> Value era Source #

Compute the lovelace which are destroyed by the transaction

verifiedWits :: (TxBodyConstraints era, AnnotatedData (Script era), ToCBOR (AuxiliaryData era), DSignable (Crypto era) (Hash (Crypto era) EraIndependentTxBody)) => Tx era -> Either [VKey 'Witness (Crypto era)] () Source #

Given a ledger state, determine if the UTxO witnesses in a given transaction are correct.

witsVKeyNeeded :: forall era. (ShelleyBased era, HasField "wdrls" (TxBody era) (Wdrl (Crypto era)), HasField "certs" (TxBody era) (StrictSeq (DCert (Crypto era))), HasField "inputs" (TxBody era) (Set (TxIn (Crypto era))), HasField "update" (TxBody era) (StrictMaybe (Update era))) => UTxO era -> Tx era -> GenDelegs (Crypto era) -> WitHashes (Crypto era) Source #

Collect the set of hashes of keys that needs to sign a given transaction. This set consists of the txin owners, certificate authors, and withdrawal reward accounts.

witsFromWitnessSet :: (Era era, AnnotatedData (Script era)) => WitnessSet era -> WitHashes (Crypto era) Source #

Extract the witness hashes from the Witness set.

DelegationState

keyRefunds :: HasField "certs" (TxBody era) (StrictSeq (DCert (Crypto era))) => PParams era -> TxBody era -> Coin Source #

Compute the key deregistration refunds in a transaction

Epoch boundary

stakeDistr :: forall era. ShelleyBased era => UTxO era -> DState (Crypto era) -> PState (Crypto era) -> SnapShot (Crypto era) Source #

applyRUpd :: RewardUpdate (Crypto era) -> EpochState era -> EpochState era Source #

Apply a reward update

createRUpd :: EpochSize -> BlocksMade (Crypto era) -> EpochState era -> Coin -> ShelleyBase (RewardUpdate (Crypto era)) Source #

Create a reward update

data NewEpochState era Source #

New Epoch state and environment

Constructors

NewEpochState 

Fields

Instances

Instances details
ShelleyBased era => Eq (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

(==) :: NewEpochState era -> NewEpochState era -> Bool #

(/=) :: NewEpochState era -> NewEpochState era -> Bool #

ShelleyBased era => Show (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Generic (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Associated Types

type Rep (NewEpochState era) :: Type -> Type #

Methods

from :: NewEpochState era -> Rep (NewEpochState era) x #

to :: Rep (NewEpochState era) x -> NewEpochState era #

Era era => NFData (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

rnf :: NewEpochState era -> () #

ShelleyBased era => ToCBOR (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

Methods

toCBOR :: NewEpochState era -> Encoding Source #

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (NewEpochState era) -> Size Source #

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [NewEpochState era] -> Size Source #

ShelleyBased era => FromCBOR (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

NoThunks (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (NewEpochState era) Source # 
Instance details

Defined in Shelley.Spec.Ledger.LedgerState

type Rep (NewEpochState era) = D1 ('MetaData "NewEpochState" "Shelley.Spec.Ledger.LedgerState" "shelley-spec-ledger-0.1.0.0-Is3EknyvW92LxCl96jGQVW" 'False) (C1 ('MetaCons "NewEpochState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nesEL") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EpochNo) :*: (S1 ('MetaSel ('Just "nesBprev") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BlocksMade (Crypto era))) :*: S1 ('MetaSel ('Just "nesBcur") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (BlocksMade (Crypto era))))) :*: (S1 ('MetaSel ('Just "nesEs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (EpochState era)) :*: (S1 ('MetaSel ('Just "nesRu") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (StrictMaybe (RewardUpdate (Crypto era)))) :*: S1 ('MetaSel ('Just "nesPd") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PoolDistr (Crypto era)))))))

updateNES :: NewEpochState era -> BlocksMade (Crypto era) -> LedgerState era -> NewEpochState era Source #

Update new epoch state

circulation :: EpochState era -> Coin -> Coin Source #

Calculate the current circulation

This is used in the rewards calculation, and for API endpoints for pool ranking.

Decay

Remove Bootstrap Redeem Addresses