Skip to content

Commit 34bf841

Browse files
fix: classic1s signTypedData bigger data (#602)
1 parent 9d54507 commit 34bf841

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/core/src/api/evm/EVMSignTypedData.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import semver from 'semver';
22
import { get } from 'lodash';
33
import BigNumber from 'bignumber.js';
4-
import { ERRORS, HardwareErrorCode, EDeviceType } from '@onekeyfe/hd-shared';
4+
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
55
import {
66
EthereumTypedDataSignature,
77
EthereumTypedDataStructAck,
@@ -337,9 +337,15 @@ export default class EVMSignTypedData extends BaseMethod<EVMSignTypedDataParams>
337337
let biggerLimit = 1024; // 1k
338338

339339
const currentVersion = getDeviceFirmwareVersion(this.device.features).join('.');
340+
const currentDeviceType = getDeviceType(this.device.features);
340341
const supportBiggerDataVersion = '4.4.0';
341342

342-
if (semver.gte(currentVersion, supportBiggerDataVersion)) {
343+
const supportBiggerData =
344+
DeviceModelToTypes.model_classic1s.includes(currentDeviceType) ||
345+
(DeviceModelToTypes.model_touch.includes(currentDeviceType) &&
346+
semver.gte(currentVersion, supportBiggerDataVersion));
347+
348+
if (supportBiggerData) {
343349
biggerLimit = 1536; // 1.5k
344350
}
345351

0 commit comments

Comments
 (0)