Improve naming

This commit is contained in:
Fabio Berger
2018-05-17 14:07:55 +02:00
parent cf7967e629
commit 7fab782907
2 changed files with 6 additions and 5 deletions

View File

@@ -38,12 +38,13 @@ describe('#Compiler', function(): void {
const exchangeArtifactString = await fsWrapper.readFileAsync(exchangeArtifactPath, opts);
const exchangeArtifact: ContractArtifact = JSON.parse(exchangeArtifactString);
// The last 43 bytes of the binaries are metadata which may not be equivalent
const last43BytesIndex = -86;
const metadataByteLength = 43;
const metadataHexLength = metadataByteLength * 2;
const unlinkedBinaryWithoutMetadata = exchangeArtifact.compilerOutput.evm.bytecode.object.slice(
2,
last43BytesIndex,
-metadataHexLength,
);
const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, last43BytesIndex);
const exchangeBinaryWithoutMetadata = exchange_binary.slice(0, -metadataHexLength);
expect(unlinkedBinaryWithoutMetadata).to.equal(exchangeBinaryWithoutMetadata);
});
});