Constitution
- class cometa.proposal_procedures.constitution.Constitution(ptr)[source]
Bases:
objectRepresents a Cardano constitution.
The constitution is a document that defines the rules and principles governing the Cardano blockchain. It includes an anchor (URL and hash) pointing to the constitution document and optionally a script hash for the constitution script.
- classmethod new(anchor, script_hash=None)[source]
Creates a new constitution.
- Parameters:
anchor (Anchor) – The anchor pointing to the constitution document.
script_hash (Blake2bHash | None) – Optional script hash for the constitution script.
- Returns:
A new Constitution instance.
- Raises:
CardanoError – If creation fails.
- Return type:
- classmethod from_cbor(reader)[source]
Deserializes a Constitution from CBOR data.
- Parameters:
reader (CborReader) – A CborReader positioned at the constitution data.
- Returns:
A new Constitution deserialized from the CBOR data.
- Raises:
CardanoError – If deserialization fails.
- Return type:
- to_cbor(writer)[source]
Serializes the constitution to CBOR format.
- Parameters:
writer (CborWriter) – A CborWriter to write the serialized data to.
- Raises:
CardanoError – If serialization fails.
- Return type:
None
- property script_hash: Blake2bHash | None
The optional script hash for the constitution script.
- Returns:
The Blake2bHash if present, None otherwise.
- 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