Safe Haskell | None |
---|---|
Language | Haskell2010 |
An API for driving on-chain poll for SPOs.
Polls are done on-chain through transaction metadata and authenticated via stake pool credentials (either VRF public key or Ed25519 cold key).
The goal is to gather opinions on governance matters such as protocol parameters updates. This standard is meant to be an inclusive interim solution while the work on a larger governance framework such as CIP-1694 continues.
Synopsis
- data family AsType t
- data family Hash keyrole
- data GovernancePoll = GovernancePoll {
- govPollQuestion :: Text
- govPollAnswers :: [Text]
- govPollNonce :: Maybe Word
- data GovernancePollAnswer = GovernancePollAnswer {}
- data GovernancePollError
- = ErrGovernancePollMismatch GovernancePollMismatchError
- | ErrGovernancePollNoAnswer
- | ErrGovernancePollUnauthenticated
- | ErrGovernancePollMalformedAnswer DecoderError
- | ErrGovernancePollInvalidAnswer GovernancePollInvalidAnswerError
- renderGovernancePollError :: GovernancePollError -> Text
- hashGovernancePoll :: GovernancePoll -> Hash GovernancePoll
- verifyPollAnswer :: GovernancePoll -> InAnyShelleyBasedEra Tx -> Either GovernancePollError [Hash PaymentKey]
Type Proxies
A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.
Values of this type are passed to deserialisation functions for example.
Instances
data family Hash keyrole Source #
Instances
Types
data GovernancePoll Source #
A governance poll declaration meant to be created by one of the genesis delegates and directed towards SPOs.
A poll is made of a question and some pre-defined answers to chose from. There's an optional nonce used to make poll unique (as things down the line are based on their hashes) if the same question/answers need to be asked multiple times.
GovernancePoll | |
|
Instances
data GovernancePollAnswer Source #
An (unauthenticated) answer to a poll from an SPO referring to a poll by hash digest value.
GovernancePollAnswer | |
|
Instances
Show GovernancePollAnswer Source # | |||||
Defined in Cardano.Api.Governance.Poll | |||||
HasTypeProxy GovernancePollAnswer Source # | |||||
Defined in Cardano.Api.Governance.Poll
| |||||
SerialiseAsCBOR GovernancePollAnswer Source # | |||||
AsTxMetadata GovernancePollAnswer Source # | |||||
Defined in Cardano.Api.Governance.Poll | |||||
Eq GovernancePollAnswer Source # | |||||
Defined in Cardano.Api.Governance.Poll (==) :: GovernancePollAnswer -> GovernancePollAnswer -> Bool Source # (/=) :: GovernancePollAnswer -> GovernancePollAnswer -> Bool Source # | |||||
data AsType GovernancePollAnswer Source # | |||||
Defined in Cardano.Api.Governance.Poll |
Errors
data GovernancePollError Source #
ErrGovernancePollMismatch GovernancePollMismatchError | |
ErrGovernancePollNoAnswer | |
ErrGovernancePollUnauthenticated | |
ErrGovernancePollMalformedAnswer DecoderError | |
ErrGovernancePollInvalidAnswer GovernancePollInvalidAnswerError |
Instances
Show GovernancePollError Source # | |
Defined in Cardano.Api.Governance.Poll |
Functions
verifyPollAnswer :: GovernancePoll -> InAnyShelleyBasedEra Tx -> Either GovernancePollError [Hash PaymentKey] Source #
Verify a poll against a given transaction and returns the signatories (verification key only) when valid.
Note: signatures aren't checked as it is assumed to have been done externally (the existence of the transaction in the ledger provides this guarantee).