Package genlayer.py.eth._internal.type_dicts#

Warning

This is an internal module

class genlayer.py.eth._internal.type_dicts.Address[source]#

Represents GenLayer Address

SIZE: Final[int] = 20#

Constant that represents size of a Genlayer address

__init__(val: str | Buffer)[source]#
Parameters:

val (str | Buffer) – either a hex encoded address (that starts with ‘0x’), or base64 encoded address, or buffer of 20 bytes

Warning

checksum validation is not performed

property as_b64: str#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_b64
'WzjaanAcVoVF3PywP8uHX1a+3cQ='
Returns:

base64 representation of an address (most compact string)

property as_bytes: bytes#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_bytes
b'[8\xdajp\x1cV\x85E\xdc\xfc\xb0?\xcb\x87_V\xbe\xdd\xc4'
Returns:

raw bytes of an address (most compact representation)

property as_hex: str#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_hex
'0x5B38Da6a701c568545dCfcB03FcB875f56beddC4'
Returns:

checksum string representation

property as_int: u160#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_int
1123907236495940146162314350759402901750813440091
>>> hex(Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_int)
'0xc4ddbe565f87cb3fb0fcdc4585561c706ada385b'
Returns:

int representation of an address (unsigned little endian)

class genlayer.py.eth._internal.type_dicts.AddressCodec[source]#
class genlayer.py.eth._internal.type_dicts.ArrayCodec[source]#
__init__(elem_encoder: Codec, elem_count: S)[source]#
class genlayer.py.eth._internal.type_dicts.BoolCodec[source]#
class genlayer.py.eth._internal.type_dicts.BytesNCodec[source]#
__init__(bytes: int)[source]#
class genlayer.py.eth._internal.type_dicts.BytesStrCodec[source]#
__init__(t: Type)[source]#
class genlayer.py.eth._internal.type_dicts.Codec[source]#
class genlayer.py.eth._internal.type_dicts.DecoderState[source]#

DecoderState(mem: memoryview, current_off: int, current_off_0: int)

__init__(mem: memoryview, current_off: int, current_off_0: int) None#
class genlayer.py.eth._internal.type_dicts.DynArrayCodec[source]#
__init__(elem_encoder: Codec)[source]#
class genlayer.py.eth._internal.type_dicts.EncodeState[source]#

EncodeState(current_off: int, result: bytearray, tails: Tails)

__init__(current_off: int, result: bytearray, tails: Tails) None#
class genlayer.py.eth._internal.type_dicts.InplaceTuple[source]#

This class indicates that tuple should be encoded/decoded in-place. Which means that even if it is dynamically sized, it is ignored. It is useful for encoding/decoding arguments and returns

class genlayer.py.eth._internal.type_dicts.IntCodec[source]#
__init__(bits: int, signed: bool)[source]#
class genlayer.py.eth._internal.type_dicts.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

exception genlayer.py.eth._internal.type_dicts.Rollback[source]#

Exception that will be treated as a “Rollback”

__init__(msg: str)[source]#
class genlayer.py.eth._internal.type_dicts.SizedArray[source]#
__init__(*args, **kwargs)#
class genlayer.py.eth._internal.type_dicts.TupleCodec[source]#
__init__(elem_encoders: tuple[Codec, ...], force_inplace: bool)[source]#
genlayer.py.eth._internal.type_dicts.dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True, kw_only=False, slots=False, weakref_slot=False)[source]#

Add dunder methods based on the fields defined in the class.

Examines PEP 526 __annotations__ to determine fields.

If init is true, an __init__() method is added to the class. If repr is true, a __repr__() method is added. If order is true, rich comparison dunder methods are added. If unsafe_hash is true, a __hash__() method is added. If frozen is true, fields may not be assigned to after instance creation. If match_args is true, the __match_args__ tuple is added. If kw_only is true, then by default all fields are keyword-only. If slots is true, a new class with a __slots__ attribute is returned.

class genlayer.py.eth._internal.type_dicts.partial[source]#

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

__new__(**kwargs)#
args#

tuple of arguments to future partial calls

func#

function object to use in future partial calls

keywords#

dictionary of keyword arguments to future partial calls