Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test module where we check that the block validation implementation matches the formal specification. To this end, the strategy is:
- generate traces of abstract blocks, which conform to the formal semantics of the blockchain layer
- elaborate these abstract blocks into concrete blocks
- feed the generated sequence of concrete blocks to the block validation function, and check that it passes the validation.
Synopsis
- tests ∷ TSGroup
- elaborateAndUpdate ∷ Config → (ChainValidationState, AbstractToConcreteIdMaps) → (State CHAIN, Block) → Either ChainValidationError (ChainValidationState, AbstractToConcreteIdMaps)
- passConcreteValidation ∷ MonadTest m ⇒ Trace CHAIN → m ()
- elaborateBlock ∷ Config → ChainValidationState → AbstractToConcreteIdMaps → State CHAIN → Block → ABlock ByteString
Documentation
elaborateAndUpdate ∷ Config → (ChainValidationState, AbstractToConcreteIdMaps) → (State CHAIN, Block) → Either ChainValidationError (ChainValidationState, AbstractToConcreteIdMaps) Source #
Elaborate an abstract signal into a concrete one, and apply the validators to the elaborated signal and given concrete state. If the signal was validated, return the next state. Otherwise return an error.