Skip to content

Commit

Permalink
Merge pull request #3037 from dusk-network/feature-3035
Browse files Browse the repository at this point in the history
  • Loading branch information
nortonandreev authored Nov 22, 2024
2 parents 4c42718 + 0e6d4b7 commit 7f3d6c3
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 30 deletions.
2 changes: 2 additions & 0 deletions web-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fix UI not scrolling to top after wizard and sub-route navigation [#2997]
- Fix edge case in Dusk to Lux conversion [#3032]
- Fix inconsistent terminology usage for "Mnemonic Phrase" [#3035]

## [0.8.0] - 2024-11-19

Expand Down Expand Up @@ -367,6 +368,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#3010]: https://github.com/dusk-network/rusk/issues/3010
[#3028]: https://github.com/dusk-network/rusk/issues/3028
[#3032]: https://github.com/dusk-network/rusk/issues/3032
[#3035]: https://github.com/dusk-network/rusk/issues/3035

<!-- VERSIONS -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<p>
Initializing a new wallet will replace your existing local wallet cache,
erasing any stored data. Ensure you have securely backed up your current
wallet's seed phrase to prevent loss. Proceeding without a backup can lead
to irreversible loss of access to your assets.
wallet's mnemonic phrase to prevent loss. Proceeding without a backup can
lead to irreversible loss of access to your assets.
</p>
<div class="actions">
<AppAnchorButton
Expand Down
6 changes: 3 additions & 3 deletions web-wallet/src/lib/dusk/components/Mnemonic/Mnemonic.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
currentInput &&
findFirstNMatches(enDictionary, currentInput.toLowerCase(), 3);
const pasteSeed = () => {
const pasteMnemonic = () => {
navigator.clipboard
.readText()
.then((data) => {
Expand Down Expand Up @@ -140,9 +140,9 @@
{#if type === "authenticate" && shouldShowPaste}
<Button
icon={{ path: mdiContentPaste }}
text="Paste seed phrase"
text="Paste mnemonic phrase"
variant="tertiary"
on:click={pasteSeed}
on:click={pasteMnemonic}
/>
{/if}
<Button
Expand Down
16 changes: 8 additions & 8 deletions web-wallet/src/lib/dusk/components/__tests__/Mnemonic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { cleanup, fireEvent, render } from "@testing-library/svelte";
import { Mnemonic } from "..";

/** @type {string[]} */
const enteredSeed = [];
const enteredMnemonicPhrase = [];

/** @type {string[]} */
const seed = [
const mnemonic = [
"auction",
"tribe",
"type",
Expand All @@ -27,7 +27,7 @@ describe("Mnemonic", () => {
it('should render the "Mnemonic" component in the authenticate state', async () => {
const { container } = render(Mnemonic, {
props: {
enteredMnemonicPhrase: enteredSeed,
enteredMnemonicPhrase,
type: "authenticate",
},
});
Expand All @@ -38,7 +38,7 @@ describe("Mnemonic", () => {
it('should render the "Mnemonic" component in the validate state', () => {
const { container } = render(Mnemonic, {
props: {
mnemonicPhrase: seed,
mnemonicPhrase: mnemonic,
type: "validate",
},
});
Expand All @@ -49,8 +49,8 @@ describe("Mnemonic", () => {
it("should display all the words in the order they have been clicked", async () => {
const { container, getAllByRole } = render(Mnemonic, {
props: {
enteredMnemonicPhrase: enteredSeed,
mnemonicPhrase: seed,
enteredMnemonicPhrase,
mnemonicPhrase: mnemonic,
type: "validate",
},
});
Expand All @@ -72,8 +72,8 @@ describe("Mnemonic", () => {
it("should revert the most recent word on Undo click", async () => {
const { container, getByText, getAllByRole } = render(Mnemonic, {
props: {
enteredMnemonicPhrase: enteredSeed,
mnemonicPhrase: seed,
enteredMnemonicPhrase,
mnemonicPhrase: mnemonic,
type: "validate",
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
$: isValid = agreementOneChecked && agreementTwoChecked;
</script>

<IconHeadingCard gap="medium" heading="Securely store your seed phrase!">
<IconHeadingCard gap="medium" heading="Securely store your mnemonic phrase!">
<Agreement
name="mnemonic_agreement_one"
bind:checked={agreementOneChecked}
label="I understand that without my seed phrase I cannot access my wallet and its assets."
label="I understand that without my mnemonic phrase I cannot access my wallet and its assets."
/>
<Agreement
name="mnemonic_agreement_two"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2900,7 +2900,7 @@ exports[`Create > lets the user proceed if they have entered a matching Mnemonic
</div>
`;

exports[`Create > should render the \`Securely store your seed phrase!\` agreement step after the ToS 1`] = `
exports[`Create > should render the \`Securely store your mnemonic phrase!\` agreement step after the ToS 1`] = `
<div
class="dusk-wizard dusk-wizard--full-height"
>
Expand Down Expand Up @@ -2977,7 +2977,7 @@ exports[`Create > should render the \`Securely store your seed phrase!\` agreeme
<h3
class="h4"
>
Securely store your seed phrase!
Securely store your mnemonic phrase!
</h3>
</div>
Expand All @@ -3002,7 +3002,7 @@ exports[`Create > should render the \`Securely store your seed phrase!\` agreeme
class="dusk-agreement__label"
for="dusk-checkbox-16"
>
I understand that without my seed phrase I cannot access my wallet and its assets.
I understand that without my mnemonic phrase I cannot access my wallet and its assets.
</label>
</div>
Expand Down Expand Up @@ -3170,8 +3170,8 @@ exports[`Create > should render the Existing Wallet notice step of the Create fl
<p>
Initializing a new wallet will replace your existing local wallet cache,
erasing any stored data. Ensure you have securely backed up your current
wallet's seed phrase to prevent loss. Proceeding without a backup can lead
to irreversible loss of access to your assets.
wallet's mnemonic phrase to prevent loss. Proceeding without a backup can
lead to irreversible loss of access to your assets.
</p>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe("Create", async () => {
expect(container.firstChild).toMatchSnapshot();
});

it("should render the `Securely store your seed phrase!` agreement step after the ToS", async () => {
it("should render the `Securely store your mnemonic phrase!` agreement step after the ToS", async () => {
const { container, getByRole } = render(Create);

const mathRandomSpy = vi.spyOn(Math, "random").mockReturnValue(42);
Expand All @@ -116,7 +116,7 @@ describe("Create", async () => {
mathRandomSpy.mockRestore();
});

it("should not allow the user proceed unless both agreement checks are selected on the `Securely store your seed phrase!` step", async () => {
it("should not allow the user proceed unless both agreement checks are selected on the `Securely store your mnemonic phrase!` step", async () => {
const { getByRole, getAllByRole } = render(Create);

await fireEvent.click(getByRole("button", { name: "Accept" }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ exports[`Restore > should render the Existing Wallet notice step of the Restore
<p>
Initializing a new wallet will replace your existing local wallet cache,
erasing any stored data. Ensure you have securely backed up your current
wallet's seed phrase to prevent loss. Proceeding without a backup can lead
to irreversible loss of access to your assets.
wallet's mnemonic phrase to prevent loss. Proceeding without a backup can
lead to irreversible loss of access to your assets.
</p>
<div
Expand Down Expand Up @@ -184,7 +184,7 @@ exports[`Restore > should render the Mnemonic Authenticate step after accepting
<span
class="dusk-button__text"
>
Paste seed phrase
Paste mnemonic phrase
</span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ describe("Restore", async () => {

expect(nextButton).toBeDisabled();

await fireEvent.click(getByRole("button", { name: "Paste seed phrase" }));
await fireEvent.click(
getByRole("button", { name: "Paste mnemonic phrase" })
);

await tick();
expect(nextButton).not.toBeDisabled();
Expand All @@ -123,7 +125,9 @@ describe("Restore", async () => {

expect(get(toastList).length).toBe(0);

await fireEvent.click(getByRole("button", { name: "Paste seed phrase" }));
await fireEvent.click(
getByRole("button", { name: "Paste mnemonic phrase" })
);
await tick();

expect(get(toastList).length).toBe(1);
Expand All @@ -143,7 +147,9 @@ describe("Restore", async () => {

expect(nextButton).toBeDisabled();

await fireEvent.click(getByRole("button", { name: "Paste seed phrase" }));
await fireEvent.click(
getByRole("button", { name: "Paste mnemonic phrase" })
);
await tick();
expect(nextButton).toBeEnabled();
await fireEvent.click(nextButton);
Expand Down Expand Up @@ -186,7 +192,9 @@ describe("Restore", async () => {

expect(nextButton).toBeDisabled();

await fireEvent.click(getByRole("button", { name: "Paste seed phrase" }));
await fireEvent.click(
getByRole("button", { name: "Paste mnemonic phrase" })
);
await tick();
expect(nextButton).toBeEnabled();
await fireEvent.click(nextButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Agreement
checked={false}
name="checkbox_five"
label="I understand that without my seed phrase I
label="I understand that without my mnemonic phrase I
cannot access my wallet and its assets."
/>
</section>
Expand Down

0 comments on commit 7f3d6c3

Please sign in to comment.