Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Marconi.Cardano.Indexers.EpochSDD
Description
Store SDD in a SQLIte table
Synopsis
- data EpochSDD = EpochSDD !EpochNo !PoolId !Lovelace !BlockNo
- sddEpochNo :: Lens' EpochSDD EpochNo
- sddPoolId :: Lens' EpochSDD PoolId
- sddLovelace :: Lens' EpochSDD Lovelace
- sddBlockNo :: Lens' EpochSDD BlockNo
- mkEpochSDDIndexer :: (MonadIO m, MonadError IndexerError m) => SQLiteDBLocation -> m (SQLiteIndexer (NonEmpty EpochSDD))
- newtype EpochSDDWorkerConfig input = EpochSDDWorkerConfig {
- epochSDDWorkerConfigExtractor :: input -> EpochNo
- epochSDDWorker :: forall input m n. (MonadIO m, MonadError IndexerError m, MonadIO n) => StandardWorkerConfig n input (NonEmpty EpochSDD) -> EpochSDDWorkerConfig input -> SQLiteDBLocation -> m (WorkerIndexer n input (NonEmpty EpochSDD) (WithTrace n SQLiteIndexer))
- newtype ActiveSDDByEpochNoQuery = ActiveSDDByEpochNoQuery EpochNo
- getEpochSDD :: ExtLedgerStateEvent -> Maybe (NonEmpty EpochSDD)
Event types and lenses
Event for SDD
storage
Instances
sddEpochNo :: Lens' EpochSDD EpochNo #
sddLovelace :: Lens' EpochSDD Lovelace #
sddBlockNo :: Lens' EpochSDD BlockNo #
Create an indexer
mkEpochSDDIndexer :: (MonadIO m, MonadError IndexerError m) => SQLiteDBLocation -> m (SQLiteIndexer (NonEmpty EpochSDD)) #
Smart constructor that creates a FileIndexer
that stores SDD.
Create a worker
newtype EpochSDDWorkerConfig input #
Constructors
EpochSDDWorkerConfig | |
Fields
|
epochSDDWorker :: forall input m n. (MonadIO m, MonadError IndexerError m, MonadIO n) => StandardWorkerConfig n input (NonEmpty EpochSDD) -> EpochSDDWorkerConfig input -> SQLiteDBLocation -> m (WorkerIndexer n input (NonEmpty EpochSDD) (WithTrace n SQLiteIndexer)) #
Queries
newtype ActiveSDDByEpochNoQuery #
Constructors
ActiveSDDByEpochNoQuery EpochNo |
Instances
FromJSON ActiveSDDByEpochNoQuery # | |
Defined in Marconi.Cardano.Indexers.EpochSDD Methods parseJSON :: Value -> Parser ActiveSDDByEpochNoQuery parseJSONList :: Value -> Parser [ActiveSDDByEpochNoQuery] | |
ToJSON ActiveSDDByEpochNoQuery # | |
Defined in Marconi.Cardano.Indexers.EpochSDD Methods toJSON :: ActiveSDDByEpochNoQuery -> Value toEncoding :: ActiveSDDByEpochNoQuery -> Encoding toJSONList :: [ActiveSDDByEpochNoQuery] -> Value toEncodingList :: [ActiveSDDByEpochNoQuery] -> Encoding | |
(MonadIO m, MonadError (QueryError ActiveSDDByEpochNoQuery) m) => Queryable m event ActiveSDDByEpochNoQuery SQLiteIndexer # | |
Defined in Marconi.Cardano.Indexers.EpochSDD Methods query :: Point event -> ActiveSDDByEpochNoQuery -> SQLiteIndexer event -> m (Result ActiveSDDByEpochNoQuery) Source # queryLatest :: ActiveSDDByEpochNoQuery -> SQLiteIndexer event -> m (Result ActiveSDDByEpochNoQuery) Source # | |
type Result ActiveSDDByEpochNoQuery # | |
Defined in Marconi.Cardano.Indexers.EpochSDD |
Extract event
getEpochSDD :: ExtLedgerStateEvent -> Maybe (NonEmpty EpochSDD) #