コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #8
0
ファイル: test_settlement.py プロジェクト: offerm/raiden
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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #14
0
ファイル: test_settlement.py プロジェクト: offerm/raiden
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,
    )
コード例 #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,
    )
コード例 #16
0
ファイル: test_settlement.py プロジェクト: offerm/raiden
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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #22
0
ファイル: test_settlement.py プロジェクト: offerm/raiden
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,
    )
コード例 #23
0
ファイル: test_settlement.py プロジェクト: offerm/raiden
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,
    )
コード例 #24
0
ファイル: test_settlement.py プロジェクト: offerm/raiden
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,
    )
コード例 #25
0
ファイル: test_settlement.py プロジェクト: offerm/raiden
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,
    )
コード例 #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,
    )
コード例 #27
0
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,
    )
コード例 #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,
    )
コード例 #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,
    )
コード例 #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,
    )