Skip to content
Snippets Groups Projects
Commit 8c8b8d76 authored by inso's avatar inso
Browse files

Initializing wallets tab

parent 7f3d0a7d
No related branches found
No related tags found
No related merge requests found
...@@ -32,18 +32,20 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): ...@@ -32,18 +32,20 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
parameters = self.community.get_parameters() parameters = self.community.get_parameters()
last_renewal = "" last_renewal = ""
expiration = "" expiration = ""
certifiers = 0
certified = 0
try: try:
person = Person.lookup(self.account.pubkey, self.community) person = Person.lookup(self.account.pubkey, self.community)
membership = person.membership(self.community) membership = person.membership(self.community)
certified = person.certified_by(self.community)
certifiers = person.certifiers_of(self.community)
renew_block = membership.block_number renew_block = membership.block_number
last_renewal = self.community.get_block(renew_block).mediantime last_renewal = self.community.get_block(renew_block).mediantime
expiration = last_renewal + parameters['sigValidity'] expiration = last_renewal + parameters['sigValidity']
except MembershipNotFoundError: except MembershipNotFoundError:
pass pass
certifiers = 0
certified = 0
date_renewal = QDateTime.fromTime_t(last_renewal).date().toString() date_renewal = QDateTime.fromTime_t(last_renewal).date().toString()
date_expiration = QDateTime.fromTime_t(expiration).date().toString() date_expiration = QDateTime.fromTime_t(expiration).date().toString()
...@@ -60,7 +62,8 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab): ...@@ -60,7 +62,8 @@ class WalletsTabWidget(QWidget, Ui_WalletsTab):
"Membership", "Membership",
"Last renewal on {:}, expiration on {:}".format(date_renewal, date_expiration), "Last renewal on {:}, expiration on {:}".format(date_renewal, date_expiration),
"Your web of trust :", "Your web of trust :",
"Certified by : {0} ; Certifier of : {0}".format(certifiers, certified) "Certified by : {0} ; Certifier of : {0}".format(len(certified),
len(certifiers))
) )
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment