Package genlayer.std._internal#

Warning

This is an internal module

exception genlayer.std._internal.ContractError[source]#

Represents “Contract error” result of a contract that is passed to validator function of genlayer.std.run_nondet()

Validating leader output and sandbox invocation are only places where contract can “handle” contract error

__init__(data: str) None#
class genlayer.std._internal.ContractReturn[source]#

Represents a normal “Return” result of a contract that is passed to validator function of genlayer.std.run_nondet()

__init__(data: Any) None#
class genlayer.std._internal.Lazy[source]#

Base class to support lazy evaluation

__init__(_eval: Callable[[], T])[source]#
get() T[source]#

Performs evaluation if necessary (only ones) and stores the result

Returns:

result of evaluating

Raises:

iff evaluation raised, this outcome is also cached, so subsequent calls will raise same exception

Return type:

T

class genlayer.std._internal.LazyApi[source]#
__init__(*args, **kwargs)#
lazy(*args: R, **kwargs: R) Lazy[source]#

Wrap evaluation into Lazy and return it

Return type:

Lazy

class genlayer.std._internal.ResultCode[source]#
__new__(value)#
exception genlayer.std._internal.Rollback[source]#

Exception that will be treated as a “Rollback”

__init__(msg: str)[source]#