Repository navigation
fix: open review for requests with an amount #1763
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5e95204
fix: open review for scanned requests with an amount
jvsena42 1d280b6
fix: route system back on direct confirm to amount
jvsena42 5a8cda7
fix: open amount when tapping it on a direct confirm
jvsena42 2017ebd
test: cover hardware fee estimate on direct confirm
jvsena42 fa34ec9
chore: drop kdoc from private confirm helper
jvsena42 c15f207
docs: update pin and usdt journeys for direct review
jvsena42 bdb1593
docs: drive the amount tap in the scan to confirm journey
jvsena42 0a1c83a
docs: check confirm stays hidden behind the pin pad
jvsena42 cfee6e4
docs: keep toolbar back first on the link-opened confirm
jvsena42 4cc1eca
fix: keep back on a direct confirm from opening amount
jvsena42 4edce34
fix: lock the amount of a scanned onchain request
jvsena42 f2cc6f9
fix: lock the amount of a scanned usdt request
jvsena42 7376f15
docs: update journeys for fixed scanned amounts
jvsena42 a1fff0f
fix: never open amount for a scanned onchain amount
jvsena42 2f37b85
fix: open the usdt review for a scanned amount
jvsena42 71fac20
fix: title the fixed usdt review as review
jvsena42 22913e7
docs: route journeys for scanned amounts away from amount
jvsena42 46cd209
fix: pay a scanned amount from a hardware wallet that covers it
jvsena42 9152b2d
fix: keep the scanned onchain amount when switching to savings
jvsena42 0db1c4f
fix: keep a scanned hardware amount on a speed change
jvsena42 a4dcc73
fix: keep a scanned usdt amount fixed after back and ignore zero
jvsena42 9a7180b
fix: offer a usdt quote retry when none is in flight
jvsena42 d00e77c
docs: cover back and zero amounts in the usdt journey
jvsena42 01fb2a6
fix: tie a fixed usdt amount to the recipient that set it
jvsena42 156f029
fix: space the usdt review error above try again
jvsena42 6a85db2
test: drop the confirm amount tap compose test
jvsena42 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
52 changes: 52 additions & 0 deletions
52
app/src/test/java/to/bitkit/ui/screens/wallets/usdt/UsdtWalletScreenTest.kt
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package to.bitkit.ui.screens.wallets.usdt | ||
|
|
||
| import org.junit.Test | ||
| import kotlin.test.assertEquals | ||
| import kotlin.test.assertFalse | ||
| import kotlin.test.assertNull | ||
| import kotlin.test.assertTrue | ||
|
|
||
| class UsdtWalletScreenTest { | ||
| private val recipient = "0x1111111111111111111111111111111111111111" | ||
|
|
||
| @Test | ||
| fun `initial payment with recipient and positive amount is quoted`() { | ||
| assertTrue(shouldQuoteInitialUsdtPayment(recipient, "0.010001")) | ||
| assertTrue(shouldQuoteInitialUsdtPayment(recipient, "5")) | ||
| } | ||
|
|
||
| @Test | ||
| fun `initial payment without a payable amount is not quoted`() { | ||
| assertFalse(shouldQuoteInitialUsdtPayment(recipient, "")) | ||
| assertFalse(shouldQuoteInitialUsdtPayment(recipient, "0")) | ||
| assertFalse(shouldQuoteInitialUsdtPayment(recipient, "abc")) | ||
| assertFalse(shouldQuoteInitialUsdtPayment(recipient, "0.0000001")) | ||
| } | ||
|
|
||
| @Test | ||
| fun `initial payment without recipient is not quoted`() { | ||
| assertFalse(shouldQuoteInitialUsdtPayment("", "5")) | ||
| } | ||
|
|
||
| private val otherRecipient = "0x2222222222222222222222222222222222222222" | ||
|
|
||
| @Test | ||
| fun `a positive requested amount is fixed and zero is not`() { | ||
| assertEquals(recipient, fixedUsdtAmountRecipient(recipient, requestAmount = "0.010001", fixedRecipient = null)) | ||
| assertNull(fixedUsdtAmountRecipient(recipient, requestAmount = "0", fixedRecipient = recipient)) | ||
| assertFalse(isPositiveUsdtAmount("0")) | ||
| } | ||
|
|
||
| @Test | ||
| fun `continuing with the recipient that fixed the amount keeps it`() { | ||
| assertEquals(recipient, fixedUsdtAmountRecipient(recipient, requestAmount = null, fixedRecipient = recipient)) | ||
| val checksummed = recipient.uppercase().replace("0X", "0x") | ||
| assertEquals(recipient, fixedUsdtAmountRecipient(checksummed, requestAmount = null, fixedRecipient = recipient)) | ||
| } | ||
|
|
||
| @Test | ||
| fun `another recipient or no earlier fixed amount leaves the amount editable`() { | ||
| assertNull(fixedUsdtAmountRecipient(otherRecipient, requestAmount = null, fixedRecipient = recipient)) | ||
| assertNull(fixedUsdtAmountRecipient(recipient, requestAmount = null, fixedRecipient = null)) | ||
| } | ||
| } |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.