Skip to content

Commit

Permalink
testing increasing transferred amount
Browse files Browse the repository at this point in the history
  • Loading branch information
hackaugusto authored and konradkonrad committed Sep 6, 2017
1 parent 615309d commit 353ec6e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion raiden/tests/unit/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def test_python_channel():
assert test_channel.get_next_nonce() == 4


def test_channel_increase_nonce():
def test_channel_increase_nonce_and_transferred_amount():
""" The nonce must increase with each new transfer. """
token_address = make_address()
privkey1, address1 = make_privkey_address()
Expand All @@ -416,6 +416,7 @@ def test_channel_increase_nonce():
)

previous_nonce = test_channel.get_next_nonce()
previous_transferred = test_channel.transferred_amount

amount = 7
block_number = 1
Expand All @@ -425,9 +426,13 @@ def test_channel_increase_nonce():
test_channel.register_transfer(block_number, direct_transfer)

new_nonce = test_channel.get_next_nonce()
new_transferred = test_channel.transferred_amount

assert new_nonce == previous_nonce + 1
assert new_transferred == previous_transferred + amount

previous_nonce = new_nonce
previous_transferred = new_transferred


@pytest.mark.parametrize('blockchain_type', ['tester'])
Expand Down

0 comments on commit 353ec6e

Please sign in to comment.