aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/subproviders/src/subproviders/ledger.ts7
-rw-r--r--packages/subproviders/src/types.ts1
2 files changed, 3 insertions, 5 deletions
diff --git a/packages/subproviders/src/subproviders/ledger.ts b/packages/subproviders/src/subproviders/ledger.ts
index ccc94d76f..eba1a48a4 100644
--- a/packages/subproviders/src/subproviders/ledger.ts
+++ b/packages/subproviders/src/subproviders/ledger.ts
@@ -1,6 +1,7 @@
+import {assert} from '@0xproject/assert';
import promisify = require('es6-promisify');
import {isAddress} from 'ethereum-address';
-import * as EthereumTx from 'ethereumjs-tx';
+import EthereumTx from 'ethereumjs-tx';
import ethUtil = require('ethereumjs-util');
import * as ledger from 'ledgerco';
import * as _ from 'lodash';
@@ -53,9 +54,7 @@ export class LedgerSubprovider extends Subprovider {
if (_.isUndefined(msgParams.data)) {
throw new Error(LedgerSubproviderErrors.DataMissingForSignPersonalMessage);
}
- if (!LedgerSubprovider.isValidHex(msgParams.data)) {
- throw new Error(LedgerSubproviderErrors.DataNotValidHexForSignPersonalMessage);
- }
+ assert.isHexString('data', msgParams.data);
}
private static validateSender(sender: string) {
if (_.isUndefined(sender) || !isAddress(sender)) {
diff --git a/packages/subproviders/src/types.ts b/packages/subproviders/src/types.ts
index 43ee32870..9dacc91b5 100644
--- a/packages/subproviders/src/types.ts
+++ b/packages/subproviders/src/types.ts
@@ -107,7 +107,6 @@ export enum LedgerSubproviderErrors {
TooOldLedgerFirmware = 'TOO_OLD_LEDGER_FIRMWARE',
FromAddressMissingOrInvalid = 'FROM_ADDRESS_MISSING_OR_INVALID',
DataMissingForSignPersonalMessage = 'DATA_MISSING_FOR_SIGN_PERSONAL_MESSAGE',
- DataNotValidHexForSignPersonalMessage = 'DATA_NOT_VALID_HEX_FOR_SIGN_PERSONAL_MESSAGE',
SenderInvalidOrNotSupplied = 'SENDER_INVALID_OR_NOT_SUPPLIED',
MultipleOpenConnectionsDisallowed = 'MULTIPLE_OPEN_CONNECTIONS_DISALLOWED',
}