From 64a2a1c11501ce9f1bf7c921a142599283eef633 Mon Sep 17 00:00:00 2001 From: shahin-hq <132887516+shahin-hq@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:44:30 +0400 Subject: [PATCH 1/2] fix: signing of multipayment from musig addresses (#816) --- package.json | 14 +++---- pnpm-lock.yaml | 104 ++++++++++++++++++++++++------------------------- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/package.json b/package.json index 8aeb5eeb34..7178b9e12f 100644 --- a/package.json +++ b/package.json @@ -44,13 +44,13 @@ }, "dependencies": { "@ardenthq/arkvault-url": "^1.2.0", - "@ardenthq/sdk": "^2.2.0", - "@ardenthq/sdk-ark": "^2.2.0", - "@ardenthq/sdk-cryptography": "^2.2.0", - "@ardenthq/sdk-helpers": "^2.2.0", - "@ardenthq/sdk-intl": "^2.2.0", - "@ardenthq/sdk-ledger": "^2.2.0", - "@ardenthq/sdk-profiles": "^2.2.0", + "@ardenthq/sdk": "^2.2.1", + "@ardenthq/sdk-ark": "^2.2.1", + "@ardenthq/sdk-cryptography": "^2.2.1", + "@ardenthq/sdk-helpers": "^2.2.1", + "@ardenthq/sdk-intl": "^2.2.1", + "@ardenthq/sdk-ledger": "^2.2.1", + "@ardenthq/sdk-profiles": "^2.2.1", "@emotion/cache": "^11.11.0", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5878b8c945..746cb0a480 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,26 +12,26 @@ importers: specifier: ^1.2.0 version: 1.2.0 '@ardenthq/sdk': - specifier: ^2.2.0 - version: 2.2.0 + specifier: ^2.2.1 + version: 2.2.1 '@ardenthq/sdk-ark': - specifier: ^2.2.0 - version: 2.2.0 + specifier: ^2.2.1 + version: 2.2.1 '@ardenthq/sdk-cryptography': - specifier: ^2.2.0 - version: 2.2.0 + specifier: ^2.2.1 + version: 2.2.1 '@ardenthq/sdk-helpers': - specifier: ^2.2.0 - version: 2.2.0 + specifier: ^2.2.1 + version: 2.2.1 '@ardenthq/sdk-intl': - specifier: ^2.2.0 - version: 2.2.0 + specifier: ^2.2.1 + version: 2.2.1 '@ardenthq/sdk-ledger': - specifier: ^2.2.0 - version: 2.2.0 + specifier: ^2.2.1 + version: 2.2.1 '@ardenthq/sdk-profiles': - specifier: ^2.2.0 - version: 2.2.0 + specifier: ^2.2.1 + version: 2.2.1 '@emotion/cache': specifier: ^11.11.0 version: 11.13.0 @@ -406,36 +406,36 @@ packages: resolution: {integrity: sha512-0Ld6SSNEzb/TeOZ0YUDAa+vFyk65LprU+wiLjWDwhqpaDtUkJZ9MBM4alagfJ5665SN+DM7Dti2QxqKX+Y8S2w==} engines: {node: '>=14.16'} - '@ardenthq/sdk-ark@2.2.0': - resolution: {integrity: sha512-6BGjjpOK+2QWOMiObgRnD1H3J0CDFNy0dE6PvUPtywuELB6GDOQKUyrdCt5B52jBlAfe5YZJRk3IFJtHLfiGFw==} + '@ardenthq/sdk-ark@2.2.1': + resolution: {integrity: sha512-Fr28V4bpVvX0PVmiFdObk2ypbraaI19r3opEeBhnFuXsIAPbPeIwdOap41vEkFgtfXRzlW2PYkqZy3/m5LSu7Q==} engines: {node: '>=16.0.0'} - '@ardenthq/sdk-cryptography@2.2.0': - resolution: {integrity: sha512-jMZYyp8cB/IOAiSneod3dClRLLwuZWoZ8B6BxQ2kRbDhTnlbUMi3zvcbvr6QxjcIdVrupKnOMPVWsiYCrINnGA==} + '@ardenthq/sdk-cryptography@2.2.1': + resolution: {integrity: sha512-nV3q2byfvf0clrpLwzHggwiR9SayoHEontHrAhY0MTG9a+FFkhPFJmY7fE/EHMSUfGvtl2ZFkEORn4wYsPhlrA==} engines: {node: '>=16.0.0'} - '@ardenthq/sdk-helpers@2.2.0': - resolution: {integrity: sha512-K+/b4TVaPhkJdpKfRxjqs1d3N8TUePBeKBJeJN8gdS69Qvg3+Y8xi+lRFUEZI8ZQ19jgRnzWTwGCZd/EIj3CWg==} + '@ardenthq/sdk-helpers@2.2.1': + resolution: {integrity: sha512-udlpWrqR5QGWcmgLXUuPt1dpyl+UhIiZJ6z1Xgmgs8k5CUUx8yZaSr1B8xlXxbkcjtWWIH7w8/IZEpOSaY6BJQ==} engines: {node: '>=16.0.0'} - '@ardenthq/sdk-intl@2.2.0': - resolution: {integrity: sha512-FwWeGLJWAOB63978u0Jn4ofmbLeD0qpH2p5BabLZQOiFSq+JMsl7es0Z2OH+cvAkWSqwVzDbkl28MOeco47RFg==} + '@ardenthq/sdk-intl@2.2.1': + resolution: {integrity: sha512-5pBvOSsWrPFtyk2k8zukEZcfgnQfzNxzpYEuTTrzAeAfr71mbCD0Sg+NaxjBlQe+vr8AJPXg24J8jO9dq5ezcg==} engines: {node: '>=16.0.0'} - '@ardenthq/sdk-ledger@2.2.0': - resolution: {integrity: sha512-ELpt6ZFmYbuH4p/DfW8HygKOY9acvb19D17z6gFpDr4MRh6mwla4WBwRblH76HvXf2oHPqYHIU8iEpBS4DfkGA==} + '@ardenthq/sdk-ledger@2.2.1': + resolution: {integrity: sha512-QXqD2lbuB0oiAU4gBjVFPZNiBEHMbvUK8SSGMlcofUB8UPMIj0rvSckbYkpIUPXgQw6LDAEf3ZKD5BwJ6bSMew==} engines: {node: '>=16.0.0'} - '@ardenthq/sdk-markets@2.2.0': - resolution: {integrity: sha512-nHpvdtJjOCAnwpukS87GHdQhDmr0sKeZU1Na6XR6aMu+mLsTLxX1D47Es4NThvxcib95M/Dze0oc83FsoTLGYA==} + '@ardenthq/sdk-markets@2.2.1': + resolution: {integrity: sha512-U2WR1K1XDhNxE6sRhgfsaX8VDP+UMrRg/36huchFBnyNkMYmk2DdtMJqbpqkr1yHKnXzFpQ9nfZqVlR8EJlTTg==} engines: {node: '>=16.0.0'} - '@ardenthq/sdk-profiles@2.2.0': - resolution: {integrity: sha512-cqIOJKgk2vRfqaUvqlXfyx0fRfpiU8fyZbx6KbOuEjXt9UZLX7cYuvKPCxSsiM0U2UeBKxNcIvKeN32aSl319w==} + '@ardenthq/sdk-profiles@2.2.1': + resolution: {integrity: sha512-RDLgp/WL2CicyeNZr+b6L+JUXTHwpZhDrhDCwtUbzME6htwnAvJSapOxSOzIRD+S/WdW3qWx1VL8fCfM/UenKA==} engines: {node: '>=16.0.0'} - '@ardenthq/sdk@2.2.0': - resolution: {integrity: sha512-/OyxMmvbR8IyQEl7S6ReqCyQ8aWc18be0+QZiEgNF2Zp/lEYNbwuThu/18iSD9xgiUTPk3gnJE34PxubvzC3jg==} + '@ardenthq/sdk@2.2.1': + resolution: {integrity: sha512-3s7zYchzuqFpyRmfyParMOHZ/VLzofcPxnTnqZA2b7JpZ/S/XqT1K4zzoam6Fi1B+3Vd2DuTkBHRCvYGDWT2Vw==} engines: {node: '>=16.0.0'} '@arkecosystem/ledger-transport@2.0.0': @@ -7009,12 +7009,12 @@ snapshots: '@ardenthq/arkvault-url@1.2.0': {} - '@ardenthq/sdk-ark@2.2.0': + '@ardenthq/sdk-ark@2.2.1': dependencies: - '@ardenthq/sdk': 2.2.0 - '@ardenthq/sdk-cryptography': 2.2.0 - '@ardenthq/sdk-helpers': 2.2.0 - '@ardenthq/sdk-intl': 2.2.0 + '@ardenthq/sdk': 2.2.1 + '@ardenthq/sdk-cryptography': 2.2.1 + '@ardenthq/sdk-helpers': 2.2.1 + '@ardenthq/sdk-intl': 2.2.1 '@arkecosystem/ledger-transport': 2.0.0 ajv: 8.12.0 ajv-formats: 2.1.1(ajv@8.12.0) @@ -7028,7 +7028,7 @@ snapshots: lodash.set: 4.3.2 node-dotify: 1.1.0 - '@ardenthq/sdk-cryptography@2.2.0': + '@ardenthq/sdk-cryptography@2.2.1': dependencies: '@noble/hashes': 0.5.9 '@noble/secp256k1': 1.7.1 @@ -7046,7 +7046,7 @@ snapshots: typeforce: 1.18.0 uuid: 8.3.2 - '@ardenthq/sdk-helpers@2.2.0': + '@ardenthq/sdk-helpers@2.2.1': dependencies: '@hapi/bourne': 2.1.0 bad-words: 3.0.4 @@ -7060,30 +7060,30 @@ snapshots: qrcode: 1.5.4 query-string: 7.1.3 - '@ardenthq/sdk-intl@2.2.0': + '@ardenthq/sdk-intl@2.2.1': dependencies: dayjs: 1.11.13 dinero.js: 1.9.1 - '@ardenthq/sdk-ledger@2.2.0': + '@ardenthq/sdk-ledger@2.2.1': dependencies: - '@ardenthq/sdk': 2.2.0 + '@ardenthq/sdk': 2.2.1 '@ledgerhq/hw-transport-webhid': 6.29.4 '@ledgerhq/hw-transport-webusb': 6.29.4 platform: 1.3.6 - '@ardenthq/sdk-markets@2.2.0': + '@ardenthq/sdk-markets@2.2.1': dependencies: - '@ardenthq/sdk': 2.2.0 - '@ardenthq/sdk-intl': 2.2.0 + '@ardenthq/sdk': 2.2.1 + '@ardenthq/sdk-intl': 2.2.1 - '@ardenthq/sdk-profiles@2.2.0': + '@ardenthq/sdk-profiles@2.2.1': dependencies: - '@ardenthq/sdk': 2.2.0 - '@ardenthq/sdk-cryptography': 2.2.0 - '@ardenthq/sdk-helpers': 2.2.0 - '@ardenthq/sdk-intl': 2.2.0 - '@ardenthq/sdk-markets': 2.2.0 + '@ardenthq/sdk': 2.2.1 + '@ardenthq/sdk-cryptography': 2.2.1 + '@ardenthq/sdk-helpers': 2.2.1 + '@ardenthq/sdk-intl': 2.2.1 + '@ardenthq/sdk-markets': 2.2.1 '@vechain/picasso': 2.1.1 joi: 17.13.3 localforage: 1.10.0 @@ -7093,10 +7093,10 @@ snapshots: semver: 7.6.3 type-fest: 2.19.0 - '@ardenthq/sdk@2.2.0': + '@ardenthq/sdk@2.2.1': dependencies: - '@ardenthq/sdk-helpers': 2.2.0 - '@ardenthq/sdk-intl': 2.2.0 + '@ardenthq/sdk-helpers': 2.2.1 + '@ardenthq/sdk-intl': 2.2.1 bad-words: 3.0.4 bent: 7.3.12 bip39: 3.1.0 From 9c2a811d04e8d18db74e859763a6308ea391a566 Mon Sep 17 00:00:00 2001 From: shahin-hq <132887516+shahin-hq@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:45:13 +0400 Subject: [PATCH 2/2] refactor: navigate to dashboard after creating profile (#817) --- .../CreateProfile/CreateProfile.test.tsx | 22 +++++++++++++++++++ .../pages/CreateProfile/CreateProfile.tsx | 16 +++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/domains/profile/pages/CreateProfile/CreateProfile.test.tsx b/src/domains/profile/pages/CreateProfile/CreateProfile.test.tsx index 1010c46a7d..3cf5c42fcc 100755 --- a/src/domains/profile/pages/CreateProfile/CreateProfile.test.tsx +++ b/src/domains/profile/pages/CreateProfile/CreateProfile.test.tsx @@ -190,6 +190,28 @@ describe("CreateProfile", () => { expect(profile.usesPassword()).toBe(false); }); + it("should navigate to dashboard after creating profile", async () => { + const history = createHashHistory(); + + render(, { history }); + + await userEvent.type(nameInput(), "test profile 2"); + + await userEvent.click(screen.getByRole("checkbox")); + + await waitFor(() => expect(submitButton()).toBeEnabled()); + + const historySpy = vi.spyOn(history, "push"); + + await userEvent.click(submitButton()); + + const profile = env.profiles().last(); + + expect(historySpy).toHaveBeenCalledWith(`/profiles/${profile.id()}/dashboard`); + + historySpy.mockRestore(); + }); + it("should not be able to create new profile if name already exists", async () => { const profile = await env.profiles().create(profileName); diff --git a/src/domains/profile/pages/CreateProfile/CreateProfile.tsx b/src/domains/profile/pages/CreateProfile/CreateProfile.tsx index 6ff84dc1dd..02f662e2ae 100755 --- a/src/domains/profile/pages/CreateProfile/CreateProfile.tsx +++ b/src/domains/profile/pages/CreateProfile/CreateProfile.tsx @@ -6,10 +6,12 @@ import { useHistory } from "react-router-dom"; import { Header } from "@/app/components/Header"; import { Page, Section } from "@/app/components/Layout"; import { useEnvironmentContext } from "@/app/contexts"; -import { useLocaleCurrency, useProfileRestore, useTheme } from "@/app/hooks"; +import { useAccentColor, useLocaleCurrency, useProfileRestore, useTheme } from "@/app/hooks"; import { ProfileForm, ProfileFormState } from "@/domains/profile/components/ProfileForm"; import { ThemeIcon } from "@/app/components/Icon"; +import { generatePath } from "react-router-dom"; +import { ProfilePaths } from "@/router/paths"; export const CreateProfile = () => { const { env, persist } = useEnvironmentContext(); @@ -22,12 +24,11 @@ export const CreateProfile = () => { useLayoutEffect(() => { resetTheme(); - - return () => { - resetTheme(); - }; }, [resetTheme]); + const { setProfileTheme } = useTheme(); + const { setProfileAccentColor } = useAccentColor(); + const handleSubmit = async ({ name, password, currency, viewingMode }: ProfileFormState) => { const profile = await env.profiles().create(name.trim()); await env.profiles().restore(profile); @@ -42,7 +43,10 @@ export const CreateProfile = () => { restoreProfileConfig(profile); await persist(); - history.push("/"); + setProfileTheme(profile); + setProfileAccentColor(profile); + + history.push(generatePath(ProfilePaths.Dashboard, { profileId: profile.id() })); }; return (