From f97382323c7dc0242e75809219032c3910ee11b2 Mon Sep 17 00:00:00 2001 From: Lucjan Dudek Date: Fri, 12 Jul 2024 11:19:29 +0200 Subject: [PATCH] Allow extra termination reason when termiating an agreement (#156) --- golem/resources/agreement/agreement.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/golem/resources/agreement/agreement.py b/golem/resources/agreement/agreement.py index 436daa3b..b4d6810d 100644 --- a/golem/resources/agreement/agreement.py +++ b/golem/resources/agreement/agreement.py @@ -83,14 +83,16 @@ async def create_activity( return activity @api_call_wrapper() - async def terminate(self, reason: str = "") -> None: + async def terminate(self, reason: str = "", **extra) -> None: """Terminate the agreement. :param reason: Optional information for the provider explaining why the agreement was terminated. + :param extra: Optional additional information attached to termination reason, which will be + shared with Provider. """ try: - await self.api.terminate_agreement(self.id, request_body={"message": reason}) + await self.api.terminate_agreement(self.id, request_body={"message": reason, **extra}) await self.node.event_bus.emit(AgreementClosed(self)) except ApiException as e: if self._is_permanent_410(e):