fix: the wallet's own send shows its amount to four decimal places (closes #522)
ConfirmTx and the wait, success and error screens printed Send's amount field as it stood (`.5 ETH`, or every digit Max filled in); TxApproval shows `0.5000 ETH`. ConfirmTx now writes the amount as TxApproval does: parsed at the scale it is encoded with, written back as plain decimal text and cut by truncateAmountNeverZero(), and hands the status screens a copy carrying that text. A token whose scale is unknown, which cannot be sent, has the field's text cut the same way. The transaction is still signed for the exact amount, which also prices the USD value. A saved confirmation screen whose amount is not text is no longer redrawn. Model: opus-5-5
This commit is contained in:
@@ -245,7 +245,7 @@ describe.each([
|
||||
test("the value", async () => {
|
||||
await confirmSend("0.1");
|
||||
expect(text("confirm-type")).toBe("Native " + symbol + " transfer");
|
||||
expect(text("confirm-amount")).toBe("0.1 " + symbol);
|
||||
expect(text("confirm-amount")).toBe("0.1000 " + symbol);
|
||||
await approveTx(NETWORKS[networkId].chainId);
|
||||
expect(text("approve-tx-value")).toBe("0.0100 " + symbol);
|
||||
});
|
||||
@@ -429,10 +429,10 @@ describe.each([
|
||||
await global.document
|
||||
.getElementById("btn-confirm-send")
|
||||
.handlers.get("click")();
|
||||
expect(text("wait-tx-summary")).toBe("0.1 " + symbol);
|
||||
expect(text("wait-tx-summary")).toBe("0.1000 " + symbol);
|
||||
state.networkId = activeNetworkId;
|
||||
txStatus.restoreWait();
|
||||
expect(text("wait-tx-summary")).toBe("0.1 " + symbol);
|
||||
expect(text("wait-tx-summary")).toBe("0.1000 " + symbol);
|
||||
});
|
||||
|
||||
test("the transaction detail screen's type line and fee", async () => {
|
||||
|
||||
Reference in New Issue
Block a user