Merge pull request #3499 from KPrasch/contracts

Compatibility with nucypher/nucypher-contracts #254
pull/3509/head
Derek Pierre 2024-05-13 16:46:33 -04:00 committed by GitHub
commit 008621ed1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 3 deletions

View File

View File

@ -48,7 +48,12 @@ DEAUTHORIZATION_DURATION = 60 * 60 * 24 * 60 # 60 days in seconds
COMMITMENT_DURATION_1 = 182 * 60 * 24 * 60 # 182 days in seconds
COMMITMENT_DURATION_2 = 2 * COMMITMENT_DURATION_1 # 365 days in seconds
COMMITMENT_DEADLINE = 60 * 60 * 24 * 100 # 100 days after deploymwent
COMMITMENT_DEADLINE = 60 * 60 * 24 * 100 # 100 days after deployment
PENALTY_DEFAULT = 1000 # 10% penalty
PENALTY_INCREMENT = 2500 # 25% penalty increment
PENALTY_DURATION = 60 * 60 * 24 # 1 day in seconds
# Coordinator
TIMEOUT = 3600
@ -167,6 +172,9 @@ def taco_application(
DEAUTHORIZATION_DURATION,
[COMMITMENT_DURATION_1, COMMITMENT_DURATION_2],
maya.now().epoch + COMMITMENT_DEADLINE,
PENALTY_DEFAULT,
PENALTY_DURATION,
PENALTY_INCREMENT,
)
proxy = deployer_account.deploy(
@ -210,6 +218,13 @@ def taco_child_application(
return proxy_contract
@pytest.fixture(scope="module")
def adjudicator(module_mocker, get_random_checksum_address):
_adjudicator = module_mocker.Mock()
_adjudicator.address = get_random_checksum_address()
return _adjudicator
@pytest.fixture(scope="module")
def coordinator(
oz_dependency,
@ -217,6 +232,7 @@ def coordinator(
deployer_account,
taco_child_application,
ritual_token,
adjudicator,
):
_coordinator = deployer_account.deploy(
nucypher_dependency.Coordinator,
@ -237,7 +253,9 @@ def coordinator(
proxy_contract = nucypher_dependency.Coordinator.at(proxy.address)
proxy_contract.makeInitiationPublic(sender=deployer_account)
taco_child_application.initialize(proxy_contract.address, sender=deployer_account)
taco_child_application.initialize(
proxy_contract.address, adjudicator.address, sender=deployer_account
)
return proxy_contract
@ -258,7 +276,6 @@ def subscription_manager(nucypher_dependency, deployer_account):
)
return _subscription_manager
#
# Deployment/Blockchains
#