From 4166c7dae95e5e301c95a74bbe5a18d611acdfd6 Mon Sep 17 00:00:00 2001 From: derekpierre Date: Fri, 29 Sep 2023 14:47:18 -0400 Subject: [PATCH] Rename eth_provider_uri to eth_endpoint as it pertains to Characters/nodes/CLI options. --- .../finnegans-wake-demo-l2.py | 4 +-- examples/pre/heartbeat_demo/alicia.py | 2 +- examples/pre/heartbeat_demo/doctor.py | 2 +- examples/testnet_compound_multichain_taco.py | 2 +- examples/testnet_simple_taco.py | 2 +- nucypher/blockchain/eth/actors.py | 10 +++---- nucypher/blockchain/eth/trackers/bonding.py | 2 +- nucypher/characters/base.py | 14 +++++---- nucypher/characters/lawful.py | 22 +++++++------- nucypher/characters/unlawful.py | 2 +- nucypher/cli/actions/configure.py | 2 +- nucypher/cli/commands/ursula.py | 30 +++++++++---------- nucypher/cli/options.py | 5 ++-- nucypher/config/base.py | 20 ++++++------- nucypher/config/characters.py | 4 +-- .../migrations/configuration_v5_to_v6.py | 5 ++-- nucypher/network/middleware.py | 6 +++- nucypher/network/nodes.py | 26 ++++++++-------- nucypher/utilities/prometheus/metrics.py | 6 ++-- .../characters/test_fault_tolerance.py | 8 ++--- tests/acceptance/characters/test_operator.py | 4 +-- .../characters/test_transacting_power.py | 2 +- tests/acceptance/cli/test_ursula_init.py | 2 +- tests/acceptance/cli/test_ursula_run.py | 8 ++--- tests/fixtures.py | 20 +++++++------ .../test_bob_joins_policy_and_retrieves.py | 2 +- tests/integration/cli/test_cli_config.py | 17 +++++++---- tests/integration/cli/test_mixed_config.py | 4 +-- .../cli/test_ursula_cli_ip_detection.py | 6 ++-- .../integration/cli/test_ursula_config_cli.py | 4 +-- ...ursula_local_keystore_cli_functionality.py | 2 +- .../config/test_character_configuration.py | 8 ++--- .../config/test_configuration_persistence.py | 4 +-- .../config/test_keystore_integration.py | 8 ++--- tests/integration/config/test_storages.py | 2 +- tests/metrics/grant_availability.py | 2 +- tests/unit/test_character_sign_and_verify.py | 8 ++--- tests/utils/config.py | 6 ++-- 38 files changed, 148 insertions(+), 135 deletions(-) diff --git a/examples/pre/finnegans_wake_demo/finnegans-wake-demo-l2.py b/examples/pre/finnegans_wake_demo/finnegans-wake-demo-l2.py index 3744db254..c0b7c7376 100644 --- a/examples/pre/finnegans_wake_demo/finnegans-wake-demo-l2.py +++ b/examples/pre/finnegans_wake_demo/finnegans-wake-demo-l2.py @@ -55,7 +55,7 @@ L2_NETWORK = "mumbai" # rest of the network from the seednode. bob = Bob( domain=L1_NETWORK, - eth_provider_uri=L1_PROVIDER, + eth_endpoint=L1_PROVIDER, ) # Bob puts his public keys somewhere alice can find them. @@ -90,7 +90,7 @@ alice = Alice( checksum_address=ALICE_ADDRESS, signer=wallet, domain=L1_NETWORK, - eth_provider_uri=L1_PROVIDER, + eth_endpoint=L1_PROVIDER, pre_payment_method=pre_payment_method, ) diff --git a/examples/pre/heartbeat_demo/alicia.py b/examples/pre/heartbeat_demo/alicia.py index 8611a1d49..e431f2c7e 100644 --- a/examples/pre/heartbeat_demo/alicia.py +++ b/examples/pre/heartbeat_demo/alicia.py @@ -88,7 +88,7 @@ alicia = Alice( checksum_address=ALICE_ADDRESS, signer=wallet, domain=L1_NETWORK, - eth_provider_uri=L1_PROVIDER, + eth_endpoint=L1_PROVIDER, pre_payment_method=pre_payment_method, ) diff --git a/examples/pre/heartbeat_demo/doctor.py b/examples/pre/heartbeat_demo/doctor.py index 8c151fa0e..df93f633b 100644 --- a/examples/pre/heartbeat_demo/doctor.py +++ b/examples/pre/heartbeat_demo/doctor.py @@ -45,7 +45,7 @@ print("Creating the Doctor ...") doctor = Bob( domain=L1_NETWORK, crypto_power_ups=power_ups, - eth_provider_uri=L1_PROVIDER, + eth_endpoint=L1_PROVIDER, ) print("Doctor = ", doctor) diff --git a/examples/testnet_compound_multichain_taco.py b/examples/testnet_compound_multichain_taco.py index 7ed0fcff2..6afda0a91 100644 --- a/examples/testnet_compound_multichain_taco.py +++ b/examples/testnet_compound_multichain_taco.py @@ -96,7 +96,7 @@ print(f"\nEncrypted message:\n{bytes(threshold_message_kit).hex()}") print("--------- Threshold Decryption ---------") bob = Bob( - eth_provider_uri=staking_provider_uri, + eth_endpoint=staking_provider_uri, domain=network, coordinator_provider_uri=coordinator_provider_uri, coordinator_network=coordinator_network, diff --git a/examples/testnet_simple_taco.py b/examples/testnet_simple_taco.py index 21778f19d..3befd6f05 100644 --- a/examples/testnet_simple_taco.py +++ b/examples/testnet_simple_taco.py @@ -73,7 +73,7 @@ print(f"\nEncrypted message:\n{bytes(threshold_message_kit).hex()}") print("--------- Threshold Decryption ---------") bob = Bob( - eth_provider_uri=staking_provider_uri, + eth_endpoint=staking_provider_uri, domain=network, coordinator_provider_uri=coordinator_provider_uri, coordinator_network=coordinator_network, diff --git a/nucypher/blockchain/eth/actors.py b/nucypher/blockchain/eth/actors.py index 20380cfc9..017f2a0e1 100644 --- a/nucypher/blockchain/eth/actors.py +++ b/nucypher/blockchain/eth/actors.py @@ -158,7 +158,7 @@ class Operator(BaseActor): def __init__( self, - eth_provider_uri: str, + eth_endpoint: str, coordinator_provider_uri: str, coordinator_network: str, pre_payment_method: ContractPayment, @@ -173,7 +173,7 @@ class Operator(BaseActor): **kwargs, ): # Falsy values may be passed down from the superclass - if not eth_provider_uri: + if not eth_endpoint: raise ValueError("Ethereum Provider URI is required to init an operator.") if not coordinator_provider_uri: raise ValueError("Polygon Provider URI is required to init an operator.") @@ -204,7 +204,7 @@ class Operator(BaseActor): self.application_agent = ContractAgency.get_agent( TACoApplicationAgent, - provider_uri=eth_provider_uri, + provider_uri=eth_endpoint, registry=self.registry, ) @@ -742,10 +742,10 @@ class Operator(BaseActor): class PolicyAuthor(NucypherTokenActor): """Alice base class for blockchain operations, mocking up new policies!""" - def __init__(self, eth_provider_uri: str, *args, **kwargs): + def __init__(self, eth_endpoint: str, *args, **kwargs): super().__init__(*args, **kwargs) self.application_agent = ContractAgency.get_agent( - TACoApplicationAgent, registry=self.registry, provider_uri=eth_provider_uri + TACoApplicationAgent, registry=self.registry, provider_uri=eth_endpoint ) def create_policy(self, *args, **kwargs): diff --git a/nucypher/blockchain/eth/trackers/bonding.py b/nucypher/blockchain/eth/trackers/bonding.py index 0e966de13..ffe0051ac 100644 --- a/nucypher/blockchain/eth/trackers/bonding.py +++ b/nucypher/blockchain/eth/trackers/bonding.py @@ -20,7 +20,7 @@ class OperatorBondedTracker(SimpleTask): application_agent = ContractAgency.get_agent( TACoApplicationAgent, registry=self._ursula.registry, - provider_uri=self._ursula.eth_provider_uri, + provider_uri=self._ursula.eth_endpoint, ) # use TACo root since unbonding happens at root and not child (more immediate this way) staking_provider_address = application_agent.get_staking_provider_from_operator( diff --git a/nucypher/characters/base.py b/nucypher/characters/base.py index fedd22d96..0180b254b 100644 --- a/nucypher/characters/base.py +++ b/nucypher/characters/base.py @@ -34,7 +34,7 @@ class Character(Learner): def __init__( self, domain: str, - eth_provider_uri: str = None, + eth_endpoint: str = None, known_node_class: object = None, is_me: bool = True, checksum_address: str = None, @@ -113,14 +113,16 @@ class Character(Learner): except NoSigningPower: self._stamp = NO_SIGNING_POWER - self.eth_provider_uri = eth_provider_uri - self.registry = registry or ContractRegistry.from_latest_publication( - domain=domain + self.eth_endpoint = eth_endpoint + self.registry = ( + registry + or ContractRegistry.from_latest_publication(domain=domain) ) # See #1580 # REST - self.network_middleware = network_middleware or RestMiddleware(registry=self.registry, - eth_provider_uri=eth_provider_uri) + self.network_middleware = network_middleware or RestMiddleware( + registry=self.registry, eth_provider_uri=eth_endpoint + ) # Learner Learner.__init__(self, diff --git a/nucypher/characters/lawful.py b/nucypher/characters/lawful.py index 803f2729e..ca15ec094 100644 --- a/nucypher/characters/lawful.py +++ b/nucypher/characters/lawful.py @@ -131,7 +131,7 @@ class Alice(Character, actors.PolicyAuthor): self, # Mode is_me: bool = True, - eth_provider_uri: str = None, + eth_endpoint: str = None, signer=None, # Ownership checksum_address: Optional[ChecksumAddress] = None, @@ -170,7 +170,7 @@ class Alice(Character, actors.PolicyAuthor): self, known_node_class=Ursula, is_me=is_me, - eth_provider_uri=eth_provider_uri, + eth_endpoint=eth_endpoint, checksum_address=checksum_address, network_middleware=network_middleware, *args, @@ -179,7 +179,7 @@ class Alice(Character, actors.PolicyAuthor): if is_me: # TODO: #289 blockchain = BlockchainInterfaceFactory.get_interface( - eth_provider_uri=self.eth_provider_uri + eth_provider_uri=self.eth_endpoint ) signer = signer or Web3Signer( blockchain.client @@ -193,7 +193,7 @@ class Alice(Character, actors.PolicyAuthor): domain=self.domain, transacting_power=self.transacting_power, registry=self.registry, - eth_provider_uri=eth_provider_uri, + eth_endpoint=eth_endpoint, ) self.log = Logger(self.__class__.__name__) @@ -458,7 +458,7 @@ class Bob(Character): self, is_me: bool = True, verify_node_bonding: bool = False, - eth_provider_uri: str = None, + eth_endpoint: str = None, coordinator_provider_uri: str = None, # TODO: Move to a higher level and formalize coordinator_network: str = None, # TODO: Move to a higher level and formalize *args, @@ -469,7 +469,7 @@ class Bob(Character): is_me=is_me, known_node_class=Ursula, verify_node_bonding=verify_node_bonding, - eth_provider_uri=eth_provider_uri, + eth_endpoint=eth_endpoint, *args, **kwargs, ) @@ -825,7 +825,7 @@ class Ursula(Teacher, Character, Operator): client_password: Optional[str] = None, transacting_power: Optional[TransactingPower] = None, operator_signature_from_metadata=NOT_SIGNED, - eth_provider_uri: Optional[str] = None, + eth_endpoint: Optional[str] = None, condition_provider_uris: Optional[Dict[int, List[str]]] = None, pre_payment_method: Optional[Union[PaymentMethod, ContractPayment]] = None, # Character @@ -844,7 +844,7 @@ class Ursula(Teacher, Character, Operator): domain=domain, known_node_class=Ursula, include_self_in_the_state=True, - eth_provider_uri=eth_provider_uri, + eth_endpoint=eth_endpoint, **character_kwargs, ) @@ -863,7 +863,7 @@ class Ursula(Teacher, Character, Operator): signer=self.signer, crypto_power=self._crypto_power, operator_address=operator_address, - eth_provider_uri=eth_provider_uri, + eth_endpoint=eth_endpoint, pre_payment_method=pre_payment_method, client_password=client_password, condition_provider_uris=condition_provider_uris, @@ -997,10 +997,10 @@ class Ursula(Teacher, Character, Operator): # Connect to Provider if not BlockchainInterfaceFactory.is_interface_initialized( - eth_provider_uri=self.eth_provider_uri + eth_provider_uri=self.eth_endpoint ): BlockchainInterfaceFactory.initialize_interface( - eth_provider_uri=self.eth_provider_uri + eth_provider_uri=self.eth_endpoint ) if preflight: diff --git a/nucypher/characters/unlawful.py b/nucypher/characters/unlawful.py index 46abdac8f..2b384cc20 100644 --- a/nucypher/characters/unlawful.py +++ b/nucypher/characters/unlawful.py @@ -75,7 +75,7 @@ class Vladimir(Ursula): checksum_address=cls.fraud_address, operator_address=cls.fraud_address, signer=Web3Signer(blockchain.client), - eth_provider_uri=blockchain.eth_provider_uri, + eth_endpoint=blockchain.eth_provider_uri, pre_payment_method=bogus_pre_payment_method, ) diff --git a/nucypher/cli/actions/configure.py b/nucypher/cli/actions/configure.py index 909749f70..228ea0b95 100644 --- a/nucypher/cli/actions/configure.py +++ b/nucypher/cli/actions/configure.py @@ -159,7 +159,7 @@ def perform_startup_ip_check(emitter: StdoutEmitter, ursula: Ursula, force: bool external_ip = determine_external_ip_address( network=ursula.domain, known_nodes=ursula.known_nodes, - provider_uri=ursula.eth_provider_uri, + provider_uri=ursula.eth_endpoint, ) except UnknownIPAddress: message = 'Cannot automatically determine external IP address' diff --git a/nucypher/cli/commands/ursula.py b/nucypher/cli/commands/ursula.py index c62da98d7..d448d18a1 100644 --- a/nucypher/cli/commands/ursula.py +++ b/nucypher/cli/commands/ursula.py @@ -34,7 +34,7 @@ from nucypher.cli.options import ( option_config_root, option_dev, option_dry_run, - option_eth_provider_uri, + option_eth_endpoint, option_force, option_gas_strategy, option_key_material, @@ -74,7 +74,7 @@ class UrsulaConfigOptions: def __init__( self, - eth_provider_uri: str, + eth_endpoint: str, operator_address: str, rest_host: str, rest_port: int, @@ -93,7 +93,7 @@ class UrsulaConfigOptions: pre_payment_network: str, ): - self.eth_provider_uri = eth_provider_uri + self.eth_endpoint = eth_endpoint self.signer_uri = signer_uri self.operator_address = operator_address self.rest_host = rest_host @@ -121,7 +121,7 @@ class UrsulaConfigOptions: light=self.light, registry_filepath=self.registry_filepath, policy_registry_filepath=self.policy_registry_filepath, - eth_provider_uri=self.eth_provider_uri, + eth_endpoint=self.eth_endpoint, signer_uri=self.signer_uri, gas_strategy=self.gas_strategy, max_gas_price=self.max_gas_price, @@ -144,7 +144,7 @@ class UrsulaConfigOptions: domain=self.domain, registry_filepath=self.registry_filepath, policy_registry_filepath=self.policy_registry_filepath, - eth_provider_uri=self.eth_provider_uri, + eth_endpoint=self.eth_endpoint, signer_uri=self.signer_uri, gas_strategy=self.gas_strategy, max_gas_price=self.max_gas_price, @@ -175,7 +175,7 @@ class UrsulaConfigOptions: self.operator_address = select_client_account( emitter=emitter, prompt=prompt, - eth_provider_uri=self.eth_provider_uri, + eth_provider_uri=self.eth_endpoint, signer_uri=self.signer_uri, ) @@ -185,7 +185,7 @@ class UrsulaConfigOptions: emitter, network=self.domain, force=force, - provider_uri=self.eth_provider_uri, + provider_uri=self.eth_endpoint, ) return UrsulaConfiguration.generate( @@ -198,7 +198,7 @@ class UrsulaConfigOptions: operator_address=self.operator_address, registry_filepath=self.registry_filepath, policy_registry_filepath=self.policy_registry_filepath, - eth_provider_uri=self.eth_provider_uri, + eth_provider_uri=self.eth_endpoint, signer_uri=self.signer_uri, gas_strategy=self.gas_strategy, max_gas_price=self.max_gas_price, @@ -217,7 +217,7 @@ class UrsulaConfigOptions: operator_address=self.operator_address, registry_filepath=self.registry_filepath, policy_registry_filepath=self.policy_registry_filepath, - eth_provider_uri=self.eth_provider_uri, + eth_provider_uri=self.eth_endpoint, signer_uri=self.signer_uri, gas_strategy=self.gas_strategy, max_gas_price=self.max_gas_price, @@ -235,7 +235,7 @@ class UrsulaConfigOptions: group_config_options = group_options( # NOTE: Don't set defaults here or they will be applied to config updates. Use the Config API. UrsulaConfigOptions, - eth_provider_uri=option_eth_provider_uri(), + eth_endpoint=option_eth_endpoint(), signer_uri=option_signer_uri, gas_strategy=option_gas_strategy, max_gas_price=option_max_gas_price, @@ -290,7 +290,7 @@ class UrsulaCharacterOptions: URSULA = make_cli_character( character_config=ursula_config, emitter=emitter, - provider_uri=ursula_config.eth_provider_uri, + provider_uri=ursula_config.eth_endpoint, min_stake=self.min_stake, teacher_uri=self.teacher_uri, unlock_keystore=not self.config_options.dev, @@ -333,11 +333,11 @@ def init(general_config, config_options, force, config_root, key_material): _pre_launch_warnings(emitter, dev=None, force=force) if not config_root: config_root = general_config.config_root - if not config_options.eth_provider_uri: + if not config_options.eth_endpoint: raise click.BadOptionUsage( - "--eth-provider", + "--eth-endpoint", message=click.style( - "--eth-provider is required to initialize a new ursula.", fg="red" + "--eth-endpoint is required to initialize a new ursula.", fg="red" ), ) if not config_options.pre_payment_provider: @@ -491,7 +491,7 @@ def config(general_config, config_options, config_file, force, action): emitter=emitter, network=config_options.domain, force=force, - provider_uri=config_options.eth_provider_uri, + provider_uri=config_options.eth_endpoint, ) config_options.rest_host = rest_host if action == "migrate": diff --git a/nucypher/cli/options.py b/nucypher/cli/options.py index 574dafa21..059b1ff26 100644 --- a/nucypher/cli/options.py +++ b/nucypher/cli/options.py @@ -199,9 +199,10 @@ def option_policy_encrypting_key(required: bool = False): required=required) -def option_eth_provider_uri(default=None, required: bool = False): +def option_eth_endpoint(default=None, required: bool = False): return click.option( - '--eth-provider', 'eth_provider_uri', + "--eth-endpoint", + "eth_endpoint", help="Blockchain provider's URI i.e. 'file:///path/to/geth.ipc'", type=click.STRING, required=required, diff --git a/nucypher/config/base.py b/nucypher/config/base.py index fcaaf1d51..9b41f854d 100644 --- a/nucypher/config/base.py +++ b/nucypher/config/base.py @@ -368,7 +368,7 @@ class CharacterConfiguration(BaseConfiguration): # Blockchain poa: Optional[bool] = None, light: bool = False, - eth_provider_uri: Optional[str] = None, + eth_endpoint: Optional[str] = None, gas_strategy: Union[Callable, str] = DEFAULT_GAS_STRATEGY, max_gas_price: Optional[int] = None, signer_uri: Optional[str] = None, @@ -418,7 +418,7 @@ class CharacterConfiguration(BaseConfiguration): # Blockchain self.poa = poa self.is_light = light - self.eth_provider_uri = eth_provider_uri or NO_BLOCKCHAIN_CONNECTION + self.eth_endpoint = eth_endpoint or NO_BLOCKCHAIN_CONNECTION self.signer_uri = signer_uri or None # Learner @@ -443,11 +443,11 @@ class CharacterConfiguration(BaseConfiguration): self.gas_strategy = gas_strategy self.max_gas_price = max_gas_price # gwei is_initialized = BlockchainInterfaceFactory.is_interface_initialized( - eth_provider_uri=self.eth_provider_uri + eth_provider_uri=self.eth_endpoint ) - if not is_initialized and eth_provider_uri: + if not is_initialized and eth_endpoint: BlockchainInterfaceFactory.initialize_interface( - eth_provider_uri=self.eth_provider_uri, + eth_provider_uri=self.eth_endpoint, poa=self.poa, light=self.is_light, emitter=emitter, @@ -456,7 +456,7 @@ class CharacterConfiguration(BaseConfiguration): ) else: self.log.warn( - f"Using existing blockchain interface connection ({self.eth_provider_uri})." + f"Using existing blockchain interface connection ({self.eth_endpoint})." ) # TODO: this is potential fix for multichain connection, if we want to use it build it out into a loop @@ -533,7 +533,7 @@ class CharacterConfiguration(BaseConfiguration): # Network self.network_middleware = network_middleware or self.DEFAULT_NETWORK_MIDDLEWARE( - registry=self.registry, eth_provider_uri=self.eth_provider_uri + registry=self.registry, eth_provider_uri=self.eth_endpoint ) super().__init__(filepath=self.config_file_location, config_root=self.config_root) @@ -703,12 +703,12 @@ class CharacterConfiguration(BaseConfiguration): ) # Optional values (mode) - if self.eth_provider_uri: + if self.eth_endpoint: if not self.signer_uri: - self.signer_uri = self.eth_provider_uri + self.signer_uri = self.eth_endpoint payload.update( dict( - eth_provider_uri=self.eth_provider_uri, + eth_endpoint=self.eth_endpoint, poa=self.poa, light=self.is_light, signer_uri=self.signer_uri, diff --git a/nucypher/config/characters.py b/nucypher/config/characters.py index aa9b25c79..c536a122d 100644 --- a/nucypher/config/characters.py +++ b/nucypher/config/characters.py @@ -87,8 +87,8 @@ class UrsulaConfiguration(CharacterConfiguration): if not staking_provider_uris: self.condition_provider_uris[staking_chain_id] = staking_provider_uris - if self.eth_provider_uri not in staking_provider_uris: - staking_provider_uris.append(self.eth_provider_uri) + if self.eth_endpoint not in staking_provider_uris: + staking_provider_uris.append(self.eth_endpoint) @classmethod def address_from_filepath(cls, filepath: Path) -> str: diff --git a/nucypher/config/migrations/configuration_v5_to_v6.py b/nucypher/config/migrations/configuration_v5_to_v6.py index 47b4acbf4..5ff35994f 100644 --- a/nucypher/config/migrations/configuration_v5_to_v6.py +++ b/nucypher/config/migrations/configuration_v5_to_v6.py @@ -5,10 +5,11 @@ from nucypher.config.migrations.common import perform_migration def __migration(config: Dict) -> Dict: + taco_network = NetworksInventory.get_network(config["domain"]) eth_provider = config["eth_provider_uri"] - eth_chain_id = NetworksInventory.get_ethereum_chain_id(config["domain"]) + eth_chain_id = taco_network.eth_network.value polygon_provider = config["payment_provider"] - polygon_chain_id = NetworksInventory.get_polygon_chain_id(config["payment_network"]) + polygon_chain_id = taco_network.poly_network.value if "condition_provider_uris" in config: return config config["condition_provider_uris"] = { diff --git a/nucypher/network/middleware.py b/nucypher/network/middleware.py index ce8dcd912..79a9771ec 100644 --- a/nucypher/network/middleware.py +++ b/nucypher/network/middleware.py @@ -88,7 +88,11 @@ class NucypherMiddlewareClient: if node_or_sprout: if node_or_sprout is not EXEMPT_FROM_VERIFICATION: node = node_or_sprout.mature() # Morph into a node. - node.verify_node(network_middleware_client=self, registry=self.registry, eth_provider_uri=self.eth_provider_uri) + node.verify_node( + network_middleware_client=self, + registry=self.registry, + eth_endpoint=self.eth_provider_uri, + ) return self.parse_node_or_host_and_port(node_or_sprout, host, port) def parse_node_or_host_and_port(self, node, host, port): diff --git a/nucypher/network/nodes.py b/nucypher/network/nodes.py index 0fb24993a..b53fe0fad 100644 --- a/nucypher/network/nodes.py +++ b/nucypher/network/nodes.py @@ -272,7 +272,7 @@ class Learner: self.learning_deferred = Deferred() self.domain = domain default_middleware = self.__DEFAULT_MIDDLEWARE_CLASS( - registry=self.registry, eth_provider_uri=self.eth_provider_uri + registry=self.registry, eth_provider_uri=self.eth_endpoint ) self.network_middleware = network_middleware or default_middleware self.save_metadata = save_metadata @@ -359,7 +359,7 @@ class Learner: maybe_sage_node = self.node_class.from_teacher_uri( teacher_uri=uri, min_stake=0, - provider_uri=self.eth_provider_uri, + provider_uri=self.eth_endpoint, network_middleware=self.network_middleware, registry=self.registry, ) @@ -383,7 +383,7 @@ class Learner: seed_node = self.node_class.from_seednode_metadata( seednode_metadata=seednode_metadata, network_middleware=self.network_middleware, - provider_uri=self.eth_provider_uri, + provider_uri=self.eth_endpoint, ) except Exception as e: # TODO: log traceback here? @@ -472,7 +472,7 @@ class Learner: force=force_verification_recheck, network_middleware_client=self.network_middleware.client, registry=registry, - eth_provider_uri=self.eth_provider_uri, + eth_endpoint=self.eth_endpoint, ) except SSLError: # TODO: Bucket this node as having bad TLS info - maybe it's an update that hasn't fully propagated? 567 @@ -1056,14 +1056,14 @@ class Teacher: return staking_provider_address == self.checksum_address def _staking_provider_is_really_staking( - self, registry: ContractRegistry, eth_provider_uri: Optional[str] = None + self, registry: ContractRegistry, eth_endpoint: Optional[str] = None ) -> bool: """ This method assumes the stamp's signature is valid and accurate. As a follow-up, this checks that the staking provider is, indeed, staking. """ application_agent = ContractAgency.get_agent( - TACoApplicationAgent, registry=registry, provider_uri=eth_provider_uri + TACoApplicationAgent, registry=registry, provider_uri=eth_endpoint ) # type: TACoApplicationAgent is_staking = application_agent.is_authorized(staking_provider=self.checksum_address) # checksum address here is staking provider return is_staking @@ -1071,7 +1071,7 @@ class Teacher: def validate_operator( self, registry: ContractRegistry = None, - eth_provider_uri: Optional[str] = None, + eth_endpoint: Optional[str] = None, ) -> None: # TODO: restore this enforcement # if registry and not eth_provider_uri: @@ -1088,14 +1088,14 @@ class Teacher: # On-chain staking check, if registry is present if registry: if not self._operator_is_bonded( - registry=registry, provider_uri=eth_provider_uri + registry=registry, provider_uri=eth_endpoint ): # <-- Blockchain CALL message = f"Operator {self.operator_address} is not bonded to staking provider {self.checksum_address}" self.log.debug(message) raise self.UnbondedOperator(message) if self._staking_provider_is_really_staking( - registry=registry, eth_provider_uri=eth_provider_uri + registry=registry, eth_endpoint=eth_endpoint ): # <-- Blockchain CALL self.log.info(f"Verified operator {self}") self.verified_operator = True @@ -1115,7 +1115,7 @@ class Teacher: raise self.InvalidNode("Metadata signature is invalid") def validate_metadata( - self, registry: ContractRegistry = None, eth_provider_uri: Optional[str] = None + self, registry: ContractRegistry = None, eth_endpoint: Optional[str] = None ): # Verify the metadata signature if not self.verified_metadata: @@ -1126,13 +1126,13 @@ class Teacher: return # Offline check of valid stamp signature by worker - self.validate_operator(registry=registry, eth_provider_uri=eth_provider_uri) + self.validate_operator(registry=registry, eth_endpoint=eth_endpoint) def verify_node( self, network_middleware_client, registry: ContractRegistry = None, - eth_provider_uri: Optional[str] = None, + eth_endpoint: Optional[str] = None, certificate_filepath: Optional[Path] = None, force: bool = False, ) -> bool: @@ -1165,7 +1165,7 @@ class Teacher: ) # This is both the stamp's client signature and interface metadata check; May raise InvalidNode - self.validate_metadata(registry=registry, eth_provider_uri=eth_provider_uri) + self.validate_metadata(registry=registry, eth_endpoint=eth_endpoint) # The node's metadata is valid; let's be sure the interface is in order. if not certificate_filepath: diff --git a/nucypher/utilities/prometheus/metrics.py b/nucypher/utilities/prometheus/metrics.py index 40978b4ea..02a0a822c 100644 --- a/nucypher/utilities/prometheus/metrics.py +++ b/nucypher/utilities/prometheus/metrics.py @@ -157,16 +157,14 @@ def create_metrics_collectors(ursula: "lawful.Ursula") -> List[MetricsCollector] # Blockchain prometheus # TODO possible include information about payment - collectors.append( - BlockchainMetricsCollector(eth_provider_uri=ursula.eth_provider_uri) - ) + collectors.append(BlockchainMetricsCollector(eth_provider_uri=ursula.eth_endpoint)) # Staking Provider prometheus collectors.append( StakingProviderMetricsCollector( staking_provider_address=ursula.checksum_address, contract_registry=ursula.registry, - eth_provider_uri=ursula.eth_provider_uri, + eth_provider_uri=ursula.eth_endpoint, ) ) diff --git a/tests/acceptance/characters/test_fault_tolerance.py b/tests/acceptance/characters/test_fault_tolerance.py index d9f406769..020a1f574 100644 --- a/tests/acceptance/characters/test_fault_tolerance.py +++ b/tests/acceptance/characters/test_fault_tolerance.py @@ -137,12 +137,12 @@ def test_invalid_operators_tolerance( force=True, registry=test_registry, network_middleware_client=ursula.network_middleware.client, - eth_provider_uri=ursula.eth_provider_uri, + eth_endpoint=ursula.eth_endpoint, ) # In particular, we know that it's bonded to a staker who is really staking. assert ursula.is_confirmed assert ursula._staking_provider_is_really_staking( - registry=test_registry, eth_provider_uri=TEST_ETH_PROVIDER_URI + registry=test_registry, eth_endpoint=TEST_ETH_PROVIDER_URI ) # OK. Now we learn about this new worker. @@ -161,7 +161,7 @@ def test_invalid_operators_tolerance( # OK...so...the staker is not staking anymore ... assert not ursula._staking_provider_is_really_staking( - registry=test_registry, eth_provider_uri=TEST_ETH_PROVIDER_URI + registry=test_registry, eth_endpoint=TEST_ETH_PROVIDER_URI ) # ... but the worker node still is "verified" (since we're not forcing on-chain verification) @@ -176,7 +176,7 @@ def test_invalid_operators_tolerance( force=True, registry=test_registry, network_middleware_client=ursula.network_middleware.client, - eth_provider_uri=TEST_ETH_PROVIDER_URI, + eth_endpoint=TEST_ETH_PROVIDER_URI, ) # diff --git a/tests/acceptance/characters/test_operator.py b/tests/acceptance/characters/test_operator.py index f6a4a4383..8a2fbef2d 100644 --- a/tests/acceptance/characters/test_operator.py +++ b/tests/acceptance/characters/test_operator.py @@ -16,7 +16,7 @@ def test_stakers_bond_to_ursulas(ursulas, test_registry, staking_providers): assert len(ursulas) == len(staking_providers) for ursula in ursulas: ursula.validate_operator( - registry=test_registry, eth_provider_uri=TEST_ETH_PROVIDER_URI + registry=test_registry, eth_endpoint=TEST_ETH_PROVIDER_URI ) assert ursula.verified_operator @@ -106,7 +106,7 @@ def test_vladimir_uses_his_own_signing_key(alice, ursulas, test_registry): message = f"Operator {vladimir.operator_address} is not bonded" with pytest.raises(vladimir.UnbondedOperator, match=message): vladimir.validate_metadata( - registry=test_registry, eth_provider_uri=TEST_ETH_PROVIDER_URI + registry=test_registry, eth_endpoint=TEST_ETH_PROVIDER_URI ) diff --git a/tests/acceptance/characters/test_transacting_power.py b/tests/acceptance/characters/test_transacting_power.py index c79100a20..52fce395e 100644 --- a/tests/acceptance/characters/test_transacting_power.py +++ b/tests/acceptance/characters/test_transacting_power.py @@ -21,7 +21,7 @@ def test_character_transacting_power_signing(testerchain, test_registry): signer = Character( is_me=True, domain=TEMPORARY_DOMAIN, - eth_provider_uri=TEST_ETH_PROVIDER_URI, + eth_endpoint=TEST_ETH_PROVIDER_URI, registry=test_registry, checksum_address=eth_address, ) diff --git a/tests/acceptance/cli/test_ursula_init.py b/tests/acceptance/cli/test_ursula_init.py index de932f4f5..63e9c1b4d 100644 --- a/tests/acceptance/cli/test_ursula_init.py +++ b/tests/acceptance/cli/test_ursula_init.py @@ -131,7 +131,7 @@ def test_ursula_and_local_keystore_signer_integration( worker_account.address, "--config-root", str(config_root_path.absolute()), - "--eth-provider", + "--eth-endpoint", TEST_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, diff --git a/tests/acceptance/cli/test_ursula_run.py b/tests/acceptance/cli/test_ursula_run.py index db1b9338f..7c4ad29d9 100644 --- a/tests/acceptance/cli/test_ursula_run.py +++ b/tests/acceptance/cli/test_ursula_run.py @@ -45,7 +45,7 @@ def test_ursula_run_with_prometheus_but_no_metrics_port(click_runner): "--dry-run", # Disable twisted reactor in subprocess "--lonely", # Do not load seednodes "--prometheus", # Specify collection of prometheus metrics - "--eth-provider", + "--eth-endpoint", TEST_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, @@ -74,7 +74,7 @@ def test_run_lone_default_development_ursula(click_runner, ursulas, testerchain) "--lonely", # Do not load seednodes, "--operator-address", ursulas[0].operator_address, - "--eth-provider", + "--eth-endpoint", TEST_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_ETH_PROVIDER_URI, @@ -128,7 +128,7 @@ def test_ursula_learns_via_cli(click_runner, ursulas, testerchain): "--dry-run", # Disable twisted reactor "--operator-address", ursulas[0].operator_address, - "--eth-provider", + "--eth-endpoint", TEST_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_ETH_PROVIDER_URI, @@ -180,7 +180,7 @@ def test_persistent_node_storage_integration( init_args = ( "ursula", "init", - "--eth-provider", + "--eth-endpoint", TEST_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, diff --git a/tests/fixtures.py b/tests/fixtures.py index 21f769d64..b60ecf97d 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -130,8 +130,8 @@ def random_address(random_account): @pytest.fixture(scope="module") def ursula_test_config(test_registry, temp_dir_path, testerchain): config = make_ursula_test_configuration( - eth_provider_uri=TEST_ETH_PROVIDER_URI, - pre_payment_provider=TEST_ETH_PROVIDER_URI, + eth_endpoint=TEST_ETH_PROVIDER_URI, + polygon_endpoint=TEST_ETH_PROVIDER_URI, test_registry=test_registry, rest_port=select_test_port(), operator_address=testerchain.ursulas_accounts.pop(), @@ -145,8 +145,8 @@ def ursula_test_config(test_registry, temp_dir_path, testerchain): @pytest.fixture(scope="module") def alice_test_config(ursulas, testerchain, test_registry): config = make_alice_test_configuration( - eth_provider_uri=TEST_ETH_PROVIDER_URI, - pre_payment_provider=TEST_ETH_PROVIDER_URI, + eth_endpoint=TEST_ETH_PROVIDER_URI, + polygon_endpoint=TEST_ETH_PROVIDER_URI, known_nodes=ursulas, checksum_address=testerchain.alice_account, test_registry=test_registry, @@ -157,9 +157,11 @@ def alice_test_config(ursulas, testerchain, test_registry): @pytest.fixture(scope="module") def bob_test_config(testerchain, test_registry): - config = make_bob_test_configuration(eth_provider_uri=TEST_ETH_PROVIDER_URI, - test_registry=test_registry, - checksum_address=testerchain.bob_account) + config = make_bob_test_configuration( + eth_endpoint=TEST_ETH_PROVIDER_URI, + test_registry=test_registry, + checksum_address=testerchain.bob_account, + ) yield config config.cleanup() @@ -338,7 +340,7 @@ def light_ursula(temp_dir_path, random_account, mocker): pre_payment_method=pre_payment_method, checksum_address=random_account.address, operator_address=random_account.address, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, signer=KeystoreSigner(path=temp_dir_path), ) return ursula @@ -462,7 +464,7 @@ def highperf_mocked_alice( def highperf_mocked_bob(fleet_of_highperf_mocked_ursulas): config = BobConfiguration( dev_mode=True, - eth_provider_uri=TEST_ETH_PROVIDER_URI, + eth_endpoint=TEST_ETH_PROVIDER_URI, domain=TEMPORARY_DOMAIN, network_middleware=MockRestMiddlewareForLargeFleetTests( eth_provider_uri=TEST_ETH_PROVIDER_URI diff --git a/tests/integration/characters/test_bob_joins_policy_and_retrieves.py b/tests/integration/characters/test_bob_joins_policy_and_retrieves.py index a79241d0f..40d4ebdb6 100644 --- a/tests/integration/characters/test_bob_joins_policy_and_retrieves.py +++ b/tests/integration/characters/test_bob_joins_policy_and_retrieves.py @@ -49,7 +49,7 @@ def test_bob_retrieves(alice, ursulas, certificates_tempdir): bob = Bob( domain=TEMPORARY_DOMAIN, start_learning_now=True, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, network_middleware=MockRestMiddleware(eth_provider_uri=MOCK_ETH_PROVIDER_URI), abort_on_learning_error=True, known_nodes=a_couple_of_ursulas, diff --git a/tests/integration/cli/test_cli_config.py b/tests/integration/cli/test_cli_config.py index ceda1eec7..ec10365ba 100644 --- a/tests/integration/cli/test_cli_config.py +++ b/tests/integration/cli/test_cli_config.py @@ -42,7 +42,7 @@ def test_initialize_via_cli( "init", "--network", TEMPORARY_DOMAIN, - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_ETH_PROVIDER_URI, @@ -103,13 +103,18 @@ def test_reconfigure_via_cli( # Read pre-edit state config = config_class.from_configuration_file(custom_config_filepath) - assert config.eth_provider_uri != TEST_ETH_PROVIDER_URI + assert config.eth_endpoint != TEST_ETH_PROVIDER_URI del config # Write - view_args = (config_class.CHARACTER_CLASS.__name__.lower(), 'config', - '--config-file', str(custom_config_filepath.absolute()), - '--eth-provider', TEST_ETH_PROVIDER_URI) + view_args = ( + config_class.CHARACTER_CLASS.__name__.lower(), + "config", + "--config-file", + str(custom_config_filepath.absolute()), + "--eth-endpoint", + TEST_ETH_PROVIDER_URI, + ) result = click_runner.invoke(nucypher_cli, view_args, env=ENV) assert result.exit_code == 0 @@ -121,4 +126,4 @@ def test_reconfigure_via_cli( assert str(custom_filepath) in result.output # After editing the fields have been updated - assert config.eth_provider_uri == TEST_ETH_PROVIDER_URI + assert config.eth_endpoint == TEST_ETH_PROVIDER_URI diff --git a/tests/integration/cli/test_mixed_config.py b/tests/integration/cli/test_mixed_config.py index 40ea09170..d852f7674 100644 --- a/tests/integration/cli/test_mixed_config.py +++ b/tests/integration/cli/test_mixed_config.py @@ -62,7 +62,7 @@ def test_corrupted_configuration( init_args = ( "ursula", "init", - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, @@ -109,7 +109,7 @@ def test_corrupted_configuration( TEMPORARY_DOMAIN, "--pre-payment-network", TEMPORARY_DOMAIN, - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, diff --git a/tests/integration/cli/test_ursula_cli_ip_detection.py b/tests/integration/cli/test_ursula_cli_ip_detection.py index 0ecdbec86..81d43d138 100644 --- a/tests/integration/cli/test_ursula_cli_ip_detection.py +++ b/tests/integration/cli/test_ursula_cli_ip_detection.py @@ -36,7 +36,7 @@ def test_ursula_startup_ip_checkup(click_runner, mocker): "init", "--network", TEMPORARY_DOMAIN, - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, @@ -55,7 +55,7 @@ def test_ursula_startup_ip_checkup(click_runner, mocker): "--network", TEMPORARY_DOMAIN, "--force", - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, @@ -73,7 +73,7 @@ def test_ursula_startup_ip_checkup(click_runner, mocker): "--network", TEMPORARY_DOMAIN, "--force", - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", TEST_POLYGON_PROVIDER_URI, diff --git a/tests/integration/cli/test_ursula_config_cli.py b/tests/integration/cli/test_ursula_config_cli.py index 281daf4da..c3bd45f9d 100644 --- a/tests/integration/cli/test_ursula_config_cli.py +++ b/tests/integration/cli/test_ursula_config_cli.py @@ -60,7 +60,7 @@ def test_interactive_initialize_ursula(click_runner, mocker, tmpdir): "init", "--network", TEMPORARY_DOMAIN, - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", MOCK_ETH_PROVIDER_URI, @@ -100,7 +100,7 @@ def test_initialize_custom_configuration_root( MOCK_IP_ADDRESS, "--rest-port", deploy_port, - "--eth-provider", + "--eth-endpoint", MOCK_ETH_PROVIDER_URI, "--pre-payment-provider", MOCK_ETH_PROVIDER_URI, diff --git a/tests/integration/cli/test_ursula_local_keystore_cli_functionality.py b/tests/integration/cli/test_ursula_local_keystore_cli_functionality.py index 756c5af36..cbbe3e291 100644 --- a/tests/integration/cli/test_ursula_local_keystore_cli_functionality.py +++ b/tests/integration/cli/test_ursula_local_keystore_cli_functionality.py @@ -50,7 +50,7 @@ def test_ursula_init_with_local_keystore_signer( # Layer 1 "--network", TEMPORARY_DOMAIN, - "--eth-provider", + "--eth-endpoint", testerchain.eth_provider_uri, # Layer 2 "--pre-payment-network", diff --git a/tests/integration/config/test_character_configuration.py b/tests/integration/config/test_character_configuration.py index 5d017f037..fd7a22154 100644 --- a/tests/integration/config/test_character_configuration.py +++ b/tests/integration/config/test_character_configuration.py @@ -52,7 +52,7 @@ def test_development_character_configurations( lonely=True, domain=TEMPORARY_DOMAIN, checksum_address=testerchain.unassigned_accounts[0], - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, ) if character is Ursula: params.update(dict(operator_address=testerchain.unassigned_accounts[0])) @@ -125,7 +125,7 @@ def test_default_character_configuration_preservation( keystore.signing_public_key = SecretKey.random().public_key() character_config = configuration_class( checksum_address=fake_address, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, domain=network, rest_host=MOCK_IP_ADDRESS, pre_payment_provider=MOCK_ETH_PROVIDER_URI, @@ -137,7 +137,7 @@ def test_default_character_configuration_preservation( else: character_config = configuration_class( checksum_address=fake_address, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, domain=network, pre_payment_network=TEMPORARY_DOMAIN, policy_registry=test_registry, @@ -178,7 +178,7 @@ def test_ursula_development_configuration(testerchain): operator_address=testerchain.unassigned_accounts[1], domain=TEMPORARY_DOMAIN, pre_payment_network=TEMPORARY_DOMAIN, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, ) assert config.is_me is True assert config.dev_mode is True diff --git a/tests/integration/config/test_configuration_persistence.py b/tests/integration/config/test_configuration_persistence.py index 02161ae01..0d2104ef2 100644 --- a/tests/integration/config/test_configuration_persistence.py +++ b/tests/integration/config/test_configuration_persistence.py @@ -57,7 +57,7 @@ def test_alices_powers_are_persistent(ursulas, temp_dir_path, testerchain): bob = Bob( start_learning_now=False, domain=TEMPORARY_DOMAIN, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, network_middleware=MockRestMiddleware(eth_provider_uri=MOCK_ETH_PROVIDER_URI), ) @@ -98,7 +98,7 @@ def test_alices_powers_are_persistent(ursulas, temp_dir_path, testerchain): # Bob's eldest brother, Roberto, appears too roberto = Bob( domain=TEMPORARY_DOMAIN, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, start_learning_now=False, network_middleware=MockRestMiddleware(eth_provider_uri=MOCK_ETH_PROVIDER_URI), ) diff --git a/tests/integration/config/test_keystore_integration.py b/tests/integration/config/test_keystore_integration.py index cc085b209..b11937c03 100644 --- a/tests/integration/config/test_keystore_integration.py +++ b/tests/integration/config/test_keystore_integration.py @@ -81,18 +81,18 @@ def test_characters_use_keystore(temp_dir_path, testerchain): start_learning_now=False, keystore=keystore, domain=TEMPORARY_DOMAIN, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, checksum_address=testerchain.alice_account, pre_payment_method=pre_payment_method, ) Bob( - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, start_learning_now=False, keystore=keystore, domain=TEMPORARY_DOMAIN, ) Ursula( - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, start_learning_now=False, keystore=keystore, rest_host=LOOPBACK_ADDRESS, @@ -170,7 +170,7 @@ def test_ritualist(temp_dir_path, testerchain, dkg_public_key): pre_payment_method=pre_payment_method, operator_address=testerchain.ursulas_accounts[0], signer=Web3Signer(testerchain.client), - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, ) ritual_id = 23 diff --git a/tests/integration/config/test_storages.py b/tests/integration/config/test_storages.py index c5dc4387f..f7a96cbca 100644 --- a/tests/integration/config/test_storages.py +++ b/tests/integration/config/test_storages.py @@ -46,7 +46,7 @@ class BaseTestNodeStorageBackends: rest_port=select_test_port(), domain=TEMPORARY_DOMAIN, signer=signer, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, checksum_address=operator_addresses[i], operator_address=operator_addresses[i], pre_payment_method=pre_payment_method, diff --git a/tests/metrics/grant_availability.py b/tests/metrics/grant_availability.py index 27bc32b65..0343b467c 100755 --- a/tests/metrics/grant_availability.py +++ b/tests/metrics/grant_availability.py @@ -162,7 +162,7 @@ def make_alice(known_nodes: Optional[Set[Ursula]] = None): wallet.unlock_account(account=ALICE_ADDRESS, password=SIGNER_PASSWORD) alice_config = AliceConfiguration( - eth_provider_uri=ETHEREUM_PROVIDER_URI, + eth_endpoint=ETHEREUM_PROVIDER_URI, checksum_address=ALICE_ADDRESS, signer_uri=f'keystore://{SIGNER_URI}', config_root=TEMP_ALICE_DIR, diff --git a/tests/unit/test_character_sign_and_verify.py b/tests/unit/test_character_sign_and_verify.py index eedc4f897..61be5cfe2 100644 --- a/tests/unit/test_character_sign_and_verify.py +++ b/tests/unit/test_character_sign_and_verify.py @@ -22,7 +22,7 @@ def test_actor_without_signing_power_cannot_sign(): crypto_power=cannot_sign, start_learning_now=False, domain=TEMPORARY_DOMAIN, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, ) # The non-signer's stamp doesn't work for signing... @@ -47,7 +47,7 @@ def test_actor_with_signing_power_can_sign(): is_me=True, start_learning_now=False, domain=TEMPORARY_DOMAIN, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, ) stamp_of_the_signer = signer.stamp @@ -73,14 +73,14 @@ def test_anybody_can_verify(random_address): domain=TEMPORARY_DOMAIN, checksum_address=random_address, pre_payment_method=FreeReencryptions(), - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, ) # So, our story is fairly simple: an everyman meets Alice. somebody = Character( start_learning_now=False, domain=TEMPORARY_DOMAIN, - eth_provider_uri=MOCK_ETH_PROVIDER_URI, + eth_endpoint=MOCK_ETH_PROVIDER_URI, ) # Alice signs a message. diff --git a/tests/utils/config.py b/tests/utils/config.py index b2cc281b8..422ba8033 100644 --- a/tests/utils/config.py +++ b/tests/utils/config.py @@ -25,16 +25,16 @@ TEST_CHARACTER_CONFIG_BASE_PARAMS = dict( def assemble( checksum_address: str = None, - eth_provider_uri: str = None, + eth_endpoint: str = None, test_registry: ContractRegistry = None, known_nodes: List[Ursula] = None, ) -> dict: """Assemble a dictionary of keyword arguments to use when constructing a test configuration.""" # Generate runtime config params runtime_params = dict( - eth_provider_uri=eth_provider_uri, + eth_endpoint=eth_endpoint, registry=test_registry, - network_middleware=MockRestMiddleware(eth_provider_uri=eth_provider_uri), + network_middleware=MockRestMiddleware(eth_provider_uri=eth_endpoint), known_nodes=known_nodes, checksum_address=checksum_address, )