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

[Release/5.2.300] ledger update #3594

Merged
merged 3 commits into from
Aug 1, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
TransactionSigningMode,
TxOutputDestinationType,
TxAuxiliaryDataType,
StakeCredentialParamsType,
CredentialParamsType,
CIP36VoteRegistrationFormat,
TxRequiredSignerType,
DatumType,
Expand Down Expand Up @@ -329,7 +329,7 @@ function formatLedgerWithdrawals(
result.push({
amount: withdrawalAmount.to_str(),
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: addressing.path,
},
});
Expand Down Expand Up @@ -366,7 +366,7 @@ function formatLedgerCertificates(
type: CertificateType.STAKE_REGISTRATION,
params: {
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: getPath(registrationCert.stake_credential()),
},
}
Expand All @@ -379,7 +379,7 @@ function formatLedgerCertificates(
type: CertificateType.STAKE_DEREGISTRATION,
params: {
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: getPath(deregistrationCert.stake_credential()),
},
},
Expand All @@ -392,7 +392,7 @@ function formatLedgerCertificates(
type: CertificateType.STAKE_DELEGATION,
params: {
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: getPath(delegationCert.stake_credential()),
},
poolKeyHashHex: Buffer.from(delegationCert.pool_keyhash().to_bytes()).toString('hex'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CertificateType,
TransactionSigningMode,
TxOutputDestinationType,
StakeCredentialParamsType,
CredentialParamsType,
} from '@cardano-foundation/ledgerjs-hw-app-cardano';
import type { DeviceOwnedAddress, SignTransactionRequest } from '@cardano-foundation/ledgerjs-hw-app-cardano';
import { networks } from '../../lib/storage/database/prepackaged/networks';
Expand Down Expand Up @@ -418,7 +418,7 @@ test('Create Ledger transaction', async () => {
certificates: [{
params: {
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: [
WalletTypePurpose.CIP1852,
CoinTypes.CARDANO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
AddressType,
CertificateType,
TxAuxiliaryDataType,
StakeCredentialParamsType,
CredentialParamsType,
} from '@cardano-foundation/ledgerjs-hw-app-cardano';
import {
pathToString,
Expand Down Expand Up @@ -209,10 +209,11 @@ export default class SendTxHintBlock extends React.Component<Props> {

if (request.cert.type === CertificateType.STAKE_REGISTRATION) {
const { params } = request.cert;
if (request.cert.params.stakeCredential.type !== StakeCredentialParamsType.KEY_PATH) {
if (params.stakeCredential.type !== CredentialParamsType.KEY_PATH) {
throw new Error('unsupported stake credential type');
}
const { keyPath } = request.cert.params.stakeCredential;
// $FLowIgnore
const { keyPath } = params.stakeCredential;
const imgRegister = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-registration.png`);
const imgRegisterConfirm = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-registration-confirm.png`);
const firstStep = request.getAndIncrementStep();
Expand Down Expand Up @@ -245,10 +246,11 @@ export default class SendTxHintBlock extends React.Component<Props> {
}
if (request.cert.type === CertificateType.STAKE_DELEGATION) {
const { params } = request.cert;
if (request.cert.params.stakeCredential.type !== StakeCredentialParamsType.KEY_PATH) {
if (params.stakeCredential.type !== CredentialParamsType.KEY_PATH) {
throw new Error('unsupported stake credential type');
}
const { keyPath } = request.cert.params.stakeCredential;
// $FLowIgnore
const { keyPath } = params.stakeCredential;
const imgDelegatePool = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-delegation-pool.png`);
const imgDelegateConfirm = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-delegation-confirm.png`);
const firstStep = request.getAndIncrementStep();
Expand Down Expand Up @@ -298,10 +300,11 @@ export default class SendTxHintBlock extends React.Component<Props> {
}
if (request.cert.type === CertificateType.STAKE_DEREGISTRATION) {
const { params } = request.cert;
if (request.cert.params.stakeCredential.type !== StakeCredentialParamsType.KEY_PATH) {
if (params.stakeCredential.type !== CredentialParamsType.KEY_PATH) {
throw new Error('unsupported stake credential type');
}
const { keyPath } = request.cert.params.stakeCredential;
// $FLowIgnore
const { keyPath } = params.stakeCredential;
const imgDeregister = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-deregister-key.png`);
const imgDeregisterConfirm = require(`../../../../assets/img/nano-${this.props.deviceCode}/hint-deregister-confirm.png`);
const firstStep = request.getAndIncrementStep();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import React from 'react';
import type { Node } from 'react';
import { observer } from 'mobx-react';
import {
utils,
AddressType,
CertificateType,
TransactionSigningMode,
TxAuxiliaryDataType,
TxOutputDestinationType,
StakeCredentialParamsType,
CredentialParamsType,
CIP36VoteRegistrationFormat,
} from '@cardano-foundation/ledgerjs-hw-app-cardano';

Expand Down Expand Up @@ -374,7 +373,7 @@ export default class TestBlock extends React.Component<Props, State> {
type: CertificateType.STAKE_REGISTRATION,
params: {
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: strToPath("1852'/1815'/0'/2/0"),
},
}
Expand All @@ -383,7 +382,7 @@ export default class TestBlock extends React.Component<Props, State> {
type: CertificateType.STAKE_DELEGATION,
params: {
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: strToPath("1852'/1815'/0'/2/0"),
},
poolKeyHashHex: 'df1750df9b2df285fcfb50f4740657a18ee3af42727d410c37b86207',
Expand All @@ -393,14 +392,14 @@ export default class TestBlock extends React.Component<Props, State> {
type: CertificateType.STAKE_DEREGISTRATION,
params: {
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: strToPath("1852'/1815'/0'/2/0"),
},
},
}],
withdrawals: [{
stakeCredential: {
type: StakeCredentialParamsType.KEY_PATH,
type: CredentialParamsType.KEY_PATH,
keyPath: strToPath("1852'/1815'/0'/2/0"),
},
amount: '1000000',
Expand Down
22 changes: 11 additions & 11 deletions packages/yoroi-extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/yoroi-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoroi",
"version": "5.2.200",
"version": "5.2.300",
"description": "Cardano ADA wallet",
"scripts": {
"dev-mv2": "rimraf dev/ && NODE_OPTIONS=--openssl-legacy-provider babel-node scripts-mv2/build --type=debug --env 'mainnet'",
Expand Down Expand Up @@ -139,7 +139,7 @@
},
"dependencies": {
"@amplitude/analytics-browser": "^2.1.3",
"@cardano-foundation/ledgerjs-hw-app-cardano": "6.0.0",
"@cardano-foundation/ledgerjs-hw-app-cardano": "7.1.3",
"@emotion/react": "^11.4.1",
"@emotion/styled": "^11.3.0",
"@emurgo/cardano-message-signing-browser": "1.0.1",
Expand All @@ -148,7 +148,7 @@
"@emurgo/cip4-js": "1.0.5",
"@emurgo/cross-csl-browser": "4.4.0",
"@emurgo/yoroi-eutxo-txs": "0.0.2-alpha.8",
"@emurgo/yoroi-lib": "0.15.5",
"@emurgo/yoroi-lib": "0.15.7",
"@ledgerhq/hw-transport-u2f": "5.36.0-deprecated",
"@ledgerhq/hw-transport-webauthn": "5.36.0-deprecated",
"@ledgerhq/hw-transport-webhid": "5.51.1",
Expand Down
Loading