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

RPC server responds with error if request params is empty array #616

Closed
sreuland opened this issue Apr 26, 2023 · 1 comment
Closed

RPC server responds with error if request params is empty array #616

sreuland opened this issue Apr 26, 2023 · 1 comment
Labels
bug Something isn't working soroban-scrum

Comments

@sreuland
Copy link
Contributor

What version are you using?

0.7.0

What did you do?

curl --location 'http://localhost:8000/soroban/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getNetwork",
    "params": []
}'

What did you expect to see?

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "friendbotUrl": "http://localhost:8000/friendbot",
        "passphrase": "Standalone Network ; February 2017",
        "protocolVersion": "20"
    }
}

What did you see instead?

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32602,
        "message": "invalid parameters: [-32602] invalid parameters"
    }
}

Noticed will get error response on other rpc methods(getHealth, getLatestLedger) that don't require params also, slightly different error message in some cases.

Made a defensive change to handle this from js client side -
stellar/js-soroban-client#70

@sreuland sreuland added bug Something isn't working soroban-scrum labels Apr 26, 2023
@sreuland
Copy link
Contributor Author

closing as duplicate - stellar/stellar-rpc#40

@github-project-automation github-project-automation bot moved this from Backlog to Done in Platform Scrum Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working soroban-scrum
Projects
Status: Done
Development

No branches or pull requests

1 participant