| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Protocol.ProposedUpdates
Description
Legacy genesis-authorized protocol update proposals. These envelopes are
distinct from Conway parameter-change governance actions. Validate input hashes
once, then collect changes with fromList and assemble UpdateProposal epoch changes.
Synopsis
- data ProposedUpdates
- empty :: ProposedUpdates
- fromList :: [(KeyHash Genesis, Update)] -> Either Error ProposedUpdates
- toList :: ProposedUpdates -> [(KeyHash Genesis, Update)]
- data UpdateProposal = UpdateProposal {}
- data EncodedUpdates
- encodeCbor :: ProposedUpdates -> ByteString
- decodeCbor :: ByteString -> Either Error EncodedUpdates
- toUpdates :: EncodedUpdates -> ProposedUpdates
- toCbor :: EncodedUpdates -> ByteString
- data EncodedProposal
- encodeProposal :: UpdateProposal -> ByteString
- decodeProposal :: ByteString -> Either Error EncodedProposal
- toProposal :: EncodedProposal -> UpdateProposal
- proposalCbor :: EncodedProposal -> ByteString
Documentation
data ProposedUpdates Source #
Unique 28-byte genesis key hashes and their sparse parameter changes. Equality is semantic; fresh encoding sorts by hash bytes.
Instances
| Show ProposedUpdates Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods showsPrec :: Int -> ProposedUpdates -> ShowS # show :: ProposedUpdates -> String # showList :: [ProposedUpdates] -> ShowS # | |
| Eq ProposedUpdates Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods (==) :: ProposedUpdates -> ProposedUpdates -> Bool # (/=) :: ProposedUpdates -> ProposedUpdates -> Bool # | |
empty :: ProposedUpdates Source #
No proposed changes.
fromList :: [(KeyHash Genesis, Update)] -> Either Error ProposedUpdates Source #
Validate unique genesis hashes. Repeated keys return DuplicateProtocolUpdate
even when their updates agree, rather than silently discarding an instruction.
toList :: ProposedUpdates -> [(KeyHash Genesis, Update)] Source #
Entries sorted by exact genesis hash bytes.
data UpdateProposal Source #
Proposed changes and their activation epoch (unsigned 64-bit). Assembly does not establish era eligibility or authorization.
Constructors
| UpdateProposal | |
Fields
| |
Instances
| Show UpdateProposal Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods showsPrec :: Int -> UpdateProposal -> ShowS # show :: UpdateProposal -> String # showList :: [UpdateProposal] -> ShowS # | |
| Eq UpdateProposal Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods (==) :: UpdateProposal -> UpdateProposal -> Bool # (/=) :: UpdateProposal -> UpdateProposal -> Bool # | |
data EncodedUpdates Source #
Exact map bytes with semantic changes. Equality and ordering compare bytes.
Instances
| Show EncodedUpdates Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods showsPrec :: Int -> EncodedUpdates -> ShowS # show :: EncodedUpdates -> String # showList :: [EncodedUpdates] -> ShowS # | |
| Eq EncodedUpdates Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods (==) :: EncodedUpdates -> EncodedUpdates -> Bool # (/=) :: EncodedUpdates -> EncodedUpdates -> Bool # | |
| Ord EncodedUpdates Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods compare :: EncodedUpdates -> EncodedUpdates -> Ordering # (<) :: EncodedUpdates -> EncodedUpdates -> Bool # (<=) :: EncodedUpdates -> EncodedUpdates -> Bool # (>) :: EncodedUpdates -> EncodedUpdates -> Bool # (>=) :: EncodedUpdates -> EncodedUpdates -> Bool # max :: EncodedUpdates -> EncodedUpdates -> EncodedUpdates # min :: EncodedUpdates -> EncodedUpdates -> EncodedUpdates # | |
encodeCbor :: ProposedUpdates -> ByteString Source #
Fresh definite map, with sorted hashes and fresh sparse update encodings.
decodeCbor :: ByteString -> Either Error EncodedUpdates Source #
Decode one complete map and retain original bytes. Duplicate hashes,
incorrect hash lengths, invalid updates and trailing bytes return
InvalidProposalCbor.
toUpdates :: EncodedUpdates -> ProposedUpdates Source #
Inspect semantic changes without altering the exact encoding.
toCbor :: EncodedUpdates -> ByteString Source #
Exact imported update-map CBOR.
data EncodedProposal Source #
Exact proposal bytes with semantic epoch and changes. Equality and ordering compare encoded bytes, not semantic data.
Instances
| Show EncodedProposal Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods showsPrec :: Int -> EncodedProposal -> ShowS # show :: EncodedProposal -> String # showList :: [EncodedProposal] -> ShowS # | |
| Eq EncodedProposal Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods (==) :: EncodedProposal -> EncodedProposal -> Bool # (/=) :: EncodedProposal -> EncodedProposal -> Bool # | |
| Ord EncodedProposal Source # | |
Defined in Cometa.Protocol.ProposedUpdates Methods compare :: EncodedProposal -> EncodedProposal -> Ordering # (<) :: EncodedProposal -> EncodedProposal -> Bool # (<=) :: EncodedProposal -> EncodedProposal -> Bool # (>) :: EncodedProposal -> EncodedProposal -> Bool # (>=) :: EncodedProposal -> EncodedProposal -> Bool # max :: EncodedProposal -> EncodedProposal -> EncodedProposal # min :: EncodedProposal -> EncodedProposal -> EncodedProposal # | |
encodeProposal :: UpdateProposal -> ByteString Source #
Fresh definite [changes, epoch] array with shortest integers.
decodeProposal :: ByteString -> Either Error EncodedProposal Source #
Decode a complete legacy proposal and retain exact bytes. Invalid schema
or trailing bytes returns InvalidProposalCbor.
toProposal :: EncodedProposal -> UpdateProposal Source #
Inspect activation epoch and changes without altering retained bytes.
proposalCbor :: EncodedProposal -> ByteString Source #
Exact imported legacy proposal CBOR.