-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
APIv2(account_info): handle invalid "signer_lists" value #4585
Changes from 1 commit
33fca64
7c970db
d626a6b
a15df56
c286cb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,15 @@ doAccountInfo(RPC::JsonContext& context) | |
} | ||
result[jss::account_flags] = std::move(acctFlags); | ||
|
||
// The document states that signer_lists is a bool, however | ||
// assigning any string value works. Do not allow this | ||
// This for api v2 onwards | ||
if (!params[jss::signer_lists].isBool() && context.apiVersion > 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to check the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a situation where we don't need to worry about validators very much, at least on the main net. This is an RPC query. It's not typical for main net validators to be required also handle very many RPC queries. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i see okay, thanks for the clarification 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the software version (e.g., There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i see, okay |
||
{ | ||
RPC::inject_error(rpcINVALID_PARAMS, result); | ||
return result; | ||
} | ||
|
||
// Return SignerList(s) if that is requested. | ||
if (params.isMember(jss::signer_lists) && | ||
params[jss::signer_lists].asBool()) | ||
|
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.
The tiniest of nits: The comment says "... allow this This for ...". Consider removing the capitalized "This".