Skip to content
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

Add common module #4

Merged
merged 26 commits into from
Jun 21, 2021
Merged

Conversation

chimp1984
Copy link
Contributor

Based on #3

I did only add few tests so far.
If any developer wants to contribute to add more unit tests to that module would be great. I need to focus to get progress on other areas...Some tests can be taken over from Bisq as well.

I am aware that buildSrc is more for common tasks instead of sharing dependencies, but as we use it for logging as well I think it is convenient to repeat that pattern for application wide used dependencies. At least I don't see any downside...

After some doubts I tend to be in favor of adding lombok as it improves productivity and reduces boilerplate code and thus increase readability.
Java records are not flexible enough to replace all use cases for value objects, as well as other annotations are convenient as well.
This will hold translation strings. It is intended to use different files for different aspects of the application. If we can match the module boundaries is questionable. I assume that might be too fine grained.
That module has no dependency to UI so can be used also for error logging in headless context, etc.
This is a collection of used utils and common classes from the misq prototype.
It has only few tests so far. Many classes are copied or derived from Bisq. There might be some tests for those to take over.

The monetary package was created in favor over the BitcoinJ monetary classes as those have heavily overloaded APIs and do not cover the use cases we need.
They are centered around BTC but we need to support fiat-fiat as well as altcoin-altcoin pairs.
Beside that the exchange rate API was very un-intuitive to use and did not cover all use cases.
The Quote class should handle all the use cases we need and was used already in the prototype project for the offer book domain.
Handling of BigInteger and BigDecimal might need more tests and checks if it handles overflow scenarios correctly.
@chimp1984 chimp1984 force-pushed the add_common_module branch from 3a95e85 to fdf1d93 Compare June 12, 2021 18:32
chimp1984 and others added 2 commits June 12, 2021 13:38
This changes a bit the behaviour in case of null values. We throw an IOException now, before it was returning null
@chimp1984 chimp1984 mentioned this pull request Jun 12, 2021
@chimp1984
Copy link
Contributor Author

@KaiWitt Great thanks for the reviews!

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the one build error, there were several complaints from git about trailing spaces.

../misqpull4.patch:480: trailing whitespace.
    
../misqpull4.patch:788: trailing whitespace.
    // We only can check if the currency is not fiat and if the code matches the format, but we do not maintain a list 
../misqpull4.patch:789: trailing whitespace.
    // of crypto currencies to be flexible with any newly added one. 
../misqpull4.patch:3868: trailing whitespace.
     * We only can check if the currency is not fiat and if the code matches the format, but we do not maintain a list 
../misqpull4.patch:239: new blank line at EOF.
+
warning: 4 lines applied after fixing whitespace errors.

@chimp1984
Copy link
Contributor Author

Other than the one build error, there were several complaints from git about trailing spaces.

../misqpull4.patch:480: trailing whitespace.
    
../misqpull4.patch:788: trailing whitespace.
    // We only can check if the currency is not fiat and if the code matches the format, but we do not maintain a list 
../misqpull4.patch:789: trailing whitespace.
    // of crypto currencies to be flexible with any newly added one. 
../misqpull4.patch:3868: trailing whitespace.
     * We only can check if the currency is not fiat and if the code matches the format, but we do not maintain a list 
../misqpull4.patch:239: new blank line at EOF.
+
warning: 4 lines applied after fixing whitespace errors.

How did you get those complaints?

@ghost
Copy link

ghost commented Jun 14, 2021

The whitespace errors are produced when applying the PR locally using git apply.

We should set up some automatic build tools like the Bisq repo has, perhaps can discuss at the status meeting.

@chimp1984
Copy link
Contributor Author

The whitespace errors are produced when applying the PR locally using git apply.

We should set up some automatic build tools like the Bisq repo has, perhaps can discuss at the status meeting.

Yes definitely! Should have been done initially, forgot about it...

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@chimp1984 chimp1984 changed the title Add common module Add common module [stage 2 of PR series] Jun 14, 2021
@chimp1984 chimp1984 changed the title Add common module [stage 2 of PR series] Add common module Jun 14, 2021
ghubstan added 7 commits June 21, 2021 12:03
There are no lombok dependency version contraints defined in common-platform,
so lombok-dependencies.gradle does not need to consume that platform.

In the normal use case, lombok dependency version contraints would be defined
in common-platform, and common-platform would be consumed by
lombok-dependencies.gradle.  However, this does not work for the gradle
dependency configuration types `annotationProcessor` and `testAnnotationProcessor`
(could be a Gradle bug).  In this corner case, we do have to specify the version
as @chimp1984 has done in lombok-dependencies.gradle.
We only need logback.xml files in application level modules, not
every module.  And logback complains about finding multiple
logback.xml files in the classpath.
Non-app level modules do not need their own logback config,
but some module's tests might.  (Test logback.xml files will be
excluded from shipped jars, but src/logback.xml files would be
included, and make logback complain about multiple config files
in the runtime classpath.)
A decision was made to use lombok.
@ghost ghost self-requested a review June 21, 2021 16:43
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ghubstan
Copy link
Contributor

ACK

@ghubstan ghubstan merged commit 3a41374 into bisq-network:main Jun 21, 2021
@chimp1984 chimp1984 deleted the add_common_module branch November 18, 2021 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants