I’ve changed the qa test code to properly assert error codes and messages for failed RPC calls. That’s revealed a few RPCs which were returning incorrect or misleading error codes. This PR fixes all of those cases.
It also adds commenting around the definition of the JSON RPC error constants to warn against using RPC_INVALID_REQUEST and RPC_METHOD_NOT_FOUND for application-layer errors.