<p>This is the second preliminary refactoring to prepare for a new core.api <code>takeoffer</code> impl.  This effort is restrained by desktop models' dependencies on JFX properties, which cannot be used as arguments to the core <code>OfferUtil</code>.</p>
<p><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="722672386" data-permission-text="Title is private" data-url="https://github.com/bisq-network/bisq/issues/4654" data-hovercard-type="pull_request" data-hovercard-url="/bisq-network/bisq/pull/4654/hovercard" href="https://github.com/bisq-network/bisq/pull/4654">#4654</a> has to be reviewed & merged before this PR.</p>
<p>Changes include:</p>
<ul>
<li>
<p>Moving utility logic into <code>OfferUtil</code> from <code>OfferDataModel</code> and <code>MutableOfferDataModel</code>.</p>
</li>
<li>
<p>Injecting <code>OfferUtil</code> into <code>TakeOfferDataModel</code>, for parent <code>OfferDataModel</code>.</p>
</li>
<li>
<p>Removing unused <code>TradeManager</code> from <code>OfferBook</code>.</p>
</li>
<li>
<p>Moving <code>isHalCashAccount</code> acct type check to abstract <code>PaymentAccount</code>.</p>
</li>
<li>
<p>Moving <code>getTradeCurrency</code> logic to abstract <code>PaymentAccount</code> from <code>MutableOfferDataModel</code>'s <code>setTradeCurrencyFromPaymentAccount</code>, and changing affected classes:  <code>MutableOfferView</code>, <code>MutableOfferViewModel</code>.</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/4666'>https://github.com/bisq-network/bisq/pull/4666</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Refactor OfferUtil into an injected service</li>
  <li>Reformat, tidy up OfferUtil</li>
  <li>Add license comment, reformat CoinUtilTest</li>
  <li>Reformat desktop createoffer view & data model tests</li>
  <li>Reformat desktop EditOfferDataModelTest</li>
  <li>Resolve argument reassignment issue (found by codacy)</li>
  <li>Remove unused final fields (found by codacy)</li>
  <li>Move utility logic from desktop offer models to OfferUtil</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-e66126b732dbd45cde04307641186caa214407bc74403812b10d3ebf18d2aecc">core/src/main/java/bisq/core/api/CoreOffersService.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-1dd9914e3d0450d8cc1aaa2f15afa9836051911a41ecb287a813f9cd4f9f5afd">core/src/main/java/bisq/core/offer/CreateOfferService.java</a>
    (37)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/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/4666/files#diff-7421f25cc1584830f6e575beb0aec9adfc30bc1360c52519f81af4d16fd3f29a">core/src/main/java/bisq/core/offer/Offer.java</a>
    (5)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-b604ee7141fcfacf2dd0aeade4bf393c4d4d93617ab327147c363539ae804496">core/src/main/java/bisq/core/offer/OfferUtil.java</a>
    (393)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-189dabf054a26f4cd086890f538252d6c47a246491d7d95e730ce6a0e640d786">core/src/main/java/bisq/core/payment/PaymentAccount.java</a>
    (24)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/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/4666/files#diff-0399e1caaadecbe847e18f0eda2ca8bf60f9777bc3bc30840e3af493601260b1">core/src/main/java/bisq/core/trade/Trade.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-f099e762eb187f7f8b74b0d0c584dc0f4f7173e745782f8ac11466dd03926a5b">core/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java</a>
    (4)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/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/4666/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/4666/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/4666/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/4666/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/4666/files#diff-3cf8bddee5a7364f6e0018392f074e94107ee04a145a51dec551b6b7145002f6">desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java</a>
    (94)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/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/4666/files#diff-6be5a2a3e9efad426d4520445826d641b9e78a901f8120af6c528cced19a0587">desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java</a>
    (31)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-59d7f22981909d111b6a51bb9b2a827534b61b1807c9c2fa99c4bcc7ac032960">desktop/src/main/java/bisq/desktop/main/offer/OfferDataModel.java</a>
    (26)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/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/4666/files#diff-44f52aed43a10a33cdc1e6d5fbb5259696adb224cbafc78ca28d4db7e0f33dc9">desktop/src/main/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModel.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-7d6cae9fee25a6cf61af1d755dba63c84d60e50c77c18a276c2618983a36310a">desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBook.java</a>
    (7)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-e91ddc497f0b94a9a80cc234cbdcedaf05e8f40e6e1d5fc7e9c9794f97063495">desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java</a>
    (22)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-574ce6bfa753de6de705ba360ded021a7a94dcc406ad740c009483f3a2effae7">desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java</a>
    (33)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-41b34a44d2df26644ec2e93e7c7211540603530d5d8649b0545ec4963b5315d5">desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferDataModel.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/files#diff-ca6bbf820403f46339905b3e92bbea2ce13c25123540da103d578ccd6b3859e6">desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferViewModel.java</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/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/4666/files#diff-aa41d7a47c998515957eb8e955020e46f1504aef8d5f89d48f8d944df7a5347a">desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java</a>
    (44)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4666/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/4666.patch'>https://github.com/bisq-network/bisq/pull/4666.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4666.diff'>https://github.com/bisq-network/bisq/pull/4666.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/4666">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNWEJIFSMNKHDCNI2J3SLH23HANCNFSM4SUSPTSA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNRA7QQ6RLYSEUJT3A3SLH23HA5CNFSM4SUSPTSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KZE45AA.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/4666",
"url": "https://github.com/bisq-network/bisq/pull/4666",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>