| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.State.Query
Synopsis
- insertGetKey ∷ ∀ (m ∷ Type → Type) backend record. (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend, AtLeastOneUniqueKey record, SafeToInsert record) ⇒ record → ReaderT backend m (Key record)
- insertUTxOState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ UTxOState CurrentEra → ReaderT SqlBackend m (Key UtxoState)
- insertUTxO ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ UTxO CurrentEra → Key UtxoState → ReaderT SqlBackend m ()
- insertDState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ DState CurrentEra → ReaderT SqlBackend m DStateId
- insertLedgerState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ EpochStateId → LedgerState CurrentEra → ReaderT SqlBackend m ()
- insertSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ SnapShot → SnapShot → ReaderT SqlBackend m ()
- insertMarkSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key EpochState → MarkSnapShot → ReaderT SqlBackend m ()
- insertSetSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key EpochState → SetSnapShot → ReaderT SqlBackend m ()
- insertGoSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key EpochState → GoSnapShot → ReaderT SqlBackend m ()
- insertSnapShots ∷ ∀ (m ∷ Type → Type) era. MonadIO m ⇒ Key EpochState → SnapShots era → ReaderT SqlBackend m ()
- insertEpochState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ EpochState CurrentEra → ReaderT SqlBackend m ()
- selectVMap ∷ ∀ k record (kv ∷ Type → Type) (vv ∷ Type → Type) v (m ∷ Type → Type). (Ord k, PersistEntity record, PersistEntityBackend record ~ SqlBackend, Vector kv k, Vector vv v, MonadResource m) ⇒ [Filter record] → (record → ReaderT SqlBackend m (k, v)) → ReaderT SqlBackend m (VMap kv vv k v)
- getSnapShotNoSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Key EpochState → SnapShotType → ReaderT SqlBackend m SnapShotM
- getSnapShotWithSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ [SnapShotM] → Key EpochState → SnapShotType → ReaderT SqlBackend m SnapShotM
- getSnapShotsWithSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m SnapShotsM
- selectMap ∷ ∀ (m ∷ Type → Type) k record a. (MonadResource m, Ord k, PersistEntity record, PersistEntityBackend record ~ SqlBackend) ⇒ [Filter record] → (record → ReaderT SqlBackend m (k, a)) → ReaderT SqlBackend m (Map k a)
- getSnapShotNoSharing ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Key EpochState → SnapShotType → ReaderT SqlBackend m (SnapShot, Maybe EpochNo, Maybe Word16, Maybe LeiosCommittee)
- getSnapShotsNoSharing ∷ ∀ (m ∷ Type → Type) era. MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m (SnapShots era)
- getSnapShotsNoSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m SnapShotsM
- getSnapShotWithSharing ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ [SnapShot] → Key EpochState → SnapShotType → ReaderT SqlBackend m (SnapShot, Maybe EpochNo, Maybe Word16, Maybe LeiosCommittee)
- getSnapShotsWithSharing ∷ ∀ (m ∷ Type → Type) era. MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m (SnapShots era)
- sourceUTxO ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ ConduitM () (TxIn, TxOut CurrentEra) (ReaderT SqlBackend m) ()
- sourceWithSharingUTxO ∷ ∀ (m ∷ Type → Type) a. MonadResource m ⇒ Map (Credential 'Staking) a → ConduitM () (TxIn, TxOut CurrentEra) (ReaderT SqlBackend m) ()
- foldDbUTxO ∷ MonadUnliftIO m ⇒ (a → (TxIn, TxOut CurrentEra) → a) → a → Text → m a
- lsId ∷ Key LedgerState
- getLedgerState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ UTxO CurrentEra → LedgerState → DState CurrentEra → ReaderT SqlBackend m (LedgerState CurrentEra)
- getDStateNoSharing ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key DState → ReaderT SqlBackend m (DState CurrentEra)
- getAccountsMap ∷ ∀ (m ∷ Type → Type) era (r' ∷ KeyRole). (MonadIO m, EraTest era) ⇒ DStateId → ReaderT SqlBackend m (Map (Credential r') (AccountState era))
- getDStateWithSharing ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key DState → ReaderT SqlBackend m (DState CurrentEra)
- loadDStateNoSharing ∷ MonadUnliftIO m ⇒ Text → m (DState CurrentEra)
- loadUTxONoSharing ∷ MonadUnliftIO m ⇒ Text → m (UTxO CurrentEra)
- loadLedgerStateNoSharing ∷ MonadUnliftIO m ⇒ Text → m (LedgerState CurrentEra)
- loadLedgerStateDStateSharing ∷ MonadUnliftIO m ⇒ Text → m (LedgerState CurrentEra)
- loadLedgerStateDStateTxIxSharing ∷ MonadUnliftIO m ⇒ Text → m (LedgerState CurrentEra, IntMap (Map TxId (TxOut CurrentEra)))
- storeEpochState ∷ MonadUnliftIO m ⇒ Text → EpochState CurrentEra → m ()
- loadDbUTxO ∷ UTxOFold a → Text → IO a
- esId ∷ Key EpochState
- loadEpochStateEntity ∷ MonadUnliftIO m ⇒ Text → m (Entity EpochState)
- getLedgerStateWithSharing ∷ ∀ (m ∷ Type → Type). (MonadUnliftIO m, MonadResource m) ⇒ Entity EpochState → ReaderT SqlBackend m (LedgerState CurrentEra)
- getLedgerStateNoSharing ∷ ∀ (m ∷ Type → Type). (MonadUnliftIO m, MonadResource m) ⇒ Entity EpochState → ReaderT SqlBackend m (LedgerState CurrentEra)
- loadEpochState ∷ MonadUnliftIO m ⇒ Text → m (EpochState CurrentEra)
- loadEpochStateWithSharing ∷ MonadUnliftIO m ⇒ Text → m (EpochState CurrentEra)
- loadSnapShotsNoSharing ∷ MonadUnliftIO m ⇒ Text → Entity EpochState → m (SnapShots era)
- loadSnapShotsWithSharing ∷ MonadUnliftIO m ⇒ Text → Entity EpochState → m (SnapShots era)
- loadSnapShotsNoSharingM ∷ Text → Entity EpochState → IO SnapShotsM
- loadSnapShotsWithSharingM ∷ Text → Entity EpochState → IO SnapShotsM
Documentation
insertGetKey ∷ ∀ (m ∷ Type → Type) backend record. (MonadIO m, PersistUniqueWrite backend, PersistRecordBackend record backend, AtLeastOneUniqueKey record, SafeToInsert record) ⇒ record → ReaderT backend m (Key record) Source #
insertUTxOState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ UTxOState CurrentEra → ReaderT SqlBackend m (Key UtxoState) Source #
insertUTxO ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ UTxO CurrentEra → Key UtxoState → ReaderT SqlBackend m () Source #
insertDState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ DState CurrentEra → ReaderT SqlBackend m DStateId Source #
insertLedgerState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ EpochStateId → LedgerState CurrentEra → ReaderT SqlBackend m () Source #
insertSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ SnapShot → SnapShot → ReaderT SqlBackend m () Source #
Insert a snapshot row together with the stake, delegation and pool rows shared by every phase. The phase-specific inserters build the row (with its Leios committee inputs) and delegate here for the common contents.
insertMarkSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key EpochState → MarkSnapShot → ReaderT SqlBackend m () Source #
insertSetSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key EpochState → SetSnapShot → ReaderT SqlBackend m () Source #
insertGoSnapShot ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key EpochState → GoSnapShot → ReaderT SqlBackend m () Source #
The go snapshot carries no Leios committee inputs of its own.
insertSnapShots ∷ ∀ (m ∷ Type → Type) era. MonadIO m ⇒ Key EpochState → SnapShots era → ReaderT SqlBackend m () Source #
insertEpochState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ EpochState CurrentEra → ReaderT SqlBackend m () Source #
selectVMap ∷ ∀ k record (kv ∷ Type → Type) (vv ∷ Type → Type) v (m ∷ Type → Type). (Ord k, PersistEntity record, PersistEntityBackend record ~ SqlBackend, Vector kv k, Vector vv v, MonadResource m) ⇒ [Filter record] → (record → ReaderT SqlBackend m (k, v)) → ReaderT SqlBackend m (VMap kv vv k v) Source #
getSnapShotNoSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Key EpochState → SnapShotType → ReaderT SqlBackend m SnapShotM Source #
getSnapShotWithSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ [SnapShotM] → Key EpochState → SnapShotType → ReaderT SqlBackend m SnapShotM Source #
getSnapShotsWithSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m SnapShotsM Source #
selectMap ∷ ∀ (m ∷ Type → Type) k record a. (MonadResource m, Ord k, PersistEntity record, PersistEntityBackend record ~ SqlBackend) ⇒ [Filter record] → (record → ReaderT SqlBackend m (k, a)) → ReaderT SqlBackend m (Map k a) Source #
getSnapShotNoSharing ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Key EpochState → SnapShotType → ReaderT SqlBackend m (SnapShot, Maybe EpochNo, Maybe Word16, Maybe LeiosCommittee) Source #
getSnapShotsNoSharing ∷ ∀ (m ∷ Type → Type) era. MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m (SnapShots era) Source #
getSnapShotsNoSharingM ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m SnapShotsM Source #
getSnapShotWithSharing ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ [SnapShot] → Key EpochState → SnapShotType → ReaderT SqlBackend m (SnapShot, Maybe EpochNo, Maybe Word16, Maybe LeiosCommittee) Source #
getSnapShotsWithSharing ∷ ∀ (m ∷ Type → Type) era. MonadResource m ⇒ Entity EpochState → ReaderT SqlBackend m (SnapShots era) Source #
sourceUTxO ∷ ∀ (m ∷ Type → Type). MonadResource m ⇒ ConduitM () (TxIn, TxOut CurrentEra) (ReaderT SqlBackend m) () Source #
sourceWithSharingUTxO ∷ ∀ (m ∷ Type → Type) a. MonadResource m ⇒ Map (Credential 'Staking) a → ConduitM () (TxIn, TxOut CurrentEra) (ReaderT SqlBackend m) () Source #
Arguments
| ∷ MonadUnliftIO m | |
| ⇒ (a → (TxIn, TxOut CurrentEra) → a) | Folding function |
| → a | Empty acc |
| → Text | Path to Sqlite db |
| → m a |
getLedgerState ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ UTxO CurrentEra → LedgerState → DState CurrentEra → ReaderT SqlBackend m (LedgerState CurrentEra) Source #
getDStateNoSharing ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key DState → ReaderT SqlBackend m (DState CurrentEra) Source #
getAccountsMap ∷ ∀ (m ∷ Type → Type) era (r' ∷ KeyRole). (MonadIO m, EraTest era) ⇒ DStateId → ReaderT SqlBackend m (Map (Credential r') (AccountState era)) Source #
getDStateWithSharing ∷ ∀ (m ∷ Type → Type). MonadIO m ⇒ Key DState → ReaderT SqlBackend m (DState CurrentEra) Source #
loadDStateNoSharing ∷ MonadUnliftIO m ⇒ Text → m (DState CurrentEra) Source #
loadUTxONoSharing ∷ MonadUnliftIO m ⇒ Text → m (UTxO CurrentEra) Source #
loadLedgerStateNoSharing ∷ MonadUnliftIO m ⇒ Text → m (LedgerState CurrentEra) Source #
loadLedgerStateDStateTxIxSharing ∷ MonadUnliftIO m ⇒ Text → m (LedgerState CurrentEra, IntMap (Map TxId (TxOut CurrentEra))) Source #
storeEpochState ∷ MonadUnliftIO m ⇒ Text → EpochState CurrentEra → m () Source #
esId ∷ Key EpochState Source #
loadEpochStateEntity ∷ MonadUnliftIO m ⇒ Text → m (Entity EpochState) Source #
getLedgerStateWithSharing ∷ ∀ (m ∷ Type → Type). (MonadUnliftIO m, MonadResource m) ⇒ Entity EpochState → ReaderT SqlBackend m (LedgerState CurrentEra) Source #
getLedgerStateNoSharing ∷ ∀ (m ∷ Type → Type). (MonadUnliftIO m, MonadResource m) ⇒ Entity EpochState → ReaderT SqlBackend m (LedgerState CurrentEra) Source #
loadEpochState ∷ MonadUnliftIO m ⇒ Text → m (EpochState CurrentEra) Source #
loadEpochStateWithSharing ∷ MonadUnliftIO m ⇒ Text → m (EpochState CurrentEra) Source #
loadSnapShotsNoSharing ∷ MonadUnliftIO m ⇒ Text → Entity EpochState → m (SnapShots era) Source #
loadSnapShotsWithSharing ∷ MonadUnliftIO m ⇒ Text → Entity EpochState → m (SnapShots era) Source #