clio
clio copied to clipboard
[get_aggregate_price] with malformed quote_asset value returns different error on Clio compared to rippled
Issue Description
Clio returns invalidParams
whereas rippled returns objectNotFound
with malformed quote_asset values in get_aggregate_price
Steps to Reproduce
- Create two oracles.
- Send a get_aggregate_price request with malformed trim value.
- Malformed base_asset values:
None
,123
,-1
,0
,1.2
Request:
{
"method": "get_aggregate_price",
"params": [
{
"base_asset": "BTC",
"quote_asset": 123,
"oracles": [
{
"account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
"oracle_document_id": 1
},
{
"account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
"oracle_document_id": 1
}
]
}
]
}
Expected Result
Rippled response:
{
"result": {
"error": "objectNotFound",
"error_code": 92,
"error_message": "The requested object was not found.",
"ledger_current_index": 82571,
"request": {
"base_asset": "BTC",
"command": "get_aggregate_price",
"oracles": [
{
"account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
"oracle_document_id": 1
},
{
"account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
"oracle_document_id": 1
}
],
"quote_asset": 123
},
"status": "error",
"validated": false
}
}
Actual Result
Clio response:
{
"result": {
"error": "invalidParams",
"error_code": 31,
"error_message": "Invalid parameters.",
"status": "error",
"type": "response",
"request": {
"method": "get_aggregate_price",
"params": [
{
"base_asset": "BTC",
"quote_asset": 123,
"oracles": [
{
"account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
"oracle_document_id": 1
},
{
"account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
"oracle_document_id": 1
}
]
}
]
}
},
"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
Issue exists with malformed values of oracle_document_id
. The values are: None
, 1.2
I think Clio's response (invalidParams) maybe more descriptive.
hi
Issue is fixed on rippled end for the below invalid test data of quote_asset
and reported cases oforacle_document_id
.
None, "Invalid", 123, -1, 0, 1.2, "H", "HB", "HBAR", "", _INVALID_NON_STANDARD_CURRENCY_CODE_:"0158415500000000C1F76FF6ECB0BAC600000000A"
objectNotFound
remains same for the below cases
VALID_NON_STANDARD_CURRENCY_CODE = "0158415500000000C1F76FF6ECB0BAC600000000", "HBA"
Clio is not replicating invalidParams
error for below test data
"Invalid", _INVALID_NON_STANDARD_CURRENCY_CODE_:"0158415500000000C1F76FF6ECB0BAC600000000A", "H", "HB", "HBAR", ""
Issue still exists for empty ""
value of and quote_asset
empty quote_asset request:
{"method": "get_aggregate_price", "params": [{"base_asset": "BTC", "quote_asset": "", "oracles": [{"account": "rHLmopST54fABrhgmhsiDou3hMDXcsSTfJ", "oracle_document_id": 1}, {"account": "rK1agLUfmeSyqTpBUmK49FnF77kV9HgdKu", "oracle_document_id": 1}], "Fee": "20"}]}
rippled response:
{
"result": {
"error": "invalidParams",
"error_code": 31,
"error_message": "Invalid parameters.",
"request": {
"Fee": "20",
"base_asset": "BTC",
"command": "get_aggregate_price",
"oracles": [
{
"account": "rHLmopST54fABrhgmhsiDou3hMDXcsSTfJ",
"oracle_document_id": 1
},
{
"account": "rK1agLUfmeSyqTpBUmK49FnF77kV9HgdKu",
"oracle_document_id": 1
}
],
"quote_asset": ""
},
"status": "error"
}
}
clio response:
{
"result": {
"error": "objectNotFound",
"error_code": 92,
"error_message": "The requested object was not found.",
"status": "error",
"type": "response",
"request": {
"method": "get_aggregate_price",
"params": [
{
"base_asset": "BTC",
"quote_asset": "",
"oracles": [
{
"account": "rHLmopST54fABrhgmhsiDou3hMDXcsSTfJ",
"oracle_document_id": 1
},
{
"account": "rK1agLUfmeSyqTpBUmK49FnF77kV9HgdKu",
"oracle_document_id": 1
}
],
"Fee": "20"
}
]
}
},
"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"
}
]
}
Fixed by #1481