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

Cometa.Governance.Proposal

Description

Governance proposals and their index-sensitive ordered collections. Assemble Proposal deposit rewardAccount action anchor from validated values. Deposit amounts are lovelace; current protocol requirements must be queried separately. This module does not submit or validate transactions.

Synopsis

Documentation

data Proposal Source #

Deposit, its return account, the proposed action and mandatory metadata.

Constructors

Proposal 

Fields

Instances

Instances details
Show Proposal Source # 
Instance details

Defined in Cometa.Governance.Proposal

Eq Proposal Source # 
Instance details

Defined in Cometa.Governance.Proposal

data Proposals Source #

Ordered proposals. Position determines proposal identity; duplicates and empty collections are retained.

Instances

Instances details
Show Proposals Source # 
Instance details

Defined in Cometa.Governance.Proposal

Eq Proposals Source # 
Instance details

Defined in Cometa.Governance.Proposal

fromList :: [Proposal] -> Proposals Source #

Preserve all proposals in input order, including duplicates.

toList :: Proposals -> [Proposal] Source #

Proposals in their index order.

empty :: Proposals Source #

No proposals.

append :: Proposals -> Proposals -> Proposals Source #

Append without sorting or deduplication. Associative, with empty as identity.

encodeCbor :: Proposal -> ByteString Source #

Fresh definite CBOR with shortest deposit encoding.

decodeCbor :: ByteString -> Either Error EncodedProposal Source #

Decode one complete proposal and retain exact original bytes. Malformed fields, non-reward return addresses or trailing bytes return InvalidProposalCbor.

fromProposal :: Proposal -> EncodedProposal Source #

Assign fresh CBOR to a proposal.

toProposal :: EncodedProposal -> Proposal Source #

Inspect the proposal while retaining its encoded wrapper unchanged.

toCbor :: EncodedProposal -> ByteString Source #

Exact imported bytes or fresh bytes assigned by fromProposal.

data EncodedProposals Source #

An ordered collection retaining exact imported bytes, including tag presence. Equality and ordering compare those bytes; semantic inspection uses toProposals.

encodeProposals :: Proposals -> ByteString Source #

Fresh tag-258 definite array, preserving proposal order and duplicates.

encodeProposalsWith :: SetEncoding -> Proposals -> ByteString Source #

Fresh definite collection with the requested outer tag. Nested proposals keep their usual encoding; order and duplicates are retained.

setEncoding :: EncodedProposals -> SetEncoding Source #

Observe the exact proposal collection's outer set tag.

withSetEncoding :: SetEncoding -> EncodedProposals -> EncodedProposals Source #

Change only the outer tag, retaining every array and proposal byte. Requesting the current representation preserves the complete encoding exactly.

decodeProposals :: ByteString -> Either Error EncodedProposals Source #

Decode a tagged or untagged collection with definite or indefinite array. Order and duplicates are preserved; invalid schema returns InvalidProposalCbor. Exact original bytes are retained.

fromProposals :: Proposals -> EncodedProposals Source #

Assign fresh CBOR to an ordered proposal collection.

toProposals :: EncodedProposals -> Proposals Source #

Inspect proposals in index order without changing retained CBOR.

proposalsCbor :: EncodedProposals -> ByteString Source #

Exact imported collection CBOR, or fresh encoding from fromProposals.