Skip to content

Commit 32012e0

Browse files
authored
Merge branch 'Emurgo:develop' into develop
2 parents 97cf759 + e34a4e8 commit 32012e0

File tree

6 files changed

+10
-220
lines changed

6 files changed

+10
-220
lines changed

packages/yoroi-extension/app/components/wallet/add/option-dialog/WalletEraOptionDialog.js

Lines changed: 0 additions & 76 deletions
This file was deleted.

packages/yoroi-extension/app/containers/wallet/AddWalletPage.js

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import WalletRestoreOptionDialogContainer from './dialogs/WalletRestoreOptionDia
2727
import WalletRestoreDialogContainer from './dialogs/WalletRestoreDialogContainer';
2828
import type { GeneratedData as WalletRestoreDialogContainerData } from './dialogs/WalletRestoreDialogContainer';
2929
import WalletRestoreOptionDialog from '../../components/wallet/add/option-dialog/WalletRestoreOptionDialog';
30-
import WalletRestoreDialog from '../../components/wallet/WalletRestoreDialog';
3130

3231
import WalletConnectHWOptionDialogContainer from './dialogs/WalletConnectHWOptionDialogContainer';
3332
import WalletConnectHWOptionDialog from '../../components/wallet/add/option-dialog/WalletConnectHWOptionDialog';
@@ -36,7 +35,6 @@ import type { GeneratedData as WalletTrezorConnectDialogContainerData } from './
3635
import WalletLedgerConnectDialogContainer from './dialogs/WalletLedgerConnectDialogContainer';
3736
import type { GeneratedData as WalletLedgerConnectDialogContainerData } from './dialogs/WalletLedgerConnectDialogContainer';
3837

39-
import WalletEraOptionDialogContainer from './dialogs/WalletEraOptionDialogContainer';
4038
import WalletPaperDialog from '../../components/wallet/WalletPaperDialog';
4139
import WalletPaperDialogContainer from './dialogs/WalletPaperDialogContainer';
4240
import type { GeneratedData as WalletPaperDialogContainerData } from './dialogs/WalletPaperDialogContainer';
@@ -54,10 +52,7 @@ import type { $npm$ReactIntl$IntlFormat } from 'react-intl';
5452
import { getApiForNetwork, ApiOptions } from '../../api/common/utils';
5553
import { PublicDeriver } from '../../api/ada/lib/storage/models/PublicDeriver/index';
5654
import type { NetworkRow } from '../../api/ada/lib/storage/database/primitives/tables';
57-
import {
58-
networks,
59-
isCardanoHaskell,
60-
} from '../../api/ada/lib/storage/database/prepackaged/networks';
55+
import { networks } from '../../api/ada/lib/storage/database/prepackaged/networks';
6156
import { withLayout } from '../../styles/context/layout';
6257
import type { LayoutComponentMap } from '../../styles/context/layout';
6358
import AddWalletPageRevamp from './AddWalletPageRevamp';
@@ -183,19 +178,14 @@ class AddWalletPage extends Component<AllProps> {
183178
<WalletRestoreOptionDialogContainer
184179
onClose={this.onClose}
185180
onRestore15={() => {
186-
if (isCardanoHaskell(selectedNetwork)) {
187-
return actions.dialogs.push.trigger({
188-
dialog: WalletEraOptionDialogContainer,
189-
});
190-
}
191181
return actions.dialogs.push.trigger({
192-
dialog: WalletRestoreDialog,
193-
params: { restoreType: { type: 'bip44', extra: undefined, length: 15 } },
182+
dialog: WalletRestoreDialogContainer,
183+
params: { restoreType: { type: 'cip1852', extra: undefined, length: 15 } },
194184
});
195185
}}
196186
onRestore24={() => {
197187
actions.dialogs.push.trigger({
198-
dialog: WalletRestoreDialog,
188+
dialog: WalletRestoreDialogContainer,
199189
params: { restoreType: { type: 'cip1852', extra: undefined, length: 24 } },
200190
});
201191
}}
@@ -205,40 +195,13 @@ class AddWalletPage extends Component<AllProps> {
205195
? undefined
206196
: () =>
207197
actions.dialogs.push.trigger({
208-
dialog: WalletRestoreDialog,
198+
dialog: WalletRestoreDialogContainer,
209199
params: { restoreType: { type: 'bip44', extra: 'paper', length: 21 } },
210200
})
211201
}
212202
/>
213203
);
214-
} else if (uiDialogs.isOpen(WalletEraOptionDialogContainer)) {
215-
if (selectedNetwork === undefined) {
216-
throw new Error(`${nameof(AddWalletPage)} no API selected`);
217-
}
218-
const hardware = uiDialogs.getParam<'trezor' | 'ledger'>('hardware');
219-
const onEra = (era: 'bip44' | 'cip1852') => {
220-
if (hardware == null) {
221-
return actions.dialogs.push.trigger({
222-
dialog: WalletRestoreDialog,
223-
params: { restoreType: { type: era, extra: undefined, length: 15 } },
224-
});
225-
}
226-
if (hardware === 'ledger') {
227-
openLedgerConnectDialog(era);
228-
}
229-
if (hardware === 'trezor') {
230-
openTrezorConnectDialog(era);
231-
}
232-
};
233-
activeDialog = (
234-
<WalletEraOptionDialogContainer
235-
onClose={this.onClose}
236-
onByron={() => onEra('bip44')}
237-
onShelley={() => onEra('cip1852')}
238-
onBack={() => actions.dialogs.pop.trigger()}
239-
/>
240-
);
241-
} else if (uiDialogs.isOpen(WalletRestoreDialog)) {
204+
} else if (uiDialogs.isOpen(WalletRestoreDialogContainer)) {
242205
const mode = uiDialogs.getParam<RestoreModeType>('restoreType');
243206
if (mode == null)
244207
throw new Error(`${nameof(AddWalletPage)} no mode for restoration selected`);
@@ -254,18 +217,8 @@ class AddWalletPage extends Component<AllProps> {
254217
activeDialog = (
255218
<WalletConnectHWOptionDialogContainer
256219
onClose={this.onClose}
257-
onTrezor={() =>
258-
actions.dialogs.push.trigger({
259-
dialog: WalletEraOptionDialogContainer,
260-
params: { hardware: 'trezor' },
261-
})
262-
}
263-
onLedger={() =>
264-
actions.dialogs.push.trigger({
265-
dialog: WalletEraOptionDialogContainer,
266-
params: { hardware: 'ledger' },
267-
})
268-
}
220+
onTrezor={() => openTrezorConnectDialog('cip1852')}
221+
onLedger={() => openLedgerConnectDialog('cip1852')}
269222
/>
270223
);
271224
} else if (uiDialogs.isOpen(WalletTrezorConnectDialogContainer)) {

packages/yoroi-extension/app/containers/wallet/AddWalletPage.stories.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import WalletRestoreOptionDialog from '../../components/wallet/add/option-dialog
3535
import WalletConnectHWOptionDialog from '../../components/wallet/add/option-dialog/WalletConnectHWOptionDialog';
3636
import WalletTrezorConnectDialogContainer from './dialogs/WalletTrezorConnectDialogContainer';
3737
import WalletLedgerConnectDialogContainer from './dialogs/WalletLedgerConnectDialogContainer';
38-
import WalletEraOptionDialogContainer from './dialogs/WalletEraOptionDialogContainer';
3938
import { getPaperWalletIntro } from '../../stores/toplevel/ProfileStore';
4039
import WalletPaperDialog from '../../components/wallet/WalletPaperDialog';
4140
import UserPasswordDialog from '../../components/wallet/add/paper-wallets/UserPasswordDialog';
@@ -642,19 +641,6 @@ export const ErgoRestoreOptions = (): Node => {
642641
);
643642
};
644643

645-
export const CardanoEraSelect = (): Node => {
646-
return (
647-
<AddWalletPage
648-
generated={defaultProps(
649-
Object.freeze({
650-
selectedNetwork: networks.CardanoMainnet,
651-
openDialog: WalletEraOptionDialogContainer,
652-
})
653-
)}
654-
/>
655-
);
656-
};
657-
658644
export const RestoreWalletStart = (): Node => {
659645
const modeOptions: {| [key: string]: RestoreModeType |} = {
660646
SHELLEY15: { type: 'cip1852', extra: undefined, length: 15 },

packages/yoroi-extension/app/containers/wallet/dialogs/WalletEraOptionDialogContainer.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

packages/yoroi-extension/app/i18n/locales/en-US.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,6 @@
449449
"wallet.add.optionDialog.restore.normalWallet.title": "Enter a {length}-word recovery phrase",
450450
"wallet.add.optionDialog.restore.paperWallet.description": "If you have generated a Yoroi paper wallet (which is usually printed and kept offline), you can choose this option to import the funds from your Yoroi paper wallet.",
451451
"wallet.add.optionDialog.restore.paperWallet.title": "Paper Wallet",
452-
"wallet.add.optionDialog.walletEra.byronEra.description": "Wallets created before July 29th, 2020 are Byron-era wallets and cannot delegate.",
453-
"wallet.add.optionDialog.walletEra.byronEra.title": "Byron-era (read-only) wallet",
454-
"wallet.add.optionDialog.walletEra.dialogTitle": "Choose era",
455-
"wallet.add.optionDialog.walletEra.standard.description": "Standard modern wallets support delegation to stake pools.",
456-
"wallet.add.optionDialog.walletEra.standard.title": "Standard wallet",
457452
"wallet.add.page.create.title": "Create wallet",
458453
"wallet.add.page.create.tooltip": "Generate a new 15-word recovery phrase<br/>and create a Yoroi wallet.",
459454
"wallet.add.page.daedalusTransfer.title": "Transfer funds from a Daedalus wallet to Yoroi",
@@ -787,11 +782,9 @@
787782
"wallet.restore.dialog.title.verify.label": "Verify Yoroi wallet",
788783
"wallet.restore.dialog.title.verify.paper.label": "Verify Yoroi Paper wallet",
789784
"wallet.restore.dialog.upgrade.noop": "Your wallet did not need to be upgraded",
790-
"wallet.restore.dialog.verify.accountId.byron.label": "Byron account checksum:",
791785
"wallet.restore.dialog.verify.accountId.label": "Your Wallet Account checksum:",
792786
"wallet.restore.dialog.verify.accountId.shelley.label": "Shelley account checksum:",
793787
"wallet.restore.dialog.verify.addressesLabel": "Your Wallet address[es]:",
794-
"wallet.restore.dialog.verify.byron.addressesLabel": "Byron Wallet address[es]:",
795788
"wallet.restore.dialog.verify.intro.line1": "Be careful about wallet restoration:",
796789
"wallet.restore.dialog.verify.intro.line2": "Make sure account checksum and icon match what you remember.",
797790
"wallet.restore.dialog.verify.intro.line3": "Make sure addresses match what you remember.",
@@ -1057,4 +1050,4 @@
10571050
"yoroiTransfer.waiting.progressInfo.checkingAddresses": "Checking addresses funds",
10581051
"yoroiTransfer.waiting.progressInfo.restoringAddresses": "Fetching addresses",
10591052
"yoroiTransfer.waiting.title.label": "Wallet is being restored"
1060-
}
1053+
}

packages/yoroi-extension/app/stores/toplevel/WalletRestoreStore.js

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type {
99
} from '../../actions/common/wallet-restore-actions';
1010
import type { PlateResponse } from '../../api/common/lib/crypto/plate';
1111
import { unscramblePaperAdaMnemonic } from '../../api/ada/lib/cardanoCrypto/paperWallet';
12-
import { generateByronPlate, generateShelleyPlate } from '../../api/ada/lib/cardanoCrypto/plate';
12+
import { generateShelleyPlate } from '../../api/ada/lib/cardanoCrypto/plate';
1313
import { generateErgoPlate } from '../../api/ergo/lib/crypto/plate';
1414
import { HARD_DERIVATION_START } from '../../config/numbersConfig';
1515
import { RustModule } from '../../api/ada/lib/cardanoCrypto/rustLoader';
@@ -36,10 +36,6 @@ const messages = defineMessages({
3636
id: 'wallet.restore.dialog.verify.accountId.label',
3737
defaultMessage: '!!!Your Wallet Account checksum:',
3838
},
39-
walletRestoreVerifyByronAccountIdLabel: {
40-
id: 'wallet.restore.dialog.verify.accountId.byron.label',
41-
defaultMessage: '!!!Byron account checksum:',
42-
},
4339
walletRestoreVerifyShelleyAccountIdLabel: {
4440
id: 'wallet.restore.dialog.verify.accountId.shelley.label',
4541
defaultMessage: '!!!Shelley account checksum:',
@@ -48,10 +44,6 @@ const messages = defineMessages({
4844
id: 'wallet.restore.dialog.verify.addressesLabel',
4945
defaultMessage: '!!!Your Wallet address[es]:',
5046
},
51-
walletRestoreVerifyByronAddressesLabel: {
52-
id: 'wallet.restore.dialog.verify.byron.addressesLabel',
53-
defaultMessage: '!!!Byron Wallet address[es]:',
54-
},
5547
walletRestoreVerifyShelleyAddressesLabel: {
5648
id: 'wallet.restore.dialog.verify.shelley.addressesLabel',
5749
defaultMessage: '!!!Shelley Wallet address[es]:',
@@ -237,19 +229,6 @@ export function generatePlates(
237229
: generateAdaWalletRootKey(recoveryPhrase);
238230
};
239231

240-
const shouldShowByronPlate = (() => {
241-
if (
242-
// generically show byron checksum if length is 15
243-
// since 15-word wallets were supported in Byron
244-
(isCardanoHaskell(network) && (mode.length === 15 || mode.extra === 'paper')) ||
245-
// only show HW byron checksums if using bip44
246-
(mode.type === 'bip44' && (mode.extra === 'trezor' || mode.extra === 'ledger'))
247-
) {
248-
return true;
249-
}
250-
return false;
251-
})();
252-
253232
const shouldShowShelleyPlate = (() => {
254233
return isCardanoHaskell(network) && mode.type === 'cip1852';
255234
})();
@@ -267,24 +246,6 @@ export function generatePlates(
267246
addressMessage: messages.walletRestoreVerifyShelleyAddressesLabel,
268247
});
269248
}
270-
if (shouldShowByronPlate) {
271-
const byronPlate = generateByronPlate(
272-
getCardanoKey(),
273-
accountIndex - HARD_DERIVATION_START,
274-
addressCount,
275-
(() => {
276-
if (network.BaseConfig[0].ByronNetworkId != null) {
277-
return network.BaseConfig[0].ByronNetworkId;
278-
}
279-
throw new Error(`${nameof(generatePlates)} missing Byron network id`);
280-
})()
281-
);
282-
plates.push({
283-
...byronPlate,
284-
checksumTitle: messages.walletRestoreVerifyAccountIdLabel,
285-
addressMessage: messages.walletRestoreVerifyAddressesLabel,
286-
});
287-
}
288249

289250
if (isErgo(network)) {
290251
const rootKey = generateErgoWalletRootKey(recoveryPhrase);

0 commit comments

Comments
 (0)