Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
RPC commands understand markers derived from all ledger object types #4361
RPC commands understand markers derived from all ledger object types #4361
Changes from all commits
31b9ddc
b16593f
11f896a
fc02cb8
9f9cda7
b88e1f7
401c85d
be7e917
789788c
6d7628b
c0717b9
5764c2a
4f23caf
0dcc806
82c6e9d
c042b68
ddd3d98
d6883e6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I'm noticing that there are functions or manual code to create
escrow
s scattered around the test subdirectory. I see them in...It's probably time we bit the bullet and wrote some common code to build escrows in the test environment. But I don't need to burden this pull request with that change. Just an observation.
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.
I agree. I actually stole my code from Escrow_test.cpp, I think.
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.
I can attempt to apply the solve in this PR if you let me know what you want.
#4396
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.
Hi @dangell7, thanks for the offer. I can't give you a precise definition of what I'm looking for, but here's a hand wave.
First, note that there are several different unit test files that locally define functions or lambdas which
Here's where those functions are defined (locally) in Escrow_test.cpp: https://github.com/XRPLF/rippled/blob/develop/src/test/app/Escrow_test.cpp#L170-L190
Since this functions are only defined locally, they are not available to all of the test files that need to do these escrow operations. So the functions have been copied, pasted, and mutated into different test files. The
escrow
lambda, on line 548 here in this file, is one such example.However, if we pulled those functions out of Escrow_test.cpp and put them somewhere they could be used by all the tests, then we can remove a lot of code duplication.
An example you could consider following is the src/test/jtx/check.h and src/test/jtx/impl/check.cpp files. Those files create a
check
namespace and put all of the check-related functions in there. So in tests the functions are invoked likecheck::create(...)
orcheck::cash(...)
. That seems like a pretty good approach for less common facilities like checks and escrows.But once you've made those functions in the
escrow
namespace the work has only started. Now you need to go through all of the tests that use escrows and remove all of those local functions and lambdas. Replace calls to those local functions will calls to the new functions you created in theescrow
namespace. This may get tricky, because the escrow-related functions that have been copied around may have mutated. So the interfaces of the copied functions may not be uniform across the code base.Once you've...
Then you're done.
Does that make sense? It may be more work than you want to take on in your pull request. It may make more sense as a separate pull request.
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 note for escrows, above, applies to payChans as well. They could both be addressed in the same pull request, but not necessarily this pull request.
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.
I can attempt to apply the solve in this PR if you let me know what you want.
#4396
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.
Hi @dangell7. Thanks for this offer also. The notes here https://github.com/XRPLF/rippled/pull/4361/files#r1109064286 describe what would be done for escrows. An almost identical process could be followed for PayChan. You can think about whether that's a task you would like to take on.