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
[WIP (redo after atomic-tx merge)] Define new CLI output formatting api, check old vs new diffs #5715
Closed
ghubstan
wants to merge
51
commits into
bisq-network:master
from
ghubstan:5-replace-cli-output-fmts-n-test-diffs
Closed
[WIP (redo after atomic-tx merge)] Define new CLI output formatting api, check old vs new diffs #5715
ghubstan
wants to merge
51
commits into
bisq-network:master
from
ghubstan:5-replace-cli-output-fmts-n-test-diffs
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
So we can see all fields (especially address) -- not always shown by annotation generated toString.
Note that newest Intellij code auto-formatter has improved indentation of method parameters on separate lines.
As usual, method pkg tests are disabled to reduce gradle apitest case runtimes. Method pkg tests are run from bisq.apitest.scenario test cases to reduce # of time test harness setup/shutdown is run.
The method pkg trade test cases were refactored to cut size.
Refactored some CLI console output formatting code to adjust to new XMR offer support in API. (TableFormat's 'formatOfferTable' method was moved to a new OfferFormat class.) BSQ offers cannot have a margin-based-price, and trigger-price was never displayed. XMR offers can have a margin-based-price and a trigger-price, so altcoin offer display in the console is not as simple as before.
Unfortunately, the EditOffer proto triggerPrice field was declared as a long instead of a string, so the CLI has to look at the offer to know how to scale the trigger-price (for a fiat or altcoin offer) param sent to the server in its 'editoffer' request. That means a preliminary round trip to the server: a 'getmyoffer' request.
So far, only a BSQ altcoin offer cannot be mkt price margin based, and cannot have a trigger price. An XMR offer can, so the server side 'editoffer' validator must not prevent editing the relevant price fields.
- Adjusted test cases to CLI console's offer formatting changes. - Disabled an edit xmr test until current mkt xmr price can be requested via API.
Resulting from github website file conflict resolution -- my 1st.
This is never released, and helps flag diffs in changes to CLI output during development.
Include non unit (jupiter) test cases to prove the new CLI output api prints the same text as the deprecated CLI output formatters. These test cases will be modified in the next PR, which will delete the deprecated CLI output formatters.
ghubstan
changed the title
Replace CLI output formatters and check old vs new diffs
Define new CLI output formatting api, check old vs new diffs
Sep 22, 2021
ghubstan
changed the title
Define new CLI output formatting api, check old vs new diffs
[WIP (redo after atomic-tx merge)] Define new CLI output formatting api, check old vs new diffs
Oct 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The CLI console output formatting code will be replaced with a simpler, easier to maintain output formatting api. This PR defines the api, but does not adjust the CLI to it (that will happen in next PR).
I verified there are no diffs in the old vs new console output, excepting removal of some extra white space. Test cases are included, to verify the new console output == the old console output. These test cases will be removed in the next PR, where deprecated code will be completely removed.
Changes were committed in the following stages.
Deprecated CLI output formatting classes being replaced.
Defined CLI table column interface and implementations.
Added license banners and class level javadoc.
Added proto consuming CLI Table builders.
Added CLI test dependency 'cowwoc:diff-match-patch'.
This is never released, and helps flag diffs in changes to CLI output during development.
Added old vs new CLI output diff checks
Include non unit (jupiter) test cases to prove the new CLI output api prints the same text as the deprecated CLI output formatters. These test cases will be modified in the next PR, which will delete the deprecated CLI output formatters.
This is the 5th in a series of PRs starting with #5685.
#5691 should be reviewed & merged before this one.