Refactor OfferUtil into an injected service #4654
Closed
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.
This is a preliminary refactoring for a new core
TakeOfferModel
to be included in the next PR, which is going to need logic currently located in the inaccessible desktop module's offer package. (A new apitakeoffer
method will depend on coreTakeOfferModel
.)This change injects service dependencies into the
OfferUtil
instance and removes those service dependency arguments from formerly static method signatures.Other changes include:
Moving some Volume calc methods from
OfferUtil
toVolumeUtil
.Moving some Coin calc methods from
OfferUtil
toCoinUtil
.Injecting
OfferUtil
intoCreateOfferService
and relevant offer data & view models.Minor changes to
TradeStatistics2
,Trade
,Offer
&Contract
, to use static methods moved fromOfferUtil
to the newVolumeUtil
class.Deletion of
bisq.desktop.main.offer.MakerFeeProvider
andbisq.core.offer.MakerFeeProvider
. They were unnecessary wrappers around a singleOfferUtil
method.Renaming
OfferUtilTest
->CoinUtilTest
.Moving tests in
CoinCryptoUtilsTest
toCoinUtilTest
, and deletingCoinCryptoUtilsTest
.Adjusting affected offer data & view model tests.