mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-20 15:55:26 +08:00
fix lack of DID resolution on imported names
This commit is contained in:
@@ -1222,6 +1222,7 @@ def get_DID_blockchain_record(did, proxy=None):
|
||||
|
||||
addr_names = get_historic_names_by_address(address, proxy=proxy)
|
||||
if json_is_error(addr_names):
|
||||
log.error("get_historic_names_by_address({}): {}".format(address, addr_names['error']))
|
||||
return addr_names
|
||||
|
||||
if len(addr_names) <= name_index:
|
||||
@@ -1244,9 +1245,18 @@ def get_DID_blockchain_record(did, proxy=None):
|
||||
if history_state['op'] == NAME_REVOKE:
|
||||
# end of the line
|
||||
return {'error': 'The name for this DID has been deleted'}
|
||||
|
||||
|
||||
assert history_state is not None
|
||||
final_name_state = history_state
|
||||
|
||||
if final_name_state is None:
|
||||
final_name_state = get_name_blockchain_record(name)
|
||||
if not json_is_error(final_name_state):
|
||||
# remove extra fields that shouldn't be present
|
||||
for extra_field in ['expired', 'expire_block', 'renewal_deadline']:
|
||||
if extra_field in final_name_state:
|
||||
del final_name_state[extra_field]
|
||||
|
||||
return final_name_state
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user