Skip to content

Commit f207199

Browse files
committed
Merge branch 'develop' into fix/ddw-1061-download-file-remains-after-update
# Conflicts: # CHANGELOG.md
2 parents 7b73cee + 4de5d2c commit f207199

File tree

142 files changed

+5738
-3255
lines changed

Some content is hidden

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

142 files changed

+5738
-3255
lines changed

.buildkite/pipeline.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ env:
22
ARTIFACT_BUCKET: s3://ci-output-sink
33
steps:
44
- label: 'daedalus-x86_64-darwin'
5-
command: 'scripts/build-installer-unix.sh --build-id $BUILDKITE_BUILD_NUMBER'
5+
command: 'scripts/build-installer-unix.sh--nix-2.5 --build-id $BUILDKITE_BUILD_NUMBER'
66
env:
77
NIX_SSL_CERT_FILE: /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
88
agents:
99
queue: daedalus
1010
system: x86_64-darwin
11+
- label: 'daedalus-aarch64-darwin'
12+
command: 'scripts/build-installer-unix.sh--nix-2.5 --build-id $BUILDKITE_BUILD_NUMBER'
13+
env:
14+
NIX_SSL_CERT_FILE: /nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
15+
UPLOAD_DIR_OVERRIDE: UNSAFE-internal-build
16+
agents:
17+
queue: daedalus
18+
system: aarch64-darwin
1119
- label: 'daedalus-x86_64-linux-nix'
1220
command: 'scripts/build-installer-nix.sh $BUILDKITE_BUILD_NUMBER'
1321
agents:

.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: 7 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
@@ -119,6 +124,8 @@ Debug
119124
/cardano-cli
120125
/cardano-wallet
121126
.vscode
127+
.yalc
128+
yalc.lock
122129

123130
# Typescript
124131
*.scss.d.ts

.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: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,27 @@
22

33
## vNext
44

5+
### Fixes
6+
7+
- Fixed downloaded installer being left in Downloads after latest update installs ([PR 2941](https://github.com/input-output-hk/daedalus/pull/2941))
8+
- Fixed incorrect behaviour of creating new wallet when paired incorrect hardware wallet during address verification ([PR 2906](https://github.com/input-output-hk/daedalus/pull/2906))
9+
- Fixed phrasing of insufficient funds for tokens message ([PR 2966](https://github.com/input-output-hk/daedalus/pull/2966))
10+
511
### Features
612

13+
- Added support for Ledger Nano S Plus ([PR 2975](https://github.com/input-output-hk/daedalus/pull/2975))
14+
- Support of Apple AArch64 chip ([PR 2684](https://github.com/input-output-hk/daedalus/pull/2684))
15+
16+
### Chores
17+
18+
- 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))
19+
- Published selfnode installers for all 3 platforms ([PR 2971](https://github.com/input-output-hk/daedalus/pull/2971))
20+
21+
## 4.10.0
22+
23+
### Features
24+
25+
- Implemented hover tooltips for menu ([PR 2938](https://github.com/input-output-hk/daedalus/pull/2938))
726
- Improved UI regarding the Hardware Wallet public key export error ([PR 2922](https://github.com/input-output-hk/daedalus/pull/2922))
827
- Added ASCII name to token header when metadata name is missing ([PR 2904](https://github.com/input-output-hk/daedalus/pull/2904))
928
- Improved IPC by reducing the amount of messages from periodic events ([PR 2892](https://github.com/input-output-hk/daedalus/pull/2892))
@@ -12,7 +31,10 @@
1231

1332
### Fixes
1433

15-
- Fixed downloaded installer being left in Downloads after latest update installs ([PR 2941](https://github.com/input-output-hk/daedalus/pull/2941))
34+
- Fixed dialogs being closed after receiving address shared ([PR 2965](https://github.com/input-output-hk/daedalus/pull/2965))
35+
- Fixed no progress shown on loading screen on Windows ([PR 2967](https://github.com/input-output-hk/daedalus/pull/2967))
36+
- Fixes hardware wallet issues on Windows ([PR 2900](https://github.com/input-output-hk/daedalus/pull/2900))
37+
- Fixed stake pool list styling ([PR 2920](https://github.com/input-output-hk/daedalus/pull/2920))
1638
- Fixed PopOver overlap ([PR 2954](https://github.com/input-output-hk/daedalus/pull/2954))
1739
- Fixed tooltip being hidden in several places ([PR-2934](https://github.com/input-output-hk/daedalus/pull/2934))
1840
- Adjusted padding for search field in stake pools ([PR 2945](https://github.com/input-output-hk/daedalus/pull/2945))
@@ -29,6 +51,9 @@
2951

3052
### Chores
3153

54+
- 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))
55+
- Refactor to remove duplicated code ([PR 2956](https://github.com/input-output-hk/daedalus/pull/2956))
56+
- Updated cardano-launcher to 0.20220119.0 ([PR 2839](https://github.com/input-output-hk/daedalus/pull/2839))
3257
- Added `storybook:build` check to pre-push hook ([PR 2955](https://github.com/input-output-hk/daedalus/pull/2955))
3358
- Using new faker.js ([PR 2855](https://github.com/input-output-hk/daedalus/pull/2855))
3459
- Fixed spelling issues and typos ([PR 2915](https://github.com/input-output-hk/daedalus/pull/2915))
@@ -78,11 +103,12 @@
78103

79104
### Fixes
80105

106+
- Improved error handling for incorrect passphrase and incorrect hardware wallet error ([PR 2860](https://github.com/input-output-hk/daedalus/pull/2860))
81107
- Fixed rewards CSV export issues ([PR 2885](https://github.com/input-output-hk/daedalus/pull/2885))
82108
- Fixed behaviour of wallet settings option of the app menu ([PR 2838](https://github.com/input-output-hk/daedalus/pull/2838))
83109
- Fixed styling of ITN rewards feature ([PR 2861](https://github.com/input-output-hk/daedalus/pull/2861))
84110
- Fixed available disk space takes a long time to show ([PR 2849](https://github.com/input-output-hk/daedalus/pull/2849))
85-
111+
86112
### Chores
87113

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

README.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ Daedalus - Cryptocurrency Wallet
4242
trusted-substituters =
4343
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
4444
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib
45+
experimental-features = nix-command flakes
4546
46-
# If you are running on a Mac with M1 chip please uncomment 'system' setting to enforce running on Rosetta2
47-
# system = x86_64-darwin
47+
# If you are running on a Mac with Intel chip
48+
system = x86_64-darwin
49+
50+
# If you are running on a Mac with M1 chip
51+
system = aarch64-darwin
4852
```
4953

5054
3. Run `nix-shell` with correct list of arguments or by using existing `package.json` scripts to load a shell with all the correct versions of all the required dependencies for development.
@@ -105,21 +109,6 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
105109
1. Run `yarn nix:testnet` from `daedalus`.
106110
2. Run `yarn dev` from the subsequent `nix-shell`
107111

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-
123112
##### Native token metadata server
124113

125114
Daedalus, by default, uses the following metadata server for all networks except for the mainnet: `https://metadata.cardano-testnet.iohkdev.io/`.
@@ -222,6 +211,26 @@ You can debug the main process by following one of these approaches:
222211

223212
The inspector runs on port 9229
224213

214+
### Linking with UI Libraries (e.g. React Polymorph)
215+
216+
You can link libraries with Daedalus using one of the following steps:
217+
218+
#### 1) Using `yalc`
219+
220+
1) Install `yalc` globally using `yarn global add yalc`.
221+
2) Run `yalc publish` from the library's root directory that you want to link with Daedalus.
222+
3) Switch to Daedalus and run `yalc add <package-name>` or preferably `yalc link <package-name>`.
223+
4) You should be able to start Daedalus and see the changes you are making locally in the library.
224+
5) To make sure your changes are reflected as you update code in the library, use `yalc push`.
225+
226+
#### 2) Using `yarn link`
227+
228+
1) From the Daedalus root directory, go to `node_modules/react` and `yarn link`.
229+
2) Navigate to the `react-dom` package in the same directory and run `yarn link` again.
230+
3) Go to the library's root directory and run `yarn link`, `yarn link react` and `yarn link react-dom`.
231+
4) Go back to the Daedalus root directory and run `yarn link <package-name>`.
232+
5) Finally, run `yarn build:watch` from the library's root directory.
233+
225234
## Testing
226235

227236
You can find more details regarding tests setup within
-107 KB
Binary file not shown.

default.nix

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,17 @@ let
3131
};
3232
};
3333
pkgs = import sources.nixpkgs { inherit system config; };
34-
pkgsNative = localLib.iohkNix.getPkgsDefault {};
3534
sources = localLib.sources;
35+
haskellNix = import sources."haskell.nix" {};
36+
inherit (import haskellNix.sources.nixpkgs-unstable haskellNix.nixpkgsArgs) haskell-nix;
37+
flake-compat = import sources.flake-compat;
38+
walletFlake = flake-compat { src = sources.cardano-wallet; };
39+
walletPackages = with walletFlake.defaultNix.hydraJobs; {
40+
x86_64-windows = linux.windows;
41+
x86_64-linux = linux.native;
42+
x86_64-darwin = macos.intel;
43+
aarch64-darwin = macos.silicon;
44+
}.${target};
3645
walletPkgs = import "${sources.cardano-wallet}/nix" {};
3746
# only used for CLI, to be removed when upgraded to next node version
3847
nodePkgs = import "${sources.cardano-node}/nix" {};
@@ -49,13 +58,14 @@ let
4958
ostable.x86_64-windows = "windows";
5059
ostable.x86_64-linux = "linux";
5160
ostable.x86_64-darwin = "macos64";
61+
ostable.aarch64-darwin = "macos64-arm";
62+
5263
packages = self: {
5364
inherit cluster pkgs version target nodeImplementation;
54-
inherit (pkgs) hello cabal2nix;
5565
cardanoLib = localLib.iohkNix.cardanoLib;
5666
daedalus-bridge = self.bridgeTable.${nodeImplementation};
5767

58-
nodejs = pkgs.nodejs-14_x;
68+
nodejs = pkgs.nodejs-16_x;
5969
nodePackages = pkgs.nodePackages.override { nodejs = self.nodejs; };
6070
yarnInfo = {
6171
version = "1.22.4";
@@ -73,17 +83,13 @@ let
7383

7484
sources = localLib.sources;
7585
bridgeTable = {
76-
cardano = self.callPackage ./nix/cardano-bridge.nix {
77-
cardano-wallet = self.cardano-wallet.cardano-wallet;
78-
cardanoWalletPkgs = self.cardano-wallet.pkgs;
79-
};
86+
cardano = self.callPackage ./nix/cardano-bridge.nix {};
8087
};
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;
88+
inherit (walletPackages) cardano-wallet;
89+
inherit (walletPackages) cardano-address;
90+
inherit (walletPackages) mock-token-metadata-server;
8591
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;
92+
local-cluster = if cluster == "selfnode" then walletPackages.local-cluster else null;
8793
cardano-node-cluster = let
8894
# Test wallets with known mnemonics
8995
walletTestGenesisYaml = (self.sources.cardano-wallet + "/lib/shelley/test/data/cardano-node-shelley/genesis.yaml");
@@ -99,10 +105,10 @@ let
99105
in (import self.sources.cardano-node { inherit system customConfig; crossSystem = crossSystem nodePkgs.lib; }).cluster;
100106
cardano-node = if useLocalNode
101107
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).cardano-node
102-
else self.cardano-wallet.cardano-node;
108+
else walletPackages.cardano-node;
103109
cardano-cli = if useLocalNode
104110
then (import self.sources.cardano-node { inherit system; crossSystem = crossSystem nodePkgs.lib; }).haskellPackages.cardano-cli
105-
else self.cardano-wallet.cardano-cli;
111+
else walletPackages.cardano-cli;
106112
darwin-launcher = self.callPackage ./nix/darwin-launcher.nix {};
107113

108114
# a cross-compiled fastlist for the ps-list package
@@ -123,7 +129,6 @@ let
123129
network = cluster;
124130
os = ostable.${target};
125131
backend = nodeImplementation;
126-
runCommandNative = pkgsNative.runCommand;
127132
};
128133

129134
unsignedUnpackedCardano = self.daedalus-bridge; # TODO
@@ -264,7 +269,7 @@ let
264269
pushd dlls
265270
${if dummyInstaller then "touch foo" else "unzip ${self.dlls}"}
266271
popd
267-
cp -v ${self.unpackedCardano}/bin/* .
272+
cp -vr ${self.unpackedCardano}/bin/* .
268273
cp -v ${self.nsisFiles}/{*.yaml,*.json,daedalus.nsi,*.key,*.cert} .
269274
cp ${self.uninstaller}/uninstall.exe ../uninstall.exe
270275
if [ -f ${self.nsisFiles}/block-0.bin ]; then
@@ -314,7 +319,11 @@ let
314319
};
315320
rawapp-win64 = self.rawapp.override { win64 = true; };
316321
source = builtins.filterSource localLib.cleanSourceFilter ./.;
317-
yaml2json = pkgs.haskell.lib.addExtraLibrary (pkgs.haskell.lib.disableCabalFlag pkgs.haskellPackages.yaml "no-exe") pkgs.haskellPackages.optparse-applicative;
322+
inherit ((haskell-nix.hackage-package { name = "yaml"; compiler-nix-name = "ghc8107"; cabalProject = ''
323+
packages: .
324+
package yaml
325+
flags: -no-exe
326+
''; }).components.exes) yaml2json;
318327

319328
electron = pkgs.callPackage ./installers/nix/electron.nix {};
320329

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)