fix: the StateRecovery erase warning names every kind of wallet backup (closes #593)
The StateRecovery erase warning told every user to rely on each wallet's recovery phrase. A wallet imported from a private key or an extended private key has none; its backup is that key. The warning now names all three, in the words the delete-wallet screens use, and README's StateRecovery entry says what a wallet can be added again from. A test reads the warning. Model: opus-5-5
This commit was merged in pull request #680.
This commit is contained in:
@@ -2820,6 +2820,9 @@ view would leave a wallet one click from deletion.
|
|||||||
- "Export Saved Data" button, and the read-only text box it fills
|
- "Export Saved Data" button, and the read-only text box it fills
|
||||||
- What erasing does and does not do, in bold: every wallet stored in this
|
- What erasing does and does not do, in bold: every wallet stored in this
|
||||||
browser is deleted; nothing on chain changes and no money is moved
|
browser is deleted; nothing on chain changes and no money is moved
|
||||||
|
- What a wallet can be added again from: a kept copy of its recovery phrase,
|
||||||
|
private key or extended private key. Without that copy or the exported
|
||||||
|
copy, everything the wallet holds is gone forever.
|
||||||
- A text input asking for `ERASE MY WALLET` to be typed back
|
- A text input asking for `ERASE MY WALLET` to be typed back
|
||||||
- Error line
|
- Error line
|
||||||
- "Erase Saved Data" button
|
- "Erase Saved Data" button
|
||||||
|
|||||||
@@ -1994,10 +1994,11 @@
|
|||||||
>Erasing the saved data deletes every wallet stored in
|
>Erasing the saved data deletes every wallet stored in
|
||||||
this browser.</strong
|
this browser.</strong
|
||||||
>
|
>
|
||||||
Nothing on the blockchain changes and no money is moved, but
|
Nothing on the blockchain changes and no money is moved. If
|
||||||
without the exported copy above, or the recovery phrase for
|
you kept a copy of a wallet's recovery phrase, private key
|
||||||
each wallet written down, everything they hold is gone
|
or extended private key, you can add that wallet again.
|
||||||
forever.
|
Without that copy or the exported copy above, everything the
|
||||||
|
wallet holds is gone forever.
|
||||||
</p>
|
</p>
|
||||||
<p class="text-xs mb-1">
|
<p class="text-xs mb-1">
|
||||||
To confirm, type
|
To confirm, type
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
// version field, and showing those users a wipe prompt would be a worse defect
|
// version field, and showing those users a wipe prompt would be a worse defect
|
||||||
// than the one being fixed. It is migrated in place and keeps working.
|
// than the one being fixed. It is migrated in place and keeps working.
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
const {
|
const {
|
||||||
bootPopup,
|
bootPopup,
|
||||||
cleanupPopup,
|
cleanupPopup,
|
||||||
@@ -148,6 +151,29 @@ describe("the destructive reset on the recovery screen", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// A key or xprv wallet has no recovery phrase, so the erase warning names all
|
||||||
|
// three backups (https://git.eeqj.de/sneak/AutistMask/issues/593). The boot
|
||||||
|
// harness holds no static text, so this reads the markup itself.
|
||||||
|
describe("the erase warning on the recovery screen", () => {
|
||||||
|
test("names the recovery phrase, the private key and the extended private key", () => {
|
||||||
|
const html = fs.readFileSync(
|
||||||
|
path.join(__dirname, "..", "src", "popup", "index.html"),
|
||||||
|
"utf8",
|
||||||
|
);
|
||||||
|
const start = html.indexOf('id="view-state-recovery"');
|
||||||
|
const end = html.indexOf('id="btn-state-recovery-reset"', start);
|
||||||
|
const screenText = html
|
||||||
|
.slice(start, end)
|
||||||
|
.replace(/<[^>]*>/g, " ")
|
||||||
|
.replace(/\s+/g, " ");
|
||||||
|
|
||||||
|
expect(screenText).toContain(
|
||||||
|
"If you kept a copy of a wallet's recovery phrase, private key or " +
|
||||||
|
"extended private key, you can add that wallet again.",
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("a popup already open when the stored profile becomes unreadable", () => {
|
describe("a popup already open when the stored profile becomes unreadable", () => {
|
||||||
// https://git.eeqj.de/sneak/AutistMask/issues/373. The popup used to stay
|
// https://git.eeqj.de/sneak/AutistMask/issues/373. The popup used to stay
|
||||||
// on the wallet list with the last good balances, and only a reopen
|
// on the wallet list with the last good balances, and only a reopen
|
||||||
|
|||||||
Reference in New Issue
Block a user