o
    ¢ØÆhÀ  ã                   @   s”   G d d„ de ƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZG d
d„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZ	dS )c                   @   s   e Zd ZdZdS )ÚRLPExceptionz1Base class for exceptions raised by this package.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú[/var/www/html/HyperOracle/crypto_trader/venv/lib/python3.10/site-packages/rlp/exceptions.pyr      s    r   c                       ó    e Zd ZdZ‡ fdd„Z‡  ZS )ÚEncodingErrorzb
    Exception raised if encoding fails.

    :ivar obj: the object that could not be encoded
    c                    ó   t ƒ  |¡ || _d S ©N©ÚsuperÚ__init__Úobj©ÚselfÚmessager   ©Ú	__class__r   r   r      ó   
zEncodingError.__init__©r   r   r   r   r   Ú__classcell__r   r   r   r   r	      ó    r	   c                       r   )ÚDecodingErrorzf
    Exception raised if decoding fails.

    :ivar rlp: the RLP string that could not be decoded
    c                    r
   r   )r   r   Úrlp)r   r   r   r   r   r   r      r   zDecodingError.__init__r   r   r   r   r   r      r   r   c                       r   )ÚSerializationErrorzj
    Exception raised if serialization fails.

    :ivar obj: the object that could not be serialized
    c                    r
   r   r   r   r   r   r   r   $   r   zSerializationError.__init__r   r   r   r   r   r      r   r   c                       ó"   e Zd ZdZd‡ fdd„	Z‡  ZS )ÚListSerializationErrora´  
    Exception raised if serialization by a :class:`sedes.List` fails.

    :ivar element_exception: the exception that occurred during the serialization of one
                             of the elements, or `None` if the error is unrelated to a
                             specific element
    :ivar index: the index in the list that produced the error or `None` if the error is
                 unrelated to a specific element
    Nc                    sT   |d u r|d us
J ‚|d usJ ‚d|› dt |ƒ› d�}tƒ  ||¡ || _|| _d S )Nz1Serialization failed because of element at index ú ("ú")©Ústrr   r   ÚindexÚelement_exception)r   r   r   r#   r"   r   r   r   r   4   s   ÿÿ
zListSerializationError.__init__©NNNNr   r   r   r   r   r   )   ó    
r   c                       r   )ÚObjectSerializationErroraµ  
    Exception raised if serialization of a :class:`sedes.Serializable` object fails.

    :ivar sedes: the :class:`sedes.Serializable` that failed
    :ivar list_exception: exception raised by the underlying list sedes, or `None` if no
                          such exception has been raised
    :ivar field: name of the field of the object that produced the error, or `None` if
                 no field responsible for the error
    Nc                    sŠ   |d u r4|d us
J ‚|j d u rd }dt|ƒ› d�}n|d us J ‚|jj|j }d|› dt|j ƒ› d�}nd }tƒ  ||¡ || _|| _d S )Nz2Serialization failed because of underlying list ("r   z&Serialization failed because of field r   )	r#   r!   Ú_metaÚfield_namesr"   r   r   ÚfieldÚlist_exception)r   r   r   Úsedesr*   r)   r   r   r   r   L   s$   
ÿÿÿÿ
z!ObjectSerializationError.__init__r$   r   r   r   r   r   r&   A   r%   r&   c                       r   )ÚDeserializationErrorz}
    Exception raised if deserialization fails.

    :ivar serial: the decoded RLP string that could not be deserialized
    c                    r
   r   )r   r   Úserial)r   r   r-   r   r   r   r   j   r   zDeserializationError.__init__r   r   r   r   r   r,   c   r   r,   c                       r   )ÚListDeserializationErrora¸  
    Exception raised if deserialization by a :class:`sedes.List` fails.

    :ivar element_exception: the exception that occurred during the deserialization of
                             one of the elements, or `None` if the error is unrelated to
                             a specific element
    :ivar index: the index in the list that produced the error or `None` if the error is
                 unrelated to a specific element
    Nc                    sP   |s|d usJ ‚|d usJ ‚d|› dt |ƒ› d�}tƒ  ||¡ || _|| _d S )Nz3Deserialization failed because of element at index r   r   r    )r   r   r-   r#   r"   r   r   r   r   z   s   ÿÿ
z!ListDeserializationError.__init__r$   r   r   r   r   r   r.   o   r%   r.   c                       r   )ÚObjectDeserializationErrora°  
    Exception raised if deserialization by a :class:`sedes.Serializable` fails.

    :ivar sedes: the :class:`sedes.Serializable` that failed
    :ivar list_exception: exception raised by the underlying list sedes, or `None` if no
                          such exception has been raised
    :ivar field: name of the field of the object that produced the error, or `None` if
                 no field responsible for the error
    Nc                    s†   |s1|d usJ ‚|j d u rd }dt|ƒ› d�}n|d usJ ‚|jj|j }d|› dt|j ƒ› d�}tƒ  ||¡ || _|| _|| _	d S )Nz4Deserialization failed because of underlying list ("r   z(Deserialization failed because of field r   )
r#   r!   r'   r(   r"   r   r   r+   r*   r)   )r   r   r-   r+   r*   r)   r   r   r   r   ’   s$   
ÿÿÿÿ
z#ObjectDeserializationError.__init__r$   r   r   r   r   r   r/   ‡   r%   r/   N)
Ú	Exceptionr   r	   r   r   r   r&   r,   r.   r/   r   r   r   r   Ú<module>   s    "