This would allow wallet operations like funding transactions with smart contract-based inputs such as LN, or any input the Core wallet doesn't know how to sign for.

https://github.com/bitcoin/bitcoin/pull/17211#issuecomment-933674310
/** @defgroup Actions
 *
 * @{
 */
bool CWaet::SignTransaction(CMutableTransaction& tx) const
{
    AssertLockHeld(cs_);
    // Build coins map
    std::map<COutPoint, Coin> coins;
    for (auto& input : tx.vin) {
        std::map<uint256, CWaetTx>::const_iterator mi = mapWaet.find(input.prevout.hash);
        if(mi == mapWaet.end() || input.prevout.n >= mi->second.tx->vout.size()) {
            return false;
        }
        const CWaetTx& wtx = mi->second;
        int prev_height = wtx.state<TxStateConfirmed>() ? wtx.state<TxStateConfirmed>()->confirmed_block_height : 0;
        coins[input.prevout] = Coin(wtx.tx->vout[input.prevout.n], prev_height, wtx.IsCoinBase());
    }
    std::map<int, bilingual_str> input_errors;
    return SignTransaction(tx, coins, SIGHASH_DEFAULT, input_errors);
}
bool CWaet::SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, bilingual_str>& input_errors) const
{
    // Try to sign with a ScriptPubKeyMans
    for (ScriptPubKeyMan* spk_man : GetAScriptPubKeyMans()) {
        // spk_man->SignTransaction wi return true if the transaction is complete,
        // so we can exit early and return true if that happens
        if (spk_man->SignTransaction(tx, coins, sighash, input_errors)) {
            return true;
        }