Beispiel #1
0
    def dump_packet(cls, data):
        """
        4-byte synchronisation token, (0x22400891),
        a 4-byte "payload size", to be interpreted as a big-endian integer
        an N-byte RLP-serialised data structure
        """
        payload = rlp.encode(recursive_int_to_big_endian(data))

        packet = ienc4(cls.SYNCHRONIZATION_TOKEN)
        packet += ienc4(len(payload))
        packet += payload
        return packet
Beispiel #2
0
    def dump_packet(cls, data):
        """
        4-byte synchronisation token, (0x22400891),
        a 4-byte "payload size", to be interpreted as a big-endian integer
        an N-byte RLP-serialised data structure
        """
        payload = rlp.encode(recursive_int_to_big_endian(data))

        packet = ienc4(cls.SYNCHRONIZATION_TOKEN)
        packet += ienc4(len(payload))
        packet += payload
        return packet
Beispiel #3
0
def step_impl(context):
    mock = context.new_transactions_received_handler
    assert mock.call_count == 1
    assert mock.call_args[1]['transactions'] == recursive_int_to_big_endian(
        context.transactions_data)
Beispiel #4
0
def step_impl(context):
    mock = context.new_transactions_received_handler
    assert mock.call_count == 1
    assert mock.call_args[1]['transactions'] == recursive_int_to_big_endian(
        context.transactions_data)
Beispiel #5
0
def step_impl(context, src):
    context.src = recursive_int_to_big_endian(src)
Beispiel #6
0
def step_impl(context, src):
    context.src = recursive_int_to_big_endian(src)
Beispiel #7
0
def step_impl(context, data):
    context.data = data
    context.encoded_data = rlp.encode(
        recursive_int_to_big_endian(context.data))