diff --git a/README.md b/README.md index d5a5221..85cb8d7 100644 --- a/README.md +++ b/README.md @@ -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 - 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 + - 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 - Error line - "Erase Saved Data" button diff --git a/src/popup/index.html b/src/popup/index.html index 81e3eb2..2ccd7d0 100644 --- a/src/popup/index.html +++ b/src/popup/index.html @@ -1994,10 +1994,11 @@ >Erasing the saved data deletes every wallet stored in this browser. - Nothing on the blockchain changes and no money is moved, but - without the exported copy above, or the recovery phrase for - each wallet written down, everything they hold is gone - forever. + Nothing on the blockchain changes and no money is moved. If + you kept a copy of a wallet's recovery phrase, private key + or extended private key, you can add that wallet again. + Without that copy or the exported copy above, everything the + wallet holds is gone forever.

To confirm, type diff --git a/tests/stateRecovery.test.js b/tests/stateRecovery.test.js index 8fd2064..d4f605e 100644 --- a/tests/stateRecovery.test.js +++ b/tests/stateRecovery.test.js @@ -23,6 +23,9 @@ // 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. +const fs = require("fs"); +const path = require("path"); + const { bootPopup, 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", () => { // 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