From fefae026f3286da7ebde7f6aab2b13f379f09fe0 Mon Sep 17 00:00:00 2001 From: Jude Nelson Date: Wed, 5 Apr 2017 11:24:14 -0400 Subject: [PATCH] add is_zonefile_data_current(), which takes a raw zone file (unlike is_zonefile_current()) --- blockstack_client/proxy.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/blockstack_client/proxy.py b/blockstack_client/proxy.py index 7170bd955..fb99e386d 100644 --- a/blockstack_client/proxy.py +++ b/blockstack_client/proxy.py @@ -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