From bc58e411e714aa8765a9ce0bcb2bd5d1f0ab9511 Mon Sep 17 00:00:00 2001 From: Kieran Hall Date: Mon, 16 Dec 2024 13:58:44 +0100 Subject: [PATCH] web-wallet: Add memo field in send flow Resolves #3112 --- .../src/lib/components/Send/Send.svelte | 44 +++++- .../src/lib/components/__tests__/Send.spec.js | 11 +- .../__tests__/__snapshots__/Send.spec.js.snap | 68 ++++++++- .../contracts/__tests__/executeSend.spec.js | 11 +- web-wallet/src/lib/contracts/executeSend.js | 7 +- web-wallet/src/lib/mock-data/transactions.js | 6 + .../lib/stores/__tests__/walletStore.spec.js | 15 +- web-wallet/src/lib/stores/stores.d.ts | 3 +- web-wallet/src/lib/stores/walletStore.js | 4 +- .../src/lib/transactions/transactions.d.ts | 1 + .../__tests__/__snapshots__/page.spec.js.snap | 22 ++- .../src/routes/(app)/settings/+page.svelte | 6 +- .../__tests__/__snapshots__/page.spec.js.snap | 132 +++++++++--------- .../src/style/dusk-components/textbox.css | 2 +- 14 files changed, 236 insertions(+), 96 deletions(-) diff --git a/web-wallet/src/lib/components/Send/Send.svelte b/web-wallet/src/lib/components/Send/Send.svelte index de8ca260db..a04c611827 100644 --- a/web-wallet/src/lib/components/Send/Send.svelte +++ b/web-wallet/src/lib/components/Send/Send.svelte @@ -18,6 +18,7 @@ Button, Icon, Stepper, + Switch, Textbox, Wizard, WizardStep, @@ -32,7 +33,7 @@ } from "$lib/components"; import { MESSAGES } from "$lib/constants"; - /** @type {(to: string, amount: bigint, gasPrice: bigint, gasLimit: bigint) => Promise} */ + /** @type {(to: string, amount: bigint, gasPrice: bigint, gasLimit: bigint, memo: any) => Promise} */ export let execute; /** @type {(amount: number) => string} */ @@ -62,12 +63,18 @@ /** @type {string} */ let sendToAddress = ""; + /** @type {string} */ + let memo = ""; + /** @type {import("qr-scanner").default} */ let scanner; /** @type {import("..").ScanQR} */ let scanQrComponent; + /** @type {boolean} */ + let showMemo = false; + /** @type {boolean} */ let isNextButtonDisabled = false; @@ -196,7 +203,7 @@ >
-

Address:

+

Address

@@ -264,7 +288,7 @@ >
-

Amount:

+

Amount

+ +
+

+ Memo +

+ +
+
+
Address step > should display a warning if the address input is class="operation__address-wrapper svelte-npcavd" >

- Address: + Address

+ +
+

+ Memo +

+ +
+
+
Address step > should render the Send component Address step 1`] class="operation__address-wrapper svelte-npcavd" >

- Address: + Address