aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-05-30 08:11:33 +0800
committerJacob Evans <jacob@dekz.net>2018-06-05 08:41:00 +0800
commit4670cc1a5f04d61045a82b4a3bbcf56e009afd56 (patch)
treec66321deb69c78a85f7a5c907fac62cc95eae14d /packages/contracts/test
parent70858603ed37de24ae47978a191b3f188f450182 (diff)
downloaddexon-sol-tools-4670cc1a5f04d61045a82b4a3bbcf56e009afd56.tar
dexon-sol-tools-4670cc1a5f04d61045a82b4a3bbcf56e009afd56.tar.gz
dexon-sol-tools-4670cc1a5f04d61045a82b4a3bbcf56e009afd56.tar.bz2
dexon-sol-tools-4670cc1a5f04d61045a82b4a3bbcf56e009afd56.tar.lz
dexon-sol-tools-4670cc1a5f04d61045a82b4a3bbcf56e009afd56.tar.xz
dexon-sol-tools-4670cc1a5f04d61045a82b4a3bbcf56e009afd56.tar.zst
dexon-sol-tools-4670cc1a5f04d61045a82b4a3bbcf56e009afd56.zip
Add missing EIP191 prefix for EIP712
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/exchange/libs.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts
index 10cb8b34e..b6de4d3b0 100644
--- a/packages/contracts/test/exchange/libs.ts
+++ b/packages/contracts/test/exchange/libs.ts
@@ -10,6 +10,7 @@ import { addressUtils } from '../../src/utils/address_utils';
import { artifacts } from '../../src/utils/artifacts';
import { chaiSetup } from '../../src/utils/chai_setup';
import { constants } from '../../src/utils/constants';
+import { EIP712Utils } from '../../src/utils/eip712_utils';
import { OrderFactory } from '../../src/utils/order_factory';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
@@ -57,13 +58,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 orderSchemaBuffer = orderHashUtils._getOrderSchemaHex();
+ const schemaHashHex = `0x${orderSchemaBuffer.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', () => {