Skip to content

Commit

Permalink
Fix few tests to adjust for emitting confirmed block
Browse files Browse the repository at this point in the history
  • Loading branch information
LefterisJP committed Oct 26, 2018
1 parent 10093f7 commit f200573
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion raiden/tests/integration/api/test_pythonapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from raiden.api.python import RaidenAPI
from raiden.exceptions import DepositMismatch, UnknownTokenAddress
from raiden.settings import DEFAULT_NUMBER_OF_BLOCK_CONFIRMATIONS
from raiden.tests.utils.events import must_contain_entry
from raiden.tests.utils.geth import wait_until_block
from raiden.tests.utils.transfer import get_channelstate
Expand Down Expand Up @@ -159,7 +160,7 @@ def test_channel_lifecycle(raiden_network, token_addresses, deposit, transport_c
channel12.settle_timeout +
10 # arbitrary number of additional blocks, used to wait for the settle() call
)
wait_until_block(node1.raiden.chain, settlement_block)
wait_until_block(node1.raiden.chain, settlement_block + DEFAULT_NUMBER_OF_BLOCK_CONFIRMATIONS)

state_changes = node1.raiden.wal.storage.get_statechanges_by_identifier(
from_identifier=0,
Expand Down
7 changes: 6 additions & 1 deletion raiden/tests/integration/test_integration_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)
from raiden.constants import GENESIS_BLOCK_NUMBER
from raiden.network.blockchain_service import BlockChainService
from raiden.settings import DEFAULT_NUMBER_OF_BLOCK_CONFIRMATIONS
from raiden.tests.utils.events import must_have_event
from raiden.tests.utils.geth import wait_until_block
from raiden.tests.utils.network import CHAIN
Expand Down Expand Up @@ -538,7 +539,11 @@ def test_secret_revealed(raiden_chain, deposit, settle_timeout, token_addresses)
channel_state2_1.partner_state.balance_proof,
)

settle_expiration = app0.raiden.chain.block_number() + settle_timeout
settle_expiration = (
app0.raiden.chain.block_number() +
settle_timeout +
DEFAULT_NUMBER_OF_BLOCK_CONFIRMATIONS
)
wait_until_block(app0.raiden.chain, settle_expiration)

assert_synced_channel_state(
Expand Down

0 comments on commit f200573

Please sign in to comment.