-
Notifications
You must be signed in to change notification settings - Fork 170
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
feat(dashpay): coinjoin entire wallet balance #1222
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8d9bca3
chore: update to dashj 20.0.0-CJ-SNAPSHOT
HashEngineering 0fd636e
Merge branch 'dashpay' of https://github.com/dashevo/dash-wallet into…
HashEngineering bde8fab
feat: use CoinJoinConfig for Mixing Mode (none, interm, adv)
HashEngineering cd74d68
fix: fix block explorer for devnet
HashEngineering 6d2e40a
feat: make SendCoinsTaskRunner coinjoin aware
HashEngineering af903e0
tests: fix DatabaseMigrationTest
HashEngineering 4ec8988
feat(coinjoin): mix entire balance
HashEngineering 7da5e2d
tests: add mock of CoinJoinConfig
HashEngineering b7291d1
fix: remove BlockchainServiceExt and further simplify CoinJoinService
HashEngineering 57e83ad
fix: always run CoinJoinService and simplify
HashEngineering 9204cb6
Merge branch 'dashpay' of https://github.com/dashevo/dash-wallet into…
HashEngineering File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,12 +31,13 @@ import org.dash.wallet.common.services.analytics.AnalyticsConstants | |
import org.dash.wallet.common.ui.dialogs.AdaptiveDialog | ||
import org.dash.wallet.common.ui.setRoundedRippleBackground | ||
import org.dash.wallet.common.ui.viewBinding | ||
import org.dash.wallet.common.util.observe | ||
|
||
@AndroidEntryPoint | ||
class CoinJoinLevelFragment : Fragment(R.layout.fragment_coinjoin_level) { | ||
private val binding by viewBinding(FragmentCoinjoinLevelBinding::bind) | ||
private val viewModel by viewModels<CoinJoinLevelViewModel>() | ||
private var selectedCoinJoinMode = CoinJoinMode.BASIC | ||
private var selectedCoinJoinMode = CoinJoinMode.NONE | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
@@ -53,11 +54,11 @@ class CoinJoinLevelFragment : Fragment(R.layout.fragment_coinjoin_level) { | |
lifecycleScope.launch { | ||
if (viewModel.isMixing) { | ||
if (confirmStopMixing()) { | ||
viewModel.stopMixing() | ||
viewModel.setMode(CoinJoinMode.NONE) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Setting the |
||
requireActivity().finish() | ||
} | ||
} else { | ||
viewModel.startMixing(selectedCoinJoinMode) | ||
viewModel.setMode(selectedCoinJoinMode) | ||
requireActivity().finish() | ||
} | ||
} | ||
|
@@ -67,7 +68,9 @@ class CoinJoinLevelFragment : Fragment(R.layout.fragment_coinjoin_level) { | |
requireActivity().finish() | ||
} | ||
|
||
setMode(viewModel.mixingMode) | ||
viewModel.mixingMode.observe(viewLifecycleOwner) { mixingMode -> | ||
setMode(mixingMode) | ||
} | ||
|
||
if (viewModel.isMixing) { | ||
binding.continueBtn.setText(R.string.coinjoin_stop) | ||
|
@@ -113,7 +116,9 @@ class CoinJoinLevelFragment : Fragment(R.layout.fragment_coinjoin_level) { | |
).show(requireActivity()) { toChange -> | ||
if (toChange == true) { | ||
setMode(mode) | ||
viewModel.mixingMode = mode | ||
lifecycleScope.launch { | ||
viewModel.setMode(mode) | ||
} | ||
requireActivity().finish() | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My first thought was to pass a "send with coinjoin" boolean value in many of these functions. But this would require that many ViewModels in many modules have access to the
CoinJoinConfig
.My final idea was to load the CoinJoin mode here and no other modules or view models need to know anything about CoinJoin.