Implement new artifacts format
This commit is contained in:
@@ -18,9 +18,7 @@ describe('#Compiler', function() {
|
||||
const compilerOpts: CompilerOptions = {
|
||||
artifactsDir,
|
||||
contractsDir,
|
||||
networkId: constants.networkId,
|
||||
optimizerEnabled: constants.optimizerEnabled,
|
||||
specifiedContracts: new Set(constants.specifiedContracts),
|
||||
contracts: constants.contracts,
|
||||
};
|
||||
const compiler = new Compiler(compilerOpts);
|
||||
beforeEach((done: DoneCallback) => {
|
||||
@@ -38,9 +36,8 @@ describe('#Compiler', function() {
|
||||
};
|
||||
const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts);
|
||||
const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString);
|
||||
const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId];
|
||||
// The last 43 bytes of the binaries are metadata which may not be equivalent
|
||||
const unlinkedBinaryWithoutMetadata = exchangeContractData.bytecode.slice(0, -86);
|
||||
const unlinkedBinaryWithoutMetadata = exchangeArtifact.compilerOutput.evm.bytecode.object.slice(0, -86);
|
||||
const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -86);
|
||||
expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata);
|
||||
});
|
||||
|
||||
@@ -19,9 +19,7 @@ describe('#Deployer', () => {
|
||||
const compilerOpts: CompilerOptions = {
|
||||
artifactsDir,
|
||||
contractsDir,
|
||||
networkId: constants.networkId,
|
||||
optimizerEnabled: constants.optimizerEnabled,
|
||||
specifiedContracts: new Set(constants.specifiedContracts),
|
||||
contracts: constants.contracts,
|
||||
};
|
||||
const compiler = new Compiler(compilerOpts);
|
||||
const deployerOpts = {
|
||||
@@ -55,8 +53,7 @@ describe('#Deployer', () => {
|
||||
const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId];
|
||||
const exchangeAddress = exchangeContractInstance.address;
|
||||
expect(exchangeAddress).to.not.equal(undefined);
|
||||
expect(exchangeContractData.address).to.equal(undefined);
|
||||
expect(exchangeContractData.constructor_args).to.equal(undefined);
|
||||
expect(exchangeContractData).to.equal(undefined);
|
||||
});
|
||||
});
|
||||
describe('#deployAndSaveAsync', () => {
|
||||
@@ -71,7 +68,7 @@ describe('#Deployer', () => {
|
||||
const exchangeContractData: ContractNetworkData = exchangeArtifact.networks[constants.networkId];
|
||||
const exchangeAddress = exchangeContractInstance.address;
|
||||
expect(exchangeAddress).to.be.equal(exchangeContractData.address);
|
||||
expect(constructor_args).to.be.equal(exchangeContractData.constructor_args);
|
||||
expect(constructor_args).to.be.equal(exchangeContractData.constructorArgs);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,5 +7,5 @@ export const constants = {
|
||||
timeoutMs: 30000,
|
||||
zrxTokenAddress: '0xe41d2489571d322189246dafa5ebde1f4699f498',
|
||||
tokenTransferProxyAddress: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4',
|
||||
specifiedContracts: '*',
|
||||
contracts: '*' as '*',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user