Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ouroboros.Consensus.HardFork.Combinator.InjectTxs
Description
Injecting a transaction from one block type to another
Synopsis
- data InjectPolyTx (tx ∷ Type → Type) blk blk' = InjectPolyTx {
- injectTxWith ∷ tx blk → Maybe (tx blk')
- cannotInjectPolyTx ∷ ∀ (tx ∷ Type → Type) blk blk'. InjectPolyTx tx blk blk'
- matchPolyTx ∷ ∀ (xs ∷ [Type]) (tx ∷ Type → Type) (f ∷ Type → Type). SListI xs ⇒ InPairs (InjectPolyTx tx) xs → NS tx xs → HardForkState f xs → Either (Mismatch tx (Current f) xs) (HardForkState (Product tx f) xs)
- matchPolyTxsTele ∷ ∀ (tx ∷ Type → Type) (g ∷ Type → Type) (f ∷ Type → Type) (xs ∷ [Type]). SListI xs ⇒ InPairs (InjectPolyTx tx) xs → Telescope g f xs → [NS tx xs] → ([(NS tx xs, Mismatch tx f xs)], Telescope g (Product f ([] :.: tx)) xs)
- type InjectTx = InjectPolyTx GenTx
- cannotInjectTx ∷ InjectTx blk blk'
- matchTx ∷ ∀ (xs ∷ [Type]) (f ∷ Type → Type). SListI xs ⇒ InPairs InjectTx xs → NS GenTx xs → HardForkState f xs → Either (Mismatch GenTx (Current f) xs) (HardForkState (Product GenTx f) xs)
- pattern InjectTx ∷ (GenTx blk → Maybe (GenTx blk')) → InjectTx blk blk'
- type InjectValidatedTx = InjectPolyTx WrapValidatedGenTx
- cannotInjectValidatedTx ∷ InjectValidatedTx blk blk'
- matchValidatedTx ∷ ∀ (xs ∷ [Type]) (f ∷ Type → Type). SListI xs ⇒ InPairs InjectValidatedTx xs → NS WrapValidatedGenTx xs → HardForkState f xs → Either (Mismatch WrapValidatedGenTx (Current f) xs) (HardForkState (Product WrapValidatedGenTx f) xs)
- matchValidatedTxsNS ∷ ∀ (f ∷ Type → Type) (xs ∷ [Type]). SListI xs ⇒ InPairs InjectValidatedTx xs → NS f xs → [NS WrapValidatedGenTx xs] → ([Mismatch WrapValidatedGenTx f xs], NS (Product f ([] :.: WrapValidatedGenTx)) xs)
- pattern InjectValidatedTx ∷ (WrapValidatedGenTx blk → Maybe (WrapValidatedGenTx blk')) → InjectValidatedTx blk blk'
Polymorphic
data InjectPolyTx (tx ∷ Type → Type) blk blk' Source #
tx
is either GenTx
or WrapValidatedGenTx
See InjectTx
and InjectValidatedTx
, respectively.
Constructors
InjectPolyTx | |
Fields
|
cannotInjectPolyTx ∷ ∀ (tx ∷ Type → Type) blk blk'. InjectPolyTx tx blk blk' Source #
The injection that always fails
matchPolyTx ∷ ∀ (xs ∷ [Type]) (tx ∷ Type → Type) (f ∷ Type → Type). SListI xs ⇒ InPairs (InjectPolyTx tx) xs → NS tx xs → HardForkState f xs → Either (Mismatch tx (Current f) xs) (HardForkState (Product tx f) xs) Source #
matchPolyTxsTele ∷ ∀ (tx ∷ Type → Type) (g ∷ Type → Type) (f ∷ Type → Type) (xs ∷ [Type]). SListI xs ⇒ InPairs (InjectPolyTx tx) xs → Telescope g f xs → [NS tx xs] → ([(NS tx xs, Mismatch tx f xs)], Telescope g (Product f ([] :.: tx)) xs) Source #
Match a list of transactions with an Telescope
, attempting to inject
where possible
Unvalidated transactions
type InjectTx = InjectPolyTx GenTx Source #
cannotInjectTx ∷ InjectTx blk blk' Source #
cannotInjectPolyTx
at type InjectTx
matchTx ∷ ∀ (xs ∷ [Type]) (f ∷ Type → Type). SListI xs ⇒ InPairs InjectTx xs → NS GenTx xs → HardForkState f xs → Either (Mismatch GenTx (Current f) xs) (HardForkState (Product GenTx f) xs) Source #
matchPolyTx
at type InjectTx
pattern InjectTx ∷ (GenTx blk → Maybe (GenTx blk')) → InjectTx blk blk' Source #
InjectPolyTx
at type InjectTx
Validated transactions
cannotInjectValidatedTx ∷ InjectValidatedTx blk blk' Source #
cannotInjectPolyTx
at type InjectValidatedTx
matchValidatedTx ∷ ∀ (xs ∷ [Type]) (f ∷ Type → Type). SListI xs ⇒ InPairs InjectValidatedTx xs → NS WrapValidatedGenTx xs → HardForkState f xs → Either (Mismatch WrapValidatedGenTx (Current f) xs) (HardForkState (Product WrapValidatedGenTx f) xs) Source #
matchPolyTx
at type InjectValidatedTx
matchValidatedTxsNS ∷ ∀ (f ∷ Type → Type) (xs ∷ [Type]). SListI xs ⇒ InPairs InjectValidatedTx xs → NS f xs → [NS WrapValidatedGenTx xs] → ([Mismatch WrapValidatedGenTx f xs], NS (Product f ([] :.: WrapValidatedGenTx)) xs) Source #
matchPolyTxsNS
at type InjectValidatedTx
pattern InjectValidatedTx ∷ (WrapValidatedGenTx blk → Maybe (WrapValidatedGenTx blk')) → InjectValidatedTx blk blk' Source #
InjectPolyTx
at type InjectValidatedTx