Voter
- class cometa.voting_procedures.voter.Voter(ptr)[source]
Bases:
objectRepresents a voter in the Cardano governance system.
A voter is any participant with an eligible role who either has a direct stake or has delegated their stake, and they exercise their rights by casting votes on governance actions. The weight or influence of their vote is determined by the amount of their active stake or the stake that’s been delegated to them.
Various roles in the Cardano ecosystem can participate in voting: - Constitutional committee members - DReps (Delegation Representatives) - SPOs (Stake Pool Operators)
- classmethod new(voter_type, credential)[source]
Creates a new voter.
- Parameters:
voter_type (VoterType) – The type of voter (CC, DRep, or SPO).
credential (Credential) – The credential identifying the voter.
- Returns:
A new Voter instance.
- Raises:
CardanoError – If creation fails.
- Return type:
Example
>>> cred = Credential.from_key_hash(key_hash) >>> voter = Voter.new(VoterType.DREP_KEY_HASH, cred)
- classmethod from_cbor(reader)[source]
Deserializes a Voter from CBOR data.
- Parameters:
reader (CborReader) – A CborReader positioned at the voter data.
- Returns:
A new Voter deserialized from the CBOR data.
- Raises:
CardanoError – If deserialization fails.
- Return type:
- to_cbor(writer)[source]
Serializes the voter to CBOR format.
- Parameters:
writer (CborWriter) – A CborWriter to write the serialized data to.
- Raises:
CardanoError – If serialization fails.
- Return type:
None
- property credential: Credential
Returns the credential associated with this voter.
- to_cip116_json(writer)[source]
Serializes this object to CIP-116 compliant JSON.
- Parameters:
writer (JsonWriter) – The JsonWriter to write the JSON to.
- Raises:
CardanoError – If serialization fails.
- Return type:
None