https://travis-ci.org/github/bitcoin/bitcoin/jobs/680452476#L6107
{
    const int num_blocks{request.params[0].get_int()};
    const uint64_t max_tries{request.params[2].isNull() ? DEFAULT_MAX_TRIES : request.params[2].get_int()};
    CScript coinbase_script;
    std::string error;
    if (!getScriptFromDescriptor(request.params[1].get_str(), coinbase_script, error)) {
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, error);
    }
    const CTxMemPool& mempool = EnsureMemPool(request.context);
    ChainstateManager& chainman = EnsureChainman(request.context);
    return generateBlocks(chainman, mempool, coinbase_script, num_blocks, max_tries);
},
    };
}
static RPCHelpMan generate()
{
    return RPCHelpMan{"generate", "has been replaced by the -generate cli option. Refer to -help for more information.", {}, {}, RPCExamples{""}, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue {
    if (request.fHelp) {
        throw std::runtime_error(self.ToString());
    } else {
        throw JSONRPCError(RPC_METHOD_NOT_FOUND, self.ToString());
    }
    }};
}
static RPCHelpMan generatetoaddress()
{
    return RPCHelpMan{"generatetoaddress",
                "\nMine blocks immediately to a specified address (before the RPC call returns)\n",
                {
                    {"nblocks", RPCArg::Type::NUM, RPCArg::Optional::NO, "How many blocks are generated immediately."},