Ejemplo n.º 1
0
def test_participant_selection(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_participant_selection,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 2
0
def test_node_can_settle_if_partner_does_not_call_update_transfer(
    raiden_network,
    number_of_nodes,
    token_addresses,
    network_wait,
):
    """ A node must be able to settle a channel, even if the partner did not
    call update transfer.

    This test will:
    - Make a transfer from app0 to app1, to make sure there are balance
    proofs available
    - Stop app1, to make sure update is not called.
    - Use app0 to close the channel.
    - Assert that app0 can settle the closed channel, even though app1 didn't
    use the latest balance proof
    """
    raise_on_failure(
        raiden_network,
        run_test_node_can_settle_if_partner_does_not_call_update_transfer,
        raiden_network=raiden_network,
        number_of_nodes=number_of_nodes,
        token_addresses=token_addresses,
        network_wait=network_wait,
    )
Ejemplo n.º 3
0
def test_api_channel_events(raiden_chain, token_addresses):
    raise_on_failure(
        raiden_chain,
        run_test_api_channel_events,
        raiden_chain=raiden_chain,
        token_addresses=token_addresses,
    )
Ejemplo n.º 4
0
def test_mediated_transfer_calls_pfs(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_mediated_transfer_calls_pfs,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 5
0
def test_locksroot_loading_during_channel_settle_handling(raiden_chain, token_addresses):
    raise_on_failure(
        raiden_chain,
        run_test_locksroot_loading_during_channel_settle_handling,
        raiden_chain=raiden_chain,
        token_addresses=token_addresses,
    )
Ejemplo n.º 6
0
def test_failfast_lockedtransfer_nochannel(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_failfast_lockedtransfer_nochannel,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 7
0
def test_receive_secrethashtransfer_unknown(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_receive_secrethashtransfer_unknown,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 8
0
def test_automatic_secret_registration(raiden_chain, token_addresses):
    raise_on_failure(
        raiden_chain,
        run_test_automatic_secret_registration,
        raiden_chain=raiden_chain,
        token_addresses=token_addresses,
    )
Ejemplo n.º 9
0
def test_mediated_transfer_with_allocated_fee(
    raiden_network,
    number_of_nodes,
    deposit,
    token_addresses,
    network_wait,
):
    """
    Tests the topology of:
    A -> B -> C -> D
    Where C & D are mediators who gain tokens by mediating transfers.
    The test checks that if no mediator sets the channel fee, then the fees
    sent by the initiator will be gained completely by the target as no fees
    will be deducted by the mediators.
    However, if the mediator sets the fee, the channel's fee will be
    deducted from received transfer's fee and the rest goes to
    the mediators in the next hops and maybe eventually to the target.
    """
    raise_on_failure(
        raiden_network,
        run_test_mediated_transfer_with_allocated_fee,
        raiden_network=raiden_network,
        number_of_nodes=number_of_nodes,
        deposit=deposit,
        token_addresses=token_addresses,
        network_wait=network_wait,
    )
Ejemplo n.º 10
0
def test_regression_multiple_revealsecret(raiden_network, token_addresses,
                                          transport_protocol):
    """ Multiple RevealSecret messages arriving at the same time must be
    handled properly.

    Unlock handling followed these steps:

        The Unlock message arrives
        The secret is registered
        The channel is updated and the correspoding lock is removed
        * A balance proof for the new channel state is created and sent to the
          payer
        The channel is unregistered for the given secrethash

    The step marked with an asterisk above introduced a context-switch. This
    allowed a second Reveal Unlock message to be handled before the channel was
    unregistered. And because the channel was already updated an exception was raised
    for an unknown secret.
    """
    raise_on_failure(
        raiden_network,
        run_test_regression_multiple_revealsecret,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
        transport_protocol=transport_protocol,
    )
Ejemplo n.º 11
0
def test_event_transfer_received_success(token_addresses, raiden_chain):
    raise_on_failure(
        raiden_chain,
        run_test_event_transfer_received_success,
        token_addresses=token_addresses,
        raiden_chain=raiden_chain,
    )
Ejemplo n.º 12
0
def test_create_monitoring_request(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_create_monitoring_request,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 13
0
def test_token_addresses(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_token_addresses,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 14
0
def test_settle_is_automatically_called(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_settle_is_automatically_called,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 15
0
def test_transfer_to_unknownchannel(raiden_network, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_transfer_to_unknownchannel,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 16
0
def test_settled_lock(token_addresses, raiden_network, deposit):
    raise_on_failure(
        raiden_network,
        run_test_settled_lock,
        token_addresses=token_addresses,
        raiden_network=raiden_network,
        deposit=deposit,
    )
Ejemplo n.º 17
0
def test_funds_check_for_openchannel(raiden_network, token_addresses):
    """Reproduces issue 2923 -- two open channel racing through the gas reserve"""
    raise_on_failure(
        raiden_network,
        run_test_funds_check_for_openchannel,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
    )
Ejemplo n.º 18
0
def test_channel_with_self(raiden_network, settle_timeout, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_channel_with_self,
        raiden_network=raiden_network,
        settle_timeout=settle_timeout,
        token_addresses=token_addresses,
    )
Ejemplo n.º 19
0
def test_insufficient_funds(raiden_network, token_addresses, deposit):
    raise_on_failure(
        raiden_network,
        run_test_insufficient_funds,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
        deposit=deposit,
    )
Ejemplo n.º 20
0
def test_echo_node_response(token_addresses, raiden_chain, network_wait):
    raise_on_failure(
        raiden_chain,
        run_test_echo_node_response,
        token_addresses=token_addresses,
        raiden_chain=raiden_chain,
        network_wait=network_wait,
    )
Ejemplo n.º 21
0
def test_channel_new(raiden_chain, retry_timeout, token_addresses):
    raise_on_failure(
        raiden_chain,
        run_test_channel_new,
        raiden_chain=raiden_chain,
        retry_timeout=retry_timeout,
        token_addresses=token_addresses,
    )
Ejemplo n.º 22
0
def test_batch_unlock_after_restart(raiden_network, token_addresses, deposit):
    raise_on_failure(
        raiden_network,
        run_test_batch_unlock_after_restart,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
        deposit=deposit,
    )
Ejemplo n.º 23
0
def test_automatic_dispute(raiden_network, deposit, token_addresses):
    raise_on_failure(
        raiden_network,
        run_test_automatic_dispute,
        raiden_network=raiden_network,
        deposit=deposit,
        token_addresses=token_addresses,
    )
Ejemplo n.º 24
0
def test_start_end_attack(token_addresses, raiden_chain, deposit):
    raise_on_failure(
        raiden_chain,
        run_test_start_end_attack,
        token_addresses=token_addresses,
        raiden_chain=raiden_chain,
        deposit=deposit,
    )
Ejemplo n.º 25
0
def test_lock_expiry(raiden_network, token_addresses, deposit):
    """Test lock expiry and removal."""
    raise_on_failure(
        raiden_network,
        run_test_lock_expiry,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
        deposit=deposit,
    )
Ejemplo n.º 26
0
def test_refund_messages(raiden_chain, token_addresses, deposit, network_wait):
    raise_on_failure(
        raiden_chain,
        run_test_refund_messages,
        raiden_chain=raiden_chain,
        token_addresses=token_addresses,
        deposit=deposit,
        network_wait=network_wait,
    )
def test_mediated_transfer_events(raiden_network, number_of_nodes, token_addresses, network_wait):
    raise_on_failure(
        raiden_network,
        run_test_mediated_transfer_events,
        raiden_network=raiden_network,
        number_of_nodes=number_of_nodes,
        token_addresses=token_addresses,
        network_wait=network_wait,
    )
Ejemplo n.º 28
0
def test_register_token(raiden_network, token_amount, contract_manager, retry_timeout):
    raise_on_failure(
        raiden_network,
        run_test_register_token,
        raiden_network=raiden_network,
        token_amount=token_amount,
        contract_manager=contract_manager,
        retry_timeout=retry_timeout,
    )
Ejemplo n.º 29
0
def test_clear_closed_queue(raiden_network, token_addresses, network_wait):
    """ Closing a channel clears the respective message queue. """
    raise_on_failure(
        raiden_network,
        run_test_clear_closed_queue,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
        network_wait=network_wait,
    )
Ejemplo n.º 30
0
def test_failsfast_lockedtransfer_exceeding_distributable(
        raiden_network, token_addresses, deposit):
    raise_on_failure(
        raiden_network,
        run_test_failsfast_lockedtransfer_exceeding_distributable,
        raiden_network=raiden_network,
        token_addresses=token_addresses,
        deposit=deposit,
    )