ScriptInvalidBefore

class cometa.scripts.native_scripts.script_invalid_before.ScriptInvalidBefore(ptr)[source]

Bases: object

Represents a time-lock script that requires a minimum slot.

This script evaluates to true if the lower bound of the transaction validity interval is a slot number Y, and Y >= X (the slot number in this script). This guarantees that the transaction is included in a slot >= X.

__init__(ptr)[source]
Return type:

None

__enter__()[source]
Return type:

ScriptInvalidBefore

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

None

__repr__()[source]

Return repr(self).

Return type:

str

classmethod new(slot)[source]

Creates a new ScriptInvalidBefore with the given slot number.

Parameters:

slot (int) – The slot number representing the lower bound of validity.

Returns:

A new ScriptInvalidBefore instance.

Raises:

CardanoError – If creation fails.

Return type:

ScriptInvalidBefore

classmethod from_cbor(reader)[source]

Deserializes a ScriptInvalidBefore from CBOR data.

Parameters:

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

Returns:

A new ScriptInvalidBefore deserialized from the CBOR data.

Raises:

CardanoError – If deserialization fails.

Return type:

ScriptInvalidBefore

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 slot: int

The slot number representing the lower bound of validity.

Returns:

The slot number.

property hash: bytes

The hash of this native script.

Returns:

The 28-byte Blake2b hash.

__eq__(other)[source]

Checks equality with another ScriptInvalidBefore.

Parameters:

other (object)

Return type:

bool

__hash__ = None