Migrate all contract-related tooling and tests to accept a chain ID in domain separators.
This commit is contained in:
committed by
Amir Bandeali
parent
92fe720ac3
commit
2d28fde24d
@@ -11,6 +11,8 @@ chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
describe('EIP712 Utils', () => {
|
||||
const CHAIN_ID = 1337;
|
||||
|
||||
describe('createTypedData', () => {
|
||||
it('adds in the EIP712DomainSeparator with default values', () => {
|
||||
const primaryType = 'Test';
|
||||
@@ -18,7 +20,7 @@ describe('EIP712 Utils', () => {
|
||||
primaryType,
|
||||
{ Test: [{ name: 'testValue', type: 'uint256' }] },
|
||||
{ testValue: '1' },
|
||||
{ verifyingContractAddress: constants.NULL_ADDRESS },
|
||||
{ chainId: CHAIN_ID, verifyingContractAddress: constants.NULL_ADDRESS, },
|
||||
);
|
||||
expect(typedData.domain).to.not.be.undefined();
|
||||
expect(typedData.types.EIP712Domain).to.not.be.undefined();
|
||||
@@ -36,7 +38,12 @@ describe('EIP712 Utils', () => {
|
||||
primaryType,
|
||||
{ Test: [{ name: 'testValue', type: 'uint256' }] },
|
||||
{ testValue: '1' },
|
||||
{ name: domainName, version: domainVersion, verifyingContractAddress: constants.NULL_ADDRESS },
|
||||
{
|
||||
name: domainName,
|
||||
version: domainVersion,
|
||||
chainId: CHAIN_ID,
|
||||
verifyingContractAddress: constants.NULL_ADDRESS,
|
||||
},
|
||||
);
|
||||
expect(typedData.domain).to.not.be.undefined();
|
||||
expect(typedData.types.EIP712Domain).to.not.be.undefined();
|
||||
@@ -54,6 +61,7 @@ describe('EIP712 Utils', () => {
|
||||
data: constants.NULL_BYTES,
|
||||
signerAddress: constants.NULL_ADDRESS,
|
||||
verifyingContractAddress: constants.NULL_ADDRESS,
|
||||
chainId: CHAIN_ID,
|
||||
});
|
||||
expect(typedData.primaryType).to.eq(constants.EXCHANGE_ZEROEX_TRANSACTION_SCHEMA.name);
|
||||
expect(typedData.types.EIP712Domain).to.not.be.undefined();
|
||||
|
Reference in New Issue
Block a user