forked from raiden-network/raiden-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
service_registry_fixtures.py
46 lines (40 loc) · 1.54 KB
/
service_registry_fixtures.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
from typing import Callable
import pytest
from web3.contract import Contract
from raiden_contracts.constants import CONTRACT_SERVICE_REGISTRY, EMPTY_ADDRESS
from raiden_contracts.tests.utils import (
DEFAULT_BUMP_DENOMINATOR,
DEFAULT_BUMP_NUMERATOR,
DEFAULT_DECAY_CONSTANT,
DEFAULT_MIN_PRICE,
DEFAULT_REGISTRATION_DURATION,
DEPLOYER_ADDRESS,
)
@pytest.fixture(scope="session")
def service_registry(deploy_tester_contract: Callable, custom_token: Contract) -> Contract:
return deploy_tester_contract(
CONTRACT_SERVICE_REGISTRY,
_token_for_registration=custom_token.address,
_controller=DEPLOYER_ADDRESS,
_initial_price=int(3000e18),
_price_bump_numerator=DEFAULT_BUMP_NUMERATOR,
_price_bump_denominator=DEFAULT_BUMP_DENOMINATOR,
_decay_constant=DEFAULT_DECAY_CONSTANT,
_min_price=DEFAULT_MIN_PRICE,
_registration_duration=DEFAULT_REGISTRATION_DURATION,
)
@pytest.fixture(scope="session")
def service_registry_without_controller(
deploy_tester_contract: Callable, custom_token: Contract
) -> Contract:
return deploy_tester_contract(
CONTRACT_SERVICE_REGISTRY,
_token_for_registration=custom_token.address,
_controller=EMPTY_ADDRESS,
_initial_price=3000 * (10 ** 18),
_price_bump_numerator=DEFAULT_BUMP_NUMERATOR,
_price_bump_denominator=DEFAULT_BUMP_DENOMINATOR,
_decay_constant=DEFAULT_DECAY_CONSTANT,
_min_price=DEFAULT_MIN_PRICE,
_registration_duration=DEFAULT_REGISTRATION_DURATION,
)