cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Copyright © 2022 IOHK
License Apache-2.0
Safe Haskell None
Language Haskell2010

Cardano.Wallet.Primitive.BlockSummary

Description

This module provides the BlockSummary type which summarizes a contiguous sequence of blocks.

Synopsis

Documentation

data BlockSummary m addr txs Source #

A BlockSummary summarizes the data contained in a contiguous sequence of blocks.

However, instead of storing the sequence of blocks of directly as a Haskell list, the BlockSummary only provides a $sel:query:BlockSummary function which looks up all transactions associated to a given addresses. In addition, this query function is monadic, which means that it can call out to an external data source.

Constructors

BlockSummary

Fields

Instances

Instances details
Generic ( BlockSummary m addr txs) Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Associated Types

type Rep ( BlockSummary m addr txs) :: Type -> Type Source #

type Rep ( BlockSummary m addr txs) Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

type Rep ( BlockSummary m addr txs) = D1 (' MetaData "BlockSummary" "Cardano.Wallet.Primitive.BlockSummary" "cardano-wallet-core-2022.7.1-AGKhlyz9liLKN3QqZD1gj" ' False ) ( C1 (' MetaCons "BlockSummary" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "from") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 BlockHeader ) :*: ( S1 (' MetaSel (' Just "to") ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 BlockHeader ) :*: S1 (' MetaSel (' Just "query") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 (addr -> m txs)))))

Chain Events

data ChainEvents Source #

BlockEvents , always ordered by slot.

fromBlockEvents :: [ BlockEvents ] -> ChainEvents Source #

Create ChainEvents from a list of block events (which do not need to be in order.)

toAscBlockEvents :: ChainEvents -> [ BlockEvents ] Source #

List of BlockEvents , in ascending order. (No duplicate blocks, all transactions within block in order).

Block Events

data BlockEvents Source #

Events (such as txs, delegations) within a single block that are potentially relevant to the wallet. This can be the entire block, or a pre-filtered version of it.

Constructors

BlockEvents

Fields

Instances

Instances details
Eq BlockEvents Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Ord BlockEvents Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Show BlockEvents Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Generic BlockEvents Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

type Rep BlockEvents Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Sublist

data Sublist a Source #

A data type representing a sublist of a total list. Such a sublist typically arises by filtering and keeps track of the indices of the filtered list elements.

In order to represent sublists of DelegationCertificate , we do not use a single Int , but a pair (Index1,Index2) as index internally. This internal index is not part of the (safe) API of Sublist .

The main purpose of this data type is optimization: When processing whole Block , we want to avoid copying and redecorating the entire list of transactions in that Block ; instead, we want to copy a pointer to this list.

Instances

Instances details
Functor Sublist Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Foldable Sublist Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Eq a => Eq ( Sublist a) Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Ord a => Ord ( Sublist a) Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

Show a => Show ( Sublist a) Source #
Instance details

Defined in Cardano.Wallet.Primitive.BlockSummary

filterSublist :: (a -> Bool ) -> Sublist a -> Sublist a Source #

Filter a Sublist by a predicate.

wholeList :: [a] -> Sublist a Source #

Construct a Sublist representing the whole list.

Internal & Testing

summarizeOnTxOut :: NonEmpty Block -> LightSummary Identity Source #

For testing: Convert a list of blocks into a BlockSummary . Unfortunately, as TxIn references are not resolved, we can only find transactions with relevant TxOut .

mergeSublist :: Sublist a -> Sublist a -> Sublist a Source #

Merge two Sublist assuming that they are sublists of the same list.

unsafeMkSublist :: [((Index1, Index2), a)] -> Sublist a Source #

Construct a Sublist from a list of indexed items.