fix: a saved SuccessTx in another shape reopens as itself, and long amounts wrap (closes #740)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run

The popup refused a saved SuccessTx whose decoded record was in a shape it
did not expect, and showed Home. SuccessTx already shows only the lines it
can read, so the popup no longer checks the record first.

A long amount or token symbol was cut off at the edge of the screen. These
now wrap:

- the Amount figure
- each decoded amount
- the token symbol
- the name and description of SuccessTx's decoded action

WaitTx and ErrorTx share the line that shows the symbol, so they gain this
too.

Model: opus-5-5
This commit was merged in pull request #742.
This commit is contained in:
2026-11-03 11:38:35 +01:00
parent 9c691dfa6b
commit 1d40e2d7d5
6 changed files with 97 additions and 39 deletions
+48 -14
View File
@@ -416,20 +416,6 @@ const CONTRACT = [
views: ["success-tx"],
restored: false,
},
{
value: { hash: "0x1", to: ADDRESS, decoded: { details: 7 } },
views: ["success-tx"],
restored: false,
},
{
value: {
hash: "0x1",
to: ADDRESS,
decoded: { details: [{ address: 42 }] },
},
views: ["success-tx"],
restored: false,
},
// error-tx passes on `data.message`, same dereference.
{
value: { message: "boom" },
@@ -1082,3 +1068,51 @@ describe("a restore-only hostile value onto", () => {
}
}
});
// A saved decoded record comes back from storage, in whatever shape it is in.
// SuccessTx reopens as itself and shows only the lines it can read.
describe("a popup reopened on a SuccessTx with a decoded record in another shape", () => {
function savedSuccess(decoded) {
return restoringOnto("success-tx", {
viewData: {
amount: "1.0000",
symbol: "ETH",
to: ADDRESS,
hash: "0x1",
chainId: "0x1",
decoded,
},
});
}
test.each([
7,
"text",
[1, 2],
{ details: 7 },
{ details: [null] },
{ details: [7] },
{ details: [{ address: 42 }] },
{ details: [{ label: "Steps", value: "text", address: 42 }] },
])("%j shows the amount and the recipient", async (decoded) => {
const page = await bootPopup(savedSuccess(decoded));
expect(page.pageErrors).toEqual([]);
expect(page.visibleViews()).toEqual(["success-tx"]);
expect(page.hidden("success-tx-decoded")).toBe(true);
expect(page.text("success-tx-summary")).toBe("1.0000 ETH");
expect(page.node("success-tx-to").innerHTML).toContain(ADDRESS);
});
test("a line it can read is shown", async () => {
const page = await bootPopup(
savedSuccess({
details: [null, { label: "Steps", value: "V3_SWAP_EXACT_IN" }],
}),
);
expect(page.pageErrors).toEqual([]);
expect(page.visibleViews()).toEqual(["success-tx"]);
expect(page.node("success-tx-decoded").innerHTML).toContain(
"V3_SWAP_EXACT_IN",
);
});
});