Skip to content

Commit 3c650dd

Browse files
committed
Merge branch 'develop' into feature/ddw-1062-showcase-jq
2 parents c35b88c + dcaba70 commit 3c650dd

File tree

158 files changed

+5548
-4077
lines changed

Some content is hidden

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

158 files changed

+5548
-4077
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: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@
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+
13+
## 4.10.0
14+
515
### Features
616

17+
- Implemented hover tooltips for menu ([PR 2938](https://github.com/input-output-hk/daedalus/pull/2938))
718
- Improved UI regarding the Hardware Wallet public key export error ([PR 2922](https://github.com/input-output-hk/daedalus/pull/2922))
819
- Added ASCII name to token header when metadata name is missing ([PR 2904](https://github.com/input-output-hk/daedalus/pull/2904))
920
- Improved IPC by reducing the amount of messages from periodic events ([PR 2892](https://github.com/input-output-hk/daedalus/pull/2892))
@@ -12,6 +23,15 @@
1223

1324
### Fixes
1425

26+
- Fixed dialogs being closed after receiving address shared ([PR 2965](https://github.com/input-output-hk/daedalus/pull/2965))
27+
- Fixed no progress shown on loading screen on Windows ([PR 2967](https://github.com/input-output-hk/daedalus/pull/2967))
28+
- Fixes hardware wallet issues on Windows ([PR 2900](https://github.com/input-output-hk/daedalus/pull/2900))
29+
- Fixed stake pool list styling ([PR 2920](https://github.com/input-output-hk/daedalus/pull/2920))
30+
- Fixed PopOver overlap ([PR 2954](https://github.com/input-output-hk/daedalus/pull/2954))
31+
- Fixed tooltip being hidden in several places ([PR-2934](https://github.com/input-output-hk/daedalus/pull/2934))
32+
- Adjusted padding for search field in stake pools ([PR 2945](https://github.com/input-output-hk/daedalus/pull/2945))
33+
- Fixed margin for dialogs content and token table header ([PR 2944](https://github.com/input-output-hk/daedalus/pull/2944))
34+
- Fixed performance issue on stake pool list view ([PR 2924](https://github.com/input-output-hk/daedalus/pull/2924))
1535
- Fixed position of popup on syncing screen ([PR 2921](https://github.com/input-output-hk/daedalus/pull/2921))
1636
- Fixed issue with missing character when copying address from PDF ([PR 2925](https://github.com/input-output-hk/daedalus/pull/2925))
1737
- Fixed stake pool list view overlapping news feed ([PR 2917](https://github.com/input-output-hk/daedalus/pull/2917))
@@ -23,12 +43,26 @@
2343

2444
### Chores
2545

46+
- 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))
47+
- Refactor to remove duplicated code ([PR 2956](https://github.com/input-output-hk/daedalus/pull/2956))
48+
- Updated cardano-launcher to 0.20220119.0 ([PR 2839](https://github.com/input-output-hk/daedalus/pull/2839))
49+
- Added `storybook:build` check to pre-push hook ([PR 2955](https://github.com/input-output-hk/daedalus/pull/2955))
2650
- Using new faker.js ([PR 2855](https://github.com/input-output-hk/daedalus/pull/2855))
27-
- Removed `dockutil` due compatibility issues with MacOs Monterey 12.3 ([PR 2929](https://github.com/input-output-hk/daedalus/pull/2929))
2851
- Fixed spelling issues and typos ([PR 2915](https://github.com/input-output-hk/daedalus/pull/2915))
2952
- Removed SASS ts-lint ignore comments ([PR 2870](https://github.com/input-output-hk/daedalus/pull/2870))
3053
- Enabled debugging of the main process ([PR 2893](https://github.com/input-output-hk/daedalus/pull/2893))
3154

55+
## 4.9.1
56+
57+
### Fixes
58+
59+
- Fixed catalyst fund name ([PR 2946](https://github.com/input-output-hk/daedalus/pull/2946))
60+
- Fixed macOS installer on Monterey 12.3 ([PR 2929](https://github.com/input-output-hk/daedalus/pull/2929))
61+
62+
### Chores
63+
64+
- Introduced new version of the `@cardano-foundation/ledgerjs-hw-app-cardano` package ([PR 2930](https://github.com/input-output-hk/daedalus/pull/2930))
65+
3266
## 4.9.0
3367

3468
### Features
@@ -61,6 +95,7 @@
6195

6296
### Fixes
6397

98+
- Improved error handling for incorrect passphrase and incorrect hardware wallet error ([PR 2860](https://github.com/input-output-hk/daedalus/pull/2860))
6499
- Fixed rewards CSV export issues ([PR 2885](https://github.com/input-output-hk/daedalus/pull/2885))
65100
- Fixed behaviour of wallet settings option of the app menu ([PR 2838](https://github.com/input-output-hk/daedalus/pull/2838))
66101
- Fixed styling of ITN rewards feature ([PR 2861](https://github.com/input-output-hk/daedalus/pull/2861))

README.md

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88

99
Daedalus - Cryptocurrency Wallet
1010

11-
## Installation
11+
## Setup development environment
1212

13-
### Yarn
13+
### Linux/macOS
14+
15+
#### Yarn
1416

1517
[Yarn](https://yarnpkg.com/lang/en/docs/install) is required to install `npm` dependencies to build Daedalus.
1618

17-
### Nix
19+
#### Nix
1820

1921
[Nix](https://nixos.org/nix/) is needed to run Daedalus in `nix-shell`.
2022

@@ -57,22 +59,19 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
5759
```
5860
2. Download certificate from https://docs.certifytheweb.com/docs/kb/kb-202109-letsencrypt/ and import to your keychain.
5961

60-
## Development
61-
62-
### Running Daedalus with Cardano Node
62+
#### Running Daedalus with Cardano Node
6363

64-
#### Selfnode
64+
##### Selfnode
6565

6666
1. Run `yarn nix:selfnode` from `daedalus`.
6767
2. Run `yarn dev` from the subsequent `nix-shell` (use `KEEP_LOCAL_CLUSTER_RUNNING` environment variable to keep the local cluster running after Daedalus exits: `KEEP_LOCAL_CLUSTER_RUNNING=true yarn dev`)
68-
1. Alternatively: run `yarn nix:selfnode yarn dev` to achieve the same thing in a single command. Note: after `yarn dev` exits, you will still remain in the `nix-shell`.
6968
3. Once Daedalus has started and has gotten past the loading screen run the following commands from a new terminal window if you wish to import funded wallets:
70-
- Byron wallets: `yarn byron:wallet:importer`
71-
- Shelley wallets: `yarn shelley:wallet:importer`
72-
- Mary wallets: `yarn mary:wallet:importer` (all of which contain native tokens which are visible once selfnode enters Mary era)
73-
- Yoroi Byron wallets: `yarn yoroi:wallet:importer`
74-
- _ITN Byron wallets:_ `yarn itn:byron:wallet:importer` **[Deprecated]**
75-
- _ITN Shelley wallets:_ `yarn itn:shelley:wallet:importer` **[Deprecated]**
69+
- Byron wallets: `yarn byron:wallet:importer`
70+
- Shelley wallets: `yarn shelley:wallet:importer`
71+
- Mary wallets: `yarn mary:wallet:importer` (all of which contain native tokens which are visible once selfnode enters Mary era)
72+
- Yoroi Byron wallets: `yarn yoroi:wallet:importer`
73+
- _ITN Byron wallets:_ `yarn itn:byron:wallet:importer` **[Deprecated]**
74+
- _ITN Shelley wallets:_ `yarn itn:shelley:wallet:importer` **[Deprecated]**
7675

7776
These scripts import 3 wallets by default. You can import up to 10 wallets by supplying `WALLET_COUNT` environment variable (e.g. `WALLET_COUNT=10 yarn mary:wallet:importer`).
7877

@@ -91,43 +90,37 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
9190
| desiredPoolNumber | 3
9291
| minimumUtxoValue | 1 ADA
9392

94-
#### Mainnet
93+
##### Mainnet
9594

9695
1. Run `yarn nix:mainnet` from `daedalus`.
9796
2. Run `yarn dev` from the subsequent `nix-shell`
98-
3. Or in one command: `yarn nix:mainnet yarn dev`
9997

100-
#### Flight
98+
##### Flight
10199

102100
1. Run `yarn nix:flight` from `daedalus`.
103101
2. Run `yarn dev` from the subsequent `nix-shell`
104-
3. Or in one command: `yarn nix:flight yarn dev`
105102

106-
#### Testnet
103+
##### Testnet
107104

108105
1. Run `yarn nix:testnet` from `daedalus`.
109106
2. Run `yarn dev` from the subsequent `nix-shell`
110-
3. Or in one command: `yarn nix:testnet yarn dev`
111107

112-
#### Staging
108+
##### Staging
113109

114110
1. Run `yarn nix:staging` from `daedalus`.
115111
2. Run `yarn dev` from the subsequent `nix-shell`
116-
3. Or in one command: `yarn nix:staging yarn dev`
117112

118-
#### Shelley QA
113+
##### Shelley QA
119114

120115
1. Run `yarn nix:shelley_qa` from `daedalus`.
121116
2. Run `yarn dev` from the subsequent `nix-shell`
122-
3. Or in one command: `yarn nix:shelley_qa yarn dev`
123117

124-
#### Alonzo Purple
118+
##### Alonzo Purple
125119

126120
1. Run `yarn nix:alonzo_purple` from `daedalus`.
127121
2. Run `yarn dev` from the subsequent `nix-shell`
128-
3. Or in one command: `yarn nix:alonzo_purple yarn dev`
129122

130-
#### Native token metadata server
123+
##### Native token metadata server
131124

132125
Daedalus, by default, uses the following metadata server for all networks except for the mainnet: `https://metadata.cardano-testnet.iohkdev.io/`.
133126

@@ -158,7 +151,26 @@ http://localhost:65432/metadata/query
158151
```
159152
... and expect a "200 OK" response.
160153

161-
### Updating upstream dependencies (cardano-wallet, cardano-node, and iohk-nix)
154+
### Windows
155+
156+
This option is only for troubleshooting windows specific issues with hardware wallets. It is not recommended to use Windows as a developer environment.
157+
Most of the commands need `nix` and will run only on Linux or macOS.
158+
159+
#### Requisites
160+
- Windows 10/11
161+
- Daedalus testnet installation (similar version used in branch) in `C:\Program Files\Daedalus Testnet`
162+
- NodeJS 16
163+
- Python2
164+
- `yarn global add windows-build-tools` (if this does not work extract daedalus\nix\windows-usb-libs.zip under daedalus\build folder)
165+
- Microsoft Build Tools 2015
166+
- Microsoft Visual Studio 2017 (Include Desktop development with C++)
167+
- `yarn config set msvsversion 2015 --global`
168+
169+
#### Steps
170+
- `yarn install`
171+
- `yarn dev:windows`
172+
173+
#### Updating upstream dependencies (cardano-wallet, cardano-node, and iohk-nix)
162174

163175
`Niv` is used to manage the version of upstream dependencies. The versions of these dependencies can be seen in `nix/sources.json`.
164176

default.nix

Lines changed: 14 additions & 12 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,15 +80,11 @@ 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; };
8689
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;
8790
cardano-node-cluster = let
@@ -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

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+
};

0 commit comments

Comments
 (0)