XRPLF / clio

An XRP Ledger API Server
https://xrpl.org
ISC License
55 stars 47 forks source link

account_objects does not report error when "type" is not account related objects #1488

Open cindyyan317 opened 4 days ago

cindyyan317 commented 4 days ago

account_objects should return error when filter is not account related, such as "fee". Clio previously reported error correctly. Now it doesn't report error which is a bug. rippled has an issue to align this behavior with Clio. We need to bring the correct behavior back.

Steps to Reproduce

{
  "method": "account_objects",
  "params": [
    {
        "account":"ra1egD7jzyZWhcDaPD1eFPKzdSMVQCTsXM",
        "type":"fee"
    }
  ]
}

Expected Result

{
  "result": {
    "error": "invalidParams",
    "error_code": 31,
    "error_message": "Invalid field 'type'.",
    "status": "error",
    "type": "response"
...
}

Actual Result

{
  "result": {
    "ledger_hash": "B77D03F5E422F488E3F41178F2B71C7A27A98B013225670C91C00A060392B277",
    "ledger_index": 1844337,
    "validated": true,
    "limit": 200,
    "account": "ra1egD7jzyZWhcDaPD1eFPKzdSMVQCTsXM",
    "account_objects": [],
    "status": "success"
  },
  "warnings": [
    [],
    {
      "id": 2001,
      "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
    }
  ]
}

Environment

devnet