Skip to content

Commit 92bc587

Browse files
tomislavhoracekmichalrusMarcin Mazurek
authored
[DDW-1211] Update @trezor/connect to v9.0.8 (#3127)
* [DDW-1211] Update @trezor/connect to v9.0.8 * [DDW-1211] Bundle slightly different `node_modules` in installers * [DDW-1211] Apply Trezor voting breaking changes * [DDW-1211] CHANGELOG update * [DDW-1211] Improve @trezor/transport types usage * [DDW-1211] Add @trezor/transport package * [DDW-1211] Fix changelog --------- Co-authored-by: Michal Rus <[email protected]> Co-authored-by: Marcin Mazurek <[email protected]>
1 parent a22c045 commit 92bc587

File tree

8 files changed

+181
-79
lines changed

8 files changed

+181
-79
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Chores
1010

11+
- Updated @trezor/connect to v9.0.8 ([PR 3127](https://github.com/input-output-hk/daedalus/pull/3127))
1112
- Add members of Cardano Wallet team to the "About Daedalus" screen ([PR 3092](https://github.com/input-output-hk/daedalus/pull/3092))
1213
- Removed Chromatic from project ([PR 3126](https://github.com/input-output-hk/daedalus/pull/3126))
1314
- Upgraded Electron to 24.2, and Node.js to 18.× ([PR 3124](https://github.com/input-output-hk/daedalus/pull/3124))

installers/common/MacInstaller.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
216216
externalYarn :: [FilePath]
217217
externalYarn =
218218
[ "@babel"
219+
, "@noble"
219220
, "@protobufjs"
220221
, "@trezor"
221222
, "agent-base"
@@ -286,7 +287,6 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
286287
, "object-is"
287288
, "object-keys"
288289
, "object.values"
289-
, "parse-uri"
290290
, "pdfkit"
291291
, "png-js"
292292
, "protobufjs"

nix/x86_64-linux.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ in rec {
135135
ln -sv $out/share/daedalus/renderer/assets $out/share/fonts/daedalus
136136
137137
mkdir -pv $out/share/daedalus/node_modules
138-
cp -r node_modules/{\@babel,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,parse-uri,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,blakejs,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,util-deprecate,bech32,blake-hash,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection,babel-runtime,bindings,brotli,clone,deep-equal,dfa,eventemitter2,file-uri-to-path,fontkit,functions-have-names,has-property-descriptors,has-tostringtag,is-arguments,is-date-object,is-regex,linebreak,node-hid,object-is,pdfkit,png-js,regexp.prototype.flags,restructure,tiny-inflate,unicode-properties,unicode-trie,socks,socks-proxy-agent,ip,smart-buffer,ripple-lib,lodash,jsonschema,ripple-address-codec,ripple-keypairs,ripple-lib-transactionparser,ripple-binary-codec,buffer,decimal.js,debug,agent-base,tslib} $out/share/daedalus/node_modules/
138+
cp -r node_modules/{\@babel,\@noble,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,blakejs,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,util-deprecate,bech32,blake-hash,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection,babel-runtime,bindings,brotli,clone,deep-equal,dfa,eventemitter2,file-uri-to-path,fontkit,functions-have-names,has-property-descriptors,has-tostringtag,is-arguments,is-date-object,is-regex,linebreak,node-hid,object-is,pdfkit,png-js,regexp.prototype.flags,restructure,tiny-inflate,unicode-properties,unicode-trie,socks,socks-proxy-agent,ip,smart-buffer,ripple-lib,lodash,jsonschema,ripple-address-codec,ripple-keypairs,ripple-lib-transactionparser,ripple-binary-codec,buffer,decimal.js,debug,agent-base,tslib} $out/share/daedalus/node_modules/
139139
140140
chmod -R +w $out
141141

nix/x86_64-windows.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ in rec {
102102
rm -rf $out/resources/app/{installers,launcher-config.yaml,gulpfile.js,home}
103103
104104
mkdir -pv $out/resources/app/node_modules
105-
cp -r node_modules/{\@babel,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,parse-uri,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,blakejs,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,util-deprecate,bech32,blake-hash,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection,babel-runtime,bindings,brotli,clone,deep-equal,dfa,eventemitter2,file-uri-to-path,fontkit,functions-have-names,has-property-descriptors,has-tostringtag,is-arguments,is-date-object,is-regex,linebreak,node-hid,object-is,pdfkit,png-js,regexp.prototype.flags,restructure,tiny-inflate,unicode-properties,unicode-trie,socks,socks-proxy-agent,ip,smart-buffer,ripple-lib,lodash,jsonschema,ripple-address-codec,ripple-keypairs,ripple-lib-transactionparser,ripple-binary-codec,buffer,decimal.js,debug,agent-base,tslib} $out/resources/app/node_modules
105+
cp -r node_modules/{\@babel,\@noble,\@protobufjs,regenerator-runtime,node-fetch,\@trezor,randombytes,safe-buffer,bip66,pushdata-bitcoin,bitcoin-ops,typeforce,varuint-bitcoin,create-hash,blake2b,blakejs,nanoassert,blake2b-wasm,bs58check,bs58,base-x,create-hmac,wif,ms,semver-compare,long,define-properties,object-keys,has,function-bind,es-abstract,has-symbols,json-stable-stringify,cashaddrjs,big-integer,inherits,bchaddrjs,cross-fetch,js-chain-libs-node,bignumber.js,call-bind,get-intrinsic,base64-js,ieee754,util-deprecate,bech32,blake-hash,tiny-secp256k1,bn.js,elliptic,minimalistic-assert,minimalistic-crypto-utils,brorand,hash.js,hmac-drbg,int64-buffer,object.values,bytebuffer,protobufjs,usb-detection,babel-runtime,bindings,brotli,clone,deep-equal,dfa,eventemitter2,file-uri-to-path,fontkit,functions-have-names,has-property-descriptors,has-tostringtag,is-arguments,is-date-object,is-regex,linebreak,node-hid,object-is,pdfkit,png-js,regexp.prototype.flags,restructure,tiny-inflate,unicode-properties,unicode-trie,socks,socks-proxy-agent,ip,smart-buffer,ripple-lib,lodash,jsonschema,ripple-address-codec,ripple-keypairs,ripple-lib-transactionparser,ripple-binary-codec,buffer,decimal.js,debug,agent-base,tslib} $out/resources/app/node_modules
106106
107107
chmod -R +w $out
108108

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
},
7878
"devDependencies": {
7979
"@dump247/storybook-state": "1.6.1",
80+
"@electron/rebuild": "3.2.13",
8081
"@faker-js/faker": "6.0.0",
8182
"@formatjs/cli": "4.8.3",
8283
"@pmmmwh/react-refresh-webpack-plugin": "0.5.3",
@@ -124,7 +125,6 @@
124125
"electron-devtools-installer": "3.2.0",
125126
"electron-mock-ipc": "0.3.12",
126127
"electron-packager": "17.1.1",
127-
"@electron/rebuild": "3.2.13",
128128
"electron-reloader": "1.2.1",
129129
"eslint": "8.13.0",
130130
"eslint-config-airbnb": "19.0.4",
@@ -199,7 +199,8 @@
199199
"@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.0",
200200
"@iohk-jormungandr/wallet-js": "0.5.0-pre7",
201201
"@ledgerhq/hw-transport-node-hid": "6.27.15",
202-
"@trezor/connect": "9.0.2",
202+
"@trezor/connect": "9.0.8",
203+
"@trezor/transport": "1.1.12",
203204
"aes-js": "3.1.2",
204205
"bech32": "2.0.0",
205206
"bignumber.js": "9.0.1",

source/main/trezor/connection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ export const initTrezorConnect = async () => {
1717
}
1818
};
1919

20-
export const reinitTrezorConnect = () => {
20+
export const reinitTrezorConnect = async () => {
2121
try {
2222
logger.info('[TREZOR-CONNECT] Called TrezorConnect.dispose()');
23-
TrezorConnect.dispose();
23+
await TrezorConnect.dispose();
2424
} catch (error) {
2525
// ignore any TrezorConnect instance disposal errors
2626
logger.info('[TREZOR-CONNECT] Failed to call TrezorConnect.dispose()');

source/renderer/app/utils/shelleyTrezor.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { utils } from '@cardano-foundation/ledgerjs-hw-app-cardano';
2+
import { Messages } from '@trezor/transport';
23
import { map } from 'lodash';
34
import {
45
derivationPathToString,
@@ -77,19 +78,20 @@ export type TrezorVotingDataType = {
7778
votingKey: string;
7879
nonce: string;
7980
};
81+
8082
export const prepareTrezorAuxiliaryData = ({
8183
votingKey,
8284
nonce,
8385
}: TrezorVotingDataType) => ({
84-
catalystRegistrationParameters: {
85-
votingPublicKey: votingKey,
86+
cVoteRegistrationParameters: {
87+
votePublicKey: votingKey,
8688
stakingPath: "m/1852'/1815'/0'/2/0",
87-
rewardAddressParameters: {
88-
addressType: 14,
89-
// REWARDS address
89+
paymentAddressParameters: {
90+
addressType: Messages.CardanoAddressType.REWARD,
9091
path: "m/1852'/1815'/0'/2/0",
9192
},
9293
nonce,
94+
format: Messages.CardanoCVoteRegistrationFormat.CIP15, // Catalyst voting format
9395
},
9496
});
9597
// Helper Methods

0 commit comments

Comments
 (0)