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 store_name_zonefile_data(name, user_zonefile_txt, txid, storage_drivers=None): """ Store a serialized zonefile to immutable storage providers, synchronously. This is only necessary if we've added/changed/removed immutable data. Return (True, hash(user zonefile)) on success Return (False, None) on failure. """ storage_drivers = [] if storage_drivers is None else storage_drivers data_hash = storage.get_zonefile_data_hash(user_zonefile_txt) result = storage.put_immutable_data( user_zonefile_txt, txid, data_hash=data_hash, required=storage_drivers ) rc = bool(result) return rc, data_hash