diff --git a/packages/testcases/package.json b/packages/testcases/package.json index bf13f4ff..a70f731f 100644 --- a/packages/testcases/package.json +++ b/packages/testcases/package.json @@ -1,6 +1,6 @@ { "name": "@ethersproject/testcases", - "version": "5.0.0-beta.126", + "version": "5.0.0-beta.127", "description": "Testcases for Ethereum and scripts to generate testcases.", "main": "index.js", "browser": "browser.js", @@ -15,13 +15,13 @@ "browserify-zlib": "^0.2.0" }, "devDependencies": { + "@ethersproject/cli": ">=5.0.0-beta.133", "@types/bip39": "2.4.1", "@types/bitcoinjs-lib": "3.3.2", "bip39": "2.5.0", "bitcoinjs-lib": "3.3.2", "ethereumjs-tx": "^1.3.5", - "ethereumjs-util": "^5.2.0", - "solc": "0.5.9" + "ethereumjs-util": "^5.2.0" }, "keywords": [ "Ethereum", @@ -32,5 +32,5 @@ "publishConfig": { "access": "public" }, - "tarballHash": "0xfff9df8ed261c3864aa377821af02945ecafd9160c443500de38fee4fe5652ce" + "tarballHash": "0xd661e673f06d0cd44fec8bbef06c1f6e0b0c5113b6311ea0ec236af4310a5b19" } diff --git a/packages/testcases/src.ts/generation-scripts/abi.ts b/packages/testcases/src.ts/generation-scripts/abi.ts index 71ccfaf3..9118ac76 100644 --- a/packages/testcases/src.ts/generation-scripts/abi.ts +++ b/packages/testcases/src.ts/generation-scripts/abi.ts @@ -2,7 +2,8 @@ //let web3 = new Web3(new Web3.providers.HttpProvider('http://127.0.0.1:8549')); -import { compile as _compile } from "solc"; +//import { compile as _compile } from "solc"; +import { compile } from "@ethersproject/cli/solc"; import { randomHexString, randomNumber } from ".." import { BN, keccak256, toChecksumAddress } from "ethereumjs-util"; @@ -58,41 +59,6 @@ class Code { } } -function compile(source: string): string { - let input = { - language: "Solidity", - sources: { - "test.sol": { - content: source - } - }, - settings: { - optimizer: { - enabled: true, - runs: 200 - }, - evmVersion: "byzantium", - outputSelection: { - "*": { - "*": [ "evm.bytecode" ] - } - } - } - }; - - let output = JSON.parse(_compile(JSON.stringify(input))); - let errors = ((output).errors || []).filter((e : any) => (e.severity == "error")); - - if (errors.length) { - errors.forEach((error: any) => { - console.log(error.formattedMessage); - }); - process.exit(); - } - - return "0x" + output.contracts["test.sol"].Test.evm.bytecode.object; -} - //idea: "tuple(address)/*StructABCDEFG*/" type TestData = { // The data type @@ -651,7 +617,7 @@ for (let i = 0; i < 100; i++) { let solidity = generateSolidity(params); console.log(solidity); console.log(i); - let bytecode = compile(solidity); + let bytecode = compile(solidity)[0].bytecode; //console.log(params.map(p => p.type).join(", ")); //console.log(bytecode); let testcase = { diff --git a/tsconfig.project.json b/tsconfig.project.json index eb9ec237..fd653d22 100644 --- a/tsconfig.project.json +++ b/tsconfig.project.json @@ -66,9 +66,6 @@ { "path": "./packages/solidity" }, - { - "path": "./packages/testcases" - }, { "path": "./packages/transactions" }, @@ -111,6 +108,9 @@ { "path": "./packages/experimental" }, + { + "path": "./packages/testcases" + }, { "path": "./packages/tests" }