-
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
Change order of checks in amm_info #4924
Conversation
58ef31b
to
99ea4fe
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4924 +/- ##
=========================================
- Coverage 71.3% 71.3% -0.0%
=========================================
Files 796 796
Lines 66981 66987 +6
Branches 10871 10887 +16
=========================================
- Hits 47774 47763 -11
- Misses 19207 19224 +17
|
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. |
Is this going to be merged soon? |
@godexsoft Yes, it should be merged today. |
* upstream/develop: (32 commits) fixInnerObjTemplate2 amendment (XRPLF#5047) Set version to 2.3.0-b1 Ignore restructuring commits (XRPLF#4997) Recompute loops (XRPLF#4997) Rewrite includes (XRPLF#4997) Rearrange sources (XRPLF#4997) Move CMake directory (XRPLF#4997) Add bin/physical.sh (XRPLF#4997) Prepare to rearrange sources: (XRPLF#4997) Change order of checks in amm_info: (XRPLF#4924) Add the fixEnforceNFTokenTrustline amendment: (XRPLF#4946) Replaces the usage of boost::string_view with std::string_view (XRPLF#4509) docs: explain how to find a clang-format patch generated by CI (XRPLF#4521) XLS-52d: NFTokenMintOffer (XRPLF#4845) chore: remove repeat words (XRPLF#5041) Expose all amendments known by libxrpl (XRPLF#5026) fixReducedOffersV2: prevent offers from blocking order books: (XRPLF#5032) Additional unit tests for testing deletion of trust lines (XRPLF#4886) Fix conan typo: (XRPLF#5044) Add new command line option to make replaying transactions easier: (XRPLF#5027) ...
* Change order of checks in amm_info * Change amm_info error message in API version 3 * Change amm_info error tests
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