XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.48k stars 1.45k forks source link

[get_aggregate_price] with malformed oracle_document_id value returns different error on Clio compared to rippled. #4999

Open mounikakun opened 2 months ago

mounikakun commented 2 months ago

Issue Description

Clio returns malformedDocumentID whereas rippled returns entryNotFound with malformed oracle_document_id values in ledger_entry.

Clio error is more descriptive compare to rippled. Would like more thoughts on this.

Steps to Reproduce

Request:


{
  "method": "ledger_entry",
  "params" : [
    {
      "oracle" : {
        "account": "rsbRFsph8AUY8zMNHfvLn9jxBxLKhgWc4j",
        "oracle_document_id":  1.2
      },
      "ledger_index": "validated"
    }
  ]
}

Expected Result

Rippled response:

{
    "result": {
        "error": "entryNotFound",
        "error_message": null,
        "ledger_hash": "A94D8AD4F72A40D3B491C756C9690AD516C1759D929ED08E43CAAF7BB62016B1",
        "ledger_index": 86953,
        "request": {
            "command": "ledger_entry",
            "ledger_index": "validated",
            "oracle": {
                "account": "rsbRFsph8AUY8zMNHfvLn9jxBxLKhgWc4j",
                "oracle_document_id": 1.2
            }
        },
        "status": "error",
        "validated": true
    }
}

Actual Result

Clio response:

{
    "result": {
        "error": "malformedDocumentID",
        "error_code": 5007,
        "error_message": "Malformed oracle_document_id.",
        "status": "error",
        "type": "response",
        "request": {
            "method": "ledger_entry",
            "params": [
                {
                    "oracle": {
                        "account": "rsbRFsph8AUY8zMNHfvLn9jxBxLKhgWc4j",
                        "oracle_document_id": 1.2E0
                    },
                    "ledger_index": "validated"
                }
            ]
        }
    },
    "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

Supporting Files