<p>These refactoring changes are for reducing existing and potential duplication coming with the addition of new trading protocol support in the gRPC API.  Some minor styling and logic simplification changes are also included.</p>
<ul>
<li>
<p>Convert OfferUtil to injected singleton, and move various offer related utility methods into it.</p>
</li>
<li>
<p>Delete both MakerFeeProvider classes, which were wrappers around the same static old OfferUtil method.</p>
</li>
<li>
<p>Inject OfferUtil into CreateOfferDataModel, CreateOfferViewModel,  TakeOfferDataModel, TakeOfferViewModel, MutableOfferDataModel,  MutableOfferViewModel, OfferDataModel, EditOfferDataModel,  EditOfferViewModel</p>
</li>
<li>
<p>Refactor TakeOfferViewModel</p>
<p>Use OfferUtil, remove unused fields & methods.<br>
Made minor logic simplification, style and formatting changes.</p>
</li>
<li>
<p>MutableOfferDataModel</p>
<p>Made minor logic simplification, style and formatting changes.</p>
</li>
<li>
<p>MutableOfferView uses new paymentAccount.isHalCashAccount().</p>
</li>
<li>
<p>MutableOfferViewModel</p>
<p>Refactored to use new VolumeUtil, CoinUtil, OfferUtil.<br>
Removed unused fields & accessors.<br>
Made minor style change.</p>
</li>
<li>
<p>Refactored OfferDataModel to use new OfferUtil</p>
</li>
<li>
<p>Refactor CreateOfferService</p>
<p>Inject and use OfferUtil<br>
Move some utility methods to OfferUtil<br>
Remove unused fields</p>
</li>
<li>
<p>Offer</p>
<p>Refactored to use new VolumeUtil for volume calculations.<br>
Made stateProperty and errorMessageProperty fields private.</p>
</li>
<li>
<p>PaymentAccount</p>
<p>Moved isHalCashAccount type check to this class.<br>
Moved getTradeCurrency logic to this class.</p>
</li>
<li>
<p>Contract, radeStatistics2, TradeStatistics3</p>
<p>Refactored to use new VolumeUtil for volume calculations.</p>
</li>
<li>
<p>Trade</p>
<p>Refactored to use new VolumeUtil for volume calculations.<br>
Made minor logic simplification, style and formatting changes.</p>
</li>
<li>
<p>CoinUtil</p>
<p>Moved some coin utility methods into this class</p>
</li>
<li>
<p>CoinUtilTest</p>
<p>Moved (coin related) tests from CoinCryptoUtilsTest and OfferUtilTest<br>
into CoinUtilTest, and deleted OfferUtilTest, CoinCryptoUtilsTest.</p>
</li>
<li>
<p>Adjust create and edit offer tests to model refactoring</p>
</li>
</ul>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/bisq-network/bisq/pull/4672'>https://github.com/bisq-network/bisq/pull/4672</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Refactor offer/trade related classes in core and desktop</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-1dd9914e3d0450d8cc1aaa2f15afa9836051911a41ecb287a813f9cd4f9f5afd">core/src/main/java/bisq/core/offer/CreateOfferService.java</a>
    (84)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-bf3127ac4929ce9edad4c827a37f61ebd7a38945ba5720e38ceb3bab38c61ba9">core/src/main/java/bisq/core/offer/MakerFeeProvider.java</a>
    (29)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-7421f25cc1584830f6e575beb0aec9adfc30bc1360c52519f81af4d16fd3f29a">core/src/main/java/bisq/core/offer/Offer.java</a>
    (9)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-b604ee7141fcfacf2dd0aeade4bf393c4d4d93617ab327147c363539ae804496">core/src/main/java/bisq/core/offer/OfferUtil.java</a>
    (408)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-189dabf054a26f4cd086890f538252d6c47a246491d7d95e730ce6a0e640d786">core/src/main/java/bisq/core/payment/PaymentAccount.java</a>
    (27)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-5628741f4073603b515dea81ac8682aaba0aa5f11fe1f88eb6edeccb73779ce3">core/src/main/java/bisq/core/trade/Contract.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-0399e1caaadecbe847e18f0eda2ca8bf60f9777bc3bc30840e3af493601260b1">core/src/main/java/bisq/core/trade/Trade.java</a>
    (34)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-f099e762eb187f7f8b74b0d0c584dc0f4f7173e745782f8ac11466dd03926a5b">core/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java</a>
    (4)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-ee3e6ab6efe02715d897f3f01ac2ea73097880835637201e3e8c7ac80d34fde7">core/src/main/java/bisq/core/trade/statistics/TradeStatistics3.java</a>
    (4)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-b5c0854e94496a94115cd7fa9a71c4116c00b68a34133d8285494d0a1f1a238c">core/src/main/java/bisq/core/util/VolumeUtil.java</a>
    (50)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-6900d6302ad69dc8ed6c739773413d30493c292af5d68851c02b0c5a28df1fb3">core/src/main/java/bisq/core/util/coin/CoinUtil.java</a>
    (109)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-b35af7717816b0a1952e3f92a1aff302bcbcd7287b9b8b68ed74b37e1a42bbe4">core/src/test/java/bisq/core/util/CoinCryptoUtilsTest.java</a>
    (60)
  </li>
  <li>
    <strong>R</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-a6a67fb80962e2383508f524b6814efa2af69b5cc42764e455eec28a0c18e15d">core/src/test/java/bisq/core/util/coin/CoinUtilTest.java</a>
    (56)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-cca0a4c068e008e6030429bf66865643800e8719fc247a3575d9ecb73cebbaba">desktop/src/main/java/bisq/desktop/main/offer/MakerFeeProvider.java</a>
    (13)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-3cf8bddee5a7364f6e0018392f074e94107ee04a145a51dec551b6b7145002f6">desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java</a>
    (88)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-a110b4dbf593eb67e3a80e59506f58cd95ddbf8fe983bf3d967d8bbe2c8471fe">desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-6be5a2a3e9efad426d4520445826d641b9e78a901f8120af6c528cced19a0587">desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java</a>
    (61)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-59d7f22981909d111b6a51bb9b2a827534b61b1807c9c2fa99c4bcc7ac032960">desktop/src/main/java/bisq/desktop/main/offer/OfferDataModel.java</a>
    (31)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-114d95e19f5232dfc62f6f3ed8998dfdc01e57bc1b8bef14eee046c8e9a2b60b">desktop/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferDataModel.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-44f52aed43a10a33cdc1e6d5fbb5259696adb224cbafc78ca28d4db7e0f33dc9">desktop/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-e91ddc497f0b94a9a80cc234cbdcedaf05e8f40e6e1d5fc7e9c9794f97063495">desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java</a>
    (21)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-574ce6bfa753de6de705ba360ded021a7a94dcc406ad740c009483f3a2effae7">desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java</a>
    (60)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-41b34a44d2df26644ec2e93e7c7211540603530d5d8649b0545ec4963b5315d5">desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferDataModel.java</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-ca6bbf820403f46339905b3e92bbea2ce13c25123540da103d578ccd6b3859e6">desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferViewModel.java</a>
    (8)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-17f0fc7fefdfe1b8cc136d009217f571fb7044c83ddad75bf497fbe7d1426f5e">desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferDataModelTest.java</a>
    (36)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-aa41d7a47c998515957eb8e955020e46f1504aef8d5f89d48f8d944df7a5347a">desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java</a>
    (51)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4672/files#diff-a74597dce33e05191f03adbd9f4e95c0bab908319d123b3a2199e5cc78ec5f8f">desktop/src/test/java/bisq/desktop/main/portfolio/editoffer/EditOfferDataModelTest.java</a>
    (29)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/bisq-network/bisq/pull/4672.patch'>https://github.com/bisq-network/bisq/pull/4672.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4672.diff'>https://github.com/bisq-network/bisq/pull/4672.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/4672">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNQJLTGY3RLA6ZOFHHLSLXHOHANCNFSM4SYWOPUQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNU5YWS5I2K46B7FOKTSLXHOHA5CNFSM4SYWOPU2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4K2DIN3A.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/4672",
"url": "https://github.com/bisq-network/bisq/pull/4672",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>