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

Refactor OfferUtil into an injected service #4654

Closed
wants to merge 7 commits into from

Conversation

ghubstan
Copy link
Member

@ghubstan ghubstan commented Oct 15, 2020

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 api takeoffer method will depend on core TakeOfferModel.)

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 to VolumeUtil.

  • Moving some Coin calc methods from OfferUtil to CoinUtil.

  • Injecting OfferUtil into CreateOfferService and relevant offer data & view models.

  • Minor changes to TradeStatistics2, Trade, Offer & Contract, to use static methods moved from OfferUtil to the new VolumeUtil class.

  • Deletion of bisq.desktop.main.offer.MakerFeeProvider and bisq.core.offer.MakerFeeProvider. They were unnecessary wrappers around a single OfferUtil method.

  • Renaming OfferUtilTest -> CoinUtilTest.

  • Moving tests in CoinCryptoUtilsTest to CoinUtilTest, and deleting CoinCryptoUtilsTest.

  • Adjusting affected offer data & view model tests.

This is a preliminary refactoring for a new core TakeOfferModel, which
is going to need logic (for api 'takeoffer') currently located in the
unaccessible desktop module's offer package.

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 to VolumeUtil.

- Moving some Coin calc methods from OfferUtil to CoinUtil.

- Injecting OfferUtil into CreateOfferService and relevant
  offer data & view models.

- Minor changes to TradeStatistics2, Trade, Offer & Contract, to use
  static methods moved from OfferUtil to the new VolumeUtil class.

- Deletion of bisq.desktop.main.offer.MakerFeeProvider,
  and bisq.core.offer.MakerFeeProvider.  They were unnecessary
  wrappers around a single OfferUtil method.

- Renaming OfferUtilTest -> CoinUtilTest.

- Moving tests in CoinCryptoUtilsTest to CoinUtilTest, and deleting
  CoinCryptoUtilsTest.

- Adjusting affected offer data & view model tests.
@ghubstan ghubstan added this to In progress in Ship Bisq Daemon and API Oct 15, 2020
@ghubstan
Copy link
Member Author

Closing, too many file conflicts in this PR chain, after 1.4.x merge into main, will redo.

@ghubstan ghubstan closed this Oct 20, 2020
Ship Bisq Daemon and API automation moved this from In progress to Done Oct 20, 2020
@ghubstan ghubstan deleted the refactor-offerutil branch October 22, 2020 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant