cometa-0.1.0.0: Idiomatic Haskell bindings to cardano-c
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Documentation

data ProposedUpdates Source #

Unique 28-byte genesis key hashes and their sparse parameter changes. Equality is semantic; fresh encoding sorts by hash bytes.

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

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.

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.