From f2193d6a3f4d969c3c8c027213088acddcb601ae Mon Sep 17 00:00:00 2001 From: Sean Darcy Date: Mon, 21 Oct 2024 07:26:49 +1100 Subject: [PATCH] return operator address in contracts --- contracts/service_node_contribution.py | 8 ++++++++ sent.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/contracts/service_node_contribution.py b/contracts/service_node_contribution.py index 8a6cae4..3deb1d6 100644 --- a/contracts/service_node_contribution.py +++ b/contracts/service_node_contribution.py @@ -95,6 +95,14 @@ def get_service_node_params(self): 'fee': params[3] } + def get_operator(self): + """ + returns the service node operator + """ + contributor_addresses = self.get_contributor_addresses() + return contributor_addresses[0] + + def get_contributor_addresses(self): """ Get the list of contributor addresses. diff --git a/sent.py b/sent.py index c4106c5..4bdc200 100644 --- a/sent.py +++ b/sent.py @@ -416,6 +416,7 @@ def fetch_contract_statuses(signum): #contributor_addresses = contract_interface.get_contributor_addresses() total_contributions = contract_interface.total_contribution() contributions = contract_interface.get_individual_contributions() + operator = contract_interface.get_operator() app.contracts[contract_address] = { 'contract_state': 'finalized' if is_finalized else 'cancelled' if is_cancelled else 'awaiting_contributors', @@ -428,6 +429,7 @@ def fetch_contract_statuses(signum): 'contributions': [ {"address": addr, "amount": amt} for addr, amt in contributions.items() ], + 'operator': operator, 'total_contributions': total_contributions, }