ProposedParamUpdates
- class cometa.protocol_params.proposed_param_updates.ProposedParamUpdates(ptr)[source]
Bases:
objectA 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.
- __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:
- __setitem__(key, value)[source]
Sets the proposed update for a genesis delegate key hash.
- Parameters:
key (Blake2bHash) – The genesis delegate key hash.
value (ProtocolParamUpdate) – The ProtocolParamUpdate to set.
- 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:
- 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:
- 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:
key (Blake2bHash) – The genesis delegate key hash.
update (ProtocolParamUpdate) – The ProtocolParamUpdate to insert.
- 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