Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ledger API accepts malformed values for full, accounts and type parameters] (Version: [2.3.0-b1]) #5119

Open
mounikakun opened this issue Sep 6, 2024 · 0 comments

Comments

@mounikakun
Copy link
Collaborator

Issue Description

full, accounts and type parameters in ledger API do not return error on malformed inputs.

Steps to Reproduce

Test data: "False", "True", "malformedinput", 0, 1, -1, "@#$%^"
Test parameters: "full", "accounts", "type"

Sample request:

{
    "method": "ledger",
    "params": [
        {
            "full": "malformedinput"
        }
    ]
}

Expected Result

In the doc, type of the parameters "full", "accounts", "type" was not mentioned as they are deprecated values but as the parameters accept True/False inputs, basic expectation is to error out if the input is non boolean value.

Expected error: invalidParams

Actual Result

{
    "result": {
        "closed": {
            "ledger": {
                "account_hash": "BB0C0AA3BAA43E15828D61555CABA689209FE310313AACCB8CA9FE95AEB379EF",
                "close_flags": 0,
                "close_time": 778962961,
                "close_time_human": "2024-Sep-06 18:36:01.000000 UTC",
                "close_time_iso": "2024-09-06T18:36:01Z",
                "close_time_resolution": 10,
                "closed": true,
                "ledger_hash": "6A8887F02C58D95B9595BD8C21B10A9C3852653183AA7AB231650E4CCDF5A122",
                "ledger_index": "3925695",
                "parent_close_time": 778962960,
                "parent_hash": "96293497C7BC2708B7FD0C7FB1E2F3E7AB76C9239A6AF4512E87A7B30ECCC501",
                "total_coins": "99999409239888716",
                "transaction_hash": "0000000000000000000000000000000000000000000000000000000000000000"
            }
        },
        "open": {
            "ledger": {
                "closed": false,
                "ledger_index": "3925696",
                "parent_hash": "6A8887F02C58D95B9595BD8C21B10A9C3852653183AA7AB231650E4CCDF5A122"
            }
        },
        "status": "success"
    }
}

Environment

Rippled version: 2.3.0-b1

Supporting Files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant