-
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
Fix 2.0 regression in tx method with binary output #4812
Conversation
57613e5
to
d6098b4
Compare
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.
👍
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 👍 Thanks for the changes.
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.
This is good to go as-is, but I left a suggestion to improve readability.
@@ -791,13 +791,13 @@ class Transaction_test : public beast::unit_test::suite | |||
auto const USD{gw["USD"]}; | |||
|
|||
env.fund(XRP(1000000), alice, gw); | |||
std::shared_ptr<STTx const> txn = env.tx(); | |||
std::shared_ptr<STTx const> const txn = env.tx(); |
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.
On second thought, you're calling getTransactionID
four times. Why not store it here, and use it at all of the calls?
uint256 const txID = txn->getTransactionID();
(You'll have to change the lambda capture to get &txID
instead of txn
.)
* Support for the mold linker (#4807) * Promote API version 2 to supported (#4803) * Promote API version 2 to be supported * Switch the command line to API version 1 * Fix LedgerRequestRPC test * Remove obsolete tx_account method This method is not implemented, the only parts which are removed are related to command-line parsing * Fix RPCCall test * Reduce diff size, small test improvements * Minor fixes * Support for the mold linker * Fix TransactionEntry_test * Fix AccountTx_test --------- Co-authored-by: seelabs <scott.determan@yahoo.com> * Update Linux smoketest distros (#4813) * Fix 2.0 regression in tx method with binary output (#4812) * Fix binary output from tx method * Formatting fix * Minor test improvement * Minor test improvements * Optimize calculation of close time to avoid impasse and minimize gratuitous proposal changes (#4760) * Optimize the calculation of close time to avoid impasse and minimize gratuitous proposal changes. * git apply clang-format.patch * Scott S review fixes. Also clang-format. * Set version to 2.0.0-rc2 --------- Co-authored-by: manoj <mdoshi@ripple.com> Co-authored-by: Scott Determan <scott.determan@yahoo.com> Co-authored-by: Bronek Kozicki <brok@incorrekt.com> Co-authored-by: Michael Legleux <legleux@users.noreply.github.com> Co-authored-by: Mark Travis <mtrippled@users.noreply.github.com>
* Fix binary output from tx method * Formatting fix * Minor test improvement * Minor test improvements
* Fix binary output from tx method * Formatting fix * Minor test improvement * Minor test improvements
* Fix binary output from tx method * Formatting fix * Minor test improvement * Minor test improvements
High Level Overview of Change
Fixes regression caused by #4775
This PR resolves #4811
Context of Change
The
STTx::getJson
was changed in API version 2 to allow for returning binary output as a single hex-encoded JSON string (not a JSON object). This caused regression insideTransaction::getJson
which will attempt to append fields to that not-an-object, resulting in failed JSON operation. This change is fixing this regression and adds a relevant test.Type of Change
.gitignore
, formatting, dropping support for older tooling)