Skip to content

Commit af2813c

Browse files
authored
Ensuring job-compile size check matches build command (#1628)
1 parent 92fe9e7 commit af2813c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

hardhat/util/collectContractBytecodes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function collectContractBytesCodes() {
4242
const jsonFileContents = fs.readFileSync(jsonfilePath);
4343
const artifacts = JSON.parse(jsonFileContents);
4444

45-
contractBytecodes[contractName] = artifacts.bytecode;
45+
contractBytecodes[contractName] = artifacts.deployedBytecode;
4646
} else {
4747
searchRecurse({ entryPath: path.join(entryPath, contractFolder) });
4848
}

publish/src/contract-size.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ module.exports = {
100100
};
101101
const entries = sizeOfContracts({ contractToObjectMap });
102102
const tableData = [
103-
['Contract', 'Size', 'Percent of Limit', 'Increase'].map(x => yellow(x)),
103+
['Contract', 'Length', 'KB', 'Percent of Limit', 'Increase'].map(x => yellow(x)),
104104
].concat(
105-
entries.reverse().map(({ file, length, pcent }) => {
105+
entries.reverse().map(({ file, length, bytes, pcent }) => {
106106
const prevSizeIfAny = previousSizes.find(candidate => candidate.file === file);
107107

108-
return [file, length, pcent, sizeChange({ prevSizeIfAny, length })].map(content =>
108+
return [file, length, bytes, pcent, sizeChange({ prevSizeIfAny, length })].map(content =>
109109
pcentToColorFnc({ pcent, content })
110110
);
111111
})

0 commit comments

Comments
 (0)