def create_trx(op_return_val, issuing_transaction_fee, issuing_address, tx_outs, tx_inputs):
    """

    :param op_return_val:
    :param issuing_transaction_fee:
    :param issuing_address:
    :param tx_outs:
    :param tx_input:
    :return:
    """
    cert_out = CMutableTxOut(0, CScript([OP_RETURN, op_return_val]))
    tx_ins = []
    value_in = 0
    for tx_input in tx_inputs:
        tx_ins.append(CTxIn(COutPoint(tx_input.tx_hash, tx_input.tx_out_index)))
        value_in += tx_input.coin_value

    # send change back to our address
    amount = value_in - issuing_transaction_fee
    if amount > 0:
        change_out = create_transaction_output(issuing_address, amount)
        tx_outs = tx_outs + [change_out]
    tx_outs = tx_outs + [cert_out]
    transaction = CMutableTransaction(tx_ins, tx_outs)
    return transaction
def create_trx ( op_return_val , issuing_transaction_fee , issuing_address , tx_outs , tx_inputs ) : cert_out = CMutableTxOut ( 0 , CScript ( [ OP_RETURN , op_return_val ] ) ) tx_ins = [ ] value_in = 0 for tx_input in tx_inputs : tx_ins . append ( CTxIn ( COutPoint ( tx_input . tx_hash , tx_input . tx_out_index ) ) ) value_in += tx_input . coin_value amount = value_in - issuing_transaction_fee if amount > 0 : change_out = create_transaction_output ( issuing_address , amount ) tx_outs = tx_outs + [ change_out ] tx_outs = tx_outs + [ cert_out ] transaction = CMutableTransaction ( tx_ins , tx_outs ) return transaction
:param op_return_val:
    :param issuing_transaction_fee:
    :param issuing_address:
    :param tx_outs:
    :param tx_input:
    :return: