forked from raiden-network/raiden-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_contracts.py
60 lines (52 loc) · 1.69 KB
/
test_contracts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from typing import Callable
import pytest
from web3 import Web3
from web3.contract import Contract
from raiden_contracts.constants import TEST_SETTLE_TIMEOUT_MAX, TEST_SETTLE_TIMEOUT_MIN
@pytest.fixture()
def token_network_test_storage(
deploy_tester_contract: Callable,
web3: Web3,
custom_token: Contract,
secret_registry_contract: Contract,
) -> Contract:
return deploy_tester_contract(
"TokenNetworkInternalStorageTest",
[
custom_token.address,
secret_registry_contract.address,
int(web3.version.network),
TEST_SETTLE_TIMEOUT_MIN,
TEST_SETTLE_TIMEOUT_MAX,
],
)
@pytest.fixture()
def token_network_test_signatures(
deploy_tester_contract: Contract,
web3: Web3,
custom_token: Contract,
secret_registry_contract: Contract,
) -> Contract:
return deploy_tester_contract(
"TokenNetworkSignatureTest",
_token_address=custom_token.address,
_secret_registry=secret_registry_contract.address,
_chain_id=int(web3.version.network),
_settlement_timeout_min=TEST_SETTLE_TIMEOUT_MIN,
_settlement_timeout_max=TEST_SETTLE_TIMEOUT_MAX,
)
@pytest.fixture()
def token_network_test_utils(
deploy_tester_contract: Contract,
web3: Web3,
custom_token: Contract,
secret_registry_contract: Contract,
) -> Contract:
return deploy_tester_contract(
"TokenNetworkUtilsTest",
_token_address=custom_token.address,
_secret_registry=secret_registry_contract.address,
_chain_id=int(web3.version.network),
_settlement_timeout_min=TEST_SETTLE_TIMEOUT_MIN,
_settlement_timeout_max=TEST_SETTLE_TIMEOUT_MAX,
)