aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/exchange
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-10-11 20:23:45 +0800
committerFabio Berger <me@fabioberger.com>2018-10-11 20:23:45 +0800
commit1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4 (patch)
tree48ef8716485c1b961b2494071f5a64f60ff42f29 /packages/contracts/test/exchange
parent6c9f7839c3948e60f2987f474bb2ad6457588fa3 (diff)
parent8941b6cee5b56fab6d3b89ac8a899f21d5c86350 (diff)
downloaddexon-sol-tools-1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4.tar
dexon-sol-tools-1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4.tar.gz
dexon-sol-tools-1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4.tar.bz2
dexon-sol-tools-1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4.tar.lz
dexon-sol-tools-1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4.tar.xz
dexon-sol-tools-1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4.tar.zst
dexon-sol-tools-1cfcc82ea9869e14c1a1b78e1376c89fdbeb91f4.zip
Merge branch 'development' into dev-section-redesign
* development: (62 commits) Fix linter error Upgrade ethereum-types Lint and update deps Be more explicit with falsiness Add type to cssRuleIfExists Fix issue where we throw if non-numeric characters are used in input Upgrade to more recent types, fix yarn.lock [fix]: [testnet-faucet] Exit 1 on build fail Explains tools we want them to use Add note about button Add dev-tools-pages bundles to gitignore Improve README Fix button and center Increase max bundle size for instant Add stuff Initial project scaffolding Change tslint config to remove conflicts with prettier fix: [testnet-faucet] Signing of orders Update the CHANGELOG Add comments for expiryBuffer ...
Diffstat (limited to 'packages/contracts/test/exchange')
-rw-r--r--packages/contracts/test/exchange/libs.ts18
-rw-r--r--packages/contracts/test/exchange/signature_validator.ts12
2 files changed, 4 insertions, 26 deletions
diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts
index 37234489e..049b7f37a 100644
--- a/packages/contracts/test/exchange/libs.ts
+++ b/packages/contracts/test/exchange/libs.ts
@@ -1,5 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { assetDataUtils, eip712Utils, orderHashUtils } from '@0xproject/order-utils';
+import { assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
@@ -126,22 +126,6 @@ describe('Exchange libs', () => {
});
describe('LibOrder', () => {
- describe('getOrderSchema', () => {
- it('should output the correct order schema hash', async () => {
- const orderSchema = await libs.getOrderSchemaHash.callAsync();
- const schemaHashBuffer = orderHashUtils._getOrderSchemaBuffer();
- const schemaHashHex = `0x${schemaHashBuffer.toString('hex')}`;
- expect(schemaHashHex).to.be.equal(orderSchema);
- });
- });
- describe('getDomainSeparatorSchema', () => {
- it('should output the correct domain separator schema hash', async () => {
- const domainSeparatorSchema = await libs.getDomainSeparatorSchemaHash.callAsync();
- const domainSchemaBuffer = eip712Utils._getDomainSeparatorSchemaBuffer();
- const schemaHashHex = `0x${domainSchemaBuffer.toString('hex')}`;
- expect(schemaHashHex).to.be.equal(domainSeparatorSchema);
- });
- });
describe('getOrderHash', () => {
it('should output the correct orderHash', async () => {
signedOrder = await orderFactory.newSignedOrderAsync();
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