<p>This is a preliminary refactoring for a new core <code>TakeOfferModel</code> 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 <code>takeoffer</code> method will depend on core <code>TakeOfferModel</code>.)</p>
<p>This change injects service dependencies into the <code>OfferUtil</code> instance and removes those service dependency arguments from formerly static method signatures.</p>
<p>Other changes include:</p>
<ul>
<li>
<p>Moving some Volume calc methods from <code>OfferUtil</code> to <code>VolumeUtil</code>.</p>
</li>
<li>
<p>Moving some Coin calc methods from <code>OfferUtil</code> to <code>CoinUtil</code>.</p>
</li>
<li>
<p>Injecting <code>OfferUtil</code> into <code>CreateOfferService</code> and relevant offer data & view models.</p>
</li>
<li>
<p>Minor changes to <code>TradeStatistics2</code>, <code>Trade</code>, <code>Offer</code> & <code>Contract</code>, to use static methods moved from <code>OfferUtil</code> to the new <code>VolumeUtil</code> class.</p>
</li>
<li>
<p>Deletion of <code>bisq.desktop.main.offer.MakerFeeProvider</code> and <code>bisq.core.offer.MakerFeeProvider</code>.  They were unnecessary<br>
wrappers around a single <code>OfferUtil</code> method.</p>
</li>
<li>
<p>Renaming <code>OfferUtilTest</code> -> <code>CoinUtilTest</code>.</p>
</li>
<li>
<p>Moving tests in <code>CoinCryptoUtilsTest</code> to <code>CoinUtilTest</code>, and deleting <code>CoinCryptoUtilsTest</code>.</p>
</li>
<li>
<p>Adjusting affected offer data & view model tests.</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/4654'>https://github.com/bisq-network/bisq/pull/4654</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>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/files#diff-1dd9914e3d0450d8cc1aaa2f15afa9836051911a41ecb287a813f9cd4f9f5afd">core/src/main/java/bisq/core/offer/CreateOfferService.java</a>
    (22)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/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/4654/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/4654/files#diff-b604ee7141fcfacf2dd0aeade4bf393c4d4d93617ab327147c363539ae804496">core/src/main/java/bisq/core/offer/OfferUtil.java</a>
    (288)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/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/4654/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/4654/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/4654/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/4654/files#diff-6900d6302ad69dc8ed6c739773413d30493c292af5d68851c02b0c5a28df1fb3">core/src/main/java/bisq/core/util/coin/CoinUtil.java</a>
    (108)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/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/4654/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/4654/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/4654/files#diff-3cf8bddee5a7364f6e0018392f074e94107ee04a145a51dec551b6b7145002f6">desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java</a>
    (29)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/files#diff-6be5a2a3e9efad426d4520445826d641b9e78a901f8120af6c528cced19a0587">desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java</a>
    (25)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/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/4654/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/4654/files#diff-e91ddc497f0b94a9a80cc234cbdcedaf05e8f40e6e1d5fc7e9c9794f97063495">desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java</a>
    (18)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/files#diff-574ce6bfa753de6de705ba360ded021a7a94dcc406ad740c009483f3a2effae7">desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferViewModel.java</a>
    (22)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/bisq-network/bisq/pull/4654/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/4654/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/4654/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/4654/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/4654/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/4654.patch'>https://github.com/bisq-network/bisq/pull/4654.patch</a></li>
  <li><a href='https://github.com/bisq-network/bisq/pull/4654.diff'>https://github.com/bisq-network/bisq/pull/4654.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/4654">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNUYYIUZASNOM6L2GLLSK5PFDANCNFSM4SSP2M5A">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNRY3XXSRMCMZVXLYCDSK5PFDA5CNFSM4SSP2M5KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KYTDMBA.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/4654",
"url": "https://github.com/bisq-network/bisq/pull/4654",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>