Add codesize tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { chaiSetup, getCodesizeFromArtifact } from '@0x/contracts-test-utils';
|
||||
import { chaiSetup, constants, getCodesizeFromArtifact } from '@0x/contracts-test-utils';
|
||||
import * as chai from 'chai';
|
||||
|
||||
chaiSetup.configure();
|
||||
@@ -7,12 +7,10 @@ const expect = chai.expect;
|
||||
import { artifacts } from '../src';
|
||||
|
||||
describe('Contract Size Checks', () => {
|
||||
const MAX_CODE_SIZE = 24576;
|
||||
|
||||
describe('Exchange', () => {
|
||||
it('should have a codesize less than the maximum', async () => {
|
||||
const actualSize = getCodesizeFromArtifact(artifacts.Exchange);
|
||||
expect(actualSize).to.be.lt(MAX_CODE_SIZE);
|
||||
expect(actualSize).to.be.lt(constants.MAX_CODE_SIZE);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
22
contracts/staking/test/codesize.ts
Normal file
22
contracts/staking/test/codesize.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { chaiSetup, constants, getCodesizeFromArtifact } from '@0x/contracts-test-utils';
|
||||
import * as chai from 'chai';
|
||||
|
||||
chaiSetup.configure();
|
||||
const expect = chai.expect;
|
||||
|
||||
import { artifacts } from '../src';
|
||||
|
||||
describe.skip('Contract Size Checks', () => {
|
||||
describe('Staking', () => {
|
||||
it('should have a codesize less than the maximum', async () => {
|
||||
const actualSize = getCodesizeFromArtifact(artifacts.Staking);
|
||||
expect(actualSize).to.be.lt(constants.MAX_CODE_SIZE);
|
||||
});
|
||||
});
|
||||
describe('StakingProxy', () => {
|
||||
it('should have a codesize less than the maximum', async () => {
|
||||
const actualSize = getCodesizeFromArtifact(artifacts.StakingProxy);
|
||||
expect(actualSize).to.be.lt(constants.MAX_CODE_SIZE);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -83,4 +83,5 @@ export const constants = {
|
||||
NUM_TEST_ACCOUNTS: 20,
|
||||
PPM_DENOMINATOR: 1e6,
|
||||
PPM_100_PERCENT: 1e6,
|
||||
MAX_CODE_SIZE: 24576,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user