ProposedParamUpdates

class cometa.protocol_params.proposed_param_updates.ProposedParamUpdates(ptr)[source]

Bases: object

A map of genesis delegate key hashes to proposed protocol parameter updates.

This is used in the Shelley-era update mechanism where genesis keys propose parameter changes. Each genesis delegate can propose their own set of parameter updates.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

ProposedParamUpdates

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

None

__repr__()[source]

Return repr(self).

Return type:

str

__len__()[source]

Returns the number of proposed updates in the map.

Return type:

int

__iter__()[source]

Iterates over key-value pairs in the map.

Return type:

Iterator[Tuple[Blake2bHash, ProtocolParamUpdate]]

__getitem__(key)[source]

Gets the proposed update for a genesis delegate key hash.

Parameters:

key (Blake2bHash) – The genesis delegate key hash.

Returns:

The ProtocolParamUpdate for that key.

Raises:

KeyError – If no update exists for the key.

Return type:

ProtocolParamUpdate

__setitem__(key, value)[source]

Sets the proposed update for a genesis delegate key hash.

Parameters:
Return type:

None

__contains__(key)[source]

Checks if an update exists for the given key.

Parameters:

key (Blake2bHash)

Return type:

bool

classmethod new()[source]

Creates a new empty ProposedParamUpdates map.

Returns:

A new empty ProposedParamUpdates instance.

Raises:

CardanoError – If creation fails.

Return type:

ProposedParamUpdates

classmethod from_cbor(reader)[source]

Deserializes ProposedParamUpdates from CBOR data.

Parameters:

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

Returns:

A new ProposedParamUpdates deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

ProposedParamUpdates

to_cbor(writer)[source]

Serializes the proposed param updates to CBOR format.

Parameters:

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

Raises:

CardanoError – If serialization fails.

Return type:

None

insert(key, update)[source]

Inserts a proposed update for a genesis delegate key hash.

Parameters:
Raises:

CardanoError – If insertion fails.

Return type:

None

get(key)[source]

Retrieves the proposed update for a genesis delegate key hash.

Parameters:

key (Blake2bHash) – The genesis delegate key hash.

Returns:

The ProtocolParamUpdate if found, None otherwise.

Return type:

ProtocolParamUpdate | None

get_key_at(index)[source]

Gets the key at a specific index.

Parameters:

index (int) – The index (0-based).

Returns:

The Blake2bHash key at that index, or None if out of range.

Return type:

Blake2bHash | None

get_value_at(index)[source]

Gets the value at a specific index.

Parameters:

index (int) – The index (0-based).

Returns:

The ProtocolParamUpdate at that index, or None if out of range.

Return type:

ProtocolParamUpdate | None

keys()[source]

Iterates over the genesis delegate key hashes.

Return type:

Iterator[Blake2bHash]

values()[source]

Iterates over the proposed updates.

Return type:

Iterator[ProtocolParamUpdate]

items()[source]

Iterates over key-value pairs.

Return type:

Iterator[Tuple[Blake2bHash, ProtocolParamUpdate]]

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