Update

class cometa.protocol_params.update.Update(ptr)[source]

Bases: object

Represents a protocol parameter update proposal.

An Update consists of proposed parameter updates from genesis delegates and the epoch in which the update should be applied.

This is part of the Shelley-era update mechanism.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

Update

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

None

__repr__()[source]

Return repr(self).

Return type:

str

classmethod new(epoch, proposed_updates)[source]

Creates a new Update with the given epoch and proposed updates.

Parameters:
  • epoch (int) – The epoch in which the update should be applied.

  • proposed_updates (ProposedParamUpdates) – The proposed parameter updates from genesis delegates.

Returns:

A new Update instance.

Raises:

CardanoError – If creation fails.

Return type:

Update

classmethod from_cbor(reader)[source]

Deserializes Update from CBOR data.

Parameters:

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

Returns:

A new Update deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

Update

to_cbor(writer)[source]

Serializes the update to CBOR format.

Parameters:

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

Raises:

CardanoError – If serialization fails.

Return type:

None

property epoch: int

The epoch in which the update should be applied.

Returns:

The target epoch number.

property proposed_parameters: ProposedParamUpdates

The proposed parameter updates from genesis delegates.

Returns:

The ProposedParamUpdates containing the updates.

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