2019-07-10 09:41:14 +00:00
|
|
|
"""
|
|
|
|
This file is part of nucypher.
|
|
|
|
|
|
|
|
nucypher is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
nucypher is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with nucypher. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
"""
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from nucypher.blockchain.eth.deployers import (NucypherTokenDeployer,
|
|
|
|
StakingEscrowDeployer)
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
2019-08-12 07:15:43 +00:00
|
|
|
def token_deployer(testerchain, test_registry):
|
2019-07-10 09:41:14 +00:00
|
|
|
|
2019-08-12 07:15:43 +00:00
|
|
|
token_deployer = NucypherTokenDeployer(registry=test_registry,
|
|
|
|
deployer_address=testerchain.etherbase_account)
|
2019-07-10 09:41:14 +00:00
|
|
|
return token_deployer
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
2019-08-12 07:15:43 +00:00
|
|
|
def staking_escrow_deployer(testerchain, token_deployer, test_registry):
|
2019-07-10 09:41:14 +00:00
|
|
|
token_deployer.deploy()
|
|
|
|
|
2019-08-12 07:15:43 +00:00
|
|
|
staking_escrow_deployer = StakingEscrowDeployer(registry=test_registry,
|
|
|
|
deployer_address=testerchain.etherbase_account)
|
2019-07-10 09:41:14 +00:00
|
|
|
return staking_escrow_deployer
|
2019-07-29 14:28:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope="function")
|
|
|
|
def deployment_progress():
|
|
|
|
class DeploymentProgress:
|
|
|
|
num_steps = 0
|
|
|
|
|
|
|
|
def update(self, steps: int):
|
|
|
|
self.num_steps += steps
|
|
|
|
|
|
|
|
progress = DeploymentProgress()
|
|
|
|
return progress
|