Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.Shelley.Ledger.Query
Synopsis
- data family BlockQuery ∷ Type → QueryFootprint → Type → Type
- newtype NonMyopicMemberRewards = NonMyopicMemberRewards {
- unNonMyopicMemberRewards ∷ Map (Either Coin (Credential 'Staking)) (Map (KeyHash 'StakePool) Coin)
- data StakeSnapshot = StakeSnapshot {}
- data StakeSnapshots = StakeSnapshots {
- ssStakeSnapshots ∷ !(Map (KeyHash 'StakePool) StakeSnapshot)
- ssMarkTotal ∷ !Coin
- ssSetTotal ∷ !Coin
- ssGoTotal ∷ !Coin
- decodeShelleyQuery ∷ ShelleyBasedEra era ⇒ ∀ s. Decoder s (SomeBlockQuery (BlockQuery (ShelleyBlock proto era)))
- decodeShelleyResult ∷ ∀ proto era (fp ∷ QueryFootprint) result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) fp result → ∀ s. Decoder s result
- encodeShelleyQuery ∷ ∀ era proto (fp ∷ QueryFootprint) result. ShelleyBasedEra era ⇒ BlockQuery (ShelleyBlock proto era) fp result → Encoding
- encodeShelleyResult ∷ ∀ proto era (fp ∷ QueryFootprint) result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) fp result → result → Encoding
- answerShelleyLookupQueries ∷ ∀ proto era m result blk. (Monad m, ShelleyCompatible proto era) ⇒ (LedgerTables (LedgerState (ShelleyBlock proto era)) KeysMK → LedgerTables (LedgerState blk) KeysMK) → (TxOut (LedgerState blk) → TxOut era) → (TxIn (LedgerState blk) → TxIn) → ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFLookupTables result → ReadOnlyForker' m blk → m result
- answerShelleyTraversingQueries ∷ ∀ proto era m result blk. (ShelleyCompatible proto era, Ord (TxIn (LedgerState blk)), Eq (TxOut (LedgerState blk)), MemPack (TxOut (LedgerState blk)), IndexedMemPack (LedgerState blk EmptyMK) (TxOut (LedgerState blk)), MemPack (TxIn (LedgerState blk)), Monad m) ⇒ (TxOut (LedgerState blk) → TxOut era) → (TxIn (LedgerState blk) → TxIn) → (∀ result'. BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result' → TxOut (LedgerState blk) → Bool) → ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result → ReadOnlyForker' m blk → m result
- shelleyQFTraverseTablesPredicate ∷ ∀ proto era proto' era' result. (ShelleyBasedEra era, ShelleyBasedEra era') ⇒ BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result → TxOut (LedgerState (ShelleyBlock proto' era')) → Bool
Documentation
data family BlockQuery ∷ Type → QueryFootprint → Type → Type Source #
Different queries supported by the ledger, indexed by the result type.
Instances
newtype NonMyopicMemberRewards Source #
Constructors
NonMyopicMemberRewards | |
Fields
|
Instances
FromCBOR NonMyopicMemberRewards Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query | |
ToCBOR NonMyopicMemberRewards Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods toCBOR ∷ NonMyopicMemberRewards → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy NonMyopicMemberRewards → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [NonMyopicMemberRewards] → Size Source # | |
Show NonMyopicMemberRewards Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods showsPrec ∷ Int → NonMyopicMemberRewards → ShowS # show ∷ NonMyopicMemberRewards → String # showList ∷ [NonMyopicMemberRewards] → ShowS # | |
Eq NonMyopicMemberRewards Source # | |
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods (==) ∷ NonMyopicMemberRewards → NonMyopicMemberRewards → Bool # (/=) ∷ NonMyopicMemberRewards → NonMyopicMemberRewards → Bool # |
data StakeSnapshot Source #
The stake snapshot returns information about the mark, set, go ledger snapshots for a pool,
plus the total active stake for each snapshot that can be used in a sigma
calculation.
Each snapshot is taken at the end of a different era. The go snapshot is the current one and was taken two epochs earlier, set was taken one epoch ago, and mark was taken immediately before the start of the current epoch.
Constructors
StakeSnapshot | |
Instances
data StakeSnapshots Source #
Constructors
StakeSnapshots | |
Fields
|
Instances
FromCBOR StakeSnapshots Source # | |||||
Defined in Ouroboros.Consensus.Shelley.Ledger.Query | |||||
ToCBOR StakeSnapshots Source # | |||||
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods toCBOR ∷ StakeSnapshots → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy StakeSnapshots → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [StakeSnapshots] → Size Source # | |||||
NFData StakeSnapshots Source # | |||||
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods rnf ∷ StakeSnapshots → () # | |||||
Generic StakeSnapshots Source # | |||||
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Associated Types
| |||||
Show StakeSnapshots Source # | |||||
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods showsPrec ∷ Int → StakeSnapshots → ShowS # show ∷ StakeSnapshots → String # showList ∷ [StakeSnapshots] → ShowS # | |||||
Eq StakeSnapshots Source # | |||||
Defined in Ouroboros.Consensus.Shelley.Ledger.Query Methods (==) ∷ StakeSnapshots → StakeSnapshots → Bool # (/=) ∷ StakeSnapshots → StakeSnapshots → Bool # | |||||
type Rep StakeSnapshots Source # | |||||
Defined in Ouroboros.Consensus.Shelley.Ledger.Query type Rep StakeSnapshots = D1 ('MetaData "StakeSnapshots" "Ouroboros.Consensus.Shelley.Ledger.Query" "ouroboros-consensus-cardano-0.24.0.0-inplace" 'False) (C1 ('MetaCons "StakeSnapshots" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ssStakeSnapshots") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (KeyHash 'StakePool) StakeSnapshot)) :*: S1 ('MetaSel ('Just "ssMarkTotal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :*: (S1 ('MetaSel ('Just "ssSetTotal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('Just "ssGoTotal") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)))) |
Serialisation
decodeShelleyQuery ∷ ShelleyBasedEra era ⇒ ∀ s. Decoder s (SomeBlockQuery (BlockQuery (ShelleyBlock proto era))) Source #
decodeShelleyResult ∷ ∀ proto era (fp ∷ QueryFootprint) result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) fp result → ∀ s. Decoder s result Source #
encodeShelleyQuery ∷ ∀ era proto (fp ∷ QueryFootprint) result. ShelleyBasedEra era ⇒ BlockQuery (ShelleyBlock proto era) fp result → Encoding Source #
encodeShelleyResult ∷ ∀ proto era (fp ∷ QueryFootprint) result. ShelleyCompatible proto era ⇒ ShelleyNodeToClientVersion → BlockQuery (ShelleyBlock proto era) fp result → result → Encoding Source #
BlockSupportsHFLedgerQuery instances
answerShelleyLookupQueries Source #
Arguments
∷ ∀ proto era m result blk. (Monad m, ShelleyCompatible proto era) | |
⇒ (LedgerTables (LedgerState (ShelleyBlock proto era)) KeysMK → LedgerTables (LedgerState blk) KeysMK) | Inject ledger tables |
→ (TxOut (LedgerState blk) → TxOut era) | Eject TxOut |
→ (TxIn (LedgerState blk) → TxIn) | Eject TxIn |
→ ExtLedgerCfg (ShelleyBlock proto era) | |
→ BlockQuery (ShelleyBlock proto era) 'QFLookupTables result | |
→ ReadOnlyForker' m blk | |
→ m result |
answerShelleyTraversingQueries Source #
Arguments
∷ ∀ proto era m result blk. (ShelleyCompatible proto era, Ord (TxIn (LedgerState blk)), Eq (TxOut (LedgerState blk)), MemPack (TxOut (LedgerState blk)), IndexedMemPack (LedgerState blk EmptyMK) (TxOut (LedgerState blk)), MemPack (TxIn (LedgerState blk)), Monad m) | |
⇒ (TxOut (LedgerState blk) → TxOut era) | Eject TxOut |
→ (TxIn (LedgerState blk) → TxIn) | Eject TxIn |
→ (∀ result'. BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result' → TxOut (LedgerState blk) → Bool) | Get filter by query |
→ ExtLedgerCfg (ShelleyBlock proto era) | |
→ BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result | |
→ ReadOnlyForker' m blk | |
→ m result |
shelleyQFTraverseTablesPredicate ∷ ∀ proto era proto' era' result. (ShelleyBasedEra era, ShelleyBasedEra era') ⇒ BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result → TxOut (LedgerState (ShelleyBlock proto' era')) → Bool Source #
Orphan instances
SameDepIndex2 (BlockQuery (ShelleyBlock proto era) ∷ QueryFootprint → Type → Type) Source # | |
Methods sameDepIndex2 ∷ ∀ (x ∷ QueryFootprint) a (y ∷ QueryFootprint) b. BlockQuery (ShelleyBlock proto era) x a → BlockQuery (ShelleyBlock proto era) y b → Maybe ('(x, a) :~: '(y, b)) Source # | |
(ShelleyCompatible proto era, LedgerSupportsProtocol (ShelleyBlock proto era), ProtoCrypto proto ~ crypto, Crypto crypto) ⇒ BlockSupportsLedgerQuery (ShelleyBlock proto era) Source # | |
Methods answerPureBlockQuery ∷ ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFNoTables result → ExtLedgerState (ShelleyBlock proto era) EmptyMK → result Source # answerBlockQueryLookup ∷ MonadSTM m ⇒ ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFLookupTables result → ReadOnlyForker' m (ShelleyBlock proto era) → m result Source # answerBlockQueryTraverse ∷ MonadSTM m ⇒ ExtLedgerCfg (ShelleyBlock proto era) → BlockQuery (ShelleyBlock proto era) 'QFTraverseTables result → ReadOnlyForker' m (ShelleyBlock proto era) → m result Source # blockQueryIsSupportedOnVersion ∷ ∀ (fp ∷ QueryFootprint) result. BlockQuery (ShelleyBlock proto era) fp result → BlockNodeToClientVersion (ShelleyBlock proto era) → Bool Source # | |
ShelleyCompatible proto era ⇒ ShowQuery (BlockQuery (ShelleyBlock proto era) fp) Source # | |
Methods showResult ∷ BlockQuery (ShelleyBlock proto era) fp result → result → String Source # | |
(Typeable era, Typeable proto) ⇒ ShowProxy (BlockQuery (ShelleyBlock proto era) ∷ QueryFootprint → Type → Type) Source # | |
Methods showProxy ∷ Proxy (BlockQuery (ShelleyBlock proto era)) → String Source # | |
Show (BlockQuery (ShelleyBlock proto era) fp result) Source # | |
Methods showsPrec ∷ Int → BlockQuery (ShelleyBlock proto era) fp result → ShowS # show ∷ BlockQuery (ShelleyBlock proto era) fp result → String # showList ∷ [BlockQuery (ShelleyBlock proto era) fp result] → ShowS # | |
Eq (BlockQuery (ShelleyBlock proto era) fp result) Source # | |
Methods (==) ∷ BlockQuery (ShelleyBlock proto era) fp result → BlockQuery (ShelleyBlock proto era) fp result → Bool # (/=) ∷ BlockQuery (ShelleyBlock proto era) fp result → BlockQuery (ShelleyBlock proto era) fp result → Bool # |