Create a wallet as follows:

```sh
$ bitcoin-cli createwallet "watchonly" true
$ bitcoin-cli -rpcwallet=watchonly getwalletinfo
{
   ...
   "private_keys_enabled": false
}
```

The following should fail, but doesn't:

```sh
$ bitcoin-cli -rpcwallet=watchonly encryptwallet 1234
wallet encrypted; The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.
```

It partially fails silently, because it doesn't actually add a seed. But it does ask for a password when calling `dumpwallet`, which doesn't make sense because we currently don't encrypt anything other than private keys.  
+ HelpExampleRpc("signmessage", "\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"my message\"")
                },
            }.ToString());
    auto locked_chain = pwallet->chain().lock();
    LOCK(pwallet->cs_wallet);
    EnsureWalletIsUnlocked(pwallet);
    std::string strAddress = request.params[0].get_str();
    std::string strMessage = request.params[1].get_str();
    CTxDestination dest = DecodeDestination(strAddress);
    if (!IsValidDestination(dest)) {
        throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
    }
    const PKHash *pkhash = boost::get<PKHash>(&dest);
    if (!pkhash) {
        throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
    }
    CKey key;
    CKeyID keyID(*pkhash);
    if (!pwallet->GetKey(keyID, key)) {
        throw JSONRPCError(RPC_WALLET_ERROR, "Private key not available");
    }
    CHashWriter ss(SER_GETHASH, 0);
    ss << strMessageMagic;
    ss << strMessage;
    std::vector<unsigned char> vchSig;
    if (!key.SignCompact(ss.GetHash(), vchSig))
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed");
    return EncodeBase64(vchSig.data(), vchSig.size());
}
static UniValue getreceivedbyaddress(const JSONRPCRequest& request)