aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-06-20 08:54:51 +0800
committerGitHub <noreply@github.com>2018-06-20 08:54:51 +0800
commit096eaa20d785baee07b06b3f0848797e470fbda0 (patch)
tree05b6186897648717b97d630ffc9da0688e64544c /packages/contracts/test
parentbe17308e507019e7c04a8a32e9aecf667de7aa2c (diff)
parent512bd84cc2478267eb359f340cdde8a110c61572 (diff)
downloaddexon-sol-tools-096eaa20d785baee07b06b3f0848797e470fbda0.tar
dexon-sol-tools-096eaa20d785baee07b06b3f0848797e470fbda0.tar.gz
dexon-sol-tools-096eaa20d785baee07b06b3f0848797e470fbda0.tar.bz2
dexon-sol-tools-096eaa20d785baee07b06b3f0848797e470fbda0.tar.lz
dexon-sol-tools-096eaa20d785baee07b06b3f0848797e470fbda0.tar.xz
dexon-sol-tools-096eaa20d785baee07b06b3f0848797e470fbda0.tar.zst
dexon-sol-tools-096eaa20d785baee07b06b3f0848797e470fbda0.zip
Merge pull request #637 from 0xProject/bug/contracts/eip712-191-prefix
Add missing EIP191 prefix for EIP712 and Execute Transaction
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/exchange/libs.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts
index eff05981d..c08001198 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 { assetProxyUtils, orderHashUtils } from '@0xproject/order-utils';
+import { assetProxyUtils, EIP712Utils, orderHashUtils } from '@0xproject/order-utils';
import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
@@ -56,13 +56,17 @@ describe('Exchange libs', () => {
describe('getOrderSchema', () => {
it('should output the correct order schema hash', async () => {
const orderSchema = await libs.getOrderSchemaHash.callAsync();
- expect(orderHashUtils._getOrderSchemaHex()).to.be.equal(orderSchema);
+ 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();
- expect(orderHashUtils._getDomainSeparatorSchemaHex()).to.be.equal(domainSeparatorSchema);
+ const domainSchemaBuffer = EIP712Utils._getDomainSeparatorSchemaBuffer();
+ const schemaHashHex = `0x${domainSchemaBuffer.toString('hex')}`;
+ expect(schemaHashHex).to.be.equal(domainSeparatorSchema);
});
});
describe('getOrderHash', () => {