-
Notifications
You must be signed in to change notification settings - Fork 3
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
archive/call: Synchronize the return type with sudo/sessionsKeys #104
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Throughout the entire API, JSON-RPC errors are only ever used in situations where the API is misused. This is intentional so that JSON-RPC client developers don't need to worry about these errors. |
Just to be sure I got this right: // Ok result wrapped in JSON-RPC Ok response
{
"jsonrpc": "2.0",
"id": 1,
"result": { "success": true, "value": ... },
}
// Error result wrapped in JSON-RPC Ok response
{
"jsonrpc": "2.0",
"id": 1,
"result": { "success": false, "error": ... },
} And we are only returning a JSON-RPC error object |
I'm not entirely certain if this is the appropriate forum for this suggestion, but I believe it would be beneficial if
I hope my intuition aligns with the technical realities, and I'd appreciate any insight or clarification on this matter. |
Yes |
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Have modified the resulting object to align with Let me know what you think of it since it removes the
Introducing this object seems oddly similar to a json-rpc object (https://github.com/paritytech/polkadot-sdk/pull/1682/files#r1335584309). Was this extension also motivated by json-rpc clients dropping / ignoring the error component? 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the rationale that it makes the method more consistent with https://paritytech.github.io/json-rpc-interface-spec/api/sudo_sessionKeys_unstable_generate.html
(if there was a desire to go the other way and add success
to both I'd also be happy).
@tomaka any remaining objections to merging this?
I included this |
I'm sortof the same; I don't care strongly either way but happy for a touch of extra consistency across the spec |
@lexnv perhaps we should just keep the |
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me!
Co-authored-by: James Wilson <james@jsdw.me>
This PR simplifies the return type of the
archive_unstable_call
method.This effectively changes the return object from
success: true, value: ...
toresult:...
andsuccess: false, error:...
toerror:...
to keep consistency with thesudo_sessionsKeys
format.The notes have been adjusted to reflect feedback from: #94.
@paritytech/subxt-team @tomaka @josepot @jsdw