# Path: rlp/exceptions.py
# class SerializationError(RLPException):
#     """Exception raised if serialization fails.
# 
#     :ivar obj: the object that could not be serialized
#     """
# 
#     def __init__(self, message, obj):
#         super(SerializationError, self).__init__(message)
#         self.obj = obj
# 
# Path: rlp/sedes/big_endian_int.py
# class BigEndianInt(object):
#     def __init__(self, l=None):
#     def serialize(self, obj):
#     def deserialize(self, serial):
# 
# Path: rlp/utils.py
# ALL_BYTES = tuple(
#     struct.pack('B', i)
#     for i in range(256)
# )


import binascii
import pytest
    import ctypes
    import sys
    import time
from eth_utils import int_to_big_endian
from rlp import SerializationError
from rlp.sedes import big_endian_int, BigEndianInt
from rlp.utils import ALL_BYTES





valid_data = (
    (256, b'\x01\x00'),
    (1024, b'\x04\x00'),
    (65535, b'\xff\xff'),
)

single_bytes = ((n, ALL_BYTES[n]) for n in range(1, 256))

random_integers = (256, 257, 4839, 849302, 483290432, 483290483290482039482039,
                   48930248348219540325894323584235894327865439258743754893066)
assert random_integers[-1] < 2**256

negative_ints = (-1, -100, -255, -256, -2342423)


def test_neg():
    for n in negative_ints:
        with pytest.raises(SerializationError):
            big_endian_int.serialize(n)


@pytest.mark.parametrize('value', [True, False])
def test_rejects_bool(value):

# Path: rlp/exceptions.py
# class SerializationError(RLPException):
#     """Exception raised if serialization fails.
# 
#     :ivar obj: the object that could not be serialized
#     """
# 
#     def __init__(self, message, obj):
#         super(SerializationError, self).__init__(message)
#         self.obj = obj
# 
# Path: rlp/sedes/big_endian_int.py
# class BigEndianInt(object):
#     def __init__(self, l=None):
#     def serialize(self, obj):
#     def deserialize(self, serial):
# 
# Path: rlp/utils.py
# ALL_BYTES = tuple(
#     struct.pack('B', i)
#     for i in range(256)
# )


# Path: tests/test_big_endian.py
import binascii
import pytest
    import ctypes
    import sys
    import time
from eth_utils import int_to_big_endian
from rlp import SerializationError
from rlp.sedes import big_endian_int, BigEndianInt
from rlp.utils import ALL_BYTES






valid_data = (
    (256, b'\x01\x00'),
    (1024, b'\x04\x00'),
    (65535, b'\xff\xff'),
)

single_bytes = ((n, ALL_BYTES[n]) for n in range(1, 256))

random_integers = (256, 257, 4839, 849302, 483290432, 483290483290482039482039,
                   48930248348219540325894323584235894327865439258743754893066)
assert random_integers[-1] < 2**256

negative_ints = (-1, -100, -255, -256, -2342423)


def test_neg():
    for n in negative_ints:
        with pytest.raises(SerializationError):
            big_endian_int.serialize(n)


@pytest.mark.parametrize('value', [True, False])
def test_rejects_bool(value):

    with pytest.raises(SerializationError):