| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Governance.Action
Description
Seven governance action alternatives assembled from validated components.
For example, NoConfidence Nothing starts a new committee confidence chain.
These values describe proposals; they do not establish ledger eligibility.
Synopsis
- data Action
- = ParameterChange !(Maybe ActionId) !Update !(Maybe ScriptHash)
- | HardForkInitiation !(Maybe ActionId) !ProtocolVersion
- | TreasuryWithdrawals !Withdrawals !(Maybe ScriptHash)
- | NoConfidence !(Maybe ActionId)
- | UpdateCommittee !(Maybe ActionId) !Removals !Members !UnitInterval
- | NewConstitution !(Maybe ActionId) !Constitution
- | InfoAction
- data Removals
- removalsFromList :: [Credential CommitteeCold] -> Removals
- removalsToList :: Removals -> [Credential CommitteeCold]
- data EncodedRemovals
- encodeRemovals :: Removals -> ByteString
- encodeRemovalsWith :: SetEncoding -> Removals -> ByteString
- decodeRemovals :: ByteString -> Either Error EncodedRemovals
- fromRemovals :: Removals -> EncodedRemovals
- toRemovals :: EncodedRemovals -> Removals
- removalsCbor :: EncodedRemovals -> ByteString
- removalsSetEncoding :: EncodedRemovals -> SetEncoding
- withRemovalsSetEncoding :: SetEncoding -> EncodedRemovals -> EncodedRemovals
- data Withdrawals
- withdrawalsFromList :: [(RewardAddress, Word64)] -> Either Error Withdrawals
- withdrawalsToList :: Withdrawals -> [(RewardAddress, Word64)]
- data EncodedAction
- encodeCbor :: Action -> ByteString
- decodeCbor :: ByteString -> Either Error EncodedAction
- fromAction :: Action -> EncodedAction
- toAction :: EncodedAction -> Action
- toCbor :: EncodedAction -> ByteString
Documentation
A governance action. Optional predecessors reference the preceding action
of the corresponding purpose; Nothing starts a chain. Optional script hashes
identify guardrails policies. Amounts and expiry epochs use unsigned 64-bit units.
Constructors
| ParameterChange !(Maybe ActionId) !Update !(Maybe ScriptHash) | Previous parameter action, sparse changes, optional guardrails policy. |
| HardForkInitiation !(Maybe ActionId) !ProtocolVersion | Previous hard-fork action and proposed protocol version. |
| TreasuryWithdrawals !Withdrawals !(Maybe ScriptHash) | Reward accounts receiving treasury lovelace and optional policy. |
| NoConfidence !(Maybe ActionId) | Previous committee-confidence action. |
| UpdateCommittee !(Maybe ActionId) !Removals !Members !UnitInterval | Previous committee action, removals, additions with expiry, and quorum. |
| NewConstitution !(Maybe ActionId) !Constitution | Previous constitution action and replacement constitution. |
| InfoAction | Informational action without additional fields. |
Cold credentials to remove, sorted by kind and hash. Repeated credentials are retained. Ledger acceptance is a separate check.
removalsFromList :: [Credential CommitteeCold] -> Removals Source #
Sort by credential kind then hash bytes, retaining duplicate credentials.
removalsToList :: Removals -> [Credential CommitteeCold] Source #
Sorted removal credentials, including duplicates.
data EncodedRemovals Source #
A standalone removal collection retaining its exact CBOR representation.
Equality and ordering compare bytes; inspect credentials with toRemovals.
Instances
| Show EncodedRemovals Source # | |
Defined in Cometa.Governance.Action Methods showsPrec :: Int -> EncodedRemovals -> ShowS # show :: EncodedRemovals -> String # showList :: [EncodedRemovals] -> ShowS # | |
| Eq EncodedRemovals Source # | |
Defined in Cometa.Governance.Action Methods (==) :: EncodedRemovals -> EncodedRemovals -> Bool # (/=) :: EncodedRemovals -> EncodedRemovals -> Bool # | |
| Ord EncodedRemovals Source # | |
Defined in Cometa.Governance.Action Methods compare :: EncodedRemovals -> EncodedRemovals -> Ordering # (<) :: EncodedRemovals -> EncodedRemovals -> Bool # (<=) :: EncodedRemovals -> EncodedRemovals -> Bool # (>) :: EncodedRemovals -> EncodedRemovals -> Bool # (>=) :: EncodedRemovals -> EncodedRemovals -> Bool # max :: EncodedRemovals -> EncodedRemovals -> EncodedRemovals # min :: EncodedRemovals -> EncodedRemovals -> EncodedRemovals # | |
encodeRemovals :: Removals -> ByteString Source #
Fresh tagged definite array of sorted credentials, retaining duplicates.
encodeRemovalsWith :: SetEncoding -> Removals -> ByteString Source #
Fresh definite array with the requested outer set tag.
decodeRemovals :: ByteString -> Either Error EncodedRemovals Source #
Decode a standalone credential collection, retaining all imported bytes.
Optional tag 258, definite and indefinite arrays, and duplicate credentials
are accepted; invalid fields or trailing bytes return InvalidProposalCbor.
fromRemovals :: Removals -> EncodedRemovals Source #
Assign fresh tagged encoding to a removal collection.
toRemovals :: EncodedRemovals -> Removals Source #
Inspect sorted removal credentials without changing retained bytes.
removalsCbor :: EncodedRemovals -> ByteString Source #
Exact imported bytes or fresh bytes assigned by fromRemovals.
removalsSetEncoding :: EncodedRemovals -> SetEncoding Source #
Observe the exact standalone removal collection's outer set tag.
withRemovalsSetEncoding :: SetEncoding -> EncodedRemovals -> EncodedRemovals Source #
Change only the outer tag, retaining every array and credential byte. Requesting the current representation preserves the entire encoding exactly.
data Withdrawals Source #
Unique reward accounts and lovelace amounts, including zero amounts.
Instances
| Show Withdrawals Source # | |
Defined in Cometa.Governance.Action Methods showsPrec :: Int -> Withdrawals -> ShowS # show :: Withdrawals -> String # showList :: [Withdrawals] -> ShowS # | |
| Eq Withdrawals Source # | |
Defined in Cometa.Governance.Action | |
| Ord Withdrawals Source # | |
Defined in Cometa.Governance.Action Methods compare :: Withdrawals -> Withdrawals -> Ordering # (<) :: Withdrawals -> Withdrawals -> Bool # (<=) :: Withdrawals -> Withdrawals -> Bool # (>) :: Withdrawals -> Withdrawals -> Bool # (>=) :: Withdrawals -> Withdrawals -> Bool # max :: Withdrawals -> Withdrawals -> Withdrawals # min :: Withdrawals -> Withdrawals -> Withdrawals # | |
withdrawalsFromList :: [(RewardAddress, Word64)] -> Either Error Withdrawals Source #
Reject repeated reward accounts with DuplicateTreasuryWithdrawal, even
when amounts agree. Values are lovelace; no minimum or positivity is imposed.
withdrawalsToList :: Withdrawals -> [(RewardAddress, Word64)] Source #
Entries ordered by exact reward-address bytes, matching fresh serialization.
data EncodedAction Source #
Exact original CBOR plus its semantic action. Equality and ordering compare
bytes. Use toAction when comparing action meanings.
Instances
| Show EncodedAction Source # | |
Defined in Cometa.Governance.Action Methods showsPrec :: Int -> EncodedAction -> ShowS # show :: EncodedAction -> String # showList :: [EncodedAction] -> ShowS # | |
| Eq EncodedAction Source # | |
Defined in Cometa.Governance.Action Methods (==) :: EncodedAction -> EncodedAction -> Bool # (/=) :: EncodedAction -> EncodedAction -> Bool # | |
| Ord EncodedAction Source # | |
Defined in Cometa.Governance.Action Methods compare :: EncodedAction -> EncodedAction -> Ordering # (<) :: EncodedAction -> EncodedAction -> Bool # (<=) :: EncodedAction -> EncodedAction -> Bool # (>) :: EncodedAction -> EncodedAction -> Bool # (>=) :: EncodedAction -> EncodedAction -> Bool # max :: EncodedAction -> EncodedAction -> EncodedAction # min :: EncodedAction -> EncodedAction -> EncodedAction # | |
encodeCbor :: Action -> ByteString Source #
Fresh definite CBOR with shortest integers and sorted maps/removal credentials.
Reconstructing semantic data can change transaction identity; toCbor preserves
imported bytes instead.
decodeCbor :: ByteString -> Either Error EncodedAction Source #
Decode exactly one action and retain its original bytes. Definite and
indefinite containers and nonminimal integers are accepted; unknown variants,
wrong arity, invalid components, duplicate map keys and trailing data return
InvalidProposalCbor.
fromAction :: Action -> EncodedAction Source #
Assign fresh encoding to semantic data.
toAction :: EncodedAction -> Action Source #
Inspect semantic data without changing retained bytes.
toCbor :: EncodedAction -> ByteString Source #
Exact imported encoding, or the encoding assigned by fromAction.