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
Change order of checks in amm_info #4924
base: develop
Are you sure you want to change the base?
Conversation
58ef31b
to
99ea4fe
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #4924 +/- ##
===========================================
- Coverage 70.93% 61.50% -9.44%
===========================================
Files 796 797 +1
Lines 66792 70163 +3371
Branches 10998 36264 +25266
===========================================
- Hits 47377 43151 -4226
- Misses 19415 19764 +349
- Partials 0 7248 +7248 ☔ View full report in Codecov by Sentry. |
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 👍
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
this is good to merge - note it preserves the current behaviour in API version 2 and adds a test for it. |
High Level Overview of Change
Checking if account is well-formed currently happens before the check if
asset
,asset2
andamm_account
are supplied, which results in an unexpected error messages if any of the fields is malformed. Swap the order of checks, so validity of fields is verified first. Since this is a breaking change, retain the existing behaviourif (apiVersion < 3)
and add identical check, but after checks of assets and accounts,if (apiVersion >= 3)
. Also add unit tests to demonstrate the old and new behaviour.Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)Before: sending an invalid account or asset to
amm_info
RPC method while other parameters are not set as expected would result inrpcINVALID_PARAMS
error. This behaviour is retained in API version 2After: sending an invalid account or asset to
amm_info
RPC method while other parameters are not set as expected will result inrpcISSUE_MALFORMED
orrpcACT_MALFORMED
error. This behaviour is new in API version 3This resolves XRPLF/clio#1157