diff --git a/apps/cli/CHANGELOG.md b/apps/cli/CHANGELOG.md index d14c565d9b7c..ff731c49bd14 100644 --- a/apps/cli/CHANGELOG.md +++ b/apps/cli/CHANGELOG.md @@ -4,100 +4,15 @@ ### Patch Changes -- [#7206](https://github.com/LedgerHQ/ledger-live/pull/7206) [`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78) Thanks [@kallen-ledger](https://github.com/kallen-ledger)! - chore: resolve merge conflicts +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1 -- [#7019](https://github.com/LedgerHQ/ledger-live/pull/7019) [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917) Thanks [@ofreyssinet-ledger](https://github.com/ofreyssinet-ledger)! - Refactor install/uninstall app commands to only rely on v2 manager apis - -- Updated dependencies [[`9551536`](https://github.com/LedgerHQ/ledger-live/commit/955153681ebc19344ed5becfbf7b131224b2ebd0), [`2e5d5bd`](https://github.com/LedgerHQ/ledger-live/commit/2e5d5bdb988c73c91f1fe42c809b192ca5dbeb7a), [`782d637`](https://github.com/LedgerHQ/ledger-live/commit/782d637b5fba8c9c9d37609b6ad492f45a4b3737), [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917), [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917), [`cde94b9`](https://github.com/LedgerHQ/ledger-live/commit/cde94b9584d6889849fb097813a5fc11ea19d069), [`d2368f6`](https://github.com/LedgerHQ/ledger-live/commit/d2368f632b834207c33df14468599b6a543d11da), [`785c618`](https://github.com/LedgerHQ/ledger-live/commit/785c6180c2212ca879c2fddb8302f0bab5686761), [`b478096`](https://github.com/LedgerHQ/ledger-live/commit/b478096537a0f86a9e39acc8c6cf17b1184e0849), [`9e82327`](https://github.com/LedgerHQ/ledger-live/commit/9e823278b69d7ccd5f8927f699930172cd50a59d), [`fc6d09b`](https://github.com/LedgerHQ/ledger-live/commit/fc6d09be89a6e8775d77b98d5a0256b68346a14d), [`6b3c8ca`](https://github.com/LedgerHQ/ledger-live/commit/6b3c8cab371db8212e1b0a02f03bb0baa46ce95c), [`c988a94`](https://github.com/LedgerHQ/ledger-live/commit/c988a946d86e7f874823ac96d66573281ba00b13), [`9f33fc1`](https://github.com/LedgerHQ/ledger-live/commit/9f33fc14e0628a68d32957171aa879c30041f27e), [`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78), [`1df64d2`](https://github.com/LedgerHQ/ledger-live/commit/1df64d27e75c2a3445903ebce9e1f681683676da), [`d9f586e`](https://github.com/LedgerHQ/ledger-live/commit/d9f586ea4bd45d15f3e42c9f733f30dceef3027d), [`d13a5d7`](https://github.com/LedgerHQ/ledger-live/commit/d13a5d7f8f23624feb3a4a041cd7966d3b100dcf), [`fec3dc8`](https://github.com/LedgerHQ/ledger-live/commit/fec3dc84ea00fc6f7f632942826978607e20c2ff), [`6692f5f`](https://github.com/LedgerHQ/ledger-live/commit/6692f5fe6701a4e47c626ea3cbb73a4641c9021d), [`4b7f19c`](https://github.com/LedgerHQ/ledger-live/commit/4b7f19c96d95d86d5b6fbb480032d77532bf755e)]: - - @ledgerhq/live-common@34.5.0 - - @ledgerhq/coin-framework@0.15.0 - - @ledgerhq/cryptoassets@13.1.1 - - @ledgerhq/live-wallet@0.3.0 - - @ledgerhq/hw-transport-node-hid@6.29.1 - - @ledgerhq/coin-bitcoin@0.6.1 - - @ledgerhq/live-countervalues@0.2.1 - -## 24.3.2-next.8 - -### Patch Changes - -- Updated dependencies []: - - @ledgerhq/live-common@34.5.0-next.7 - -## 24.3.2-next.7 - -### Patch Changes - -- Updated dependencies [[`fec3dc8`](https://github.com/LedgerHQ/ledger-live/commit/fec3dc84ea00fc6f7f632942826978607e20c2ff)]: - - @ledgerhq/live-common@34.5.0-next.6 - -## 24.3.2-next.6 - -### Patch Changes - -- Updated dependencies [[`9e82327`](https://github.com/LedgerHQ/ledger-live/commit/9e823278b69d7ccd5f8927f699930172cd50a59d)]: - - @ledgerhq/live-common@34.5.0-next.5 - -## 24.3.2-next.5 - -### Patch Changes - -- [#7206](https://github.com/LedgerHQ/ledger-live/pull/7206) [`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78) Thanks [@kallen-ledger](https://github.com/kallen-ledger)! - chore: resolve merge conflicts - -- Updated dependencies [[`81e5b8b`](https://github.com/LedgerHQ/ledger-live/commit/81e5b8bf4830dcb9d666436f2cc4367d92e93e78)]: - - @ledgerhq/hw-transport-node-hid@6.29.1-next.1 - - @ledgerhq/cryptoassets@13.1.1-next.1 - - @ledgerhq/coin-bitcoin@0.6.1-next.2 - - @ledgerhq/live-common@34.5.0-next.4 - - @ledgerhq/live-countervalues@0.2.1-next.2 - - @ledgerhq/coin-framework@0.15.0-next.2 - - @ledgerhq/live-wallet@0.3.0-next.2 - -## 24.3.2-next.4 +## 24.3.2-hotfix.0 ### Patch Changes -- Updated dependencies [[`b478096`](https://github.com/LedgerHQ/ledger-live/commit/b478096537a0f86a9e39acc8c6cf17b1184e0849), [`d13a5d7`](https://github.com/LedgerHQ/ledger-live/commit/d13a5d7f8f23624feb3a4a041cd7966d3b100dcf)]: - - @ledgerhq/cryptoassets@13.1.1-next.0 - - @ledgerhq/live-common@34.4.0-next.3 - - @ledgerhq/coin-framework@0.15.0-next.1 - - @ledgerhq/coin-bitcoin@0.6.1-next.1 - - @ledgerhq/live-countervalues@0.2.1-next.1 - - @ledgerhq/live-wallet@0.3.0-next.1 - -## 24.3.2-next.3 - -### Patch Changes - -- Updated dependencies []: - - @ledgerhq/live-common@34.4.0-next.2 - -## 24.3.2-next.2 - -### Patch Changes - -- Updated dependencies []: - - @ledgerhq/live-common@34.4.0-next.1 - -## 24.3.2-next.1 - -### Patch Changes - -- Updated dependencies [[`1df64d2`](https://github.com/LedgerHQ/ledger-live/commit/1df64d27e75c2a3445903ebce9e1f681683676da)]: - - @ledgerhq/hw-transport-node-hid@6.29.1-next.0 - -## 24.3.2-next.0 - -### Patch Changes - -- [#7019](https://github.com/LedgerHQ/ledger-live/pull/7019) [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917) Thanks [@ofreyssinet-ledger](https://github.com/ofreyssinet-ledger)! - Refactor install/uninstall app commands to only rely on v2 manager apis - -- Updated dependencies [[`9551536`](https://github.com/LedgerHQ/ledger-live/commit/955153681ebc19344ed5becfbf7b131224b2ebd0), [`2e5d5bd`](https://github.com/LedgerHQ/ledger-live/commit/2e5d5bdb988c73c91f1fe42c809b192ca5dbeb7a), [`782d637`](https://github.com/LedgerHQ/ledger-live/commit/782d637b5fba8c9c9d37609b6ad492f45a4b3737), [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917), [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917), [`cde94b9`](https://github.com/LedgerHQ/ledger-live/commit/cde94b9584d6889849fb097813a5fc11ea19d069), [`d2368f6`](https://github.com/LedgerHQ/ledger-live/commit/d2368f632b834207c33df14468599b6a543d11da), [`785c618`](https://github.com/LedgerHQ/ledger-live/commit/785c6180c2212ca879c2fddb8302f0bab5686761), [`fc6d09b`](https://github.com/LedgerHQ/ledger-live/commit/fc6d09be89a6e8775d77b98d5a0256b68346a14d), [`6b3c8ca`](https://github.com/LedgerHQ/ledger-live/commit/6b3c8cab371db8212e1b0a02f03bb0baa46ce95c), [`c988a94`](https://github.com/LedgerHQ/ledger-live/commit/c988a946d86e7f874823ac96d66573281ba00b13), [`9f33fc1`](https://github.com/LedgerHQ/ledger-live/commit/9f33fc14e0628a68d32957171aa879c30041f27e), [`d9f586e`](https://github.com/LedgerHQ/ledger-live/commit/d9f586ea4bd45d15f3e42c9f733f30dceef3027d), [`6692f5f`](https://github.com/LedgerHQ/ledger-live/commit/6692f5fe6701a4e47c626ea3cbb73a4641c9021d), [`4b7f19c`](https://github.com/LedgerHQ/ledger-live/commit/4b7f19c96d95d86d5b6fbb480032d77532bf755e)]: - - @ledgerhq/live-common@34.4.0-next.0 - - @ledgerhq/coin-framework@0.15.0-next.0 - - @ledgerhq/live-wallet@0.3.0-next.0 - - @ledgerhq/coin-bitcoin@0.6.1-next.0 - - @ledgerhq/live-countervalues@0.2.1-next.0 +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1-hotfix.0 ## 24.3.1 diff --git a/apps/ledger-live-desktop/CHANGELOG.md b/apps/ledger-live-desktop/CHANGELOG.md index c6faa333d63f..47a000b2143a 100644 --- a/apps/ledger-live-desktop/CHANGELOG.md +++ b/apps/ledger-live-desktop/CHANGELOG.md @@ -197,6 +197,20 @@ - @ledgerhq/live-nft@0.4.1-next.0 - @ledgerhq/live-nft-react@0.4.1-next.0 +## 2.82.2 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1 + +## 2.82.2-hotfix.0 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1-hotfix.0 + ## 2.82.1 ### Patch Changes diff --git a/apps/ledger-live-desktop/package.json b/apps/ledger-live-desktop/package.json index ce62dafc91c1..14cfec59a8e0 100644 --- a/apps/ledger-live-desktop/package.json +++ b/apps/ledger-live-desktop/package.json @@ -13,7 +13,7 @@ "license": "MIT", "private": true, "main": "./.webpack/main.bundle.js", - "version": "2.83.0", + "version": "2.82.2", "scripts": { "start:prod": "electron ./.webpack/main.bundle.js", "start": "cross-env NODE_ENV=development node ./tools/main.js", diff --git a/apps/ledger-live-mobile/CHANGELOG.md b/apps/ledger-live-mobile/CHANGELOG.md index 918101cc85a9..06efbc662848 100644 --- a/apps/ledger-live-mobile/CHANGELOG.md +++ b/apps/ledger-live-mobile/CHANGELOG.md @@ -145,6 +145,48 @@ - @ledgerhq/live-nft@0.4.1-next.0 - @ledgerhq/live-nft-react@0.4.1-next.0 +## 3.45.2 + +### Patch Changes + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`fc95e03`](https://github.com/LedgerHQ/ledger-live/commit/fc95e032a0045093e343017051fc2f64fa3bcdef) Thanks [@valpinkman](https://github.com/valpinkman)! - Bluetooth update banner to always display but shows the correct message in a drawer if the update is not supported + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`22a4ebf`](https://github.com/LedgerHQ/ledger-live/commit/22a4ebf8130b0c8f06c132769a6b0ef5602bfd7d) Thanks [@valpinkman](https://github.com/valpinkman)! - move update firmware checks to the ViewProps component and add tests + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`a9954fa`](https://github.com/LedgerHQ/ledger-live/commit/a9954fac8d0827d659f1e0f134d437bd45802cbf) Thanks [@valpinkman](https://github.com/valpinkman)! - Add new tests for the UpdateBanner + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`aa30245`](https://github.com/LedgerHQ/ledger-live/commit/aa302450112c7215263a266fb1bb07256d9efdeb) Thanks [@valpinkman](https://github.com/valpinkman)! - Add version check for nano X bluetooth firmware update + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1 + +## 3.45.2-hotfix.3 + +### Patch Changes + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`fc95e03`](https://github.com/LedgerHQ/ledger-live/commit/fc95e032a0045093e343017051fc2f64fa3bcdef) Thanks [@valpinkman](https://github.com/valpinkman)! - Bluetooth update banner to always display but shows the correct message in a drawer if the update is not supported + +## 3.45.2-hotfix.2 + +### Patch Changes + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`a9954fa`](https://github.com/LedgerHQ/ledger-live/commit/a9954fac8d0827d659f1e0f134d437bd45802cbf) Thanks [@valpinkman](https://github.com/valpinkman)! - Add new tests for the UpdateBanner + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1-hotfix.0 + +## 3.45.2-hotfix.1 + +### Patch Changes + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`22a4ebf`](https://github.com/LedgerHQ/ledger-live/commit/22a4ebf8130b0c8f06c132769a6b0ef5602bfd7d) Thanks [@valpinkman](https://github.com/valpinkman)! - move update firmware checks to the ViewProps component and add tests + +## 3.45.2-hotfix.0 + +### Patch Changes + +- [#7241](https://github.com/LedgerHQ/ledger-live/pull/7241) [`aa30245`](https://github.com/LedgerHQ/ledger-live/commit/aa302450112c7215263a266fb1bb07256d9efdeb) Thanks [@valpinkman](https://github.com/valpinkman)! - Add version check for nano X bluetooth firmware update + ## 3.45.1 ### Patch Changes diff --git a/apps/ledger-live-mobile/package.json b/apps/ledger-live-mobile/package.json index afc7d72e0b9d..a2372292d5e8 100644 --- a/apps/ledger-live-mobile/package.json +++ b/apps/ledger-live-mobile/package.json @@ -1,6 +1,6 @@ { "name": "live-mobile", - "version": "3.46.0", + "version": "3.45.2", "private": true, "scripts": { "postinstall": "zx ./scripts/post.mjs", diff --git a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/UpdateBanner.test.tsx b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/UpdateBanner.test.tsx index 3e593d06b3f8..2e3205b59e48 100644 --- a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/UpdateBanner.test.tsx +++ b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/UpdateBanner.test.tsx @@ -52,33 +52,46 @@ const EUROPA_DATA = { productName: getDeviceModel(DeviceModelId.europa).productName, }; +const OUTDATED_NANOX_BLE_UPDATE = { + deviceModelId: DeviceModelId.nanoX, + productName: getDeviceModel(DeviceModelId.nanoX).productName, + version: "2.3.0", + fwVersion: "2.4.0", + hasCompletedOnboarding: true, + wired: false, + hasConnectedDevice: true, +}; + const oldUpdateFlowNotSupportedDataSet: Array<{ deviceModelId: DeviceModelId; version: string; + fwVersion: string; productName: string; }> = [ - { ...NANO_S_DATA, version: "1.6.0" }, - { ...NANO_X_DATA, version: "1.2.9" }, - { ...NANO_SP_DATA, version: "0.9.9" }, + { ...NANO_S_DATA, version: "1.6.0", fwVersion: "1.7.0" }, + { ...NANO_X_DATA, version: "1.2.9", fwVersion: "1.3.0" }, + { ...NANO_SP_DATA, version: "0.9.9", fwVersion: "1.0.0" }, ]; const oldUpdateFlowSupportedDataSet: Array<{ deviceModelId: DeviceModelId; version: string; + fwVersion: string; productName: string; }> = [ - { ...NANO_S_DATA, version: "1.6.1" }, - { ...NANO_SP_DATA, version: "1.0.0" }, + { ...NANO_S_DATA, version: "1.6.1", fwVersion: "1.7.2" }, + { ...NANO_SP_DATA, version: "1.0.0", fwVersion: "1.1.0" }, ]; const newUpdateFlowSupportedDataSet: Array<{ deviceModelId: DeviceModelId; version: string; + fwVersion: string; productName: string; }> = [ - { ...STAX_DATA, version: "1.0.0" }, - { ...EUROPA_DATA, version: "1.0.0" }, - { ...NANO_X_DATA, version: "1.3.0" }, + { ...STAX_DATA, version: "1.0.0", fwVersion: "1.1.0" }, + { ...EUROPA_DATA, version: "1.0.0", fwVersion: "1.1.0" }, + { ...NANO_X_DATA, version: "2.4.0", fwVersion: "2.4.1" }, ]; describe("", () => { @@ -115,6 +128,7 @@ describe("", () => { useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", + version: "3.0.0", }, }); @@ -139,6 +153,7 @@ describe("", () => { useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", + version: "3.0.0", }, }); @@ -164,6 +179,7 @@ describe("", () => { useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", + version: "3.0.0", }, }); @@ -201,11 +217,88 @@ describe("", () => { expect(navigateToNewUpdateFlow).not.toHaveBeenCalled(); }); + it("should open the unsupported drawer if there is a bluetooth update on Android on Nano X with version < 2.4.0", async () => { + const { fwVersion, ...nanoX } = OUTDATED_NANOX_BLE_UPDATE; + PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform); + useLatestFirmware.mockReturnValue({ + final: { + name: "mockVersion", + version: fwVersion, + }, + }); + + const { user } = render( {}} />, { + overrideInitialState: makeOverrideInitialState({ + ...nanoX, + }), + }); + + // Check that the banner is displayed with the correct wording + expect(await screen.findByText("OS update available")).toBeOnTheScreen(); + expect( + await screen.findByText("Tap to update your Ledger Nano X to OS version mockVersion."), + ).toBeOnTheScreen(); + + // Press the banner + await user.press(screen.getByTestId("fw-update-banner")); + + // Check that the unsupported drawer is displayed + expect(await screen.findByText("USB cable needed")).toBeOnTheScreen(); + expect( + await screen.findByText( + "To start the firmware update, plug your Ledger Nano X to your mobile phone using a USB cable.", + ), + ).toBeOnTheScreen(); + + // Check that the entrypoints to the update flows are not called + expect(navigateToOldUpdateFlow).not.toHaveBeenCalled(); + expect(navigateToNewUpdateFlow).not.toHaveBeenCalled(); + }); + + it("should open the unsupported drawer if there is a bluetooth update on iOS on Nano X with version < 2.4.0", async () => { + const { fwVersion, ...nanoX } = OUTDATED_NANOX_BLE_UPDATE; + PlatformSpy.mockReturnValue({ OS: "ios" } as typeof ReactNative.Platform); + useLatestFirmware.mockReturnValue({ + final: { + name: "mockVersion", + version: fwVersion, + }, + }); + + const { user } = render( {}} />, { + overrideInitialState: makeOverrideInitialState({ + ...nanoX, + }), + }); + + // Check that the banner is displayed with the correct wording + expect(await screen.findByText("OS update available")).toBeOnTheScreen(); + expect( + await screen.findByText("Tap to update your Ledger Nano X to OS version mockVersion."), + ).toBeOnTheScreen(); + + // Press the banner + await user.press(screen.getByTestId("fw-update-banner")); + + // Check that the unsupported drawer is displayed + expect(await screen.findByText("Firmware Update")).toBeOnTheScreen(); + expect( + await screen.findByText( + "Update your Ledger Nano firmware by connecting it to the Ledger Live application on desktop", + ), + ).toBeOnTheScreen(); + + // Check that the entrypoints to the update flows are not called + expect(navigateToOldUpdateFlow).not.toHaveBeenCalled(); + expect(navigateToNewUpdateFlow).not.toHaveBeenCalled(); + }); + it("should open the unsupported drawer if there is an update and it's Android but the device has to be wired", async () => { PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform); useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", + version: "3.0.0", }, }); @@ -242,12 +335,13 @@ describe("", () => { expect(navigateToNewUpdateFlow).not.toHaveBeenCalled(); }); - oldUpdateFlowNotSupportedDataSet.forEach(({ deviceModelId, version, productName }) => { + oldUpdateFlowNotSupportedDataSet.forEach(({ deviceModelId, version, productName, fwVersion }) => { it(`should open the unsupported drawer if there is an update and it's Android but the update is not supported for this device version (${version} ${deviceModelId})`, async () => { PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform); useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", + version: fwVersion, }, }); @@ -284,12 +378,13 @@ describe("", () => { }); }); - oldUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName }) => { + oldUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName, fwVersion }) => { it(`should redirect to the OLD firmware update flow if the device is supported (${version} ${deviceModelId})`, async () => { PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform); useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", + version: fwVersion, }, }); @@ -316,12 +411,13 @@ describe("", () => { }); }); - newUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName }) => { + newUpdateFlowSupportedDataSet.forEach(({ deviceModelId, version, productName, fwVersion }) => { it(`should redirect to the NEW firmware update flow if the device is supported (${version} ${deviceModelId})`, async () => { PlatformSpy.mockReturnValue({ OS: "android" } as typeof ReactNative.Platform); useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", + version: fwVersion, }, }); diff --git a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/index.tsx b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/index.tsx index 82c3ce42ce3b..2e604116e549 100644 --- a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/index.tsx +++ b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/index.tsx @@ -30,6 +30,7 @@ const UpdateBanner = ({ : undefined; const deviceName = lastConnectedDevice?.deviceName; + return bannerVisible ? ( <> diff --git a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.test.tsx b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.test.tsx index 5d2534e34e1a..077c37096e32 100644 --- a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.test.tsx +++ b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.test.tsx @@ -23,7 +23,7 @@ jest.mock("~/reducers/settings", () => ({ lastConnectedDeviceSelector: jest.fn(), hasCompletedOnboardingSelector: jest.fn(), })); -const { lastConnectedDeviceSelector, hasCompletedOnboardingSelector } = +const { lastConnectedDeviceSelector, hasCompletedOnboardingSelector, lastSeenDeviceSelector } = jest.requireMock("~/reducers/settings"); jest.mock("~/reducers/appstate", () => ({ @@ -76,7 +76,7 @@ describe("useUpdateBannerViewModel", () => { lastConnectedDeviceSelector.mockReturnValue(lastConnectedDevice); hasConnectedDeviceSelector.mockReturnValue(true); hasCompletedOnboardingSelector.mockReturnValue(true); - useLatestFirmware.mockReturnValue({ final: { name: "mockVersion" } }); + useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", version: "1.0.0" } }); const { result } = renderHook(() => useUpdateBannerViewModel({ @@ -211,10 +211,63 @@ describe("useUpdateBannerViewModel", () => { expect(navigateToOldUpdateFlow).toHaveBeenCalled(); }); + it("should not call startFirmwareUpdateFlow when onClickUpdate is called for a bluetooth Nano X update with version < 2.4.0", () => { + hasConnectedDeviceSelector.mockReturnValue(true); + hasCompletedOnboardingSelector.mockReturnValue(true); + useLatestFirmware.mockReturnValue({ final: { name: "mockVersion", version: "2.4.0" } }); + lastConnectedDeviceSelector.mockReturnValue({ modelId: "nanoX", wired: false }); + lastSeenDeviceSelector.mockReturnValue({ modelId: "nanoX", deviceInfo: { version: "2.3.9" } }); + + isOldFirmwareUpdateUxSupported.mockReturnValue({ + updateSupported: false, + updateSupportedButDeviceNotWired: false, + }); + isNewFirmwareUpdateUxSupported.mockReturnValue(true); + + const { result } = renderHook(() => + useUpdateBannerViewModel({ + onBackFromUpdate: jest.fn(), + }), + ); + + act(() => result.current.onClickUpdate()); + + expect(result.current.unsupportedUpdateDrawerOpened).toBe(true); + }); + it("should call startFirmwareUpdateFlow when onClickUpdate is called if new update flow is supported", () => { hasConnectedDeviceSelector.mockReturnValue(true); hasCompletedOnboardingSelector.mockReturnValue(true); useLatestFirmware.mockReturnValue({ final: { name: "mockVersion" } }); + lastSeenDeviceSelector.mockReturnValue({ modelId: "mockId", deviceInfo: { version: "3.0.0" } }); + + isOldFirmwareUpdateUxSupported.mockReturnValue({ + updateSupported: false, + updateSupportedButDeviceNotWired: false, + }); + isNewFirmwareUpdateUxSupported.mockReturnValue(true); + + const { result } = renderHook(() => + useUpdateBannerViewModel({ + onBackFromUpdate: jest.fn(), + }), + ); + + act(() => result.current.onClickUpdate()); + + expect(result.current.unsupportedUpdateDrawerOpened).toBe(false); + expect(navigateToNewUpdateFlow).toHaveBeenCalled(); + }); + + it("should call startFirmwareUpdateFlow when onClickUpdate is called for a bluetooth Nano X update with version >= 2.4.0", () => { + hasConnectedDeviceSelector.mockReturnValue(true); + hasCompletedOnboardingSelector.mockReturnValue(true); + useLatestFirmware.mockReturnValue({ final: { name: "mockVersion" } }); + lastConnectedDeviceSelector.mockReturnValue({ + modelId: "nanoX", + wired: false, + }); + lastSeenDeviceSelector.mockReturnValue({ modelId: "nanoX", deviceInfo: { version: "2.4.0" } }); isOldFirmwareUpdateUxSupported.mockReturnValue({ updateSupported: false, diff --git a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.tsx b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.tsx index 1e349c0ca931..60716af075af 100644 --- a/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.tsx +++ b/apps/ledger-live-mobile/src/newArch/features/FirmwareUpdate/components/UpdateBanner/useUpdateBannerViewModel.tsx @@ -1,7 +1,10 @@ import { useState, useCallback } from "react"; +import { Platform } from "react-native"; import { useNavigation, useRoute } from "@react-navigation/native"; import { useSelector } from "react-redux"; import { useLatestFirmware } from "@ledgerhq/live-common/device/hooks/useLatestFirmware"; +import { DeviceModelId } from "@ledgerhq/devices"; +import semver from "semver"; import { lastSeenDeviceSelector, hasCompletedOnboardingSelector, @@ -32,6 +35,7 @@ export function useUpdateBannerViewModel({ const bannerVisible = Boolean(latestFirmware) && hasCompletedOnboarding && hasConnectedDevice; const version = latestFirmware?.final?.name ?? ""; + const connectionType = lastConnectedDevice?.wired ? "usb" : "bluetooth"; const { updateSupported: isOldUxSupported, @@ -53,13 +57,22 @@ export function useUpdateBannerViewModel({ const onClickUpdate = useCallback(() => { if (isNewUxSupported) { - navigateToNewUpdateFlow({ - navigation, - lastConnectedDevice, - lastSeenDeviceModelInfo, - latestFirmware, - onBackFromUpdate, - }); + if ( + connectionType === "bluetooth" && + lastConnectedDevice?.modelId === DeviceModelId.nanoX && + lastSeenDeviceModelInfo?.deviceInfo.version && + semver.lt(lastSeenDeviceModelInfo?.deviceInfo.version, "2.4.0") + ) { + setUnsupportedUpdateDrawerOpened(true); + } else { + navigateToNewUpdateFlow({ + navigation, + lastConnectedDevice, + lastSeenDeviceModelInfo, + latestFirmware, + onBackFromUpdate, + }); + } } else if (isOldUxSupported) { navigateToOldUpdateFlow({ route, navigation }); } else { @@ -74,6 +87,7 @@ export function useUpdateBannerViewModel({ navigation, onBackFromUpdate, route, + connectionType, ]); return { @@ -83,6 +97,11 @@ export function useUpdateBannerViewModel({ onClickUpdate, unsupportedUpdateDrawerOpened, closeUnsupportedUpdateDrawer, - isUpdateSupportedButDeviceNotWired: isOldUxSupportedButDeviceNotWired, + isUpdateSupportedButDeviceNotWired: + isOldUxSupportedButDeviceNotWired || + (connectionType === "bluetooth" && + Platform.OS === "android" && + !!lastSeenDeviceModelInfo && + semver.lt(lastSeenDeviceModelInfo?.deviceInfo.version, "2.4.0")), }; } diff --git a/apps/web-tools/CHANGELOG.md b/apps/web-tools/CHANGELOG.md index 91f66f046d6a..207e3f12ae0e 100644 --- a/apps/web-tools/CHANGELOG.md +++ b/apps/web-tools/CHANGELOG.md @@ -92,6 +92,20 @@ - @ledgerhq/domain-service@1.2.1-next.0 - @ledgerhq/hw-app-eth@6.37.1-next.0 +## 0.6.2 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1 + +## 0.6.2-hotfix.0 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1-hotfix.0 + ## 0.6.1 ### Patch Changes diff --git a/libs/ledger-live-common/CHANGELOG.md b/libs/ledger-live-common/CHANGELOG.md index be8ee6be5efa..a275bf10a48f 100644 --- a/libs/ledger-live-common/CHANGELOG.md +++ b/libs/ledger-live-common/CHANGELOG.md @@ -222,6 +222,24 @@ - @ledgerhq/live-countervalues-react@0.2.1-next.0 - @ledgerhq/live-nft@0.4.1-next.0 +## 34.4.1 + +### Patch Changes + +- [#7245](https://github.com/LedgerHQ/ledger-live/pull/7245) [`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix: polkadot send tx in LLM + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/hw-app-polkadot@6.30.1 + +## 34.4.1-hotfix.0 + +### Patch Changes + +- [#7245](https://github.com/LedgerHQ/ledger-live/pull/7245) [`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix: polkadot send tx in LLM + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/hw-app-polkadot@6.30.1-hotfix.0 + ## 34.4.0 ### Minor Changes diff --git a/libs/ledger-live-common/package.json b/libs/ledger-live-common/package.json index b226a00eca5c..306f7902cbac 100644 --- a/libs/ledger-live-common/package.json +++ b/libs/ledger-live-common/package.json @@ -1,7 +1,7 @@ { "name": "@ledgerhq/live-common", "description": "Common ground for the Ledger Live apps", - "version": "34.5.0", + "version": "34.4.1", "repository": { "type": "git", "url": "https://github.com/LedgerHQ/ledger-live.git" diff --git a/libs/ledger-live-common/src/families/polkadot/config.ts b/libs/ledger-live-common/src/families/polkadot/config.ts index 6c856a112b48..b79fe99152dc 100644 --- a/libs/ledger-live-common/src/families/polkadot/config.ts +++ b/libs/ledger-live-common/src/families/polkadot/config.ts @@ -19,12 +19,12 @@ export const polkadotConfig: Record = { electionStatusThreshold: getEnv("POLKADOT_ELECTION_STATUS_THRESHOLD"), }, metadataShortener: { - url: "https://api.zondax.ch/polkadot/transaction/metadata", + url: "https://polkadot-metadata-shortener.api.live.ledger.com/transaction/metadata", }, metadataHash: { - url: "https://api.zondax.ch/polkadot/node/metadata/hash", + url: "https://polkadot-metadata-shortener.api.live.ledger.com/node/metadata/hash", }, - runtimeUpgraded: false, + runtimeUpgraded: true, }, }, }; diff --git a/libs/ledgerjs/packages/hw-app-polkadot/CHANGELOG.md b/libs/ledgerjs/packages/hw-app-polkadot/CHANGELOG.md index a63db3e92e5e..54d12cc5eac0 100644 --- a/libs/ledgerjs/packages/hw-app-polkadot/CHANGELOG.md +++ b/libs/ledgerjs/packages/hw-app-polkadot/CHANGELOG.md @@ -22,6 +22,18 @@ - [#6326](https://github.com/LedgerHQ/ledger-live/pull/6326) [`4b7f19c`](https://github.com/LedgerHQ/ledger-live/commit/4b7f19c96d95d86d5b6fbb480032d77532bf755e) Thanks [@hedi-edelbloute](https://github.com/hedi-edelbloute)! - polkadot generic nano app support +## 6.30.1 + +### Patch Changes + +- [#7245](https://github.com/LedgerHQ/ledger-live/pull/7245) [`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix: polkadot send tx in LLM + +## 6.30.1-hotfix.0 + +### Patch Changes + +- [#7245](https://github.com/LedgerHQ/ledger-live/pull/7245) [`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff) Thanks [@hzheng-ledger](https://github.com/hzheng-ledger)! - fix: polkadot send tx in LLM + ## 6.30.0 ### Minor Changes diff --git a/libs/ledgerjs/packages/hw-app-polkadot/package.json b/libs/ledgerjs/packages/hw-app-polkadot/package.json index a567cfa3a9b5..e531d183ce33 100644 --- a/libs/ledgerjs/packages/hw-app-polkadot/package.json +++ b/libs/ledgerjs/packages/hw-app-polkadot/package.json @@ -1,6 +1,6 @@ { "name": "@ledgerhq/hw-app-polkadot", - "version": "6.31.0", + "version": "6.30.1", "description": "Ledger Hardware Wallet Polkadot Application API", "keywords": [ "Ledger", diff --git a/libs/ledgerjs/packages/hw-app-polkadot/src/Polkadot.ts b/libs/ledgerjs/packages/hw-app-polkadot/src/Polkadot.ts index 6e0797242ea6..a0b3c562527d 100644 --- a/libs/ledgerjs/packages/hw-app-polkadot/src/Polkadot.ts +++ b/libs/ledgerjs/packages/hw-app-polkadot/src/Polkadot.ts @@ -136,6 +136,8 @@ export default class Polkadot { Buffer.from(message), Buffer.from(metadata.slice(2), "hex"), ); + // we need to cast the signature to Buffer explicitly. In react native, the signature from signWithMetadata is not necessarily a Buffer + signatureRequest.signature = Buffer.from(signatureRequest.signature); return { signature: signatureRequest.signature.toString("hex"), return_code: SW_OK, diff --git a/libs/test-utils/CHANGELOG.md b/libs/test-utils/CHANGELOG.md index 11fbe84ad7c0..4f7c859feeba 100644 --- a/libs/test-utils/CHANGELOG.md +++ b/libs/test-utils/CHANGELOG.md @@ -67,6 +67,20 @@ - Updated dependencies [[`9551536`](https://github.com/LedgerHQ/ledger-live/commit/955153681ebc19344ed5becfbf7b131224b2ebd0), [`2e5d5bd`](https://github.com/LedgerHQ/ledger-live/commit/2e5d5bdb988c73c91f1fe42c809b192ca5dbeb7a), [`782d637`](https://github.com/LedgerHQ/ledger-live/commit/782d637b5fba8c9c9d37609b6ad492f45a4b3737), [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917), [`2e56708`](https://github.com/LedgerHQ/ledger-live/commit/2e567080b07abb8540907c0cb89457c746362917), [`d2368f6`](https://github.com/LedgerHQ/ledger-live/commit/d2368f632b834207c33df14468599b6a543d11da), [`785c618`](https://github.com/LedgerHQ/ledger-live/commit/785c6180c2212ca879c2fddb8302f0bab5686761), [`fc6d09b`](https://github.com/LedgerHQ/ledger-live/commit/fc6d09be89a6e8775d77b98d5a0256b68346a14d), [`6b3c8ca`](https://github.com/LedgerHQ/ledger-live/commit/6b3c8cab371db8212e1b0a02f03bb0baa46ce95c), [`c988a94`](https://github.com/LedgerHQ/ledger-live/commit/c988a946d86e7f874823ac96d66573281ba00b13), [`d9f586e`](https://github.com/LedgerHQ/ledger-live/commit/d9f586ea4bd45d15f3e42c9f733f30dceef3027d), [`6692f5f`](https://github.com/LedgerHQ/ledger-live/commit/6692f5fe6701a4e47c626ea3cbb73a4641c9021d), [`4b7f19c`](https://github.com/LedgerHQ/ledger-live/commit/4b7f19c96d95d86d5b6fbb480032d77532bf755e)]: - @ledgerhq/live-common@34.4.0-next.0 +## 0.2.2 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1 + +## 0.2.2-hotfix.0 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1-hotfix.0 + ## 0.2.1 ### Patch Changes diff --git a/tests/dummy-wallet-app/CHANGELOG.md b/tests/dummy-wallet-app/CHANGELOG.md index 04d7a4cb6904..06eac5b5ed02 100644 --- a/tests/dummy-wallet-app/CHANGELOG.md +++ b/tests/dummy-wallet-app/CHANGELOG.md @@ -71,6 +71,20 @@ - @ledgerhq/live-common@34.4.0-next.0 - @ledgerhq/hw-app-eth@6.37.1-next.0 +## 0.3.2 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1 + +## 0.3.2-hotfix.0 + +### Patch Changes + +- Updated dependencies [[`2dafbf7`](https://github.com/LedgerHQ/ledger-live/commit/2dafbf7a2ee0cefd00e19b203b97f5918c2607ff)]: + - @ledgerhq/live-common@34.4.1-hotfix.0 + ## 0.3.1 ### Patch Changes