Committee

class cometa.proposal_procedures.committee.Committee(ptr)[source]

Bases: object

Represents the constitutional committee.

The constitutional committee represents a set of individuals or entities (each associated with a pair of Ed25519 credentials) that are collectively responsible for ensuring that the Constitution is respected.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

Committee

__exit__(exc_type, exc_val, exc_tb)[source]
Return type:

None

__repr__()[source]

Return repr(self).

Return type:

str

classmethod new(quorum_threshold)[source]

Creates a new constitutional committee.

Parameters:

quorum_threshold (UnitInterval) – The minimum percentage of committee members required to participate in a vote for it to be valid.

Returns:

A new Committee instance.

Raises:

CardanoError – If creation fails.

Return type:

Committee

classmethod from_cbor(reader)[source]

Deserializes a Committee from CBOR data.

Parameters:

reader (CborReader) – A CborReader positioned at the committee data.

Returns:

A new Committee deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

Committee

to_cbor(writer)[source]

Serializes the committee to CBOR format.

Parameters:

writer (CborWriter) – A CborWriter to write the serialized data to.

Raises:

CardanoError – If serialization fails.

Return type:

None

property quorum_threshold: UnitInterval

The quorum threshold for the committee.

Returns:

The UnitInterval representing the minimum voting percentage.

members_keys()[source]

Retrieves all member credentials.

Returns:

A CredentialSet containing all committee member credentials.

Raises:

CardanoError – If retrieval fails.

Return type:

CredentialSet

add_member(credential, epoch)[source]

Adds a member to the committee.

Parameters:
  • credential (Credential) – The credential of the member to add.

  • epoch (int) – The epoch when the member’s term expires.

Raises:

CardanoError – If addition fails.

Return type:

None

get_member_epoch(credential)[source]

Gets the term epoch for a specific member.

Parameters:

credential (Credential) – The credential of the member to look up.

Returns:

The epoch when the member’s term expires, or 0 if not found.

Return type:

int

get_key_at(index)[source]

Retrieves the credential at a specific index.

Parameters:

index (int) – The index of the credential to retrieve.

Returns:

The Credential at the specified index.

Raises:

CardanoError – If retrieval fails.

Return type:

Credential

get_value_at(index)[source]

Retrieves the term epoch at a specific index.

Parameters:

index (int) – The index of the epoch to retrieve.

Returns:

The term epoch at the specified index.

Raises:

CardanoError – If retrieval fails.

Return type:

int

get_key_value_at(index)[source]

Retrieves the key-value pair at a specific index.

Parameters:

index (int) – The index of the key-value pair to retrieve.

Returns:

A tuple containing the Credential and term epoch at the specified index.

Raises:

CardanoError – If retrieval fails.

Return type:

tuple[Credential, int]

__iter__()[source]

Iterates over all member credentials.

Return type:

Iterator[Credential]

items()[source]

Returns an iterator over (credential, epoch) pairs.

Return type:

Iterator[Tuple[Credential, int]]