From 8ad466162e7fbf82d6c008a07eca209f0d544b64 Mon Sep 17 00:00:00 2001 From: Stepan Lavrentev <40560660+stepanLav@users.noreply.github.com> Date: Fri, 21 Jul 2023 22:30:39 +0300 Subject: [PATCH 1/9] fix: add additional step in release build (#980) --- .github/workflows/release.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b27d50836f..4e48fbad94 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -92,6 +92,15 @@ jobs: filename="${original%.*}" new="$filename"_x86_64.AppImage mv "$original" "$new" + + - name: Replace space by "-" + run: | + for file in *; do + if [ -f "$file" ]; then + new_name=$(echo "$file" | tr ' ' '-') + mv "$file" "$new_name" + fi + done - name: 🔐 Generate checksum run: | From bc0b89cf9e42f341540246a9052d34cd9e43c54f Mon Sep 17 00:00:00 2001 From: Stepan Lavrentev <40560660+stepanLav@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:48:48 +0300 Subject: [PATCH 2/9] fix: add skip if file name wasn't changed (#984) --- .github/workflows/release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4e48fbad94..ab2541781e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -98,7 +98,9 @@ jobs: for file in *; do if [ -f "$file" ]; then new_name=$(echo "$file" | tr ' ' '-') - mv "$file" "$new_name" + if [ "$new_name" != "$file" ]; then # Skip files with no spaces + mv "$file" "$new_name" + fi fi done From 13b180e25ba753f8b23e933c798c1484b498d7c9 Mon Sep 17 00:00:00 2001 From: Pavel Date: Wed, 26 Jul 2023 11:42:43 +0300 Subject: [PATCH 3/9] feat: rolling log file appender (#979) * feat: rolling log file appender --- src/main/main.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index 0b3d97f0dc..47484dcde4 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -1,7 +1,9 @@ import { join } from 'path'; import { BrowserWindow, shell } from 'electron'; -import log from 'electron-log'; +import log, { LogFile } from 'electron-log'; import windowStateKeeper from 'electron-window-state'; +import * as path from 'path'; +import * as fs from 'fs'; import { ENVIRONMENT } from '@shared/constants'; import { APP_CONFIG } from '../../app.config'; @@ -17,7 +19,19 @@ log.transports.console.useStyles = true; log.transports.file.fileName = 'nova-spektr.log'; log.transports.file.format = '{y}/{m}/{d} {h}:{i}:{s}.{ms} [{env}#{version}]-{processType} [{level}] > {text}'; log.transports.file.level = 'info'; -log.transports.file.maxSize = 1048576 * 5; //5mb +log.transports.file.maxSize = 1048576 * 5; //5mb; +log.transports.file.archiveLogFn = (oldLogFile: LogFile): void => { + const file = oldLogFile.toString(); + const info = path.parse(file); + + try { + const date = new Date().toISOString(); + let newFileName = path.join(info.dir, info.name + '.' + date + info.ext); + fs.renameSync(file, newFileName); + } catch (e) { + console.warn('Could not rotate log', e); + } +}; Object.assign(console, log.functions); log.errorHandler.startCatching({ From 8aeabb5795d1b715735953edd115d4ae945508fa Mon Sep 17 00:00:00 2001 From: Yaroslav Grachev Date: Thu, 27 Jul 2023 10:08:40 +0300 Subject: [PATCH 4/9] fix: hide selector for non-multishard wallet (#986) --- .../Modals/ReceiveModal/ReceiveModal.test.tsx | 4 ++-- .../Modals/ReceiveModal/ReceiveModal.tsx | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.test.tsx b/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.test.tsx index df6be781f5..66db57c739 100644 --- a/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.test.tsx +++ b/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.test.tsx @@ -16,7 +16,7 @@ jest.mock('@renderer/context/I18nContext', () => ({ jest.mock('@renderer/services/account/accountService', () => ({ useAccount: jest.fn().mockReturnValue({ - getActiveAccounts: () => [{ name: 'Test Wallet', accountId: TEST_ACCOUNT_ID }], + getActiveAccounts: () => [{ name: 'Test Wallet', accountId: TEST_ACCOUNT_ID, signingType: SigningType.WATCH_ONLY }], }), })); @@ -75,7 +75,7 @@ describe('screens/Assets/ReceiveModal', () => { (useAccount as jest.Mock).mockImplementation(() => ({ getActiveAccounts: () => [ { name: 'Test Wallet 1', accountId: TEST_ACCOUNT_ID, signingType: SigningType.PARITY_SIGNER }, - { name: 'Test Wallet 2', accountId: TEST_ACCOUNT_ID, signingType: SigningType.MULTISIG }, + { name: 'Test Wallet 2', accountId: TEST_ACCOUNT_ID, signingType: SigningType.PARITY_SIGNER }, ], })); diff --git a/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.tsx b/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.tsx index a081d46326..1f5f4018d5 100644 --- a/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.tsx +++ b/src/renderer/screens/Assets/components/Modals/ReceiveModal/ReceiveModal.tsx @@ -62,6 +62,7 @@ export const ReceiveModal = ({ chain, asset, isOpen, onClose }: Props) => { setActiveAccount({ id: accounts[0].id, value: accounts[0].value }); }, [activeAccounts.length, chain.chainId]); + const hasShards = activeAccounts.length > 1; const account = activeAccount ? activeAccounts[activeAccount.value] : undefined; const accountId = account?.accountId || '0x00'; const prefix = chain.addressPrefix; @@ -79,14 +80,16 @@ export const ReceiveModal = ({ chain, asset, isOpen, onClose }: Props) => { isOpen={isOpen} onClose={onClose} > - + )} {/* eslint-disable-next-line i18next/no-literal-string */} From b10b1763129d5559b3ca69007a66332fad82923e Mon Sep 17 00:00:00 2001 From: Aleksandr Makhnev Date: Thu, 27 Jul 2023 16:27:40 +0500 Subject: [PATCH 5/9] Feat: signature verify (#987) --- .../QrGeneratorContainer.tsx | 4 +- .../QrReader/QrMultiframeSignatureReader.tsx | 4 +- .../QrCode/QrReader/QrReaderWrapper.tsx | 105 +++++++++++------- .../QrCode/QrReader/QrSignatureReader.tsx | 4 +- .../QrCode/QrReader/SignatureReaderError.tsx | 12 +- .../common/Scanning/ScanMultiframeQr.tsx | 15 ++- .../common/Scanning/ScanSingleframeQr.tsx | 28 ++--- .../components/WalletForm.tsx | 2 +- .../Dropdowns/Combobox/Combobox.tsx | 22 ++-- .../Dropdowns/MultiSelect/MultiSelect.tsx | 25 +++-- .../ui-redesign/Dropdowns/Select/Select.tsx | 49 +++++--- .../ui-redesign/Dropdowns/common/constants.ts | 57 ++++++++-- .../ui-redesign/Dropdowns/common/types.ts | 1 + .../ui-redesign/Inputs/Input/Input.tsx | 6 +- .../Inputs/InputArea/InputArea.tsx | 41 ++++--- .../ui-redesign/Inputs/common/styles.ts | 10 +- .../ui/Inputs/InputArea/InputArea.tsx | 41 ++++--- .../Modals/ReceiveModal/ReceiveModal.tsx | 2 +- .../components/modals/ApproveTx.tsx | 8 +- .../Operations/components/modals/RejectTx.tsx | 8 +- .../CustomRpcModal/CustomRpcModal.tsx | 2 +- .../NetworkSelector/NetworkSelector.tsx | 10 +- .../screens/Staking/Operations/Bond/Bond.tsx | 21 +++- .../ChangeValidators/ChangeValidators.tsx | 21 +++- .../Operations/Destination/Destination.tsx | 21 +++- .../Staking/Operations/Redeem/Redeem.tsx | 21 +++- .../Staking/Operations/Restake/Restake.tsx | 21 +++- .../Operations/StakeMore/StakeMore.tsx | 21 +++- .../Staking/Operations/Unstake/Unstake.tsx | 21 +++- .../Operations/components/Signing/Signing.tsx | 35 ++++-- .../ValidatorsModal/ValidatorsModal.tsx | 2 +- src/renderer/screens/Transfer/Transfer.tsx | 16 ++- .../components/ActionSteps/Signing.tsx | 35 +++--- .../services/transaction/common/types.ts | 3 +- .../transaction/transactionService.ts | 8 +- src/renderer/shared/utils/validation.ts | 1 + src/renderer/theme/default.css | 5 + src/shared/locale/en.json | 3 +- src/shared/locale/ru.json | 3 +- tw-config-consts/colors.ts | 5 + 40 files changed, 487 insertions(+), 232 deletions(-) diff --git a/src/renderer/components/common/QrCode/QrGeneratorContainer/QrGeneratorContainer.tsx b/src/renderer/components/common/QrCode/QrGeneratorContainer/QrGeneratorContainer.tsx index fd4c4a896b..ecc1893fb7 100644 --- a/src/renderer/components/common/QrCode/QrGeneratorContainer/QrGeneratorContainer.tsx +++ b/src/renderer/components/common/QrCode/QrGeneratorContainer/QrGeneratorContainer.tsx @@ -21,7 +21,7 @@ const QrGeneratorContainer = ({ countdown, onQrReset, chainId, children }: Props
{t('signing.scanQrTitle')} -
+
{t('signing.qrCountdownTitle')} }
-
+
{t('signing.troubleshootingLink')} diff --git a/src/renderer/components/common/QrCode/QrReader/QrMultiframeSignatureReader.tsx b/src/renderer/components/common/QrCode/QrReader/QrMultiframeSignatureReader.tsx index d38d88d31d..a8839e58eb 100644 --- a/src/renderer/components/common/QrCode/QrReader/QrMultiframeSignatureReader.tsx +++ b/src/renderer/components/common/QrCode/QrReader/QrMultiframeSignatureReader.tsx @@ -34,7 +34,7 @@ const QrMultiframeSignatureReader = ({ size = 300, cameraId, className, - bgVideo, + bgVideo = true, bgVideoClassName, onCameraList, onResult, @@ -298,7 +298,7 @@ const QrMultiframeSignatureReader = ({ return ( <> -
+