The `generate` RPC method:
- was introduced in 2010
- is now only used for testing
- reaches across multiple components (wallet, mining)

I propose we remove the wallet `generate` RPC method and update all tests to use the `generatetoaddress` RPC method. We can do this non-invasively in the test framework by adding a `generate` method to `TestNode` so that the individual tests do not need to be updated. We could also add a `generate` alias to the `generatetoaddress` RPC method.

Doing this removes a wallet->server dependency and simplifies the wallet->server interface (#10973).

I'm opening this issue before implementing in case anyone has objections.
CBlockIndex *pb = chainActive.Tip();
    if (height >= 0 && height < chainActive.Height())
        pb = chainActive[height];
    if (pb == nullptr || !pb->nHeight)
        return 0;
    
    if (lookup <= 0)
        lookup = pb->nHeight % Params().GetConsensus().DifficultyAdjustmentInterval() + 1;
    
    if (lookup > pb->nHeight)
        lookup = pb->nHeight;
    CBlockIndex *pb0 = pb;
    int64_t minTime = pb0->GetBlockTime();
    int64_t maxTime = minTime;
    for (int i = 0; i < lookup; i++) {
        pb0 = pb0->pprev;
        int64_t time = pb0->GetBlockTime();
        minTime = std::min(time, minTime);
        maxTime = std::max(time, maxTime);
    }
    
    if (minTime == maxTime)
        return 0;
    arith_uint256 workDiff = pb->nChainWork - pb0->nChainWork;
    int64_t timeDiff = maxTime - minTime;
    return workDiff.getdouble() / timeDiff;
}
static UniValue getnetworkhashps(const JSONRPCRequest& request)