aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-08-25 05:13:54 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-08-25 05:40:00 +0800
commit0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f (patch)
treebe76b4195f3cdb3a3d22e3bd4a1d62c0c1a2721a
parenta27112cbefbe9d9039d265cfc92c1022b0f9d103 (diff)
downloaddexon-sol-tools-0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f.tar
dexon-sol-tools-0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f.tar.gz
dexon-sol-tools-0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f.tar.bz2
dexon-sol-tools-0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f.tar.lz
dexon-sol-tools-0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f.tar.xz
dexon-sol-tools-0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f.tar.zst
dexon-sol-tools-0629a7d1434e9a17ba98be4de66fd4a7fa7ff16f.zip
Remove remaining Trezor references
-rw-r--r--packages/order-utils/src/signature_utils.ts13
-rw-r--r--packages/order-utils/test/signature_utils_test.ts9
-rw-r--r--packages/types/src/index.ts3
3 files changed, 2 insertions, 23 deletions
diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts
index e5478d4d6..c0c9e71a7 100644
--- a/packages/order-utils/src/signature_utils.ts
+++ b/packages/order-utils/src/signature_utils.ts
@@ -291,7 +291,7 @@ export const signatureUtils = {
/**
* Combines the signature proof and the Signature Type.
* @param signature The hex encoded signature proof
- * @param signatureType The signature type, i.e EthSign, Trezor, Wallet etc.
+ * @param signatureType The signature type, i.e EthSign, Wallet etc.
* @return Hex encoded string of signature proof with Signature Type
*/
convertToSignatureWithType(signature: string, signatureType: SignatureType): string {
@@ -318,12 +318,6 @@ export const signatureUtils = {
const prefixedMsgHex = ethUtil.bufferToHex(prefixedMsgBuff);
return prefixedMsgHex;
}
- case SignerType.Trezor: {
- const msgBuff = ethUtil.toBuffer(message);
- const prefixedMsgBuff = hashTrezorPersonalMessage(msgBuff);
- const prefixedMsgHex = ethUtil.bufferToHex(prefixedMsgBuff);
- return prefixedMsgHex;
- }
default:
throw new Error(`Unrecognized SignerType: ${signerType}`);
}
@@ -346,11 +340,6 @@ export const signatureUtils = {
},
};
-function hashTrezorPersonalMessage(message: Buffer): Buffer {
- const prefix = ethUtil.toBuffer(`\x19Ethereum Signed Message:\n${message.byteLength}`);
- return ethUtil.sha3(Buffer.concat([prefix, message]));
-}
-
function parseValidatorSignature(signature: string): ValidatorSignature {
assert.isOneOfExpectedSignatureTypes(signature, [SignatureType.Validator]);
// tslint:disable:custom-no-magic-numbers
diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts
index 0e7831b41..2ca1109a1 100644
--- a/packages/order-utils/test/signature_utils_test.ts
+++ b/packages/order-utils/test/signature_utils_test.ts
@@ -256,15 +256,6 @@ describe('Signature utils', () => {
r: '0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d64393',
s: '0x46b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf2',
};
- it('should concatenate v,r,s and append the Trezor signature type', async () => {
- const expectedSignatureWithSignatureType =
- '0x1baca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf208';
- const signatureWithSignatureType = signatureUtils.convertECSignatureToSignatureHex(
- ecSignature,
- SignerType.Trezor,
- );
- expect(signatureWithSignatureType).to.equal(expectedSignatureWithSignatureType);
- });
it('should concatenate v,r,s and append the EthSign signature type when SignerType is Default', async () => {
const expectedSignatureWithSignatureType =
'0x1baca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf203';
diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
index 5261ddfe2..4375fc631 100644
--- a/packages/types/src/index.ts
+++ b/packages/types/src/index.ts
@@ -140,14 +140,13 @@ export enum SignatureType {
}
/**
- * The type of the Signer implementation. Some signer implementations use different message prefixes (e.g Trezor) or implement different
+ * The type of the Signer implementation. Some signer implementations use different message prefixes or implement different
* eth_sign behaviour (e.g Metamask). Default assumes a spec compliant `eth_sign`.
*/
export enum SignerType {
Default = 'DEFAULT',
Ledger = 'LEDGER',
Metamask = 'METAMASK',
- Trezor = 'TREZOR',
}
export enum AssetProxyId {