1 suggestion
Optional improvements
[suggestion] · Invalid-element batch tests leave the null reply ID unchecked
Both new batch cases would accept an incorrect non-null error ID other than "X"; comparing complete replies would lock in the intended null ID and legacy error shape.
Location: test/functional/interface_rpc.py:186 (head).
Details and suggested fix
For each non-object element, parse() now resets the ID to JSON null and the version to legacy before throwing. The batch catch therefore produces {"result": None, "error": {"code": RPC_INVALID_REQUEST, "message": "Invalid Request object"}, "id": None} in both cases. However, the first case accepts any ID other than "X", and the notification case checks only the response length and error code. Changing just the parse-entry ID default to "Y" would leave both cases passing; object requests overwrite that default, so the existing object-only batch checks do not cover it. Define the expected invalid-element reply once and compare the complete response arrays against [successful_reply, invalid_element] and [invalid_element]. This retains coverage of the stale-ID and dropped-reply bugs while pinning the null ID and full legacy error shape.