ScriptAll
- class cometa.scripts.native_scripts.script_all.ScriptAll(ptr)[source]
Bases:
objectRepresents a script that requires all sub-scripts to evaluate to true.
This script evaluates to true if all the sub-scripts evaluate to true. If the list of sub-scripts is empty, this script evaluates to true.
- classmethod new(scripts)[source]
Creates a new ScriptAll with the given sub-scripts.
- Parameters:
scripts (NativeScriptList | List[Any]) – The list of native scripts that must all evaluate to true. Can be a NativeScriptList or a Python list of native scripts.
- Returns:
A new ScriptAll instance.
- Raises:
CardanoError – If creation fails.
- Return type:
- classmethod from_cbor(reader)[source]
Deserializes a ScriptAll from CBOR data.
- Parameters:
reader (CborReader) – A CborReader positioned at the script data.
- Returns:
A new ScriptAll deserialized from the CBOR data.
- Raises:
CardanoError – If deserialization fails.
- Return type:
- to_cbor(writer)[source]
Serializes the script to CBOR format.
- Parameters:
writer (CborWriter) – A CborWriter to write the serialized data to.
- Raises:
CardanoError – If serialization fails.
- Return type:
None
- 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
- property scripts: NativeScriptList
The list of sub-scripts.
- Returns:
The NativeScriptList containing all sub-scripts.
- property hash: bytes
The hash of this native script.
- Returns:
The 28-byte Blake2b hash.
- __eq__(other)[source]
Checks equality with another ScriptAll.
- Parameters:
other (object)
- Return type:
bool
- __hash__ = None