Remove stale references to PreallocationEscrow contract stuff

pull/2616/head
David Núñez 2021-03-28 19:58:48 +02:00
parent e9cfb0819b
commit 6279827657
5 changed files with 5 additions and 22 deletions

View File

@ -26,7 +26,6 @@ STAKING_ESCROW_CONTRACT_NAME = 'StakingEscrow'
STAKING_ESCROW_STUB_CONTRACT_NAME = 'StakingEscrowStub'
POLICY_MANAGER_CONTRACT_NAME = 'PolicyManager'
STAKING_INTERFACE_CONTRACT_NAME = 'StakingInterface'
PREALLOCATION_ESCROW_CONTRACT_NAME = 'PreallocationEscrow'
ADJUDICATOR_CONTRACT_NAME = 'Adjudicator'
WORKLOCK_CONTRACT_NAME = 'WorkLock'
MULTISIG_CONTRACT_NAME = 'MultiSig'
@ -39,7 +38,6 @@ NUCYPHER_CONTRACT_NAMES = (
DISPATCHER_CONTRACT_NAME,
STAKING_INTERFACE_CONTRACT_NAME,
STAKING_INTERFACE_ROUTER_CONTRACT_NAME,
PREALLOCATION_ESCROW_CONTRACT_NAME,
WORKLOCK_CONTRACT_NAME,
MULTISIG_CONTRACT_NAME,
)

View File

@ -25,12 +25,9 @@ import shutil
import tempfile
from abc import ABC, abstractmethod
from constant_sorrow.constants import REGISTRY_COMMITTED
from eth_typing.evm import ChecksumAddress
from typing import Dict, Iterator, List, Tuple, Type, Union, Optional
from web3.types import ABI
from typing import Dict, Iterator, List, Tuple, Type, Union
from nucypher.blockchain.eth import CONTRACT_REGISTRY_BASE
from nucypher.blockchain.eth.constants import PREALLOCATION_ESCROW_CONTRACT_NAME
from nucypher.blockchain.eth.networks import NetworksInventory
from nucypher.config.constants import DEFAULT_CONFIG_ROOT
from nucypher.utilities.logging import Logger

View File

@ -566,8 +566,8 @@ def _make_agency(testerchain, test_registry, token_economics, deployer_transacti
@pytest.fixture(scope='module')
def test_registry_source_manager(testerchain, test_registry):
with mock_registry_source_manager(blockchain=testerchain, test_registry=test_registry):
def test_registry_source_manager(test_registry):
with mock_registry_source_manager(test_registry=test_registry):
yield

View File

@ -161,9 +161,7 @@ def test_registry():
@pytest.fixture(scope='module')
def test_registry_source_manager(mock_testerchain, test_registry):
with mock_registry_source_manager(blockchain=mock_testerchain,
test_registry=test_registry,
mock_backend=True) as real_inventory:
with mock_registry_source_manager(test_registry=test_registry) as real_inventory:
yield real_inventory

View File

@ -22,7 +22,6 @@ from contextlib import contextmanager
from typing import Union
from nucypher.blockchain.eth.clients import EthereumClient
from nucypher.blockchain.eth.constants import PREALLOCATION_ESCROW_CONTRACT_NAME
from nucypher.blockchain.eth.networks import NetworksInventory
from nucypher.blockchain.eth.registry import (
BaseContractRegistry,
@ -35,7 +34,7 @@ from tests.utils.blockchain import TesterBlockchain
@contextmanager
def mock_registry_source_manager(blockchain, test_registry, mock_backend: bool = False):
def mock_registry_source_manager(test_registry):
class MockRegistrySource(CanonicalRegistrySource):
name = "Mock Registry Source"
@ -47,13 +46,6 @@ def mock_registry_source_manager(blockchain, test_registry, mock_backend: bool =
raise ValueError(f"Somehow, MockRegistrySource is trying to get a registry for '{self.network}'. "
f"Only '{TEMPORARY_DOMAIN}' is supported.'")
if not mock_backend:
factory = blockchain.get_contract_factory(contract_name=PREALLOCATION_ESCROW_CONTRACT_NAME)
preallocation_escrow_abi = factory.abi
self.allocation_template = {
"BENEFICIARY_ADDRESS": ["ALLOCATION_CONTRACT_ADDRESS", preallocation_escrow_abi]
}
def get_publication_endpoint(self) -> str:
return f":mock-registry-source:/{self.network}/{self.registry_name}"
@ -61,8 +53,6 @@ def mock_registry_source_manager(blockchain, test_registry, mock_backend: bool =
self.logger.debug(f"Reading registry at {self.get_publication_endpoint()}")
if self.registry_name == BaseContractRegistry.REGISTRY_NAME:
registry_data = test_registry.read()
elif self.registry_name == IndividualAllocationRegistry.REGISTRY_NAME:
registry_data = self.allocation_template
raw_registry_data = json.dumps(registry_data)
return raw_registry_data