code: def validate_id(tx_body):
          
          # NOTE: Remove reference to avoid side effects
          tx_body = deepcopy(tx_body)
          try:
              proposed_tx_id = tx_body['id']
          except KeyError:
              raise InvalidHash('No transaction id found!')
  
          tx_body['id'] = None
  
          tx_body_serialized = Transaction._to_str(tx_body)
          valid_tx_id = Transaction._to_hash(tx_body_serialized)
  
          if proposed_tx_id != valid_tx_id:
              err_msg = ("The transaction's id '{}' isn't equal to "
                         "the hash of its body, i.e. it's not valid.")
              raise InvalidHash(err_msg.format(proposed_tx_id))
docs: Validate the transaction ID of a transaction
  
              Args:
                  tx_body (dict): The Transaction to be transformed.