Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDW-1211] Update @trezor/connect to v9.0.8 #3127

Merged
merged 11 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Chores

- Updated @trezor/connect to v9.0.8 ([PR 3127](https://github.com/input-output-hk/daedalus/pull/3127))
- Add members of Cardano Wallet team to the "About Daedalus" screen ([PR 3092](https://github.com/input-output-hk/daedalus/pull/3092))
- Removed Chromatic from project ([PR 3126](https://github.com/input-output-hk/daedalus/pull/3126))
- Upgraded Electron to 24.2, and Node.js to 18.× ([PR 3124](https://github.com/input-output-hk/daedalus/pull/3124))
Expand Down
2 changes: 1 addition & 1 deletion installers/common/MacInstaller.hs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
externalYarn :: [FilePath]
externalYarn =
[ "@babel"
, "@noble"
, "@protobufjs"
, "@trezor"
, "agent-base"
Expand Down Expand Up @@ -286,7 +287,6 @@ buildElectronApp darwinConfig@DarwinConfig{dcAppName, dcAppNameApp} installerCon
, "object-is"
, "object-keys"
, "object.values"
, "parse-uri"
, "pdfkit"
, "png-js"
, "protobufjs"
Expand Down
2 changes: 1 addition & 1 deletion nix/x86_64-linux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ in rec {
ln -sv $out/share/daedalus/renderer/assets $out/share/fonts/daedalus

mkdir -pv $out/share/daedalus/node_modules
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/
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/

chmod -R +w $out

Expand Down
2 changes: 1 addition & 1 deletion nix/x86_64-windows.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ in rec {
rm -rf $out/resources/app/{installers,launcher-config.yaml,gulpfile.js,home}

mkdir -pv $out/resources/app/node_modules
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
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

chmod -R +w $out

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"devDependencies": {
"@dump247/storybook-state": "1.6.1",
"@electron/rebuild": "3.2.13",
"@faker-js/faker": "6.0.0",
"@formatjs/cli": "4.8.3",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.3",
Expand Down Expand Up @@ -124,7 +125,6 @@
"electron-devtools-installer": "3.2.0",
"electron-mock-ipc": "0.3.12",
"electron-packager": "17.1.1",
"@electron/rebuild": "3.2.13",
"electron-reloader": "1.2.1",
"eslint": "8.13.0",
"eslint-config-airbnb": "19.0.4",
Expand Down Expand Up @@ -199,7 +199,8 @@
"@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.0",
"@iohk-jormungandr/wallet-js": "0.5.0-pre7",
"@ledgerhq/hw-transport-node-hid": "6.27.15",
"@trezor/connect": "9.0.2",
"@trezor/connect": "9.0.8",
"@trezor/transport": "1.1.12",
"aes-js": "3.1.2",
"bech32": "2.0.0",
"bignumber.js": "9.0.1",
Expand Down
4 changes: 2 additions & 2 deletions source/main/trezor/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export const initTrezorConnect = async () => {
}
};

export const reinitTrezorConnect = () => {
export const reinitTrezorConnect = async () => {
try {
logger.info('[TREZOR-CONNECT] Called TrezorConnect.dispose()');
TrezorConnect.dispose();
await TrezorConnect.dispose();
} catch (error) {
// ignore any TrezorConnect instance disposal errors
logger.info('[TREZOR-CONNECT] Failed to call TrezorConnect.dispose()');
Expand Down
12 changes: 7 additions & 5 deletions source/renderer/app/utils/shelleyTrezor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { utils } from '@cardano-foundation/ledgerjs-hw-app-cardano';
import { Messages } from '@trezor/transport';
import { map } from 'lodash';
import {
derivationPathToString,
Expand Down Expand Up @@ -77,19 +78,20 @@ export type TrezorVotingDataType = {
votingKey: string;
nonce: string;
};

export const prepareTrezorAuxiliaryData = ({
votingKey,
nonce,
}: TrezorVotingDataType) => ({
catalystRegistrationParameters: {
votingPublicKey: votingKey,
cVoteRegistrationParameters: {
marcin-mazurek marked this conversation as resolved.
Show resolved Hide resolved
votePublicKey: votingKey,
stakingPath: "m/1852'/1815'/0'/2/0",
rewardAddressParameters: {
addressType: 14,
// REWARDS address
paymentAddressParameters: {
addressType: Messages.CardanoAddressType.REWARD,
path: "m/1852'/1815'/0'/2/0",
},
nonce,
format: Messages.CardanoCVoteRegistrationFormat.CIP15, // Catalyst voting format
},
});
// Helper Methods
Expand Down
Loading