Package genlayer.py.storage._internal.desc_base_types#

Warning

This is an internal module

class genlayer.py.storage._internal.desc_base_types.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.storage._internal.desc_base_types.ComplexCopyAction[source]#
__init__(*args, **kwargs)#
class genlayer.py.storage._internal.desc_base_types.StorageMan[source]#
__init__(*args, **kwargs)#
class genlayer.py.storage._internal.desc_base_types.TypeDesc[source]#

Basic type description

__init__(size: int, copy_actions: list[CopyAction])[source]#
copy_actions: list[CopyAction]#

actions that must be executed for copying this data

int represents memcpy

abstract get(slot: StorageSlot, off: int) T[source]#

Method that reads value from slot and offset pair

Return type:

T

abstract set(slot: StorageSlot, off: int, val: T) None[source]#

Method that writes value to slot and offset pair

size: int#

size that value takes in current slot