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

chore: whitelist all device models #1335

Merged
merged 2 commits into from
Jun 18, 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
5 changes: 0 additions & 5 deletions packages/hardware-ledger/src/LedgerKeyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ const stakeCredentialCert = (cert: Certificate) =>
cert.type === CertificateType.STAKE_REGISTRATION ||
cert.type === CertificateType.STAKE_DEREGISTRATION ||
cert.type === CertificateType.STAKE_DELEGATION;
const isLedgerModelSupported = (deviceModelId: string): deviceModelId is 'nanoS' | 'nanoX' | 'nanoSP' =>
['nanoS', 'nanoX', 'nanoSP'].includes(deviceModelId);

const establishDeviceConnectionMethodName = 'establishDeviceConnection';

Expand Down Expand Up @@ -384,9 +382,6 @@ export class LedgerKeyAgent extends KeyAgentBase {
if (!transport || !transport.deviceModel) {
throw new errors.TransportError('Missing transport');
}
if (!isLedgerModelSupported(transport.deviceModel.id)) {
throw new errors.TransportError(`Ledger device model: "${transport.deviceModel.id}" is not supported`);
}

const newConnection = await LedgerKeyAgent.createDeviceConnection(transport);
this.rememberConnection({
Expand Down
3 changes: 0 additions & 3 deletions packages/hardware-trezor/src/TrezorKeyAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ export class TrezorKeyAgent extends KeyAgentBase {
if (!deviceFeatures.success) {
throw new errors.TransportError('Failed to get device', deviceFeatures.payload);
}
if (deviceFeatures.payload.model !== 'T') {
throw new errors.TransportError(`Trezor device model "${deviceFeatures.payload.model}" is not supported.`);
}
return deviceFeatures.payload;
} catch (error) {
throw transportTypedError(error);
Expand Down
Loading