
    (i                     6    d dl mZmZ  G d d      Z e       Zy)    )DeserializationErrorSerializationErrorc                       e Zd ZdZd Zd Zy)BooleanzA sedes for booleansc                 d    t        |t              st        d|      |du ry|du ryt        d      )NzCan only serialize integersF    T   z.Invariant: no other options for boolean values)
isinstanceboolr   	Exception)selfobjs     B/var/www/br/venv/lib/python3.12/site-packages/rlp/sedes/boolean.py	serializezBoolean.serialize
   s:    #t$$%BCHH%<D[LMMr   c                 2    |dk(  ry|dk(  ryt        d|      )Nr   Fr	   Tz8Invalid serialized boolean.  Must be either 0x01 or 0x00)r   )r   serials     r   deserializezBoolean.deserialize   s)    S=w&JF r   N)__name__
__module____qualname____doc__r   r    r   r   r   r      s    	Nr   r   N)rlp.exceptionsr   r   r   booleanr   r   r   <module>r      s    2 )r   