| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Singular.Registry.TrieState.Types
Description
Shared capability representations. Certificate and proof constructors stay inside the implementation; the public module exposes only observers.
Synopsis
- newtype StatePolicyId = StatePolicyId ByteString
- data RegistryIdentity = RegistryIdentity StatePolicyId AssetName
- newtype SessionId = SessionId Text
- data SessionBinding
- data StatePoint = StatePoint {
- pointSession :: SessionId
- pointBinding :: SessionBinding
- pointOutput :: TxIn
- data TrieSelection = TrieSelection {}
- data TrieState (m :: Type -> Type) = TrieState {
- withTrieState :: forall a. TrieSelection -> (TrieSnapshot m -> m a) -> m (Either TrieFailure a)
- acceptObservedFold :: ObservedFold -> m (Either TrieFailure ())
- data TrieSnapshot (m :: Type -> Type) = TrieSnapshot {
- snapshotTrieIdentity :: RegistryIdentity
- snapshotTriePoint :: StatePoint
- snapshotTrieRoot :: Root
- snapshotTrieCoverage :: CompleteFromCreate
- snapshotTrieLineage :: Maybe PublicLineage
- snapshotLeafAt :: ByteString -> m (Either TrieFailure Leaf)
- snapshotMembership :: ByteString -> Leaf -> m (Either TrieFailure MembershipProof)
- snapshotNonMembership :: ByteString -> m (Either TrieFailure NonMembershipProof)
- snapshotSpeculateEdges :: NonEmpty (ByteString, Integer) -> m (Either TrieFailure SpeculativeWalk)
- data Leaf
- leafName :: Leaf -> Text
- leafBytes :: Leaf -> ByteString
- data TrieFailure
- = HistoryIncomplete RegistryIdentity (Maybe TxId) Incomplete
- | RootDoesNotChain RegistryIdentity (Maybe TxId) Parting
- | UndecodableRequest RegistryIdentity (Maybe TxId) Undecodable
- | WrongRegistry RegistryIdentity (Maybe TxId) Mismatch
- | StaleState RegistryIdentity (Maybe TxId) Staleness
- | MissingProof RegistryIdentity Missing
- data Parting
- = RootsPart Root Root
- | UnreadableRoot Text
- data Incomplete
- = MissingTransaction
- | ProviderHistoryFailure HistoryFailure
- | UnresolvedInput TxIn
- | ConflictingResolution TxIn
- | ConflictingCopies
- | NoStateInput
- | ForkedStateOutput TxIn
- | OutsideLineage
- data Undecodable
- = UndecodableStateOutput
- | MissingRedeemer
- | NotModify
- | ActionCount Int Int
- | EdgeOutOfRange Integer
- | UnreadableRecord Text
- data Mismatch
- data Staleness
- = StaleRoot Root Root
- | StaleSelection TrieSelection TrieSelection
- | StaleOutput TxIn TxIn
- | NoSelection
- data Missing
- = NoProofFor ByteString
- | NoLocalTrie
- newtype CompleteFromCreate = CompleteFromCreate {
- coverageTransitions :: Int
- data PublicLineage = PublicLineage {
- lineageCreate :: TxId
- lineageFolds :: [TxId]
- lineageKeys :: [ByteString]
- newtype MembershipProof = MembershipProof {
- membershipBytes :: ByteString
- data NonMembershipProof = NonMembershipProof ByteString (MPFExclusionProof MPFHash)
- data SpeculativeWalk = SpeculativeWalk {
- walkRoot :: Root
- walkProofs :: [[ProofStep]]
- data CreateRecord = CreateRecord RegistryIdentity TxIn
- data ObservedFold = ObservedFold TrieSelection TrieSelection (NonEmpty (ByteString, Integer))
- data TrieObservation
- = Created TrieSelection
- | Selected TrieSelection
- | LeafRead TrieSelection ByteString Leaf
- | MemberProved TrieSelection ByteString Leaf ByteString
- | AbsenceProved TrieSelection ByteString
- | Speculated TrieSelection SpeculativeWalk
- | FoldAccepted TrieSelection TrieSelection
Documentation
newtype StatePolicyId Source #
Constructors
| StatePolicyId ByteString |
Instances
| Show StatePolicyId Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> StatePolicyId -> ShowS Source # show :: StatePolicyId -> String Source # showList :: [StatePolicyId] -> ShowS Source # | |
| Eq StatePolicyId Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: StatePolicyId -> StatePolicyId -> Bool Source # (/=) :: StatePolicyId -> StatePolicyId -> Bool Source # | |
| Ord StatePolicyId Source # | |
Defined in Singular.Registry.TrieState.Types Methods compare :: StatePolicyId -> StatePolicyId -> Ordering Source # (<) :: StatePolicyId -> StatePolicyId -> Bool Source # (<=) :: StatePolicyId -> StatePolicyId -> Bool Source # (>) :: StatePolicyId -> StatePolicyId -> Bool Source # (>=) :: StatePolicyId -> StatePolicyId -> Bool Source # max :: StatePolicyId -> StatePolicyId -> StatePolicyId Source # min :: StatePolicyId -> StatePolicyId -> StatePolicyId Source # | |
data RegistryIdentity Source #
Constructors
| RegistryIdentity StatePolicyId AssetName |
Instances
| Show RegistryIdentity Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> RegistryIdentity -> ShowS Source # show :: RegistryIdentity -> String Source # showList :: [RegistryIdentity] -> ShowS Source # | |
| Eq RegistryIdentity Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: RegistryIdentity -> RegistryIdentity -> Bool Source # (/=) :: RegistryIdentity -> RegistryIdentity -> Bool Source # | |
| Ord RegistryIdentity Source # | |
Defined in Singular.Registry.TrieState.Types Methods compare :: RegistryIdentity -> RegistryIdentity -> Ordering Source # (<) :: RegistryIdentity -> RegistryIdentity -> Bool Source # (<=) :: RegistryIdentity -> RegistryIdentity -> Bool Source # (>) :: RegistryIdentity -> RegistryIdentity -> Bool Source # (>=) :: RegistryIdentity -> RegistryIdentity -> Bool Source # max :: RegistryIdentity -> RegistryIdentity -> RegistryIdentity Source # min :: RegistryIdentity -> RegistryIdentity -> RegistryIdentity Source # | |
Constructors
| SessionId Text |
Instances
| Show SessionId # | |
Defined in Singular.Registry.Evidence | |
| Eq SessionId # | |
Defined in Singular.Registry.Evidence | |
| Ord SessionId # | |
Defined in Singular.Registry.Evidence | |
data SessionBinding #
Instances
| Show SessionBinding # | |
Defined in Singular.Registry.Evidence Methods showsPrec :: Int -> SessionBinding -> ShowS Source # show :: SessionBinding -> String Source # showList :: [SessionBinding] -> ShowS Source # | |
| Eq SessionBinding # | |
Defined in Singular.Registry.Evidence Methods (==) :: SessionBinding -> SessionBinding -> Bool Source # (/=) :: SessionBinding -> SessionBinding -> Bool Source # | |
data StatePoint Source #
Constructors
| StatePoint | |
Fields
| |
Instances
| Show StatePoint Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> StatePoint -> ShowS Source # show :: StatePoint -> String Source # showList :: [StatePoint] -> ShowS Source # | |
| Eq StatePoint Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: StatePoint -> StatePoint -> Bool Source # (/=) :: StatePoint -> StatePoint -> Bool Source # | |
data TrieSelection Source #
Constructors
| TrieSelection | |
Fields | |
Instances
| Show TrieSelection Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> TrieSelection -> ShowS Source # show :: TrieSelection -> String Source # showList :: [TrieSelection] -> ShowS Source # | |
| Eq TrieSelection Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: TrieSelection -> TrieSelection -> Bool Source # (/=) :: TrieSelection -> TrieSelection -> Bool Source # | |
data TrieState (m :: Type -> Type) Source #
Constructors
| TrieState | |
Fields
| |
data TrieSnapshot (m :: Type -> Type) Source #
Constructors
| TrieSnapshot | |
Fields
| |
Instances
| Bounded Leaf Source # | |
Defined in Singular.Registry.TrieState.Types | |
| Enum Leaf Source # | |
| Show Leaf Source # | |
Defined in Singular.Registry.TrieState.Types | |
| Eq Leaf Source # | |
Defined in Singular.Registry.TrieState.Types | |
data TrieFailure Source #
Why a registry's trie cannot be served, naming what a person needs to act on it: the registry, the transaction where one is known, and the reason. A backend passes what it knows and never invents the rest.
Constructors
| HistoryIncomplete RegistryIdentity (Maybe TxId) Incomplete | The history does not reach the selection from |
| RootDoesNotChain RegistryIdentity (Maybe TxId) Parting | A rebuilt root is not the recorded one, or a recorded root cannot be read. |
| UndecodableRequest RegistryIdentity (Maybe TxId) Undecodable | A fold's redeemer, actions, state output or edges cannot be read. |
| WrongRegistry RegistryIdentity (Maybe TxId) Mismatch | The material is another registry's, or not this registry's state. |
| StaleState RegistryIdentity (Maybe TxId) Staleness | The selection is not the state the trie is served at. |
| MissingProof RegistryIdentity Missing | No proof can be given. |
Instances
| Show TrieFailure Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> TrieFailure -> ShowS Source # show :: TrieFailure -> String Source # showList :: [TrieFailure] -> ShowS Source # | |
| Eq TrieFailure Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: TrieFailure -> TrieFailure -> Bool Source # (/=) :: TrieFailure -> TrieFailure -> Bool Source # | |
How a rebuilt root parts from the recorded one.
Constructors
| RootsPart Root Root | The rebuilt root is not the recorded root: rebuilt, recorded. |
| UnreadableRoot Text | A recorded root cannot be read; the text says which. |
Instances
| Show Parting Source # | |
Defined in Singular.Registry.TrieState.Types | |
| Eq Parting Source # | |
Defined in Singular.Registry.TrieState.Types | |
data Incomplete Source #
How a history falls short of the lineage.
Constructors
| MissingTransaction | A transaction the lineage spends through is not in the history. |
| ProviderHistoryFailure HistoryFailure | The acquired provider refused reconstruction; every datum is retained. |
| UnresolvedInput TxIn | A spent input is resolved neither by the history nor by the map. |
| ConflictingResolution TxIn | The map resolves an input differently from the transaction that made it. |
| ConflictingCopies | Two different transactions share one identifier. |
| NoStateInput | A transaction holds the token but spends no state output and mints none. |
| ForkedStateOutput TxIn | A state output is spent by two different transactions. |
| OutsideLineage | A transaction touches the token outside the lineage. |
Instances
| Show Incomplete Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> Incomplete -> ShowS Source # show :: Incomplete -> String Source # showList :: [Incomplete] -> ShowS Source # | |
| Eq Incomplete Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: Incomplete -> Incomplete -> Bool Source # (/=) :: Incomplete -> Incomplete -> Bool Source # | |
data Undecodable Source #
What of a fold cannot be read.
Constructors
| UndecodableStateOutput | The state output carries no inline state datum, or is not first. |
| MissingRedeemer | The state input's spend carries no redeemer. |
| NotModify | The state input's redeemer is not |
| ActionCount Int Int | Actions given and matching requests found differ in number. |
| EdgeOutOfRange Integer | An edge outside the seven the registry defines. |
| UnreadableRecord Text | A local record the history is read from cannot be read; the text says what. |
Instances
| Show Undecodable Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> Undecodable -> ShowS Source # show :: Undecodable -> String Source # showList :: [Undecodable] -> ShowS Source # | |
| Eq Undecodable Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: Undecodable -> Undecodable -> Bool Source # (/=) :: Undecodable -> Undecodable -> Bool Source # | |
How the material differs from the selected registry.
Constructors
| SelectionNotState | The output read as the state does not hold exactly the registry's token. |
| CreateMint |
|
| SeedNotSpent |
|
| SeedName | The token's name is not |
| CreateOutput |
|
| OtherRegistry RegistryIdentity | The material names this other registry. |
| UnknownRegistry | Nothing is held for the registry. |
Instances
| Show Mismatch Source # | |
Defined in Singular.Registry.TrieState.Types | |
| Eq Mismatch Source # | |
Defined in Singular.Registry.TrieState.Types | |
How the selection differs from the state the trie is served at.
Constructors
| StaleRoot Root Root | The selection's root is not the root at its output: selected, at the output. |
| StaleSelection TrieSelection TrieSelection | The selection is not the one held: selected, held. |
| StaleOutput TxIn TxIn | The selected output is not the output the history makes: selected, made. |
| NoSelection | No selection has been made, or the live state could not be read. |
Instances
| Show Staleness Source # | |
Defined in Singular.Registry.TrieState.Types | |
| Eq Staleness Source # | |
Defined in Singular.Registry.TrieState.Types | |
What no proof can be given for.
Constructors
| NoProofFor ByteString | The key no proof binds under the selected root. |
| NoLocalTrie | No local trie is held for the registry. |
Instances
| Show Missing Source # | |
Defined in Singular.Registry.TrieState.Types | |
| Eq Missing Source # | |
Defined in Singular.Registry.TrieState.Types | |
newtype CompleteFromCreate Source #
Constructors
| CompleteFromCreate | |
Fields
| |
Instances
| Show CompleteFromCreate Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> CompleteFromCreate -> ShowS Source # show :: CompleteFromCreate -> String Source # showList :: [CompleteFromCreate] -> ShowS Source # | |
| Eq CompleteFromCreate Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: CompleteFromCreate -> CompleteFromCreate -> Bool Source # (/=) :: CompleteFromCreate -> CompleteFromCreate -> Bool Source # | |
data PublicLineage Source #
A replayed registry's public lineage: the transaction that minted
its state token, every fold from create to the selection in chain
order, and the distinct keys the applied updates named, ascending.
Constructors
| PublicLineage | |
Fields
| |
Instances
| Show PublicLineage Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> PublicLineage -> ShowS Source # show :: PublicLineage -> String Source # showList :: [PublicLineage] -> ShowS Source # | |
| Eq PublicLineage Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: PublicLineage -> PublicLineage -> Bool Source # (/=) :: PublicLineage -> PublicLineage -> Bool Source # | |
newtype MembershipProof Source #
Constructors
| MembershipProof | |
Fields
| |
Instances
| Show MembershipProof Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> MembershipProof -> ShowS Source # show :: MembershipProof -> String Source # showList :: [MembershipProof] -> ShowS Source # | |
| Eq MembershipProof Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: MembershipProof -> MembershipProof -> Bool Source # (/=) :: MembershipProof -> MembershipProof -> Bool Source # | |
data NonMembershipProof Source #
Constructors
| NonMembershipProof ByteString (MPFExclusionProof MPFHash) |
data SpeculativeWalk Source #
Constructors
| SpeculativeWalk | |
Fields
| |
Instances
| Show SpeculativeWalk Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> SpeculativeWalk -> ShowS Source # show :: SpeculativeWalk -> String Source # showList :: [SpeculativeWalk] -> ShowS Source # | |
| Eq SpeculativeWalk Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: SpeculativeWalk -> SpeculativeWalk -> Bool Source # (/=) :: SpeculativeWalk -> SpeculativeWalk -> Bool Source # | |
data CreateRecord Source #
Constructors
| CreateRecord RegistryIdentity TxIn |
Instances
| Show CreateRecord Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> CreateRecord -> ShowS Source # show :: CreateRecord -> String Source # showList :: [CreateRecord] -> ShowS Source # | |
| Eq CreateRecord Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: CreateRecord -> CreateRecord -> Bool Source # (/=) :: CreateRecord -> CreateRecord -> Bool Source # | |
data ObservedFold Source #
Constructors
| ObservedFold TrieSelection TrieSelection (NonEmpty (ByteString, Integer)) |
Instances
| Show ObservedFold Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> ObservedFold -> ShowS Source # show :: ObservedFold -> String Source # showList :: [ObservedFold] -> ShowS Source # | |
| Eq ObservedFold Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: ObservedFold -> ObservedFold -> Bool Source # (/=) :: ObservedFold -> ObservedFold -> Bool Source # | |
data TrieObservation Source #
Completed operations, emitted by the same engine that returned their values or persisted their accepted nodes.
Constructors
| Created TrieSelection | |
| Selected TrieSelection | |
| LeafRead TrieSelection ByteString Leaf | |
| MemberProved TrieSelection ByteString Leaf ByteString | |
| AbsenceProved TrieSelection ByteString | |
| Speculated TrieSelection SpeculativeWalk | |
| FoldAccepted TrieSelection TrieSelection |
Instances
| Show TrieObservation Source # | |
Defined in Singular.Registry.TrieState.Types Methods showsPrec :: Int -> TrieObservation -> ShowS Source # show :: TrieObservation -> String Source # showList :: [TrieObservation] -> ShowS Source # | |
| Eq TrieObservation Source # | |
Defined in Singular.Registry.TrieState.Types Methods (==) :: TrieObservation -> TrieObservation -> Bool Source # (/=) :: TrieObservation -> TrieObservation -> Bool Source # | |