Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4cc127cbc |
@@ -1467,18 +1467,17 @@ view would leave a wallet one click from deletion.
|
|||||||
- Amount input with current balance display, which reads
|
- Amount input with current balance display, which reads
|
||||||
`Current balance: unknown (SYMBOL)` for a token whose scale is unknown, as
|
`Current balance: unknown (SYMBOL)` for a token whose scale is unknown, as
|
||||||
ConfirmTx's balance line does (see Unknown token scale)
|
ConfirmTx's balance line does (see Unknown token scale)
|
||||||
- "Max" button beside the amount input, always in place. It fills in the
|
- "Max" button beside the amount input, always in place. It fills in a
|
||||||
most the selected holding can send: a token's whole balance, cut down to
|
token's balance, cut down to the 18 decimal places ConfirmTx accepts for a
|
||||||
the 18 decimal places ConfirmTx accepts for a token that has more, or for
|
token that has more, or for ETH the exact balance minus the network fee
|
||||||
ETH the exact balance minus the network fee reserve that ConfirmTx's
|
reserve that ConfirmTx's balance check gates on, never the rounded balance
|
||||||
balance check gates on, never the rounded balance shown above it. The ETH
|
shown above it. The ETH fee is estimated for the recipient entered, so it
|
||||||
fee is estimated for the recipient entered, so it asks for a recipient
|
asks for a recipient first; an estimate that finishes after the screen was
|
||||||
first; an estimate that finishes after the screen was left or the address,
|
left or the address, holding or recipient changed fills nothing in. Where
|
||||||
holding or recipient changed fills nothing in. Where there is nothing to
|
there is nothing to fill in, a flash message says why: the balance does
|
||||||
fill in, a flash message says why: the balance does not cover the fee, the
|
not cover the fee, the fee could not be estimated, or the token's balance
|
||||||
fee could not be estimated, or the token's balance is unknown or zero.
|
is unknown or zero. Typing in the amount makes it an ordinary amount;
|
||||||
Typing in the amount makes it an ordinary amount; changing what to send
|
changing what to send clears an amount Max filled in
|
||||||
clears an amount Max filled in
|
|
||||||
- "Review" button, disabled until the recipient validates
|
- "Review" button, disabled until the recipient validates
|
||||||
- **Transitions**:
|
- **Transitions**:
|
||||||
- "Review" (valid inputs, ENS resolved) → **ConfirmTx**
|
- "Review" (valid inputs, ENS resolved) → **ConfirmTx**
|
||||||
|
|||||||
+3
-2
@@ -240,8 +240,9 @@ screen. Tokens can also be added from Settings, under "Tracked Tokens".
|
|||||||
2. Select what to send (ETH, or any ERC-20 token with a balance on this address
|
2. Select what to send (ETH, or any ERC-20 token with a balance on this address
|
||||||
that survives the spam filters).
|
that survives the spam filters).
|
||||||
3. Enter the recipient address or ENS name (e.g. `vitalik.eth`).
|
3. Enter the recipient address or ENS name (e.g. `vitalik.eth`).
|
||||||
4. Enter the amount, or click "Max" to fill in everything you can send: a
|
4. Enter the amount, or click "Max" to fill it in: a token's balance, cut to 18
|
||||||
token's whole balance, or your ETH balance minus the network fee.
|
decimal places, or your ETH balance minus the amount reserved for the network
|
||||||
|
fee.
|
||||||
5. Click "Review" to see the confirmation screen.
|
5. Click "Review" to see the confirmation screen.
|
||||||
|
|
||||||
The confirmation screen shows:
|
The confirmation screen shows:
|
||||||
|
|||||||
@@ -419,6 +419,34 @@ describe("Max on an ETH send", () => {
|
|||||||
expect(text("flash-msg")).toBe("");
|
expect(text("flash-msg")).toBe("");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("fills nothing in when the holding was changed while the fee was estimated", async () => {
|
||||||
|
await refreshWith(BALANCE_WEI, [tokenRow(10n ** 18n)]);
|
||||||
|
// Opened from the home screen, where the dropdown picks the holding.
|
||||||
|
openSend(null);
|
||||||
|
el("send-token").value = "ETH";
|
||||||
|
const release = holdFeeEstimate();
|
||||||
|
const pressed = pressMax();
|
||||||
|
el("send-token").value = TOKEN;
|
||||||
|
el("send-token").handlers.get("change")();
|
||||||
|
release();
|
||||||
|
await pressed;
|
||||||
|
expect(el("send-amount").value).toBe("");
|
||||||
|
expect(text("flash-msg")).toBe("");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("keeps an amount typed while the fee was estimated", async () => {
|
||||||
|
await refreshWith(BALANCE_WEI);
|
||||||
|
openSend();
|
||||||
|
const release = holdFeeEstimate();
|
||||||
|
const pressed = pressMax();
|
||||||
|
el("send-amount").value = "0.5";
|
||||||
|
el("send-amount").handlers.get("input")();
|
||||||
|
release();
|
||||||
|
await pressed;
|
||||||
|
expect(el("send-amount").value).toBe("0.5");
|
||||||
|
expect(text("flash-msg")).toBe("");
|
||||||
|
});
|
||||||
|
|
||||||
test("fills in once the held fee estimate arrives with nothing changed", async () => {
|
test("fills in once the held fee estimate arrives with nothing changed", async () => {
|
||||||
await refreshWith(BALANCE_WEI);
|
await refreshWith(BALANCE_WEI);
|
||||||
openSend();
|
openSend();
|
||||||
|
|||||||
Reference in New Issue
Block a user