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

Identity From and to Json #178

parent a8e130af
No related branches found
No related tags found
No related merge requests found
......@@ -204,12 +204,12 @@ class IdentitiesRegistry:
self._instances[pubkey].blockchain_state = blockchain_state
elif self._instances[pubkey].blockchain_state != BlockchainState.VALIDATED \
and blockchain_state == BlockchainState.VALIDATED:
self._instance[pubkey].blockchain_state = blockchain_state
self._instances[pubkey].inner_data_changed.emit()
self._instances[pubkey].blockchain_state = blockchain_state
self._instances[pubkey].inner_data_changed.emit("")
if self._instances[pubkey].uid != uid:
self._instances[pubkey].uid = uid
self._instances[pubkey].inner_data_changed.emit()
self._instances[pubkey].inner_data_changed.emit("")
if self._instances[pubkey].local_state == LocalState.NOT_FOUND:
self._instances[pubkey].local_state = LocalState.COMPLETED
......
......@@ -68,8 +68,8 @@ class Identity(QObject):
"""
pubkey = json_data['pubkey']
uid = json_data['uid']
local_state = json_data['local_state']
blockchain_state = json_data['blockchain_state']
local_state = LocalState[json_data['local_state']]
blockchain_state = BlockchainState[json_data['blockchain_state']]
return cls(uid, pubkey, local_state, blockchain_state)
......@@ -325,8 +325,8 @@ class Identity(QObject):
"""
data = {'uid': self.uid,
'pubkey': self.pubkey,
'local_state': self.local_state,
'blockchain_state': self.blockchain_state}
'local_state': self.local_state.name,
'blockchain_state': self.blockchain_state.name}
return data
def __str__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment