Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Chain.Update.Validation.Registration
Description
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
{
- avNumSoftwareVersion :: ! NumSoftwareVersion
- avSlotNumber :: ! SlotNumber
- avMetadata :: ! Metadata
- 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
Constructors
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 #
Constructors
Environment | |
Fields |
State keeps track of registered protocol and software update proposals
Constructors
State | |
data ApplicationVersion Source #
Constructors
ApplicationVersion | |
Fields
|
Instances
data ProtocolUpdateProposal Source #
Constructors
ProtocolUpdateProposal | |
Fields |
Instances
data SoftwareUpdateProposal Source #
Constructors
SoftwareUpdateProposal | |
Fields |
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.
Constructors
TooLarge | |
Fields
|