add is_zonefile_data_current(), which takes a raw zone file (unlike is_zonefile_current())

This commit is contained in:
Jude Nelson
2017-04-05 11:24:14 -04:00
parent 9097fdecf3
commit fefae026f3

View File

@@ -1628,7 +1628,7 @@ def has_zonefile_hash(fqu, proxy=None):
def is_zonefile_current(fqu, zonefile_json, proxy=None):
"""
Return True if hash(@zonefile_json) published on blockchain
Return True if hash(@zonefile_json) is published on the blockchain
"""
proxy = get_default_proxy() if proxy is None else proxy
@@ -1638,6 +1638,18 @@ def is_zonefile_current(fqu, zonefile_json, proxy=None):
return is_zonefile_hash_current(fqu, zonefile_hash, proxy=proxy)
def is_zonefile_data_current(fqu, zonefile_data, proxy=None):
"""
Return True if hash(@zonefile_data) is published on the blockchain
"""
proxy = get_default_proxy() if proxy is None else proxy
zonefile_hash = storage.get_zonefile_data_hash(zonefile_data)
return is_zonefile_hash_current(fqu, zonefile_hash, proxy=proxy)
def is_zonefile_hash_current(fqu, zonefile_hash, proxy=None):
"""
Return True if hash(@zonefile_json) published on blockchain