Skip to content

Commit da78da5

Browse files
committed
Merge branch 'develop' into merge-4.12.0-into-develop
2 parents 4bda8fe + af2c892 commit da78da5

File tree

23 files changed

+306
-111
lines changed

23 files changed

+306
-111
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## vNext
4+
5+
### Fixes
6+
7+
- Ensured non-recommended decimal place setting alert is correctly shown ([PR 3007](https://github.com/input-output-hk/daedalus/pull/3007))
8+
9+
### Chores
10+
11+
- Updated cardano-node to 1.35.1 ([PR 3012](https://github.com/input-output-hk/daedalus/pull/3012))
12+
13+
### Features
14+
15+
- Updated Terms of Service ([PR 3009](https://github.com/input-output-hk/daedalus/pull/3009))
16+
317
## 4.12.0
418

519
### Fixes
@@ -9,6 +23,7 @@
923

1024
### Chores
1125

26+
- Made Windows installer more resilient w.r.t. auto-updates ([PR 3017](https://github.com/input-output-hk/daedalus/pull/3017))
1227
- Added OS-architecture tuple to installer file names to help with releases ([PR 3016](https://github.com/input-output-hk/daedalus/pull/3016))
1328
- Added Vasil-supported cardano-wallet ([PR 3001](https://github.com/input-output-hk/daedalus/pull/3001))
1429
- Upgraded webpack to version 5 ([PR 2772](https://github.com/input-output-hk/daedalus/pull/2772))

default.nix

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,20 @@ let
8080
cardanoLib = localLib.iohkNix.cardanoLib;
8181
daedalus-bridge = self.bridgeTable.${nodeImplementation};
8282

83-
nodejs = pkgs.nodejs-16_x;
83+
nodejs = let
84+
njPath = pkgs.path + "/pkgs/development/web/nodejs";
85+
buildNodeJs = pkgs.callPackage (import (njPath + "/nodejs.nix")) {
86+
python = pkgs.python3;
87+
icu = pkgs.icu68; # can’t build against ICU 69: <https://chromium-review.googlesource.com/c/v8/v8/+/2477751>
88+
};
89+
in
90+
buildNodeJs {
91+
enableNpm = true;
92+
version = "14.17.0";
93+
sha256 = "1vf989canwcx0wdpngvkbz2x232yccp7fzs1vcbr60rijgzmpq2n";
94+
patches = pkgs.lib.optional pkgs.stdenv.isDarwin (njPath + "/bypass-xcodebuild.diff");
95+
};
96+
8497
nodePackages = pkgs.nodePackages.override { nodejs = self.nodejs; };
8598
yarnInfo = {
8699
version = "1.22.4";

installers/nix/electron.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{ stdenv, lib, makeWrapper, fetchurl, unzip, atomEnv, libuuid, at-spi2-atk, at_spi2_core, libxshmfence,
2-
libxkbcommon }:
2+
libxkbcommon, runCommand, binutils-unwrapped }:
33

44
let
5-
version = "13.6.3";
5+
version = (builtins.fromJSON (builtins.readFile ../../package.json)).dependencies.electron;
66
name = "electron-${version}";
77

88
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";

nix/yarn-nix-shell.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@ if [ -z "$command" ] ; then
2929
fi
3030

3131
export NETWORK
32+
33+
# Prevent segfaults on Darwin in `GC_*` code:
34+
export GC_DONT_GC=1
35+
3236
# `return` will make the user stay in `nix-shell` after the initial command finishes:
3337
exec nix-shell --argstr nodeImplementation cardano --argstr cluster "$cluster" --command "$command ; return"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build:main": "yarn webpack -c source/main/webpack.config.js --progress",
1414
"build:renderer": "yarn webpack -c source/renderer/webpack.config.js --progress",
1515
"build:cleanup": "rimraf ./dist",
16-
"build:electron": "electron-rebuild -w usb --useCache -s --debug",
16+
"build:electron": "electron-rebuild --useCache && electron-rebuild -w usb --useCache -s --debug",
1717
"check:all": "yarn prettier:check && yarn lint && yarn compile && yarn stylelint && yarn lockfile:check && yarn i18n:manage && yarn storybook:build",
1818
"start": "yarn electron ./",
1919
"start:dev": "nodemon --watch 'dist/main' --exec 'NODE_ENV=development yarn start'",

release.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ in {
6969
in {
7070
daedalus-installer = allArchesNoWindows;
7171
yaml2json = allArchesNoWindows;
72+
nodejs = allArchesNoWindows;
7273
bridgeTable = {
7374
cardano = allArches;
7475
};
7576
cardano-node = allArches;
76-
}))
77+
})) // {
78+
recurseForDerivations = {};
79+
}

scripts/postinstall.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22

33
if [[ "$CI" != "true" ]]; then
44
yarn lockfile:fix
5+
6+
# Let’s patch electron-rebuild to force correct Node.js headers to
7+
# build native modules against even in `nix-shell`, otherwise, it
8+
# doesn’t work reliably.
9+
eval "$(nix-build -A rawapp.patchElectronRebuild)"
510
fi

shell.nix

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,6 @@ let
111111
ln -svf $(type -P cardano-node)
112112
ln -svf $(type -P cardano-wallet)
113113
ln -svf $(type -P cardano-cli)
114-
mkdir -p ${BUILDTYPE}/
115-
${let
116-
# (TODO: investigate why – @michalrus)
117-
sourceBUILDTYPE = "Release";
118-
in ''
119-
ln -svf $PWD/node_modules/usb/build/${sourceBUILDTYPE}/usb_bindings.node ${BUILDTYPE}/
120-
ln -svf $PWD/node_modules/node-hid/build/${sourceBUILDTYPE}/HID.node ${BUILDTYPE}/
121-
ln -svf $PWD/node_modules/node-hid/build/${sourceBUILDTYPE}/HID_hidraw.node ${BUILDTYPE}/
122-
ln -svf $PWD/node_modules/usb-detection/build/${sourceBUILDTYPE}/detection.node ${BUILDTYPE}/
123-
''}
124114
125115
${pkgs.lib.optionalString (nodeImplementation == "cardano") ''
126116
source <(cardano-node --bash-completion-script `type -p cardano-node`)
@@ -135,14 +125,51 @@ let
135125
''
136126
}
137127
yarn install --frozen-lockfile
128+
129+
# Rebuild native modules for <https://www.electronjs.org/docs/latest/tutorial/using-native-node-modules>:
130+
find Debug/ Release/ -name '*.node' | xargs rm -v || true
138131
yarn build:electron
132+
133+
${let
134+
# Several native modules have to be linked in ${BUILDTYPE}/ in
135+
# root directory, for `yarn dev` to work correctly. If a Debug
136+
# version of such extension exists, we use it, otherwise, we
137+
# use Release:
138+
tryLink = dependency: fileName: ''
139+
symlinkTarget=$(ls 2>/dev/null -d \
140+
"$PWD/node_modules/${dependency}/build/Debug/${fileName}" \
141+
"$PWD/node_modules/${dependency}/build/Release/${fileName}" \
142+
| head -1
143+
)
144+
145+
if [ -z "$symlinkTarget" ] ; then
146+
echo >&2 "error: symlink target not found: ‘${fileName}’ in ‘${dependency}’"
147+
# ~exit 1~ — do not exit, let the person fix from inside `nix-shell`
148+
fi
149+
150+
${localLib.optionalString pkgs.stdenv.isLinux ''
151+
${pkgs.patchelf}/bin/patchelf --set-rpath ${pkgs.lib.makeLibraryPath [
152+
pkgs.stdenv.cc.cc pkgs.udev
153+
]} "$symlinkTarget"
154+
''}
155+
156+
mkdir -p ${BUILDTYPE}/
157+
ln -svf "$symlinkTarget" ${BUILDTYPE}/
158+
unset symlinkTarget
159+
'';
160+
in ''
161+
${tryLink "usb" "usb_bindings.node"}
162+
${tryLink "usb-detection" "detection.node"}
163+
${tryLink "node-hid" "HID.node"}
164+
${localLib.optionalString pkgs.stdenv.isLinux ''
165+
${tryLink "node-hid" "HID_hidraw.node"}
166+
''}
167+
''}
168+
139169
${localLib.optionalString pkgs.stdenv.isLinux ''
140-
${pkgs.patchelf}/bin/patchelf --set-rpath ${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.udev ]} ${BUILDTYPE}/usb_bindings.node
141-
${pkgs.patchelf}/bin/patchelf --set-rpath ${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.udev ]} ${BUILDTYPE}/HID.node
142-
# TODO: is this needed for `detection.node`?
143-
${pkgs.patchelf}/bin/patchelf --set-rpath ${pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.udev ]} ${BUILDTYPE}/detection.node
144170
ln -svf ${daedalusPkgs.electron}/bin/electron ./node_modules/electron/dist/electron
145171
''}
172+
146173
echo 'jq < $LAUNCHER_CONFIG'
147174
echo debug the node by running debug-node
148175
'';

source/common/types/logging.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import type {
1414
} from '../../renderer/app/api/wallets/types';
1515
import type { Address } from '../../renderer/app/api/addresses/types';
1616
import type { GetTransactionsRequest } from '../../renderer/app/api/transactions/types';
17-
import type { HardwareWalletLocalData } from '../../renderer/app/api/utils/localStorage';
1817
import type { AdaApiStakePool } from '../../renderer/app/api/staking/types';
18+
import { HardwareWalletLocalData } from '../../renderer/app/types/localDataTypes';
1919

2020
export type LoggingLevel = 'debug' | 'info' | 'error' | 'warn';
2121
export type Logger = {

source/renderer/app/api/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,11 @@ import type {
223223
ApiAsset,
224224
StoredAssetMetadata,
225225
} from './assets/types';
226-
import type { AssetLocalData } from './utils/localStorage';
227226
import Asset from '../domains/Asset';
228227
import { getAssets } from './assets/requests/getAssets';
229228
import { getAccountPublicKey } from './wallets/requests/getAccountPublicKey';
230229
import { doesWalletRequireAdaToRemainToSupportTokens } from './utils/apiHelpers';
230+
import { AssetLocalData } from '../types/localDataTypes';
231231

232232
export default class AdaApi {
233233
config: RequestConfig;
@@ -663,14 +663,14 @@ export default class AdaApi {
663663
logger.debug('AdaApi::getAssets success', {
664664
assets: response,
665665
});
666-
const assetsLocaldata = await global.daedalus.api.localStorage.getAssetsLocalData();
666+
const assetsLocalData = await global.daedalus.api.localStorage.getAssetsLocalData();
667667
logger.debug('AdaApi::getAssetsLocalData success', {
668-
assetsLocaldata,
668+
assetsLocalData,
669669
});
670670
const assets = response.map((asset) =>
671671
_createAssetFromServerData(
672672
asset,
673-
assetsLocaldata[asset.policy_id + asset.asset_name] || {},
673+
assetsLocalData[asset.policy_id + asset.asset_name] || {},
674674
this.storedAssetMetadata
675675
)
676676
);

0 commit comments

Comments
 (0)