Merge pull request #337 from sc-forks/upgrade/testrpc-sc

Upgrade testrpc-sc to 6.4.5
update/parser
cgewecke 5 years ago committed by GitHub
commit 3086047ee5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 27
      .circleci/config.yml
  2. 5
      lib/app.js
  3. 8
      package.json
  4. 9
      test/app.js
  5. 1
      test/sources/zeppelin
  6. 10
      test/util/mockTruffle.js
  7. 3096
      yarn.lock

@ -38,12 +38,7 @@ jobs:
# command: |
# ./scripts/run-colony.sh
# It would be nice if all this could be a shell script but Circle is
# extremely annoying about
# a) cacheing
# b) sudo
# c) scripts
# d) being in a docker container.
# It would be nice if all this could be a shell script... :/
e2e-zeppelin:
docker:
- image: circleci/node:10.12-stretch
@ -55,15 +50,35 @@ jobs:
sudo git clone https://github.com/OpenZeppelin/openzeppelin-solidity.git &&
cd openzeppelin-solidity &&
sudo sed -i 's/cat coverage\/lcov.info | npx coveralls/echo "No coveralls"/g' scripts/test.sh &&
sudo sed -i 's/ganache-cli-coverage/testrpc-sc/g' scripts/test.sh &&
sudo sed -i 's/--emitFreeLogs true/ /g' scripts/test.sh &&
sudo yarn &&
sudo yarn remove solidity-coverage --dev &&
sudo yarn add "$PR_PATH" --dev &&
sudo npm run coverage
# AND...this doesn't work either! Thanks to truffle "obtain" and circle permission denied.
e2e-metacoin:
docker:
- image: circleci/node:10.12-stretch
steps:
- checkout
- run: >
sudo npm config set user 0 &&
sudo npm config set unsafe-perm true &&
sudo rm -rf node_modules &&
PR_PATH=$(echo "$CIRCLE_REPOSITORY_URL#$CIRCLE_BRANCH" | sudo sed 's/git@github.com:/https:\/\/github.com\//') &&
sudo mkdir metacoin &&
cd metacoin &&
sudo npx truffle unbox metacoin &&
sudo rm test/TestMetacoin.sol &&
sudo yarn add $PR_PATH --dev &&
sudo npx solidity-coverage
workflows:
version: 2
build:
jobs:
- unit-test
- e2e-zeppelin
- e2e-metacoin
#- e2e-colony

@ -207,12 +207,11 @@ class App {
return new Promise((resolve, reject) => {
if (!this.norpc) {
const defaultRpcOptions = `--accounts ${this.accounts} --port ${this.port}`;
const options = (this.testrpcOptions || defaultRpcOptions) + ` --gasLimit ${gasLimitHex} --allowUnlimitedContractSize`;
const command = require.resolve('ethereumjs-testrpc-sc/cli.js');
const options = (this.testrpcOptions || defaultRpcOptions) + ` --gasLimit ${gasLimitHex}`;
// Launch
const execOpts = {maxBuffer: 1024 * 1024 * 100};
this.testrpcProcess = childprocess.exec(`node ${command} ${options}`, execOpts, (err, stdout, stderr) => {
this.testrpcProcess = childprocess.exec(`npx testrpc-sc ${options}`, execOpts, (err, stdout, stderr) => {
if (err) {
if (stdout) this.log(`testRpc stdout:\n${stdout}`);
if (stderr) this.log(`testRpc stderr:\n${stderr}`);

@ -21,15 +21,15 @@
"license": "ISC",
"dependencies": {
"death": "^1.1.0",
"ethereumjs-testrpc-sc": "6.4.1",
"ethereumjs-testrpc-sc": "6.4.5-sc.2",
"istanbul": "^0.4.5",
"keccakjs": "^0.2.1",
"req-cwd": "^1.0.1",
"shelljs": "https://github.com/sc-forks/shelljs.git",
"sol-explore": "^1.6.2",
"solidity-parser-antlr": "^0.4.1",
"solidity-parser-antlr": "0.4.5",
"tree-kill": "^1.2.0",
"web3": "^1.0.0-beta.50",
"web3": "1.0.0-beta.50",
"web3-eth-abi": "1.0.0-beta.50"
},
"devDependencies": {
@ -42,6 +42,6 @@
"mocha": "^4.1.0",
"request": "^2.88.0",
"solc": "^0.5.3",
"truffle": "^5.0.0"
"truffle": "^5.0.26"
}
}

@ -28,7 +28,7 @@ describe('app', () => {
};
before(done => {
const command = `./node_modules/.bin/testrpc-sc --allowUnlimitedContractSize --gasLimit 0xfffffffffff --port ${port}`;
const command = `npx testrpc-sc --gasLimit 0xfffffffffff --port ${port}`;
testrpcProcess = childprocess.exec(command);
testrpcProcess.stdout.on('data', data => {
@ -153,15 +153,14 @@ describe('app', () => {
coverage: {
host: "localhost",
port: 8999,
network_id: "*"
network_id: "*",
gas: 0xfffffffffff,
gasPrice: 0x01
}
},
compilers: {
solc: {
version: "0.5.3",
settings: {
evmVersion: "constantinople"
}
}
}
};`;

@ -1 +0,0 @@
Subproject commit 0dded493a03623c93845c2d58634c229862ab54a

@ -37,7 +37,7 @@ module.exports.install = function install(
) {
const configjs = `module.exports = ${JSON.stringify(config)}`;
const contractLocation = `./${contract}`;
const trufflejsName = _trufflejsName || 'truffle.js';
const trufflejsName = _trufflejsName || 'truffle-config.js';
// Mock migrations
const initialMigration = `
@ -55,7 +55,7 @@ module.exports.install = function install(
// Mock external asset
const asset = 'module.exports = { value: true };';
// Mock truffle.js
// Mock truffle-config.js
const trufflejs = _trufflejs || defaultTruffleJs;
// Generate mock
@ -126,12 +126,12 @@ module.exports.installInheritanceTest = function installInheritanceTest(config)
// Mock test
shell.cp('./test/cli/inheritance.js', './mock/test/inheritance.js');
// Mock truffle.js
// Mock truffle-config.js
const trufflejs = defaultTruffleJs;
const configjs = `module.exports = ${JSON.stringify(config)}`;
fs.writeFileSync('./mock/truffle.js', trufflejs);
fs.writeFileSync('./mock/truffle-config.js', trufflejs);
fs.writeFileSync('./.solcover.js', configjs);
};
@ -177,7 +177,7 @@ module.exports.installLibraryTest = function installInheritanceTest(config) {
shell.cp('./test/sources/cli/CLibrary.sol', './mock/assets/CLibrary.sol');
shell.cp('./test/sources/cli/Face.sol', './mock/assets/Face.sol');
// Mock truffle.js
// Mock truffle-config.js
const trufflejs = defaultTruffleJs;
const configjs = `module.exports = ${JSON.stringify(config)}`;

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save