<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def txn2epoch(self, txn: dict) -> int: """ Given ledger transaction, return its epoch time. :param txn: transaction as dict :return: transaction time """


        rv = None
        if self == Protocol.V_13:
            rv = txn['result']['txnTime']
        else:
            rv = txn['result']['txnMetadata']['txnTime']

        return rv