Skip to content

Use buidler's RC for compiling and testing #1071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions buidler.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,31 @@ module.exports = {
}
},

solc: {
version: "0.6.6",
optimizer: require("./solcOptimiserSettings.js")
solidity: {
compilers: [{
version: "0.4.18",
settings: {
optimizer: require("./solcOptimiserSettings.js")
}
}, {
version: "0.5.11",
settings: {
optimizer: require("./solcOptimiserSettings.js")
}
}, {
version: "0.6.6",
settings: {
optimizer: require("./solcOptimiserSettings.js")
}
}]
},

paths: {
sources: "./contracts/sol6",
sources: "./contracts",
tests: "./test/",
},

mocha: {
enableTimeouts: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see some tests time out now
seems this flag not working?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently that option is not working anymore. That's weird because, while enableTimeouts was removed in mocha@8, buidler depends on version 7.

You can use timeout: 0 instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh
I see
thanks
can u update here
it fails the CI for this PR

}
};
};
10 changes: 0 additions & 10 deletions buidlerConfigSol4.js

This file was deleted.

11 changes: 0 additions & 11 deletions buidlerConfigSol5.js

This file was deleted.

155 changes: 0 additions & 155 deletions buidlerConfigSol6.js

This file was deleted.

2 changes: 0 additions & 2 deletions cmp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh
export NODE_OPTIONS=--max-old-space-size=4096
npx buidler compile &&
npx buidler compile --config buidlerConfigSol5.js &&
npx buidler compile --config buidlerConfigSol4.js &&
node contractSizeReport.js
3 changes: 0 additions & 3 deletions cmpSol6.sh

This file was deleted.

11 changes: 5 additions & 6 deletions contractSizeReport.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
'use strict';
const bre = require('@nomiclabs/buidler')
const { Artifacts } = require('@nomiclabs/buidler/plugins')
const fs = require('fs');
const util = require('util');
const got = require('got');
const yargs = require('yargs');

let path = 'artifacts';

const readdir = util.promisify(fs.readdir);
const artifacts = new Artifacts(bre.config.paths.artifacts)

let argv = yargs.default('branch', 'Katalyst').alias('b', 'branch').argv;

async function generateCodeSizeReport() {
let result = {};
let fileNames = await readdir(path);
let fileNames = await artifacts.getArtifacts();
for (let i = 0; i < fileNames.length; i++) {
let fileName = fileNames[i];
let rawData = fs.readFileSync(path + '/' + fileName);
let rawData = fs.readFileSync(fileName);
let contractData = JSON.parse(rawData);
let codeSize = contractData.deployedBytecode.length / 2 - 1;
if (codeSize > 0) {
Expand Down
Loading