Repository navigation
fix(wallet): show a completing shielded transfer as an ordinary internal transfer - #1212
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue being fixed or feature implemented
Part of #1042. Builds against platform
v5.1-devatb0ccf7b5f5(.platform-ref), which carries dashpay/platform#5460 and dashpay/platform#5476 (onAssetLockBuilt). With dashpay/platform#5460, a Transparent → Shielded transfer from a balance of many small coins no longer fails: the SDK waits a few minutes for a ChainLock and then completes it. During that wait the History row readPending — tap to finish, and a tap started a second attempt on the same asset lock while the first was still running.What was done?
ShieldedAssetLocksInFlight(inShieldedTransferCoordinator.swift): a shared, ref-counted registry of the asset locks an attempt is consuming. It releases a claim when the attempt's phase leaves the in-flight states.beginTransfer(consuming:vout:)refuses a resume of a lock that is already claimed with the newCoordinatorError.assetLockInFlight.onAssetLockBuilt(feat(platform-wallet)!: report a freshly built asset lock's outpoint to the caller platform#5476). The handler runs on the FFI worker thread before the lock's row is persisted, so no surface ever sees the lock unclaimed, and the status poll reads that exact row. "Try again" is armed with the reported outpoint unless the broadcast was definitely rejected. The registry also counts fresh transfers from before their authorization, so a removal (Drop & Rescan, Remove if Not on Network) is refused while one runs.HomeView: an in-flight lock's row shows the ordinaryTransparent → Shieldedroute chip and no finish prompt; taps route as for a normal internal transfer.TxDetailModel/TxDetailViewController: Retry is hidden while the lock is in flight; a tap on a screen opened earlier shows "This transfer is still in progress. Check its status again in a few minutes." instead of doing nothing.AssetLockRecoveryService: the bulk recovery pass skips in-flight locks and does not count them as failures.performWalletDrain, from fix(wallet): make Core to Shielded Max restart-safe #1205/feat(wallet): Max to an external shielded address uses the SDK wallet drain #1251):shieldedFundFromWalletDrainreports no built lock, so the drain is claimed by its operation id before the call. The lock's row carries that id;ShieldedTxLookuppasses it to every reader (Home row, tx detail, bulk pass, resume gate), andresumeAssetLockre-checks the row it reads. A completed drain keeps its claim until its row reads as finished (consumed or drain-completed), at most 30 s, so its lock is not offered as stuck while the SDK's final status lands. The drain also holds a funding call, so a removal is refused while it runs. feat(platform-wallet): report the wallet drain's built asset lock to the caller, as the other funding calls do platform#5737 asks for the built-lock callback on the drain, which would replace the operation-id claim.outcome=skipped reason=in-flight), written by the coordinator.Localizable.stringswith the English value; translations come through Transifex.How Has This Been Tested?
DashWalletTestson the iOS 27.1 simulator againstb0ccf7b5f5: 1541 tests pass exceptString_DashWallet.testAssumptionThatCurrencySymbolIsEitherAtTheBeginningOrAtTheEnd, which iterates the simulator's locales and is untouched by this change (green on develop's CI). New tests cover drain claims by operation id, their publication, removal admission and the completed-drain settling (finished, RecoveredFromChain, missing row, timeout, release).Earlier, testnet, iOS 27 simulator,
dashpayDebug, against the SDK from dashpay/platform#5460, wallet of 160 coins of 0.0125 tDASH:Internal Transfer · Transparent → Shieldedduring the ChainLock wait and the transfer completed on its own;Not exercised on a device yet: the refusal toast on a second Complete Transfer tap during the wait, and a Max drain's History row during its ChainLock wait.
Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code
Summary by CodeRabbit