-
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
Added Error messages on Gateway_Balance and Channel_Authorize #4577
Changes from 9 commits
f7c5c65
2b78768
2eb175e
e493534
690ce23
0cd5145
c843248
614cea4
29971ca
311e66c
3adae5b
dad2e8e
7344b30
b1bae4d
da46159
41fcf31
682a1a4
920cd81
21c5ebd
38e7f8e
ce680b5
092f6c3
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 |
---|---|---|
|
@@ -846,7 +846,10 @@ getSeedFromRPC(Json::Value const& params, Json::Value& error) | |
} | ||
|
||
std::pair<PublicKey, SecretKey> | ||
keypairForSignature(Json::Value const& params, Json::Value& error) | ||
keypairForSignature( | ||
Json::Value const& params, | ||
Json::Value& error, | ||
std::optional<std::reference_wrapper<JsonContext>> context) | ||
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. consider |
||
{ | ||
bool const has_key_type = params.isMember(jss::key_type); | ||
|
||
|
@@ -900,7 +903,14 @@ keypairForSignature(Json::Value const& params, Json::Value& error) | |
|
||
if (!keyType) | ||
{ | ||
error = RPC::invalid_field_error(jss::key_type); | ||
if (context.has_value() && context.value().get().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. nit: keep it consistent - use |
||
{ | ||
error = RPC::make_error(rpcBAD_KEY_TYPE); | ||
} | ||
else | ||
{ | ||
error = RPC::invalid_field_error(jss::key_type); | ||
} | ||
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. are the brackets needed here? |
||
return {}; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,7 +207,10 @@ std::optional<Seed> | |
parseRippleLibSeed(Json::Value const& params); | ||
|
||
std::pair<PublicKey, SecretKey> | ||
keypairForSignature(Json::Value const& params, Json::Value& error); | ||
keypairForSignature( | ||
Json::Value const& params, | ||
Json::Value& error, | ||
std::optional<std::reference_wrapper<JsonContext>> context = std::nullopt); | ||
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. Consider changing to |
||
|
||
/** | ||
* API version numbers used in API version 1 | ||
|
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.
consider passing
context.apiVersion
instead.