Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Validation rules for registering updates
This is an implementation of the rules defined in the Byron ledger specification
Synopsis
- data Error
- = DuplicateProtocolVersion ProtocolVersion
- | DuplicateSoftwareVersion SoftwareVersion
- | InvalidProposer KeyHash
- | InvalidProtocolVersion ProtocolVersion Adopted
- | InvalidScriptVersion Word16 Word16
- | InvalidSignature
- | InvalidSoftwareVersion ApplicationVersions SoftwareVersion
- | MaxBlockSizeTooLarge (TooLarge Natural)
- | MaxTxSizeTooLarge (TooLarge Natural)
- | ProposalAttributesUnknown
- | ProposalTooLarge (TooLarge Natural)
- | SoftwareVersionError SoftwareVersionError
- | SystemTagError SystemTagError
- | NullUpdateProposal
- data Environment = Environment {}
- data State = State {}
- data ApplicationVersion = ApplicationVersion {}
- type ApplicationVersions = Map ApplicationName ApplicationVersion
- type Metadata = Map SystemTag InstallerHash
- data ProtocolUpdateProposal = ProtocolUpdateProposal {}
- type ProtocolUpdateProposals = Map UpId ProtocolUpdateProposal
- data SoftwareUpdateProposal = SoftwareUpdateProposal {}
- type SoftwareUpdateProposals = Map UpId SoftwareUpdateProposal
- registerProposal ∷ MonadError Error m ⇒ Environment → State → AProposal ByteString → m State
- data TooLarge n = TooLarge {
- tlActual ∷ n
- tlMaxBound ∷ n
- newtype Adopted = Adopted ProtocolVersion
Documentation
Error captures the ways in which registration could fail
DuplicateProtocolVersion ProtocolVersion | |
DuplicateSoftwareVersion SoftwareVersion | |
InvalidProposer KeyHash | |
InvalidProtocolVersion ProtocolVersion Adopted | |
InvalidScriptVersion Word16 Word16 | |
InvalidSignature | |
InvalidSoftwareVersion ApplicationVersions SoftwareVersion | |
MaxBlockSizeTooLarge (TooLarge Natural) | |
MaxTxSizeTooLarge (TooLarge Natural) | |
ProposalAttributesUnknown | |
ProposalTooLarge (TooLarge Natural) | |
SoftwareVersionError SoftwareVersionError | |
SystemTagError SystemTagError | |
NullUpdateProposal | The update proposal proposes neither a bump in the protocol or application versions. |
data Environment Source #
State keeps track of registered protocol and software update proposals
data ApplicationVersion Source #
Instances
data ProtocolUpdateProposal Source #
Instances
data SoftwareUpdateProposal Source #
Instances
registerProposal ∷ MonadError Error m ⇒ Environment → State → AProposal ByteString → m State Source #
Register an update proposal after verifying its signature and validating
its contents. This corresponds to the UPREG
rules in the spec.
TooLarge | |
|