array_dynamic_type
- class ArrayDynamicType(arg_type: ABIType)
Bases:
ABIType
Represents a ArrayDynamic ABI Type for encoding.
- Parameters
child_type (ABIType) – the type of the dynamic array.
- byte_len() NoReturn
Return the length in bytes of the ABI type.
- is_dynamic() bool
Return whether the ABI type is dynamic.
- encode(value_array: Union[List[Any], bytes, bytearray]) bytes
Encodes a list of values into a ArrayDynamic ABI bytestring.
- Parameters
value_array (list | bytes | bytearray) – list of values to be encoded.
ByteType (If the child types are) –
be (then bytes or bytearray can) –
well. (passed in to be encoded as) –
- Returns
encoded bytes of the dynamic array
- Return type
bytes
- decode(array_bytes: Union[bytes, bytearray]) list
Decodes a bytestring to a dynamic list.
- Parameters
array_bytes (bytes | bytearray) – bytestring to be decoded
- Returns
values from the encoded bytestring
- Return type
list