Skip to content

Commit 8795963

Browse files
committed
Merge branch 'develop' into chore/ddw-1189-new-cardano-wallet-flake
2 parents 8ea45b3 + b584a26 commit 8795963

32 files changed

+196
-398
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ installers/csl-daedalus/
5151
installers/delegation.cert
5252
installers/signing.key
5353

54-
# temporary certs for daedalus dev
55-
tls/client
56-
tls/server
57-
5854
# App packaged
5955
dist
6056
release

CHANGELOG.md

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

33
## vNext
44

5+
### Fixes
6+
7+
- Fixed decimals for syncing percentage ([PR 3106](https://github.com/input-output-hk/daedalus/pull/3106))
8+
9+
### Chores
10+
11+
- Updated `@cardano-foundation/ledgerjs-hw-app-cardano` to version `6.0.0` ([PR 3093](https://github.com/input-output-hk/daedalus/pull/3093))
12+
- Added regeneration of dev TLS certificates for cardano-wallet on each nix-shell entry ([PR 3117](https://github.com/input-output-hk/daedalus/pull/3117))
13+
514
## 5.2.0
615

716
### Features

installers/common/MacInstaller.hs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/prebuilds/dar
156156
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/bin/darwin-x64-"*"/blake-hash.node"
157157
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/bin/darwin-arm64-"*"/blake-hash.node"
158158
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake-hash/build/Release/addon.node"
159-
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake2/build/Release/binding.node"
160-
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake2/bin/darwin-x64-"*"/blake2.node"
161-
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/blake2/bin/darwin-arm64-"*"/blake2.node"
162159
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/tiny-secp256k1/build/Release/secp256k1.node"
163160
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/tiny-secp256k1/bin/darwin-x64-"*"/tiny-secp256k1.node"
164161
sign_cmd "$ABS_PATH/Contents/Resources/app/node_modules/tiny-secp256k1/bin/darwin-arm64-"*"/tiny-secp256k1.node"
@@ -241,7 +238,6 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
241238
, "bip66"
242239
, "bitcoin-ops"
243240
, "blake-hash"
244-
, "blake2"
245241
, "blake2b"
246242
, "blake2b-wasm"
247243
, "bn.js"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"yarn-lockfile": "1.1.1"
202202
},
203203
"dependencies": {
204-
"@cardano-foundation/ledgerjs-hw-app-cardano": "5.1.0",
204+
"@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.0",
205205
"@iohk-jormungandr/wallet-js": "0.5.0-pre7",
206206
"@ledgerhq/hw-transport-node-hid": "6.27.1",
207207
"@trezor/connect": "9.0.2",

scripts/package.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const DEFAULT_OPTS = {
3737
/^\/storybook($|\/)/,
3838
/^\/tests($|\/)/,
3939
/^\/tests-report($|\/)/,
40-
/^\/tls($|\/)/,
4140
/^\/translations($|\/)/,
4241
],
4342
};

shell.nix

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ let
5252
daedalusPkgs.daedalus-installer
5353
daedalusPkgs.darwin-launcher
5454
daedalusPkgs.mock-token-metadata-server
55+
regenerateDevCerts
5556
] ++ (with pkgs; [
5657
nix bash binutils coreutils curl gnutar
5758
git python27 curl jq
@@ -74,7 +75,17 @@ let
7475
name = "daedalus-build";
7576
buildInputs = daedalusShellBuildInputs;
7677
};
77-
78+
regenerateDevCerts = let
79+
moddedConfig = pkgs.writeText "launcher-config.yaml" (builtins.toJSON (
80+
daedalusPkgs.launcherConfigs.launcherConfig
81+
// {
82+
daedalusBin = "true";
83+
}
84+
));
85+
in
86+
pkgs.writeShellScriptBin "regenerate-dev-certs" ''
87+
${daedalusPkgs.daedalus-bridge}/bin/cardano-launcher --config ${moddedConfig}
88+
'';
7889
gcRoot = pkgs.runCommandLocal "gc-root" {
7990
properBuildShell = buildShell.overrideAttrs (old: { buildCommand = "export >$out"; });
8091
cardanoWalletsHaskellNix = daedalusPkgs.walletFlake.outputs.legacyPackages.${system}.roots;
@@ -182,6 +193,17 @@ let
182193
183194
echo 'jq < $LAUNCHER_CONFIG'
184195
echo debug the node by running debug-node
196+
197+
echo 'Resolving environment variables to absolute paths…'
198+
# XXX: they originally contain references to HOME or XDG_DATA_HOME in launcher-config.yaml:
199+
export CARDANO_WALLET_TLS_PATH="${daedalusPkgs.launcherConfigs.launcherConfig.tlsPath}"
200+
201+
echo 'Re-generating dev certificates for ‘cardano-wallet’…'
202+
mkdir -p "$CARDANO_WALLET_TLS_PATH"
203+
regenerate-dev-certs >/dev/null
204+
205+
echo
206+
echo 'Now, run ‘yarn dev’.'
185207
'';
186208
});
187209
daedalus = daedalusShell.overrideAttrs (oldAttrs: {

source/common/types/hardware-wallets.types.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import { BridgeInfo, Device as TrezorDevice, UdevInfo } from '@trezor/connect';
2+
import {
3+
TxOutputDestinationType,
4+
AddressType,
5+
CIP36VoteRegistrationFormat,
6+
TxAuxiliaryDataType,
7+
} from '@cardano-foundation/ledgerjs-hw-app-cardano';
28

39
export type BIP32Path = Array<number>;
410
export type LedgerModel = 'nanoS' | 'nanoSP' | 'nanoX';
@@ -139,14 +145,18 @@ export type LedgerSignTransactionOutputsType =
139145
| []
140146
| Array<LedgerOutputTypeAddress | LedgerOutputTypeChange>;
141147
export type LedgerAuxiliaryDataType = {
142-
type: string;
148+
type: TxAuxiliaryDataType;
143149
params: {
144-
votingPublicKeyHex: string;
150+
format: CIP36VoteRegistrationFormat;
151+
voteKeyHex: string;
145152
stakingPath: BIP32Path;
146-
rewardsDestination: {
147-
type: number;
153+
paymentDestination: {
154+
type: TxOutputDestinationType;
148155
params: {
149-
stakingPath: BIP32Path;
156+
type: AddressType;
157+
params: {
158+
stakingPath: BIP32Path;
159+
};
150160
};
151161
};
152162
nonce: string;
@@ -199,7 +209,7 @@ export type LedgerSignTransactionResponse = {
199209
txHashHex: string;
200210
witnesses: Array<Witness>;
201211
auxiliaryDataSupplement?: {
202-
catalystRegistrationSignatureHex: string;
212+
cip36VoteRegistrationSignatureHex: string;
203213
auxiliaryDataHashHex: string;
204214
type: 'catalyst_registration';
205215
};

source/main/cardano/CardanoWalletLauncher.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,6 @@ export async function CardanoWalletLauncher(
8383
svCert: path.join(tlsPath, 'server/server.crt'),
8484
svKey: path.join(tlsPath, 'server/server.key'),
8585
};
86-
// Prepare development TLS files
87-
const { isProduction } = environment;
88-
89-
if (
90-
!isProduction &&
91-
nodeImplementation === CardanoNodeImplementationOptions.CARDANO
92-
) {
93-
await fs.copy('tls', tlsPath);
94-
}
9586

9687
let tokenMetadataServer;
9788
// This switch statement handles any node specific

source/main/ipc/getHardwareWalletChannel.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import TransportNodeHid, {
33
getDevices,
44
} from '@ledgerhq/hw-transport-node-hid-noevents';
55
import AppAda, { utils } from '@cardano-foundation/ledgerjs-hw-app-cardano';
6+
import { str_to_path } from '@cardano-foundation/ledgerjs-hw-app-cardano/dist/utils/address';
7+
import { HexString } from '@cardano-foundation/ledgerjs-hw-app-cardano/dist/types/internal';
68
import TrezorConnect, {
79
DEVICE,
810
DEVICE_EVENT,
@@ -455,7 +457,7 @@ export const handleHardwareWalletRequests = async (
455457
});
456458
deriveXpubChannel.onRequest(async (params) => {
457459
const { parentXpubHex, lastIndex, derivationScheme } = params;
458-
const parentXpub = utils.hex_to_buf(parentXpubHex);
460+
const parentXpub = utils.hex_to_buf(parentXpubHex as HexString);
459461

460462
try {
461463
const xpub = deriveChildXpub(parentXpub, lastIndex, derivationScheme);
@@ -474,10 +476,8 @@ export const handleHardwareWalletRequests = async (
474476
networkId,
475477
protocolMagic,
476478
} = params;
477-
const spendingPath = utils.str_to_path(spendingPathStr);
478-
const stakingPath = stakingPathStr
479-
? utils.str_to_path(stakingPathStr)
480-
: null;
479+
const spendingPath = str_to_path(spendingPathStr);
480+
const stakingPath = stakingPathStr ? str_to_path(stakingPathStr) : null;
481481

482482
deviceConnection = get(devicesMemo, [devicePath, 'AdaConnection']);
483483

@@ -542,10 +542,8 @@ export const handleHardwareWalletRequests = async (
542542
networkId,
543543
protocolMagic,
544544
} = params;
545-
const spendingPath = utils.str_to_path(spendingPathStr);
546-
const stakingPath = stakingPathStr
547-
? utils.str_to_path(stakingPathStr)
548-
: null;
545+
const spendingPath = str_to_path(spendingPathStr);
546+
const stakingPath = stakingPathStr ? str_to_path(stakingPathStr) : null;
549547

550548
try {
551549
deviceConnection = get(devicesMemo, [devicePath, 'AdaConnection']);
@@ -804,9 +802,8 @@ export const handleHardwareWalletRequests = async (
804802
if (!deviceConnection) {
805803
throw new Error('Ledger device not connected');
806804
}
807-
808805
const extendedPublicKey = await deviceConnection.getExtendedPublicKey({
809-
path: utils.str_to_path(path),
806+
path: str_to_path(path),
810807
});
811808
const deviceSerial = await deviceConnection.getSerial();
812809
return Promise.resolve({

source/main/utils/handleCheckBlockReplayProgress.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const createHandleNewLogLine = (mainWindow: BrowserWindow) => {
6868
return;
6969
}
7070

71-
const progress = Math.floor(parseFloat(unparsedProgress));
71+
const progress = parseFloat(unparsedProgress);
7272

7373
if (progressReport[type] !== progress) {
7474
progressReport[type] = progress;

0 commit comments

Comments
 (0)