<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_tx_fee(tx_hex, config_path=None, bitcoind_opts=None, bitcoind_client=None):
 """ Get the tx fee for a tx Return the fee on success Return None on error """

    tx_fee_per_byte = get_tx_fee_per_byte(config_path=config_path, bitcoind_opts=bitcoind_opts, bitcoind_client=bitcoind_client)
    if tx_fee_per_byte is None:
        return None

    return calculate_tx_fee(tx_hex, tx_fee_per_byte)