Update jsdoc

This commit is contained in:
Jacob Evans
2018-08-03 11:35:03 +08:00
parent 45e9fbe8f9
commit 9dd6ba7825
2 changed files with 5 additions and 5 deletions

View File

@@ -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
*/

View File

@@ -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';