Skip to content

[DDW-106] Wallet import feature #1956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 154 commits into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
673d29b
[DDW-106] Adds CHANGELOG
nikolaglumac Apr 7, 2020
9942297
[DDW-106] Enable wallet import for mainnet, flight and testnet
nikolaglumac Apr 7, 2020
af50847
bump SL: new export-wallets
disassembler Apr 10, 2020
3c06fb8
Merge branch 'develop' into feature/ddw-106-wallet-import-feature
nikolaglumac Apr 10, 2020
2069a2e
[DDW-106] Genesis file update
nikolaglumac Apr 10, 2020
e8fa7d4
[DDW-106] Fix scenario name
nikolaglumac Apr 10, 2020
db97ba9
[DDW-106] - Wallet import feature
DeeJayElly Apr 13, 2020
6db0300
[DDW-106] - Wallet import feature
DeeJayElly Apr 13, 2020
320e497
[DDW-106] - Wallet import feature
DeeJayElly Apr 13, 2020
3700c8b
[DDW-106] - Wallet import feature
DeeJayElly Apr 13, 2020
4dc8cef
[DDW-106] - Wallet import feature
DeeJayElly Apr 13, 2020
31e5dec
[DDW-106] - Wallet import feature
DeeJayElly Apr 13, 2020
de3aacf
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
860e9e4
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
afd2f4c
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
03618a2
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
4a5a4d1
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
ef402c3
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
d476249
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
6ed23b7
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
2f8939f
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
ea2928d
[DDW-106] Fix env flags
nikolaglumac Apr 14, 2020
340fe16
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
76481b5
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 14, 2020
b8ff629
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
b8d0841
[DDW-106] Export types fix
nikolaglumac Apr 14, 2020
7cc851b
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 14, 2020
06ff6e9
[DDW-106] Improve logging
nikolaglumac Apr 14, 2020
94a11ac
Merge branch 'develop' into feature/ddw-106-wallet-import-feature
nikolaglumac Apr 14, 2020
653dda3
[DDW-106] - Wallet import feature
DeeJayElly Apr 14, 2020
eac6754
Merge branch 'develop' into feature/ddw-106-wallet-import-feature
DeeJayElly Apr 14, 2020
c2801e2
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 14, 2020
d80123f
[DDW-106] - Wallet import feature
DeeJayElly Apr 15, 2020
eab4f81
[DDW-106] - Wallet import feature
DeeJayElly Apr 15, 2020
294bb89
[DDW-106] Wallet migration logic WIP
nikolaglumac Apr 15, 2020
5ae78d6
[DDW-106] Reorder methods
nikolaglumac Apr 15, 2020
95139a7
[DDW-106] Introduce skipped wallet migration state
nikolaglumac Apr 15, 2020
92e5068
[DDW-106] Record skipped wallet migration
nikolaglumac Apr 15, 2020
c737261
[DDW-106] - Wallet import feature - fixing lint errors
DeeJayElly Apr 15, 2020
02e49d4
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 15, 2020
ca82fc4
[DDW-106] Update migration store
nikolaglumac Apr 15, 2020
0342d24
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 15, 2020
02d3299
[DDW-106] Update export tool
nikolaglumac Apr 15, 2020
74e4795
[DDW-106] Introduce pending import wallets
nikolaglumac Apr 15, 2020
a67f6af
[DDW-106] Connect UI with store logicu
nikolaglumac Apr 15, 2020
d8eab2a
[DDW-106] Add name/selection handlers
nikolaglumac Apr 15, 2020
aaf24ab
[DDW-106] Fix lint errors
nikolaglumac Apr 15, 2020
b32ea37
[DDW-106] Merges develop
nikolaglumac Apr 15, 2020
ccf4ec5
[DDW-106] Button spinner
thedanheller Apr 15, 2020
38e3204
[DDW-106] Fix default mainnet legacy state dir path
nikolaglumac Apr 15, 2020
f9e383c
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 15, 2020
eacf6b6
[DDW-106] Enable export source path selection
nikolaglumac Apr 15, 2020
40f3390
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 15, 2020
f068366
[DDW-106] Improve button state handling
nikolaglumac Apr 15, 2020
0b8c7f3
[DDW-106] Wallet Rename - WIP
thedanheller Apr 15, 2020
0319f28
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 15, 2020
ba7b657
[DDW-106] Fix opacity
nikolaglumac Apr 15, 2020
26995b9
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 15, 2020
efa2f2c
[DDW-106] Wallet Rename - WIP
thedanheller Apr 15, 2020
1fdfcc3
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 15, 2020
158dd6f
[DDW-106] Wallet Rename - WIP
thedanheller Apr 15, 2020
f6f027c
[DDW-106] Restores
thedanheller Apr 15, 2020
9b464b8
[DDW-106] Prevent text selection
nikolaglumac Apr 15, 2020
5b3b02f
[DDW-106] Separate nameless wallets
nikolaglumac Apr 15, 2020
3107a33
[DDW-106] Input adjustment
thedanheller Apr 15, 2020
7379f2e
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 15, 2020
c83301c
[DDW-106] Remove Fragment
nikolaglumac Apr 15, 2020
bc03c67
[DDW-106] - Wallet import feature
DeeJayElly Apr 15, 2020
98f1c51
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 15, 2020
ed08c74
[DDW-106] Buttons adjustments - WIP
thedanheller Apr 15, 2020
67a83bf
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 15, 2020
894bde9
[DDW-106] - Wallet import feature
DeeJayElly Apr 15, 2020
14548d8
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 15, 2020
3af113a
[DDW-106] Merges develop
nikolaglumac Apr 15, 2020
520c12a
[DDW-106] Enable pending wallet selection
nikolaglumac Apr 15, 2020
f4ce3fa
[DDW-106] - Wallet import feature
DeeJayElly Apr 15, 2020
46ee559
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 15, 2020
2ec9691
[DDW-106] Buttons actions
thedanheller Apr 16, 2020
cefdb5a
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
103639c
[DDW-106] Translation manager
thedanheller Apr 16, 2020
5206fa5
[DDW-106] Prevent closing wallet import dialog after first wallet is …
nikolaglumac Apr 16, 2020
8a829c9
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
f125b5f
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
DeeJayElly Apr 16, 2020
28e96e4
[DDW-106] Finish wallet name field implementation
nikolaglumac Apr 16, 2020
d1034ef
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 16, 2020
5b4fea2
[DDW-106] Improve import wallet selection
nikolaglumac Apr 16, 2020
8979725
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
0247844
[DDW-106] Improve inline editing input
nikolaglumac Apr 16, 2020
302975b
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 16, 2020
2bd8e47
[DDW-105] Fix set password overlay scrollbar
nikolaglumac Apr 16, 2020
7892942
[DDW-106] Improve wallet name handling
nikolaglumac Apr 16, 2020
71eaaf0
[DDW-106] Separate existing/completed status
nikolaglumac Apr 16, 2020
8759b19
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
d10e438
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
63ca165
[DDW-106] Small styling adjustment
thedanheller Apr 16, 2020
1230d09
[DDW-106] Storybook story
thedanheller Apr 16, 2020
e28f834
[DDW-106] Storybook story
thedanheller Apr 16, 2020
16ff13f
[DDW-106] Unamed wallets header
thedanheller Apr 16, 2020
61746f0
[DDW-106] Close window link
thedanheller Apr 16, 2020
cb0a95e
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
98d2573
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 16, 2020
6724bf6
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
4726a7e
[DDW-106]: Fix button styles of wallet import dialog
topseniors Apr 16, 2020
f11d40b
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
topseniors Apr 16, 2020
22c990f
[DDW-106]: Fix inline edit input style
topseniors Apr 16, 2020
a973e9d
[DDW-106] 'Enter a wallet name' tooltip
thedanheller Apr 16, 2020
1106ea3
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
5b2f151
[DDW-106] Hide Wallet import learn more link
Apr 16, 2020
9af0aef
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
Apr 16, 2020
c9bef96
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
5f750b4
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 16, 2020
c801845
[DDW-106] Remove learn more link
thedanheller Apr 16, 2020
f7b655e
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
2ced38a
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
7686d16
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
f07cea2
[DDW-106] Improve styling
nikolaglumac Apr 16, 2020
0141a34
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 16, 2020
f52d87e
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
66f5d91
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 16, 2020
8f895c8
[DDW-106]: Fix disabled inline edit input style
topseniors Apr 16, 2020
45161de
[DDW-106] Split import description to 2 lines
Apr 16, 2020
908fde8
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
topseniors Apr 16, 2020
b4a07d9
[DDW-106] Styling improvements
nikolaglumac Apr 16, 2020
fff252e
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 16, 2020
d5849d9
[DDW-106] Merge and fix conflicts
Apr 16, 2020
deca5d6
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
Apr 16, 2020
5248871
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 16, 2020
6d8f557
Merge branch 'develop' into feature/ddw-106-wallet-import-feature
nikolaglumac Apr 16, 2020
1ef2204
[DDW-106] Conditional walletsWithoutNames header
thedanheller Apr 16, 2020
6cf8582
[DDW-106] Change inline editing input border opacity
Apr 16, 2020
d6c7f79
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
Apr 16, 2020
965a410
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
c9d7a01
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
b3b5468
[DDW-106] Fix tests
nikolaglumac Apr 16, 2020
4283c8a
[DDW-106] Fix failing tests
nikolaglumac Apr 16, 2020
da5ee53
[DDW-106]: Fix checkbox style on wallet import modal
topseniors Apr 16, 2020
4ea53d0
[DDW-106]: Fix checkbox style on wallet import modal
topseniors Apr 16, 2020
e3c90c7
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
topseniors Apr 16, 2020
7e732ea
[DDW-106] Update e2e address classes
Apr 16, 2020
06ddcea
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
Apr 16, 2020
c2f6383
[DDW-106] Update e2e ITN address classes
Apr 16, 2020
dadc64e
[DDW-106] Storybook improvements
thedanheller Apr 16, 2020
9346056
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
75e78c4
[DDW-106]: Fix form field error style on wallet import modal
topseniors Apr 16, 2020
3286492
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
topseniors Apr 16, 2020
9f9abf7
[DDW-106] - Wallet import feature
DeeJayElly Apr 16, 2020
76c9cd6
Merge remote-tracking branch 'origin/feature/ddw-106-wallet-import-fe…
DeeJayElly Apr 16, 2020
547d7e2
[DDW-106]: Fix form field error style on wallet import modal
topseniors Apr 16, 2020
3e2e4ed
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
topseniors Apr 16, 2020
283deac
[DDW-106] Scroller fix
nikolaglumac Apr 16, 2020
5ea02a8
Merge branch 'feature/ddw-106-wallet-import-feature' of github.com:in…
nikolaglumac Apr 16, 2020
7b2b2bf
[DDW-106] Bump Daedalus version
nikolaglumac Apr 16, 2020
cc4913c
[DDW-106] Small fix
thedanheller Apr 16, 2020
44e4bbe
Merge branch 'feature/ddw-106-wallet-import-feature' of https://githu…
thedanheller Apr 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Changelog
=========

## vNext
## 1.0.0-FC3

### Features

- Implemented "Wallet Import" feature ([PR 1956](https://github.com/input-output-hk/daedalus/pull/1956))
- Force setting spending password on passwordless wallets ([PR 1957](https://github.com/input-output-hk/daedalus/pull/1957))

### Chores
Expand Down
21 changes: 9 additions & 12 deletions nix/launcher-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,18 @@ let
''}
'';

legacyStateDir = if network == "mainnet_flight" then mainnetDataDir else dataDir;

legacyWalletDB = let
prefix = if network == "mainnet_flight"
then "${mainnetDataDir}${dirSep}"
else "${dataDir}${dirSep}";
path.linux = "${prefix}Wallet";
path.macos64 = "${prefix}Wallet-1.0";
path.windows = "${prefix}Wallet-1.0";
path.linux = "Wallet";
path.macos64 = "Wallet-1.0";
path.windows = "Wallet-1.0";
in path.${os};

legacySecretKey = let
prefix = if network == "mainnet_flight"
then "${mainnetDataDir}${dirSep}"
else "${dataDir}${dirSep}";
path.linux = "${prefix}Secrets${dirSep}secret.key";
path.macos64 = "${prefix}Secrets-1.0${dirSep}secret.key";
path.windows = "${prefix}Secrets-1.0${dirSep}secret.key";
path.linux = "Secrets${dirSep}secret.key";
path.macos64 = "Secrets-1.0${dirSep}secret.key";
path.windows = "Secrets-1.0${dirSep}secret.key";
in path.${os};

launcherConfig = defaultLauncherConfig // {
Expand All @@ -216,6 +212,7 @@ let
walletBin
exportWalletsBin
dbConverterBin
legacyStateDir
legacyWalletDB
legacySecretKey;
syncTolerance = "300s";
Expand Down
6 changes: 3 additions & 3 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"homepage": "",
"owner": "input-output-hk",
"repo": "cardano-sl",
"rev": "1702a9eb12953e76a5a8b070e5c6a2bfb02ff160",
"sha256": "0x6xlby8wzmvyd24qxpamrhq7gi1nw9xs78rk3c1y3ypq050pmqy",
"rev": "c1815b7dce5fb71d997bd3a94c4c5ccf2c9a9a94",
"sha256": "1dzfhv7qhv1498sd8jrac39qd8vgpdahv7dskg1hnfs5rw2gipar",
"type": "tarball",
"url": "https://github.com/input-output-hk/cardano-sl/archive/1702a9eb12953e76a5a8b070e5c6a2bfb02ff160.tar.gz",
"url": "https://github.com/input-output-hk/cardano-sl/archive/c1815b7dce5fb71d997bd3a94c4c5ccf2c9a9a94.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"cardano-wallet": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "daedalus",
"productName": "Daedalus",
"version": "1.0.0-FC2",
"version": "1.0.0-FC3",
"description": "Cryptocurrency Wallet",
"main": "./dist/main/index.js",
"scripts": {
Expand Down
4 changes: 3 additions & 1 deletion source/common/ipc/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ export type DetectSystemLocaleMainResponse = string;
* Channel where renderer can ask main process to export wallets
*/
export const EXPORT_WALLETS_CHANNEL = 'EXPORT_WALLETS_CHANNEL';
export type ExportWalletsRendererRequest = void;
export type ExportWalletsRendererRequest = {
exportSourcePath: string,
};
export type ExportWalletsMainResponse = {
wallets: Array<ExportedByronWallet>,
errors: string,
Expand Down
27 changes: 20 additions & 7 deletions source/common/types/logging.types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { CardanoNodeState } from './cardano-node.types';
import type { SystemInfo } from '../../renderer/app/types/systemInfoTypes';
import type { CoreSystemInfo } from '../../renderer/app/types/coreSystemInfoTypes';
import type { WalletImportStatus } from '../../renderer/app/types/walletExportTypes';
import type { WalletMigrationStatus } from '../../renderer/app/stores/WalletMigrationStore';
import LocalizableError from '../../renderer/app/i18n/LocalizableError';

Expand Down Expand Up @@ -81,19 +82,31 @@ export type StateSnapshotLogParams = {
networkTip: ?Object,
};

export type ExportedWalletData = {
id: string,
name: ?string,
hasPassword: boolean,
import?: {
status: WalletImportStatus,
error: ?LocalizableError,
},
};

export type RestoredWalletData = {
id: string,
name: string,
hasPassword: boolean,
};

export type WalletMigrationReportData = {
exportedWalletsData: Array<{ name: string }>,
exportedWalletsData: Array<ExportedWalletData>,
exportedWalletsCount: number,
exportErrors: string,
restoredWalletsData: Array<{
id: string,
name: string,
hasPassword: boolean,
}>,
restoredWalletsData: Array<RestoredWalletData>,
restoredWalletsCount: number,
restorationErrors: Array<{
error: LocalizableError,
wallet: { name: string },
wallet: ExportedWalletData,
}>,
finalMigrationStatus: WalletMigrationStatus,
};
15 changes: 11 additions & 4 deletions source/main/cardano/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {
CardanoStatus,
TlsConfig,
} from '../../common/types/cardano-node.types';
import type { ExportWalletsRendererRequest } from '../../common/ipc/api';
import {
cardanoAwaitUpdateChannel,
cardanoFaultInjectionChannel,
Expand Down Expand Up @@ -184,10 +185,16 @@ export const setupCardanoNode = (
return cardanoNode.setFault(fault);
});

exportWalletsChannel.onRequest(() => {
logger.info('ipcMain: Received request from renderer to export wallets');
return Promise.resolve(exportWallets(launcherConfig, mainWindow, locale));
});
exportWalletsChannel.onRequest(
({ exportSourcePath }: ExportWalletsRendererRequest) => {
logger.info('ipcMain: Received request from renderer to export wallets', {
exportSourcePath,
});
return Promise.resolve(
exportWallets(exportSourcePath, launcherConfig, mainWindow, locale)
);
}
);

return cardanoNode;
};
52 changes: 35 additions & 17 deletions source/main/cardano/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const createSelfnodeConfig = async (
};

export const exportWallets = async (
exportSourcePath: string,
launcherConfig: LauncherConfig,
mainWindow: BrowserWindow,
locale: string
Expand All @@ -182,7 +183,8 @@ export const exportWallets = async (
isFlight,
} = launcherConfig;

logger.info('ipcMain: Exporting wallets...', {
logger.info('ipcMain: Starting wallets export...', {
exportSourcePath,
exportWalletsBin,
legacySecretKey,
legacyWalletDB,
Expand All @@ -191,19 +193,19 @@ export const exportWallets = async (
isFlight,
});

let legacySecretKeyPath = legacySecretKey;
let legacyWalletDBPath = legacyWalletDB;
let legacySecretKeyPath = path.join(exportSourcePath, legacySecretKey);
let legacyWalletDBPath = path.join(exportSourcePath, legacyWalletDB);

// In case of Daedalus Flight build we need to copy over
// legacySecretKey and legacyWalletDB from Mainnet state dir
// legacySecretKey and legacyWalletDB from mainnet state dir
// into Daedalus Flight state dir before extracting the wallets
if (isFlight) {
try {
const response = await prepareMigrationData(
mainWindow,
stateDir,
legacySecretKey,
legacyWalletDB,
legacySecretKeyPath,
legacyWalletDBPath,
locale
);
legacySecretKeyPath = response.legacySecretKeyPath;
Expand All @@ -219,26 +221,42 @@ export const exportWallets = async (
}
}

const clusterFlags = [];
// Export tool flags
const exportWalletsBinFlags = [];

// Cluster flags
if (cluster === 'testnet') {
clusterFlags.push('--testnet', TESTNET_MAGIC);
exportWalletsBinFlags.push('--testnet', TESTNET_MAGIC);
} else {
clusterFlags.push('--mainnet');
exportWalletsBinFlags.push('--mainnet');
}

const { stdout, stderr } = spawnSync(exportWalletsBin, [
...clusterFlags,
'--keyfile',
legacySecretKeyPath,
'--wallet-db-path',
legacyWalletDBPath,
]);
// Secret key flags
exportWalletsBinFlags.push('--keyfile', legacySecretKeyPath);

// Wallet DB flags
const legacyWalletDBPathExists = await fs.pathExists(
`${legacyWalletDBPath}-acid`
);
if (legacyWalletDBPathExists) {
exportWalletsBinFlags.push('--wallet-db-path', legacyWalletDBPath);
}

logger.info('ipcMain: Exporting wallets...', {
exportWalletsBin,
exportWalletsBinFlags,
});

const { stdout, stderr } = spawnSync(exportWalletsBin, exportWalletsBinFlags);
const wallets = JSON.parse(stdout.toString() || '[]');
const errors = stderr.toString();

logger.info(`ipcMain: Exported ${wallets.length} wallets`, {
walletsData: wallets.map(w => ({ name: w.name })),
walletsData: wallets.map(w => ({
name: w.name,
id: w.id,
hasPassword: w.is_passphrase_empty,
})),
errors,
});

Expand Down
4 changes: 3 additions & 1 deletion source/main/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export type LauncherConfig = {
syncTolerance: string,
cliBin: string,
exportWalletsBin: string,
legacyStateDir: string,
legacySecretKey: string,
legacyWalletDB: string,
isFlight: boolean,
Expand Down Expand Up @@ -114,6 +115,7 @@ export const {
cluster,
nodeImplementation,
stateDir,
legacyStateDir,
logsPrefix,
isFlight,
} = launcherConfig;
Expand Down Expand Up @@ -169,4 +171,4 @@ export const STAKE_POOL_REGISTRY_URL = {
};

// Cardano Byron Testnet network magic
export const TESTNET_MAGIC = 1097911063;
export const TESTNET_MAGIC = '1097911063';
8 changes: 7 additions & 1 deletion source/main/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import { ipcRenderer as _ipcRenderer, remote as _remote } from 'electron';
import _electronLog from 'electron-log-daedalus';
import ElectronStore from 'electron-store';
import { environment } from './environment';
import { buildLabel, nodeImplementation, isFlight } from './config';
import {
buildLabel,
legacyStateDir,
nodeImplementation,
isFlight,
} from './config';

const _process = process;
const _isIncentivizedTestnet = nodeImplementation === 'jormungandr';
Expand Down Expand Up @@ -52,6 +57,7 @@ process.once('loaded', () => {
},
isIncentivizedTestnet: _isIncentivizedTestnet,
isFlight,
legacyStateDir,
});
// Expose require for Spectron!
if (_process.env.NODE_ENV === 'test') {
Expand Down
3 changes: 3 additions & 0 deletions source/renderer/app/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import StakingActions from './staking-actions';
import TransactionsActions from './transactions-actions';
import WalletsActions from './wallets-actions';
import WalletBackupActions from './wallet-backup-actions';
import WalletMigrationActions from './wallet-migration-actions';
import WalletSettingsActions from './wallet-settings-actions';
import WindowActions from './window-actions';

Expand All @@ -29,6 +30,7 @@ export type ActionsMap = {
transactions: TransactionsActions,
wallets: WalletsActions,
walletBackup: WalletBackupActions,
walletMigration: WalletMigrationActions,
walletSettings: WalletSettingsActions,
window: WindowActions,
};
Expand All @@ -47,6 +49,7 @@ const actionsMap: ActionsMap = {
transactions: new TransactionsActions(),
wallets: new WalletsActions(),
walletBackup: new WalletBackupActions(),
walletMigration: new WalletMigrationActions(),
walletSettings: new WalletSettingsActions(),
window: new WindowActions(),
};
Expand Down
11 changes: 11 additions & 0 deletions source/renderer/app/actions/wallet-migration-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// @flow
import Action from './lib/Action';

export default class WalletMigrationActions {
startMigration: Action<any> = new Action();
finishMigration: Action<any> = new Action();
toggleWalletImportSelection: Action<string> = new Action();
updateWalletName: Action<{ id: string, name: string }> = new Action();
nextStep: Action<any> = new Action();
selectExportSourcePath: Action<any> = new Action();
}
1 change: 0 additions & 1 deletion source/renderer/app/actions/wallet-settings-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default class WalletSettingsActions {
startEditingWalletField: Action<{ field: string }> = new Action();
stopEditingWalletField: Action<any> = new Action();
updateWalletField: Action<{ field: string, value: string }> = new Action();
// eslint-disable-next-line max-len
updateSpendingPassword: Action<{
walletId: string,
oldPassword: string,
Expand Down
3 changes: 3 additions & 0 deletions source/renderer/app/assets/images/arrow-right.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions source/renderer/app/assets/images/info-icon.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions source/renderer/app/assets/images/pen.inline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions source/renderer/app/components/wallet/WalletAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ const messages = defineMessages({
},
importDescription: {
id: 'wallet.add.dialog.import.description',
defaultMessage: '!!!Import a wallet from a file',
defaultMessage:
'!!!Import wallets from an earlier version of Daedalus or the Daedalus state directory',
description:
'Description for the "Import" button on the wallet add dialog.',
},
Expand All @@ -96,6 +97,9 @@ type Props = {
onRestore: Function,
onImportFile: Function,
isMaxNumberOfWalletsReached: boolean,
isMainnet: boolean,
isTestnet: boolean,
isProduction: boolean,
};

@observer
Expand All @@ -116,6 +120,9 @@ export default class WalletAdd extends Component<Props> {
onRestore,
onImportFile,
isMaxNumberOfWalletsReached,
isMainnet,
isTestnet,
isProduction,
} = this.props;

const componentClasses = classnames([styles.component, 'WalletAdd']);
Expand Down Expand Up @@ -166,7 +173,7 @@ export default class WalletAdd extends Component<Props> {
icon={importIcon}
label={intl.formatMessage(messages.importLabel)}
description={intl.formatMessage(messages.importDescription)}
isDisabled
isDisabled={isProduction && !isMainnet && !isTestnet}
/>
</div>
{activeNotification ? (
Expand Down
Loading