<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transform_attrib_for_ledger(txn):
 """ Creating copy of result so that `RAW`, `ENC` or `HASH` can be replaced by their hashes. We do not insert actual attribute data in the ledger but only the hash of it. """

        txn = deepcopy(txn)
        txn_data = get_payload_data(txn)
        attr_type, _, value = domain.parse_attr_txn(txn_data)
        if attr_type in [RAW, ENC]:
            txn_data[attr_type] = domain.hash_of(value) if value else ''

        return txn