Skip to content

Commit 46c38d6

Browse files
committed
Merge branch 'develop' into chore/ddw-1069-update-readme-to-include-linking-steps
# Conflicts: # CHANGELOG.md
2 parents c0c8e76 + 3dd9e2f commit 46c38d6

File tree

107 files changed

+4288
-2716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+4288
-2716
lines changed

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@
109109
"no-useless-constructor": "off",
110110
"@typescript-eslint/no-useless-constructor": "error"
111111
}
112+
},
113+
{
114+
"files": "hardware-wallet-tests/**/*.ts",
115+
"rules": {
116+
"jest/no-standalone-expect": "off",
117+
}
112118
}
113119
]
114120
}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ installers/tls/client
4141
installers/tls/server
4242
installers/DLLs
4343
installers/libressl
44+
installers/cfg-files
45+
installers/config.yaml
46+
installers/icons/electron.icns
47+
installers/installer-config.json
48+
installers/topology.yaml
4449

4550
# temporary certs for daedalus dev
4651
tls/client

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
!source/
66
!features/
77
!storybook/
8+
!hardware-wallet-tests/
89

910
# Now we ignore all files
1011
*.*

CHANGELOG.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22

33
## vNext
44

5+
### Fixes
6+
7+
- Fixed phrasing of insufficient funds for tokens message ([PR 2966](https://github.com/input-output-hk/daedalus/pull/2966))
8+
9+
### Features
10+
11+
- Added support for Ledger Nano S Plus ([PR 2975](https://github.com/input-output-hk/daedalus/pull/2975))
12+
513
### Chores
614

715
- Added steps on how to link with `react-polymorph` and other external UI libraries ([PR 2948](https://github.com/input-output-hk/daedalus/pull/2948))
16+
- Published selfnode installers for all 3 platforms ([PR 2971](https://github.com/input-output-hk/daedalus/pull/2971))
817

918
## 4.10.0
1019

@@ -19,6 +28,9 @@
1928

2029
### Fixes
2130

31+
- Fixed dialogs being closed after receiving address shared ([PR 2965](https://github.com/input-output-hk/daedalus/pull/2965))
32+
- Fixed no progress shown on loading screen on Windows ([PR 2967](https://github.com/input-output-hk/daedalus/pull/2967))
33+
- Fixes hardware wallet issues on Windows ([PR 2900](https://github.com/input-output-hk/daedalus/pull/2900))
2234
- Fixed stake pool list styling ([PR 2920](https://github.com/input-output-hk/daedalus/pull/2920))
2335
- Fixed PopOver overlap ([PR 2954](https://github.com/input-output-hk/daedalus/pull/2954))
2436
- Fixed tooltip being hidden in several places ([PR-2934](https://github.com/input-output-hk/daedalus/pull/2934))
@@ -36,7 +48,9 @@
3648

3749
### Chores
3850

39-
- Introduced new version of the `@cardano-foundation/ledgerjs-hw-app-cardano` package ([PR 2930](https://github.com/input-output-hk/daedalus/pull/2930))
51+
- Updated cardano-wallet to v2022-04-27 and cardano-node to 1.34.1 ([PR 2951](https://github.com/input-output-hk/daedalus/pull/2951))
52+
- Refactor to remove duplicated code ([PR 2956](https://github.com/input-output-hk/daedalus/pull/2956))
53+
- Updated cardano-launcher to 0.20220119.0 ([PR 2839](https://github.com/input-output-hk/daedalus/pull/2839))
4054
- Added `storybook:build` check to pre-push hook ([PR 2955](https://github.com/input-output-hk/daedalus/pull/2955))
4155
- Using new faker.js ([PR 2855](https://github.com/input-output-hk/daedalus/pull/2855))
4256
- Fixed spelling issues and typos ([PR 2915](https://github.com/input-output-hk/daedalus/pull/2915))
@@ -86,11 +100,12 @@
86100

87101
### Fixes
88102

103+
- Improved error handling for incorrect passphrase and incorrect hardware wallet error ([PR 2860](https://github.com/input-output-hk/daedalus/pull/2860))
89104
- Fixed rewards CSV export issues ([PR 2885](https://github.com/input-output-hk/daedalus/pull/2885))
90105
- Fixed behaviour of wallet settings option of the app menu ([PR 2838](https://github.com/input-output-hk/daedalus/pull/2838))
91106
- Fixed styling of ITN rewards feature ([PR 2861](https://github.com/input-output-hk/daedalus/pull/2861))
92107
- Fixed available disk space takes a long time to show ([PR 2849](https://github.com/input-output-hk/daedalus/pull/2849))
93-
108+
94109
### Chores
95110

96111
- Migrated codebase from javascript to typescript ([PR 2843](https://github.com/input-output-hk/daedalus/pull/2843))

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,6 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
105105
1. Run `yarn nix:testnet` from `daedalus`.
106106
2. Run `yarn dev` from the subsequent `nix-shell`
107107

108-
##### Staging
109-
110-
1. Run `yarn nix:staging` from `daedalus`.
111-
2. Run `yarn dev` from the subsequent `nix-shell`
112-
113-
##### Shelley QA
114-
115-
1. Run `yarn nix:shelley_qa` from `daedalus`.
116-
2. Run `yarn dev` from the subsequent `nix-shell`
117-
118-
##### Alonzo Purple
119-
120-
1. Run `yarn nix:alonzo_purple` from `daedalus`.
121-
2. Run `yarn dev` from the subsequent `nix-shell`
122-
123108
##### Native token metadata server
124109

125110
Daedalus, by default, uses the following metadata server for all networks except for the mainnet: `https://metadata.cardano-testnet.iohkdev.io/`.
-107 KB
Binary file not shown.

default.nix

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@ let
3131
};
3232
};
3333
pkgs = import sources.nixpkgs { inherit system config; };
34-
pkgsNative = localLib.iohkNix.getPkgsDefault {};
3534
sources = localLib.sources;
35+
flake-compat = import sources.flake-compat;
36+
walletFlake = flake-compat { src = sources.cardano-wallet; };
37+
walletPackages = with walletFlake.defaultNix.hydraJobs; {
38+
x86_64-windows = linux.windows;
39+
x86_64-linux = linux.native;
40+
x86_64-darwin = macos.intel;
41+
aarch64-darwin = macos.silicon;
42+
}.${target};
3643
walletPkgs = import "${sources.cardano-wallet}/nix" {};
3744
# only used for CLI, to be removed when upgraded to next node version
3845
nodePkgs = import "${sources.cardano-node}/nix" {};
@@ -73,17 +80,13 @@ let
7380

7481
sources = localLib.sources;
7582
bridgeTable = {
76-
cardano = self.callPackage ./nix/cardano-bridge.nix {
77-
cardano-wallet = self.cardano-wallet.cardano-wallet;
78-
cardanoWalletPkgs = self.cardano-wallet.pkgs;
79-
};
83+
cardano = self.callPackage ./nix/cardano-bridge.nix {};
8084
};
81-
cardano-wallet = import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; };
82-
cardano-wallet-native = import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; };
83-
cardano-address = (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).cardano-address;
84-
mock-token-metadata-server = (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).mock-token-metadata-server;
85+
inherit (walletPackages) cardano-wallet;
86+
inherit (walletPackages) cardano-address;
87+
inherit (walletPackages) mock-token-metadata-server;
8588
cardano-shell = import self.sources.cardano-shell { inherit system; crossSystem = crossSystem shellPkgs.lib; };
86-
local-cluster = if cluster == "selfnode" then (import self.sources.cardano-wallet { inherit system; gitrev = self.sources.cardano-wallet.rev; crossSystem = crossSystem walletPkgs.lib; }).local-cluster else null;
89+
local-cluster = if cluster == "selfnode" then walletPackages.local-cluster else null;
8790
cardano-node-cluster = let
8891
# Test wallets with known mnemonics
8992
walletTestGenesisYaml = (self.sources.cardano-wallet + "/lib/shelley/test/data/cardano-node-shelley/genesis.yaml");
@@ -99,10 +102,10 @@ let
99102
in (import self.sources.cardano-node { inherit system customConfig; crossSystem = crossSystem nodePkgs.lib; }).cluster;
100103
cardano-node = if useLocalNode
101104
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).cardano-node
102-
else self.cardano-wallet.cardano-node;
105+
else walletPackages.cardano-node;
103106
cardano-cli = if useLocalNode
104107
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).haskellPackages.cardano-cli
105-
else self.cardano-wallet.cardano-cli;
108+
else walletPackages.cardano-cli;
106109
darwin-launcher = self.callPackage ./nix/darwin-launcher.nix {};
107110

108111
# a cross-compiled fastlist for the ps-list package
@@ -123,7 +126,6 @@ let
123126
network = cluster;
124127
os = ostable.${target};
125128
backend = nodeImplementation;
126-
runCommandNative = pkgsNative.runCommand;
127129
};
128130

129131
unsignedUnpackedCardano = self.daedalus-bridge; # TODO
@@ -264,7 +266,7 @@ let
264266
pushd dlls
265267
${if dummyInstaller then "touch foo" else "unzip ${self.dlls}"}
266268
popd
267-
cp -v ${self.unpackedCardano}/bin/* .
269+
cp -vr ${self.unpackedCardano}/bin/* .
268270
cp -v ${self.nsisFiles}/{*.yaml,*.json,daedalus.nsi,*.key,*.cert} .
269271
cp ${self.uninstaller}/uninstall.exe ../uninstall.exe
270272
if [ -f ${self.nsisFiles}/block-0.bin ]; then

gulpfile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ gulp.task(
177177
'clean:dist',
178178
'server:create:dev',
179179
'build:renderer:html',
180-
'build:main:watch',
180+
process.argv.includes('--disable-electron-reload')
181+
? 'build:main'
182+
: 'build:main:watch',
181183
'build:renderer:watch'
182184
)
183185
);
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import expect from 'expect';
2+
3+
import {
4+
createAndRegisterHardwareWalletChannels,
5+
createHardwareWalletConnectionChannel,
6+
initLedgerChannel,
7+
createTestInstructions,
8+
createCardanoAppChannel,
9+
createGetPublicKeyChannel,
10+
ipcRenderer,
11+
} from './utils';
12+
13+
export const run = () => {
14+
expect.assertions(3);
15+
16+
createTestInstructions([
17+
'Plug Ledger Nano S to your computer',
18+
'Launch Cardano APP on Nano S/Nano X',
19+
'Run the test again with Cardano App opened',
20+
'Export the public key',
21+
]);
22+
23+
createAndRegisterHardwareWalletChannels();
24+
25+
const cardanoAppChannel = createCardanoAppChannel();
26+
const publicKeyChannel = createGetPublicKeyChannel();
27+
const hardwareWalletConnectionChannel = createHardwareWalletConnectionChannel();
28+
29+
return new Promise<void>((resolve) => {
30+
hardwareWalletConnectionChannel.onReceive(
31+
async (params: { path: string }) => {
32+
expect(params).toEqual({
33+
disconnected: expect.any(Boolean),
34+
deviceType: expect.any(String),
35+
deviceId: null,
36+
deviceModel: expect.any(String),
37+
deviceName: expect.any(String),
38+
path: expect.any(String),
39+
product: expect.any(String),
40+
});
41+
42+
const cardanoAppChannelReply = await cardanoAppChannel.request(
43+
{ path: params.path },
44+
ipcRenderer,
45+
ipcRenderer
46+
);
47+
48+
expect(cardanoAppChannelReply).toEqual({
49+
minor: expect.any(Number),
50+
major: expect.any(Number),
51+
patch: expect.any(Number),
52+
deviceId: expect.any(String),
53+
});
54+
55+
const extendedPublicKey = await publicKeyChannel.request(
56+
{
57+
path: "1852'/1815'/0'",
58+
// Shelley 1852 ADA 1815 indicator for account '0'
59+
isTrezor: false,
60+
devicePath: params.path,
61+
},
62+
ipcRenderer,
63+
ipcRenderer
64+
);
65+
66+
expect(extendedPublicKey).toEqual({
67+
chainCodeHex: expect.any(String),
68+
publicKeyHex: expect.any(String),
69+
deviceId: expect.any(String),
70+
});
71+
72+
resolve();
73+
}
74+
);
75+
76+
initLedgerChannel();
77+
});
78+
};
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import expect from 'expect';
2+
3+
import {
4+
createAndRegisterHardwareWalletChannels,
5+
createHardwareWalletConnectionChannel,
6+
initLedgerChannel,
7+
createTestInstructions,
8+
createGetPublicKeyChannel,
9+
ipcRenderer,
10+
requestLaunchingCardanoAppOnLedger,
11+
} from './utils';
12+
13+
export const run = () => {
14+
expect.assertions(3);
15+
16+
createTestInstructions([
17+
'Start test runner',
18+
'Plug Ledger Nano S to your computer',
19+
'Start Cardano APP on Nano S',
20+
'Nano S will prompt to export the public key',
21+
'Export the public key',
22+
]);
23+
24+
createAndRegisterHardwareWalletChannels();
25+
26+
const publicKeyChannel = createGetPublicKeyChannel();
27+
const hardwareWalletConnectionChannel = createHardwareWalletConnectionChannel();
28+
29+
return new Promise<void>((resolve) => {
30+
hardwareWalletConnectionChannel.onReceive(
31+
async (params: { path: string }) => {
32+
expect(params).toEqual({
33+
disconnected: expect.any(Boolean),
34+
deviceType: expect.any(String),
35+
deviceId: null,
36+
deviceModel: expect.any(String),
37+
deviceName: expect.any(String),
38+
path: expect.any(String),
39+
product: expect.any(String),
40+
});
41+
42+
const cardanoAppChannelResponse = await requestLaunchingCardanoAppOnLedger(
43+
params.path
44+
);
45+
46+
expect(cardanoAppChannelResponse).toEqual({
47+
minor: expect.any(Number),
48+
major: expect.any(Number),
49+
patch: expect.any(Number),
50+
deviceId: expect.any(String),
51+
});
52+
53+
const extendedPublicKey = await publicKeyChannel.request(
54+
{
55+
path: "1852'/1815'/0'",
56+
// Shelley 1852 ADA 1815 indicator for account '0'
57+
isTrezor: false,
58+
devicePath: params.path,
59+
},
60+
ipcRenderer,
61+
ipcRenderer
62+
);
63+
64+
expect(extendedPublicKey).toEqual({
65+
chainCodeHex: expect.any(String),
66+
publicKeyHex: expect.any(String),
67+
deviceId: expect.any(String),
68+
});
69+
70+
resolve();
71+
}
72+
);
73+
74+
initLedgerChannel();
75+
});
76+
};

0 commit comments

Comments
 (0)