handle test cases where operator address is untentionally unset in key mismatch prevention.

pull/3533/head
KPrasch 2024-08-01 01:21:41 +07:00
parent e3ef37d2c1
commit 0880e48dc8
No known key found for this signature in database
1 changed files with 21 additions and 18 deletions

View File

@ -98,26 +98,29 @@ class UrsulaConfiguration(CharacterConfiguration):
registry=self.registry,
)
staking_provider_address = application_agent.staking_provider_from_operator(
self.operator_address
)
if staking_provider_address and staking_provider_address != NULL_ADDRESS:
if coordinator_agent.is_provider_public_key_set(staking_provider_address):
message = (
f"Operator {self.operator_address} has already published a public key.\n"
f"It is not permitted to create a new node with this operator address."
f"{render_lost_seed_phrase_message()}"
)
self.log.critical(message)
raise self.ConfigurationError(message)
else:
emitter.echo(
"NOTE: Your operator is not bonded to a staking provider. \n"
"Bond the operator to a staking provider on the threshold dashboard.",
color="cyan",
if self.operator_address:
staking_provider_address = application_agent.staking_provider_from_operator(
self.operator_address
)
if staking_provider_address and staking_provider_address != NULL_ADDRESS:
if coordinator_agent.is_provider_public_key_set(
staking_provider_address
):
message = (
f"Operator {self.operator_address} has already published a public key.\n"
f"It is not permitted to create a new node with this operator address."
f"{render_lost_seed_phrase_message()}"
)
self.log.critical(message)
raise self.ConfigurationError(message)
else:
emitter.echo(
"NOTE: Your operator is not bonded to a staking provider. \n"
"Bond the operator to a staking provider on the threshold dashboard.",
color="cyan",
)
return super().initialize(*args, **kwargs)
def configure_condition_blockchain_endpoints(self) -> None: