From 9dd6ba78250d8bbde1d5023ce4ac4254884f4115 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Fri, 3 Aug 2018 11:35:03 +0800 Subject: Update jsdoc --- packages/order-utils/src/signature_utils.ts | 9 ++++----- packages/order-utils/test/signature_utils_test.ts | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages') diff --git a/packages/order-utils/src/signature_utils.ts b/packages/order-utils/src/signature_utils.ts index 3237259c9..07644ebe2 100644 --- a/packages/order-utils/src/signature_utils.ts +++ b/packages/order-utils/src/signature_utils.ts @@ -196,9 +196,8 @@ export function isValidECSignature(data: string, signature: ECSignature, signerA * @param orderHash Hex encoded orderHash to sign. * @param signerAddress The hex encoded Ethereum address you wish to sign it with. This address * must be available via the Provider supplied to 0x.js. - * @param messagePrefixOpts Different signers add/require different prefixes be prepended to the message being signed. - * Since we cannot know ahead of time which signer you are using, you must supply both a prefixType and - * whether it must be added before calling `eth_sign` (some signers add it themselves) + * @param signerProviderType Different signers add/require different prefixes to be prepended to the message being signed. + * Since we cannot know ahead of time which signer you are using, you must supply a SignerProviderType. * @return A hex encoded string containing the Elliptic curve signature generated by signing the orderHash and the Signature Type. */ export async function ecSignOrderHashAsync( @@ -251,7 +250,7 @@ export async function ecSignOrderHashAsync( /** * Combines ECSignature with V,R,S and the relevant signature type for use in 0x protocol * @param ecSignature The ECSignature of the signed data - * @param messagePrefixType The MessagePrefixType of the signed data + * @param signerProviderType The SignerProviderType of the signed data * @return Hex encoded string of signature with Signature Type */ export function convertECSignatureToSignatureHex( @@ -283,7 +282,7 @@ export function convertToSignatureWithType(signature: string, type: SignatureTyp /** * Adds the relevant prefix to the message being signed. * @param message Message to sign - * @param messagePrefixType The type of message prefix to add. Different signers expect + * @param signerProviderType The type of message prefix to add for a given SignerProviderType. Different signers expect * specific message prefixes. * @return Prefixed message */ diff --git a/packages/order-utils/test/signature_utils_test.ts b/packages/order-utils/test/signature_utils_test.ts index 179905b18..de76e82ac 100644 --- a/packages/order-utils/test/signature_utils_test.ts +++ b/packages/order-utils/test/signature_utils_test.ts @@ -192,6 +192,7 @@ describe('Signature utils', () => { expect(ecSignature).to.equal(expectedSignature); }); // Note this is due to a bug in Metamask where it does not prefix before signing, this is a known issue and is to be fixed in the future + // Source: https://github.com/MetaMask/metamask-extension/commit/a9d36860bec424dcee8db043d3e7da6a5ff5672e it('should receive a payload modified with a prefix when Metamask is SignerProviderType', async () => { const orderHash = '0x34decbedc118904df65f379a175bb39ca18209d6ce41d5ed549d54e6e0a95004'; const orderHashPrefixed = '0xae70f31d26096291aa681b26cb7574563956221d0b4213631e1ef9df675d4cba'; -- cgit v1.2.3