PoolOwners

class cometa.pool_params.pool_owners.PoolOwners(ptr)[source]

Bases: object

Represents a set of stake pool owners.

Pool owners are identified by their Ed25519 key hashes (28 bytes). This class provides a set-like interface for managing pool owner key hashes.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

PoolOwners

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

None

__repr__()[source]

Return repr(self).

Return type:

str

__len__()[source]
Return type:

int

__getitem__(index: int) Blake2bHash[source]
__getitem__(index: slice) List[Blake2bHash]
__iter__()[source]
Return type:

Iterator[Blake2bHash]

__contains__(item)[source]
Parameters:

item (object)

Return type:

bool

classmethod new()[source]

Creates a new empty PoolOwners set.

Returns:

A new empty PoolOwners instance.

Raises:

CardanoError – If creation fails.

Return type:

PoolOwners

classmethod from_cbor(reader)[source]

Deserializes a PoolOwners set from CBOR data.

Parameters:

reader (CborReader) – A CborReader positioned at the pool owners data.

Returns:

A new PoolOwners deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

PoolOwners

to_cbor(writer)[source]

Serializes the pool owners set to CBOR format.

Parameters:

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

Raises:

CardanoError – If serialization fails.

Return type:

None

add(owner)[source]

Adds an owner key hash to the set.

Parameters:

owner (Blake2bHash) – The owner’s key hash (28-byte Blake2b hash).

Raises:

CardanoError – If adding fails.

Return type:

None

append(owner)[source]

Appends an owner key hash to the set (alias for add).

Parameters:

owner (Blake2bHash) – The owner’s key hash (28-byte Blake2b hash).

Raises:

CardanoError – If appending fails.

Return type:

None

extend(owners)[source]

Extends the set with owners from another set or list.

Parameters:

owners (PoolOwners | List[Blake2bHash]) – Another PoolOwners set or a list of Blake2bHash objects.

Raises:

CardanoError – If extending fails.

Return type:

None

to_cip116_json(writer)[source]

Serializes this pool owners set to CIP-116 compliant JSON.

Parameters:

writer (JsonWriter) – The JsonWriter to write the JSON to.

Raises:

CardanoError – If serialization fails.

Return type:

None