diff --git a/autonomy/analyse/service.py b/autonomy/analyse/service.py index 09574029cf..358a2e7631 100644 --- a/autonomy/analyse/service.py +++ b/autonomy/analyse/service.py @@ -184,6 +184,7 @@ ABCI = "abci" LEDGER = "ledger" TERMINATION_ABCI = PublicId(author="valory", name="termination_abci", version="any") +SLASHING_ABCI = PublicId(author="valory", name="slashing_abci", version="any") ENV_VAR_RE = re.compile( r"^\$\{(?P[A-Z_0-9]+)?:?(?Pbool|int|float|str|list|dict)?:?(?P.+)?\}$" ) @@ -728,12 +729,14 @@ def validate_override( ) ) - def _check_for_termination_abci_skill(self, dependencies: Set[PublicId]) -> None: + def _check_for_dependency( + self, dependencies: Set[PublicId], dependency: PublicId + ) -> None: """Check termination ABCI skill is an dependency for the agent""" - for dependency in dependencies: - if dependency.to_any() == TERMINATION_ABCI: + for _dependency in dependencies: + if _dependency.to_any() == dependency: return - self.logger.warning("Termination skill is not defined as a dependency") + self.logger.warning(f"{dependency} is not defined as a dependency") def validate_skill_config(self, skill_config: SkillConfig) -> None: """Check required overrides.""" @@ -751,7 +754,8 @@ def validate_skill_config(self, skill_config: SkillConfig) -> None: has_multiple_overrides=False, error_message="ABCI skill validation failed; {error}", ) - self._check_for_termination_abci_skill(skill_config.skills) + self._check_for_dependency(skill_config.skills, TERMINATION_ABCI) + self._check_for_dependency(skill_config.skills, SLASHING_ABCI) self.logger.info("No issues found in the ABCI skill configuration") def validate_agent_overrides(self, agent_config: AgentConfig) -> None: @@ -778,7 +782,9 @@ def validate_agent_overrides(self, agent_config: AgentConfig) -> None: "Agent overrides validation failed with following errors" f"\n\t- {error_string}" ) - self._check_for_termination_abci_skill(agent_config.skills) + + self._check_for_dependency(agent_config.skills, TERMINATION_ABCI) + self._check_for_dependency(agent_config.skills, SLASHING_ABCI) self.logger.info("No issues found in the agent overrides") def validate_service_overrides(self) -> None: diff --git a/tests/test_autonomy/test_cli/test_analyse/test_verify_service.py b/tests/test_autonomy/test_cli/test_analyse/test_verify_service.py index 156f007c55..c5b6423746 100644 --- a/tests/test_autonomy/test_cli/test_analyse/test_verify_service.py +++ b/tests/test_autonomy/test_cli/test_analyse/test_verify_service.py @@ -907,4 +907,7 @@ def test_run(self, caplog: Any) -> None: assert result.exit_code == 0, result.stderr assert "Service is ready to be deployed" in result.output - assert "Termination skill is not defined as a dependency" in caplog.text + assert ( + "valory/termination_abci:any is not defined as a dependency" in caplog.text + ) + assert "valory/slashing_abci:any is not defined as a dependency" in caplog.text