Implement new artifacts format

This commit is contained in:
Leonid Logvinov
2018-04-18 22:22:39 +02:00
parent 69a6166b6a
commit 72b2a1c66f
24 changed files with 314 additions and 272 deletions

View File

@@ -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);
});