diff options
author | Jacob Evans <jacob@dekz.net> | 2018-10-02 15:32:28 +0800 |
---|---|---|
committer | Jacob Evans <jacob@dekz.net> | 2018-10-05 10:00:41 +0800 |
commit | 07926ded6ef194969ffe26e3879d6e86a0eb9c50 (patch) | |
tree | 9603fa9942cdf1c364fe794e037013351416fc73 /packages/contracts | |
parent | adcfaa2e80389f69e196b602955cee858a1eb40f (diff) | |
download | dexon-sol-tools-07926ded6ef194969ffe26e3879d6e86a0eb9c50.tar dexon-sol-tools-07926ded6ef194969ffe26e3879d6e86a0eb9c50.tar.gz dexon-sol-tools-07926ded6ef194969ffe26e3879d6e86a0eb9c50.tar.bz2 dexon-sol-tools-07926ded6ef194969ffe26e3879d6e86a0eb9c50.tar.lz dexon-sol-tools-07926ded6ef194969ffe26e3879d6e86a0eb9c50.tar.xz dexon-sol-tools-07926ded6ef194969ffe26e3879d6e86a0eb9c50.tar.zst dexon-sol-tools-07926ded6ef194969ffe26e3879d6e86a0eb9c50.zip |
Introduce Metamask Subprovider.
MM has a number of inconsistencies with other providers when implementing the JSON RPC interface. This subprovider wraps those nuances so they do not leak into the rest of our code
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/test/exchange/signature_validator.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts index 5cc62e777..192ed3ca9 100644 --- a/packages/contracts/test/exchange/signature_validator.ts +++ b/packages/contracts/test/exchange/signature_validator.ts @@ -1,6 +1,6 @@ import { BlockchainLifecycle } from '@0xproject/dev-utils'; import { assetDataUtils, orderHashUtils, signatureUtils } from '@0xproject/order-utils'; -import { RevertReason, SignatureType, SignedOrder, SignerType } from '@0xproject/types'; +import { RevertReason, SignatureType, SignedOrder } from '@0xproject/types'; import * as chai from 'chai'; import { LogWithDecodedArgs } from 'ethereum-types'; import ethUtil = require('ethereumjs-util'); @@ -231,10 +231,7 @@ describe('MixinSignatureValidator', () => { it('should return true when SignatureType=EthSign and signature is valid', async () => { // Create EthSign signature const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder); - const orderHashWithEthSignPrefixHex = signatureUtils.addSignedMessagePrefix( - orderHashHex, - SignerType.Default, - ); + const orderHashWithEthSignPrefixHex = signatureUtils.addSignedMessagePrefix(orderHashHex); const orderHashWithEthSignPrefixBuffer = ethUtil.toBuffer(orderHashWithEthSignPrefixHex); const ecSignature = ethUtil.ecsign(orderHashWithEthSignPrefixBuffer, signerPrivateKey); // Create 0x signature from EthSign signature @@ -257,10 +254,7 @@ describe('MixinSignatureValidator', () => { it('should return false when SignatureType=EthSign and signature is invalid', async () => { // Create EthSign signature const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder); - const orderHashWithEthSignPrefixHex = signatureUtils.addSignedMessagePrefix( - orderHashHex, - SignerType.Default, - ); + const orderHashWithEthSignPrefixHex = signatureUtils.addSignedMessagePrefix(orderHashHex); const orderHashWithEthSignPrefixBuffer = ethUtil.toBuffer(orderHashWithEthSignPrefixHex); const ecSignature = ethUtil.ecsign(orderHashWithEthSignPrefixBuffer, signerPrivateKey); // Create 0x signature from EthSign signature |