diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000000..9ed2ea09fb4 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,23 @@ +version: 2.1 +orbs: + node: circleci/node@2.1.1 +jobs: + build-and-test-COLONY: + executor: + name: node/default + tag: '10.20' + steps: + - checkout + - setup_remote_docker + - run: yarn bootstrap + - run: npx truffle obtain --solc=0.5.16 + - run: COLONY=true yarn ci + +workflows: + colony: + jobs: + - build-and-test-COLONY: + filters: + branches: + only: + - develop diff --git a/.travis.yml b/.travis.yml index 193852557bb..e74def95559 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,6 @@ matrix: env: FABRICEVM=true - node_js: 8 env: COVERAGE=true - - if: | - branch = develop AND \ - type = push - node_js: 10 - env: COLONY=true allow_failures: - node_js: 8 env: COVERAGE=true diff --git a/packages/artifactor/package.json b/packages/artifactor/package.json index f9d79096fbd..c0580694cc9 100644 --- a/packages/artifactor/package.json +++ b/packages/artifactor/package.json @@ -5,7 +5,7 @@ "license": "MIT", "author": "Tim Coulter", "repository": "https://github.com/trufflesuite/truffle/tree/master/packages/artifactor", - "version": "4.0.57", + "version": "4.0.60", "main": "dist/index.js", "scripts": { "build": "tsc", @@ -17,10 +17,10 @@ "fs-extra": "^8.1.0", "lodash.assign": "^4.2.0", "lodash.merge": "^4.6.2", - "source-map-support": "^0.5.16" + "source-map-support": "^0.5.19" }, "devDependencies": { - "@truffle/contract": "^4.2.2", + "@truffle/contract": "^4.2.5", "@types/fs-extra": "^8.1.0", "@types/lodash.assign": "^4.2.6", "@types/lodash.merge": "^4.6.6", diff --git a/packages/blockchain-utils/index.ts b/packages/blockchain-utils/index.ts index 066c5cfb0f3..d92266d84c8 100644 --- a/packages/blockchain-utils/index.ts +++ b/packages/blockchain-utils/index.ts @@ -51,63 +51,67 @@ const Blockchain = { return parsed; }, - asURI(provider: Provider, callback: Callback) { - let genesis: any, latest; - - this.getBlockByNumber( - "0x0", - provider, - (err: Error, { result }: JsonRPCResponse) => { - if (err) return callback(err); - genesis = result; - - this.getBlockByNumber( - "latest", - provider, - (err: Error, { result }: JsonRPCResponse) => { - if (err) return callback(err); - latest = result; - const url = `blockchain://${genesis.hash.replace( - "0x", - "" - )}/block/${latest.hash.replace("0x", "")}`; - callback(null, url); - } - ); - } - ); + asURI(provider: Provider) { + return new Promise((resolve, reject) => { + let genesis: any, latest; + + this.getBlockByNumber( + "0x0", + provider, + (err: Error, { result }: JsonRPCResponse) => { + if (err) return reject(err); + genesis = result; + + this.getBlockByNumber( + "latest", + provider, + (err: Error, { result }: JsonRPCResponse) => { + if (err) return reject(err); + latest = result; + const url = `blockchain://${genesis.hash.replace( + "0x", + "" + )}/block/${latest.hash.replace("0x", "")}`; + resolve(url); + } + ); + } + ); + }); }, - matches(uri: string, provider: Provider, callback: Callback) { - const parsedUri = this.parse(uri); - - const expected_genesis = parsedUri.genesis_hash; - const expected_block = parsedUri.block_hash; - - this.getBlockByNumber( - "0x0", - provider, - (err: Error, { result }: JsonRPCResponse) => { - if (err) return callback(err); - const block = result; - if (block.hash !== expected_genesis) return callback(null, false); - - this.getBlockByHash( - expected_block, - provider, - (err: Error, { result }: JsonRPCResponse) => { - // Treat an error as if the block didn't exist. This is because - // some clients respond differently. - const block = result; - if (err || block == null) { - return callback(null, false); + matches(uri: string, provider: Provider) { + return new Promise((resolve, reject) => { + const parsedUri = this.parse(uri); + + const expected_genesis = parsedUri.genesis_hash; + const expected_block = parsedUri.block_hash; + + this.getBlockByNumber( + "0x0", + provider, + (err: Error, { result }: JsonRPCResponse) => { + if (err) return reject(err); + const block = result; + if (block.hash !== expected_genesis) return resolve(false); + + this.getBlockByHash( + expected_block, + provider, + (err: Error, { result }: JsonRPCResponse) => { + // Treat an error as if the block didn't exist. This is because + // some clients respond differently. + const block = result; + if (err || block == null) { + return resolve(false); + } + + resolve(true); } - - callback(null, true); - } - ); - } - ); + ); + } + ); + }); } }; diff --git a/packages/blockchain-utils/package.json b/packages/blockchain-utils/package.json index 6ed017d22b4..0d4d9b0a642 100644 --- a/packages/blockchain-utils/package.json +++ b/packages/blockchain-utils/package.json @@ -8,7 +8,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "0.0.18", + "version": "0.0.19", "main": "dist/index.js", "scripts": { "build": "tsc", @@ -34,6 +34,6 @@ "access": "public" }, "dependencies": { - "source-map-support": "^0.5.16" + "source-map-support": "^0.5.19" } } diff --git a/packages/box/package.json b/packages/box/package.json index 5423cb0c031..e7a291e936b 100644 --- a/packages/box/package.json +++ b/packages/box/package.json @@ -4,7 +4,7 @@ "license": "MIT", "author": "g. nicholas d'andrea ", "repository": "https://github.com/trufflesuite/truffle/tree/master/packages/box", - "version": "1.0.59", + "version": "1.0.60", "main": "dist/box.js", "scripts": { "build": "tsc", @@ -13,13 +13,13 @@ }, "types": "./typings/index.d.ts", "dependencies": { - "@truffle/config": "^1.2.17", + "@truffle/config": "^1.2.18", "fs-extra": "^8.1.0", "github-download": "^0.5.0", "inquirer": "^7.0.0", "request": "^2.85.0", "request-promise-native": "^1.0.7", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "tmp": "0.0.33", "vcsurl": "^0.1.1" }, diff --git a/packages/code-utils/package.json b/packages/code-utils/package.json index 7849181c4e4..18a16c66182 100644 --- a/packages/code-utils/package.json +++ b/packages/code-utils/package.json @@ -4,7 +4,7 @@ "license": "MIT", "author": "", "repository": "https://github.com/trufflesuite/truffle/tree/master/packages/code-utils", - "version": "1.2.14", + "version": "1.2.15", "main": "dist/index.js", "scripts": { "build": "tsc", @@ -23,6 +23,6 @@ "access": "public" }, "dependencies": { - "source-map-support": "^0.5.16" + "source-map-support": "^0.5.19" } } diff --git a/packages/codec/lib/abi-data/allocate/index.ts b/packages/codec/lib/abi-data/allocate/index.ts index 2c092db3c41..b16f8a20b59 100644 --- a/packages/codec/lib/abi-data/allocate/index.ts +++ b/packages/codec/lib/abi-data/allocate/index.ts @@ -759,6 +759,10 @@ function getCalldataAllocationsForContract( //(if it doesn't then it will remain as default) functionAllocations: {} }; + if (!abi) { + //if no ABI, can't do much! + return allocations; + } for (let abiEntry of abi) { if ( AbiDataUtils.abiEntryIsObviouslyIllTyped(abiEntry) || diff --git a/packages/codec/lib/ast/utils.ts b/packages/codec/lib/ast/utils.ts index 560b8807953..f796b88bbe3 100644 --- a/packages/codec/lib/ast/utils.ts +++ b/packages/codec/lib/ast/utils.ts @@ -276,8 +276,9 @@ export function spliceLocation( */ export function regularizeTypeIdentifier(identifier: string): string { return identifier.replace( - /(?<=_(storage|memory|calldata))((_slice)?_ptr)?$/, - "_ptr" + /(_(storage|memory|calldata))((_slice)?_ptr)?$/, + "$1_ptr" //this used to use lookbehind for clarity, but Firefox... + //(see: https://github.com/trufflesuite/truffle/issues/3068 ) ); } diff --git a/packages/codec/package.json b/packages/codec/package.json index eeb1831697e..6e390ae4f2b 100644 --- a/packages/codec/package.json +++ b/packages/codec/package.json @@ -1,6 +1,6 @@ { "name": "@truffle/codec", - "version": "0.5.1", + "version": "0.5.3", "description": "Library for encoding and decoding smart contract data", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", @@ -60,7 +60,7 @@ "lodash.partition": "^4.6.0", "lodash.sum": "^4.0.2", "semver": "^6.3.0", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "utf8": "^3.0.0", "web3-utils": "1.2.1" }, diff --git a/packages/compile-solidity/compilerSupplier/loadingStrategies/Native.js b/packages/compile-solidity/compilerSupplier/loadingStrategies/Native.js index 3dfd764f982..25c95758b11 100644 --- a/packages/compile-solidity/compilerSupplier/loadingStrategies/Native.js +++ b/packages/compile-solidity/compilerSupplier/loadingStrategies/Native.js @@ -6,10 +6,12 @@ class Native extends LoadingStrategy { load() { const versionString = this.validateAndGetSolcVersion(); const command = "solc --standard-json"; + const maxBuffer = 1024 * 1024 * 10; try { return { - compile: options => String(execSync(command, { input: options })), + compile: options => + String(execSync(command, { input: options, maxBuffer })), version: () => versionString }; } catch (error) { diff --git a/packages/compile-solidity/package.json b/packages/compile-solidity/package.json index 7377542269a..54f94f14f6a 100644 --- a/packages/compile-solidity/package.json +++ b/packages/compile-solidity/package.json @@ -1,10 +1,10 @@ { "name": "@truffle/compile-solidity", "description": "Compiler helper and artifact manager for Solidity files", - "version": "4.3.2", + "version": "4.3.5", "main": "index.js", "dependencies": { - "@truffle/config": "^1.2.17", + "@truffle/config": "^1.2.18", "@truffle/contract-sources": "^0.1.7", "@truffle/error": "^0.0.8", "@truffle/expect": "^0.0.13", @@ -20,7 +20,7 @@ "solc": "^0.6.0" }, "devDependencies": { - "@truffle/resolver": "^5.1.11", + "@truffle/resolver": "^6.0.1", "babel-core": "^6.26.0", "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.6.1", diff --git a/packages/compile-solidity/profiler/getImports.js b/packages/compile-solidity/profiler/getImports.js index daa32f02c6a..14cc00109be 100644 --- a/packages/compile-solidity/profiler/getImports.js +++ b/packages/compile-solidity/profiler/getImports.js @@ -15,7 +15,7 @@ const getImports = (file, { body, source }, solc, parserSolc) => { return imports.map( dependencyPath => isExplicitlyRelative(dependencyPath) - ? source.resolve_dependency_path(file, dependencyPath) + ? source.resolveDependencyPath(file, dependencyPath) : dependencyPath ); }; diff --git a/packages/compile-solidity/profiler/index.js b/packages/compile-solidity/profiler/index.js index 5beb39185f9..23df7974684 100644 --- a/packages/compile-solidity/profiler/index.js +++ b/packages/compile-solidity/profiler/index.js @@ -195,19 +195,16 @@ module.exports = { } else { file = candidate; } - const promise = new Promise((accept, reject) => { - resolver.resolve(file, parent, (err, body, absolutePath, source) => { - err ? reject(err) : accept({ file: absolutePath, body, source }); - }); - }); - promises.push(promise); + promises.push(resolver.resolve(file, parent)); } // Resolve everything known and add it to the map, then inspect each file's // imports and add those to the list of paths to resolve if we don't have it. return Promise.all(promises).then(async results => { // Generate the sources mapping - results.forEach(item => (mapping[item.file] = Object.assign({}, item))); + results.forEach( + item => (mapping[item.filePath] = Object.assign({}, item)) + ); // Queue unknown imports for the next resolver cycle while (results.length) { @@ -216,7 +213,12 @@ module.exports = { // Inspect the imports let imports; try { - imports = await getImports(result.file, result, solc, parserSolc); + imports = await getImports( + result.filePath, + result, + solc, + parserSolc + ); } catch (err) { if (err.message.includes("requires different compiler version")) { const contractSolcPragma = err.message.match( @@ -238,7 +240,7 @@ module.exports = { // Keep track of location of this import because we need to report that. imports.forEach(item => { if (!mapping[item]) - allPaths.push({ file: item, parent: result.file }); + allPaths.push({ file: item, parent: result.filePath }); }); } }); diff --git a/packages/compile-vyper/index.js b/packages/compile-vyper/index.js index dc846132416..1c5af3f210e 100644 --- a/packages/compile-vyper/index.js +++ b/packages/compile-vyper/index.js @@ -1,8 +1,6 @@ const path = require("path"); const exec = require("child_process").exec; const fs = require("fs"); - -const async = require("async"); const colors = require("colors"); const minimatch = require("minimatch"); @@ -120,44 +118,45 @@ function compileAll(options, callback) { compile.display(options.paths, options); - async.map( - options.paths, - function(source_path, c) { - execVyper(options, source_path, function(err, compiled_contract) { - if (err) return c(err); - - // remove first extension from filename - const extension = path.extname(source_path); - const basename = path.basename(source_path, extension); - - // if extension is .py, remove second extension from filename - const contract_name = - extension !== ".py" - ? basename - : path.basename(basename, path.extname(basename)); - - const source_buffer = fs.readFileSync(source_path); - const source_contents = source_buffer.toString(); - - const contract_definition = { - contract_name: contract_name, - sourcePath: source_path, - source: source_contents, - abi: compiled_contract.abi, - bytecode: compiled_contract.bytecode, - deployedBytecode: compiled_contract.bytecode_runtime, - sourceMap: compiled_contract.source_map, - - compiler: compiler - }; - - c(null, contract_definition); - }); - }, - function(err, contracts) { - if (err) return callback(err); - - const result = contracts.reduce(function(result, contract) { + const promises = []; + options.paths.forEach(sourcePath => { + promises.push( + new Promise((resolve, reject) => { + execVyper(options, sourcePath, function(error, compiledContract) { + if (error) return reject(error); + + // remove first extension from filename + const extension = path.extname(sourcePath); + const basename = path.basename(sourcePath, extension); + + // if extension is .py, remove second extension from filename + const contractName = + extension !== ".py" + ? basename + : path.basename(basename, path.extname(basename)); + + const sourceBuffer = fs.readFileSync(sourcePath); + const sourceContents = sourceBuffer.toString(); + + const contractDefinition = { + contract_name: contractName, + sourcePath: sourcePath, + source: sourceContents, + abi: compiledContract.abi, + bytecode: compiledContract.bytecode, + deployedBytecode: compiledContract.bytecode_runtime, + sourceMap: compiledContract.source_map, + compiler: compiler + }; + + resolve(contractDefinition); + }); + }) + ); + }); + Promise.all(promises) + .then(contracts => { + const result = contracts.reduce((result, contract) => { result[contract.contract_name] = contract; return result; @@ -166,8 +165,8 @@ function compileAll(options, callback) { const compilerInfo = { name: "vyper", version: compiler.version }; callback(null, result, options.paths, compilerInfo); - } - ); + }) + .catch(callback); } // Check that vyper is available then forward to internal compile function diff --git a/packages/compile-vyper/package.json b/packages/compile-vyper/package.json index a72ff071b80..2b7f84384f7 100644 --- a/packages/compile-vyper/package.json +++ b/packages/compile-vyper/package.json @@ -4,20 +4,19 @@ "license": "MIT", "author": "Evgeniy Filatov ", "repository": "https://github.com/trufflesuite/truffle/tree/master/packages/compile-vyper", - "version": "1.0.53", + "version": "1.0.55", "main": "index.js", "scripts": { "test": "mocha" }, "dependencies": { - "@truffle/compile-solidity": "^4.3.1", - "async": "2.6.1", + "@truffle/compile-solidity": "^4.3.5", "colors": "^1.1.2", "eslint": "^5.5.0", "minimatch": "^3.0.4" }, "devDependencies": { - "@truffle/config": "^1.2.17", + "@truffle/config": "^1.2.18", "mocha": "5.2.0" }, "keywords": [ diff --git a/packages/config/package.json b/packages/config/package.json index e9f71674b44..d195767494e 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@truffle/config", - "version": "1.2.17", + "version": "1.2.18", "description": "Utility for interacting with truffle-config.js files", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -36,14 +36,14 @@ "dependencies": { "@truffle/error": "^0.0.8", "@truffle/events": "^0.0.5", - "@truffle/provider": "^0.2.9", + "@truffle/provider": "^0.2.10", "configstore": "^4.0.0", "find-up": "^2.1.0", "lodash.assignin": "^4.2.0", "lodash.merge": "^4.6.2", "module": "^1.2.5", "original-require": "1.0.1", - "source-map-support": "^0.5.16" + "source-map-support": "^0.5.19" }, "publishConfig": { "access": "public" diff --git a/packages/contract-schema/typings/index.d.ts b/packages/contract-schema/typings/index.d.ts index d645595d942..53bbf552aed 100644 --- a/packages/contract-schema/typings/index.d.ts +++ b/packages/contract-schema/typings/index.d.ts @@ -3,7 +3,11 @@ declare module "@truffle/contract-schema" { export { ContractObject } from "@truffle/contract-schema/spec"; namespace Schema { - export function normalize(dirtyObj: object, opts?: object): ContractObject; + export function validate(contractObject: ContractObject): ContractObject; + export function normalize( + objDirty: object, + options?: object + ): ContractObject; } export default Schema; diff --git a/packages/contract/lib/contract/constructorMethods.js b/packages/contract/lib/contract/constructorMethods.js index 8f4f9a82de9..45fcabc93d9 100644 --- a/packages/contract/lib/contract/constructorMethods.js +++ b/packages/contract/lib/contract/constructorMethods.js @@ -76,6 +76,9 @@ module.exports = Contract => ({ }, async deployed() { + if (this.reloadJson) { + this.reloadJson(); //truffle test monkey-patches in this method + } utils.checkProvider(this); await this.detectNetwork(); utils.checkNetworkArtifactMatch(this); diff --git a/packages/contract/lib/contract/index.js b/packages/contract/lib/contract/index.js index 2b74a4b8ad9..2d3b9cc26b6 100644 --- a/packages/contract/lib/contract/index.js +++ b/packages/contract/lib/contract/index.js @@ -33,7 +33,9 @@ if (typeof Web3 === "object" && Object.keys(Web3).length === 0) { instance.contract = contract; //for stacktracing in tests - instance.debugger = constructor.debugger; + if (constructor.debugger) { + instance.debugger = constructor.debugger; + } // User defined methods, overloaded methods, events instance.abi.forEach(function(item) { diff --git a/packages/contract/lib/utils/index.js b/packages/contract/lib/utils/index.js index 0cd34ea852a..f9e3f6c4d58 100644 --- a/packages/contract/lib/utils/index.js +++ b/packages/contract/lib/utils/index.js @@ -121,28 +121,6 @@ const Utils = { return merged; }, - parallel(arr, callback = () => {}) { - if (!arr.length) { - return callback(null, []); - } - let index = 0; - const results = new Array(arr.length); - arr.forEach((fn, position) => { - fn((err, result) => { - if (err) { - callback(err); - callback = () => {}; - } else { - index++; - results[position] = result; - if (index >= arr.length) { - callback(null, results); - } - } - }); - }); - }, - linkBytecode(bytecode, links) { Object.keys(links).forEach(library_name => { const library_address = links[library_name]; @@ -290,38 +268,32 @@ const Utils = { }, // parses known contract instance networks - parseKnownNetworks( + async parseKnownNetworks( { networks, currentProvider, setNetwork, network_id }, gasLimit ) { - // wrap uri matching in a promise to allow provider.send time to resolve - // (.send call happens in BlockchainUtils.matches) - return new Promise((accept, reject) => { - // go through all the networks that are listed as - // blockchain uris and see if they match - const uris = Object.keys(networks).filter( - network => network.indexOf("blockchain://") === 0 - ); - const matches = uris.map(uri => - BlockchainUtils.matches.bind(BlockchainUtils, uri, currentProvider) - ); - - Utils.parallel(matches, (err, results) => { - if (err) reject(err); - - for (let i = 0; i < results.length; i++) { - if (results[i]) { - setNetwork(uris[i]); - accept({ - id: network_id, - blockLimit: gasLimit - }); - } + if (!networks && Object.keys(networks).length === 0) { + return false; + } + // go through all the networks that are listed as + // blockchain uris and see if they match + for (const network in networks) { + if (network.startsWith("blockchain://")) { + const networkMatches = await BlockchainUtils.matches( + network, + currentProvider + ); + if (networkMatches) { + setNetwork(network); + return { + id: network_id, + blockLimit: gasLimit + }; } - // no match found! - accept(false); - }); - }); + } + } + // no match found! + return false; }, // sets a contract instance network ID diff --git a/packages/contract/package.json b/packages/contract/package.json index 457c52f77f7..5b1f5d0d9ce 100644 --- a/packages/contract/package.json +++ b/packages/contract/package.json @@ -8,7 +8,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "4.2.2", + "version": "4.2.5", "main": "index.js", "scripts": { "compile": "sh -c \"mkdir -p ./dist\" && browserify --debug ./index.js | exorcist ./dist/truffle-contract.js.map > ./dist/truffle-contract.js && uglifyjs ./dist/truffle-contract.js -o ./dist/truffle-contract.min.js", @@ -20,15 +20,15 @@ }, "typings": "./typings/index.d.ts", "dependencies": { - "@truffle/blockchain-utils": "^0.0.18", + "@truffle/blockchain-utils": "^0.0.19", "@truffle/contract-schema": "^3.1.0", + "@truffle/debug-utils": "^4.1.3", "@truffle/error": "^0.0.8", - "@truffle/interface-adapter": "^0.4.6", + "@truffle/interface-adapter": "^0.4.7", "bignumber.js": "^7.2.1", "ethereum-ens": "^0.8.0", "ethers": "^4.0.0-beta.1", - "exorcist": "^1.0.1", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "web3": "1.2.1", "web3-core-helpers": "1.2.1", "web3-core-promievent": "1.2.1", @@ -36,10 +36,11 @@ "web3-utils": "1.2.1" }, "devDependencies": { - "@truffle/compile-solidity": "^4.3.2", + "@truffle/compile-solidity": "^4.3.5", "browserify": "^14.0.0", "chai": "4.2.0", "debug": "^4.1.0", + "exorcist": "^1.0.1", "ganache-core": "2.10.2", "mocha": "5.2.0", "sinon": "^7.3.2", diff --git a/packages/contract/test/deploy.js b/packages/contract/test/deploy.js index f798ce2f51a..e8e2c76de21 100644 --- a/packages/contract/test/deploy.js +++ b/packages/contract/test/deploy.js @@ -105,32 +105,26 @@ describe("Deployments", function() { .catch(() => null); }); - it("Errors with gas limit error if constructor reverts", async function() { + it("Errors with always failing transaction error if constructor reverts", async function() { try { await Example.new(13); // 13 fails a require gate assert.fail(); } catch (e) { - const errorCorrect = - e.message.includes("gas required exceeds allowance") || - e.message.includes("intrinsic gas too low"); + const errorCorrect = e.message.includes("always failing transaction"); - assert(errorCorrect, "Expected gas limit error"); + assert(errorCorrect, "Expected always failing transaction error"); assert(e.receipt === undefined, "Expected no receipt"); } }); - // This example contains a reason string when run with ganache but no - // reason strings when run vs geth. - it("Handles absence of reason string gracefully", async function() { + it(".new(): revert with reasonstring", async function() { try { await Example.new(2001); // 2001 fails a require gate assert.fail(); } catch (e) { - const errorCorrect = - e.message.includes("gas required exceeds allowance") || - e.message.includes("intrinsic gas too low"); + const errorCorrect = e.message.includes("reasonstring"); - assert(errorCorrect, "Expected gas limit error"); + assert(errorCorrect, "Expected reason string"); assert(e.receipt === undefined, "Expected no receipt"); } }); diff --git a/packages/contract/test/methods.js b/packages/contract/test/methods.js index 789b165f02e..4ca800f9881 100644 --- a/packages/contract/test/methods.js +++ b/packages/contract/test/methods.js @@ -486,7 +486,7 @@ describe("Methods", function() { } }); - it("errors with a revert reason", async function() { + it.skip("errors with a revert reason", async function() { const example = await Example.new(1); try { // At the moment, this test can't rely on @truffle/contract's diff --git a/packages/contract/test/networks.js b/packages/contract/test/networks.js index f6d703bdd36..c75783d2528 100644 --- a/packages/contract/test/networks.js +++ b/packages/contract/test/networks.js @@ -13,7 +13,6 @@ var debug = require("debug")("ganache-core"); var Ganache = require("ganache-core"); var BlockchainUtils = require("@truffle/blockchain-utils"); var contract = require("../"); -var times = require("async/times"); var log = { log: debug @@ -347,139 +346,109 @@ describe("Different networks: ", function() { }); }); - it("detects the network when a blockchain uri is specified", function(done) { - BlockchainUtils.asURI(network_two, function(err, uri) { - if (err) return done(err); + it("detects the network when a blockchain uri is specified", async () => { + const uri = await BlockchainUtils.asURI(network_two); - var json = { - contractName: "NetworkExample", - abi: ExampleOne.abi, - bytecode: ExampleOne.binary, - networks: {} - }; - - json.networks[uri] = { - address: "0x1234567890123456789012345678901234567890" // fake - }; + var json = { + contractName: "NetworkExample", + abi: ExampleOne.abi, + bytecode: ExampleOne.binary, + networks: {} + }; - var NetworkExample = contract(json); + json.networks[uri] = { + address: "0x1234567890123456789012345678901234567890" // fake + }; - NetworkExample.setProvider(network_two); + var NetworkExample = contract(json); - NetworkExample.defaults({ - from: ExampleTwo.defaults().from // Borrow the address from this one. - }); + NetworkExample.setProvider(network_two); - NetworkExample.deployed() - .then(instance => { - assert.equal(NetworkExample.network_id, uri); - assert.equal(instance.address, json.networks[uri].address); - done(); - }) - .catch(done); + NetworkExample.defaults({ + from: ExampleTwo.defaults().from // Borrow the address from this one. }); + + const instance = await NetworkExample.deployed(); + assert.equal(NetworkExample.network_id, uri); + assert.equal(instance.address, json.networks[uri].address); }); - it("resolve networks artifacts when two matching but unequal blockchain uris are passed in", function(done) { - BlockchainUtils.asURI(network_two, function(err, uri) { - if (err) return done(err); + it("resolve networks artifacts when two matching but unequal blockchain uris are passed in", async () => { + const uri = await BlockchainUtils.asURI(network_two); - var json = { - contractName: "NetworkExampleTwo", - abi: ExampleOne.abi, - bytecode: ExampleOne.binary, - networks: {} - }; + var json = { + contractName: "NetworkExampleTwo", + abi: ExampleOne.abi, + bytecode: ExampleOne.binary, + networks: {} + }; - json.networks[uri] = { - address: "0x1234567890123456789012345678901234567890" // fake - }; + json.networks[uri] = { + address: "0x1234567890123456789012345678901234567890" // fake + }; - var NetworkExample = contract(json); + var NetworkExample = contract(json); - NetworkExample.setProvider(network_two); + NetworkExample.setProvider(network_two); - NetworkExample.defaults({ - from: ExampleTwo.defaults().from // Borrow the address from this one. - }); - - // This is what makes this test different than others. We're going to set - // the network id to a number, but we're still going to expect it to resolve - // to the correct set of artifacts identified by the blockchain uri, even - // when the network id has been explicitly set. - NetworkExample.setNetwork(network_two_id); - - NetworkExample.deployed() - .then(instance => { - assert.equal(NetworkExample.network_id, uri); - assert.equal(instance.address, json.networks[uri].address); - done(); - }) - .catch(done); + NetworkExample.defaults({ + from: ExampleTwo.defaults().from // Borrow the address from this one. }); + + // This is what makes this test different than others. We're going to set + // the network id to a number, but we're still going to expect it to resolve + // to the correct set of artifacts identified by the blockchain uri, even + // when the network id has been explicitly set. + NetworkExample.setNetwork(network_two_id); + + const instance = await NetworkExample.deployed(); + assert.equal(NetworkExample.network_id, uri); + assert.equal(instance.address, json.networks[uri].address); }); // TODO: Rewrite this as a promise chain - it("resolve network artifacts when two equal but different network identifiers are passed in", function(done) { - BlockchainUtils.asURI(network_two, function(err, uri) { - if (err) return done(err); - - var json = { - contractName: "NetworkExampleThree", - abi: ExampleOne.abi, - bytecode: ExampleOne.binary, - networks: {} - }; - - json.networks[uri] = { - address: "0x1234567890123456789012345678901234567890" // fake - }; - - var NetworkExample = contract(json); - - // Now send two transactions that, when finished, will ensure - // we've mined two more blocks. We'll use ExampleTwo for this - // that's hooked up to the same network. - times( - 2, - function(n, finished) { - ExampleTwo.new(1, { gas: 3141592 }) - .then(function() { - finished(); - }) - .catch(finished); - }, - function(err) { - if (err) return done(err); - - // Now get the blockchain URI again - BlockchainUtils.asURI(network_two, function(err, new_uri) { - if (err) return done(err); - - assert.notEqual(new_uri, uri); - - NetworkExample = contract(json); - NetworkExample.setProvider(network_two); - - NetworkExample.defaults({ - from: ExampleTwo.defaults().from // Borrow the address from this one. - }); - - // We're setting the id to a URI that matches the same network as an already set URI - // (but the URIs aren't equal). - // We should get the address that's been saved as the URIs should match. - NetworkExample.setNetwork(new_uri); - - NetworkExample.deployed() - .then(instance => { - assert.equal(NetworkExample.network_id, uri); - assert.equal(instance.address, json.networks[uri].address); - done(); - }) - .catch(done); - }); - } - ); + it("resolve network artifacts when two equal but different network identifiers are passed in", async () => { + const uri = await BlockchainUtils.asURI(network_two); + + var json = { + contractName: "NetworkExampleThree", + abi: ExampleOne.abi, + bytecode: ExampleOne.binary, + networks: {} + }; + + json.networks[uri] = { + address: "0x1234567890123456789012345678901234567890" // fake + }; + + var NetworkExample = contract(json); + + // Now send two transactions that, when finished, will ensure + // we've mined two more blocks. We'll use ExampleTwo for this + // that's hooked up to the same network. + + await ExampleTwo.new(1, { gas: 3141592 }); + await ExampleTwo.new(1, { gas: 3141592 }); + + // Now get the blockchain URI again + const newURI = await BlockchainUtils.asURI(network_two); + + assert.notEqual(newURI, uri); + + NetworkExample = contract(json); + NetworkExample.setProvider(network_two); + + NetworkExample.defaults({ + from: ExampleTwo.defaults().from // Borrow the address from this one. }); + + // We're setting the id to a URI that matches the same network as an already set URI + // (but the URIs aren't equal). + // We should get the address that's been saved as the URIs should match. + NetworkExample.setNetwork(newURI); + + const newInstance = await NetworkExample.deployed(); + assert.equal(NetworkExample.network_id, uri); + assert.equal(newInstance.address, json.networks[uri].address); }); }); diff --git a/packages/core/lib/commands/create/templates/Example.sol b/packages/core/lib/commands/create/templates/Example.sol index 0da78d62333..e4cdce237b9 100644 --- a/packages/core/lib/commands/create/templates/Example.sol +++ b/packages/core/lib/commands/create/templates/Example.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.5.0 < 0.7.0; contract Example { diff --git a/packages/core/lib/commands/create/templates/Test.sol b/packages/core/lib/commands/create/templates/Test.sol index 35e63b9cd16..d4642f7f847 100644 --- a/packages/core/lib/commands/create/templates/Test.sol +++ b/packages/core/lib/commands/create/templates/Test.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; import "truffle/DeployedAddresses.sol"; diff --git a/packages/core/lib/commands/debug.js b/packages/core/lib/commands/debug.js index aecb909223a..b754b085dfc 100644 --- a/packages/core/lib/commands/debug.js +++ b/packages/core/lib/commands/debug.js @@ -5,11 +5,20 @@ const command = { builder: { _: { type: "string" + }, + network: { + describe: "Network to connect to", + type: "string", + default: "development" } }, help: { - usage: "truffle debug []", + usage: "truffle debug [--network ] []", options: [ + { + option: "--network", + description: "Network to connect to. Default: development" + }, { option: "", description: "Transaction ID to use for debugging." diff --git a/packages/core/lib/commands/test/index.js b/packages/core/lib/commands/test/index.js index d9536244b58..89d100e2346 100644 --- a/packages/core/lib/commands/test/index.js +++ b/packages/core/lib/commands/test/index.js @@ -7,6 +7,11 @@ const command = { type: "boolean", default: false }, + "compile-all-debug": { + describe: "Compile in debug mode", + type: "boolean", + default: false + }, "debug": { describe: "Enable in-test debugging", type: "boolean", @@ -22,11 +27,13 @@ const command = { default: false }, "bail": { + alias: "b", describe: "Bail after first test failure", type: "boolean", default: false }, "stacktrace": { + alias: "t", describe: "Produce Solidity stacktraces", type: "boolean", default: false @@ -39,7 +46,7 @@ const command = { }, help: { usage: - "truffle test [] [--compile-all] [--network ] [--verbose-rpc] [--show-events] [--debug] [--debug-global ] [--bail] [--stacktrace[-extra]]", + "truffle test [] [--compile-all[-debug]] [--network ] [--verbose-rpc] [--show-events] [--debug] [--debug-global ] [--bail] [--stacktrace[-extra]]", options: [ { option: "", @@ -53,6 +60,12 @@ const command = { "Compile all contracts instead of intelligently choosing which contracts need " + "to be compiled." }, + { + option: "--compile-all-debug", + description: + "Compile all contracts and do so in debug mode for extra revert info. May " + + "cause errors on large\n contracts." + }, { option: "--network ", description: @@ -85,20 +98,18 @@ const command = { }, { option: "--bail", - description: "Bail after first test failure" + description: "Bail after first test failure. Alias: -b" }, { option: "--stacktrace", description: "Allows for mixed JS/Solidity stacktraces when a Truffle Contract transaction " + "or deployment\n reverts. Does not apply to calls or gas estimates. " + - "Implies --compile-all. Experimental." + "Implies --compile-all. Experimental. Alias: -t" }, { option: "--stacktrace-extra", - description: - "Like --stacktrace, but compiles contracts in debug mode for additional revert info. " + - "May cause\n errors on large contracts." + description: "Shortcut for --stacktrace --compile-all-debug." } ] }, @@ -126,9 +137,10 @@ const command = { if (config.stacktraceExtra) { config.stacktrace = true; + config.compileAllDebug = true; } // enables in-test debug() interrupt, or stacktraces, forcing compileAll - if (config.debug || config.stacktrace) { + if (config.debug || config.stacktrace || config.compileAllDebug) { config.compileAll = true; } diff --git a/packages/core/lib/console.js b/packages/core/lib/console.js index a1ca8749420..d07b8426b18 100644 --- a/packages/core/lib/console.js +++ b/packages/core/lib/console.js @@ -101,7 +101,7 @@ class Console extends EventEmitter { const unfilteredFiles = fse.readdirSync( this.options.contracts_build_directory ); - files = unfilteredFiles.filter(file => file.match(".json") !== null); + files = unfilteredFiles.filter(file => file.endsWith(".json")); } catch (error) { // Error reading the build directory? Must mean it doesn't exist or we don't have access to it. // Couldn't provision the contracts if we wanted. It's possible we're hiding very rare FS diff --git a/packages/core/lib/debug/interpreter.js b/packages/core/lib/debug/interpreter.js index 963ed3f3706..9220df6ce62 100644 --- a/packages/core/lib/debug/interpreter.js +++ b/packages/core/lib/debug/interpreter.js @@ -431,12 +431,13 @@ class DebugInterpreter { this.printer.print(""); //check if transaction failed if (!this.session.view(evm.transaction.status)) { - this.printer.printRevertMessage(); + await this.printer.printRevertMessage(); this.printer.print(""); this.printer.printStacktrace(true); //final stacktrace } else { //case if transaction succeeded this.printer.print("Transaction completed successfully."); + await this.printer.printReturnValue(); } } @@ -462,6 +463,9 @@ class DebugInterpreter { break; case "v": await this.printer.printVariables(); + if (this.session.view(trace.finished)) { + await this.printer.printReturnValue(); + } break; case ":": watchExpressionAnalytics(cmdArgs); diff --git a/packages/core/lib/debug/printer.js b/packages/core/lib/debug/printer.js index 7c88ee852ec..82c8592443e 100644 --- a/packages/core/lib/debug/printer.js +++ b/packages/core/lib/debug/printer.js @@ -200,9 +200,9 @@ class DebugPrinter { } this.config.logger.log(""); - expressions.forEach(function(expression) { + for (const expression of expressions) { this.config.logger.log(" " + expression); - }); + } } printBreakpoints() { @@ -237,15 +237,14 @@ class DebugPrinter { } } - printRevertMessage() { + //this doesn't really *need* to be async as we could use codec directly, but, eh + async printRevertMessage() { this.config.logger.log( DebugUtils.truffleColors.red("Transaction halted with a RUNTIME ERROR.") ); this.config.logger.log(""); - let rawRevertMessage = this.session.view(evm.current.step.returnValue); - let revertDecodings = Codec.decodeRevert( - Codec.Conversion.toBytes(rawRevertMessage) - ); + const revertDecodings = await this.session.returnValue(); //in this context we know it's a revert + debug("revertDecodings: %o", revertDecodings); switch (revertDecodings.length) { case 0: this.config.logger.log( @@ -253,7 +252,7 @@ class DebugPrinter { ); break; case 1: - let revertDecoding = revertDecodings[0]; + const revertDecoding = revertDecodings[0]; switch (revertDecoding.kind) { case "failure": this.config.logger.log( @@ -261,7 +260,7 @@ class DebugPrinter { ); break; case "revert": - let revertStringInfo = revertDecoding.arguments[0].value.value; + const revertStringInfo = revertDecoding.arguments[0].value.value; let revertString; switch (revertStringInfo.kind) { case "valid": @@ -296,6 +295,118 @@ class DebugPrinter { ); } + async printReturnValue() { + //note: when printing revert messages, this will do so in a somewhat + //different way than printRevertMessage does + const allocationFound = Boolean( + this.session.view(data.current.returnAllocation) + ); + const decodings = await this.session.returnValue(); + debug("decodings: %o", decodings); + if (!allocationFound && decodings.length === 0) { + //case 1: no allocation found, decoding failed + this.config.logger.log(""); + this.config.logger.log( + "A value was returned but it could not be decoded." + ); + this.config.logger.log(""); + } else if (!allocationFound && decodings[0].status === true) { + //case 2: no allocation found, decoding succeeded, but not a revert + //(i.e. it's a presumed selfdestruct; no value was returned) + //do nothing + } else if (allocationFound && decodings.length === 0) { + //case 3: allocation found but decoding failed + this.config.logger.log(""); + this.config.logger.log("The return value could not be decoded."); + this.config.logger.log(""); + } else if (allocationFound && decodings[0].kind === "selfdestruct") { + //case 4: allocation found, apparent self-destruct (note due to the use of [0] this + //won't occur if no return value was expected, as return takes priority over selfdestruct) + //Oops -- in an actual selfdestruct, we won't have the code! >_> + //(Not until reconstruct mode exists...) Oh well, leaving this in + this.config.logger.log(""); + this.config.logger.log( + "No value was returned even though one was expected. This may indicate a self-destruct." + ); + this.config.logger.log(""); + } else if (decodings[0].kind === "failure") { + //case 5: revert (no message) + this.config.logger.log(""); + this.config.logger.log("There was no revert message."); + this.config.logger.log(""); + } else if (decodings[0].kind === "unknownbytecode") { + //case 6: unknown bytecode + this.config.logger.log(""); + this.config.logger.log( + "Bytecode was returned, but it could not be identified." + ); + this.config.logger.log(""); + } else if ( + decodings[0].kind === "return" && + decodings[0].arguments.length === 0 + ) { + //case 7: return values but with no content + //do nothing + } else if (decodings[0].kind === "bytecode") { + //case 8: known bytecode + this.config.logger.log(""); + const decoding = decodings[0]; + const contractKind = decoding.contractKind || "contract"; + if (decoding.address !== undefined) { + this.config.logger.log( + `Returned bytecode for a ${contractKind} ${ + decoding.class.typeName + } at ${decoding.address}.` + ); + } else { + this.config.logger.log( + `Returned bytecode for a ${contractKind} ${decoding.class.typeName}.` + ); + } + this.config.logger.log(""); + } else if (decodings[0].kind === "revert") { + //case 9: revert (with message) + this.config.logger.log(""); + const prefix = "Revert string: "; + const value = decodings[0].arguments[0].value; + const formatted = DebugUtils.formatValue(value, prefix.length); + this.config.logger.log(prefix + formatted); + this.config.logger.log(""); + } else if ( + decodings[0].kind === "return" && + decodings[0].arguments.length > 0 + ) { + //case 10: actual return values to print! + this.config.logger.log(""); + const values = decodings[0].arguments; + if (values.length === 1 && !values[0].name) { + //case 10a: if there's only one value and it's unnamed + const value = values[0].value; + const prefix = "Returned value: "; + const formatted = DebugUtils.formatValue(value, prefix.length); + this.config.logger.log(prefix + formatted); + } else { + //case 10b: otherwise + this.config.logger.log("Returned values:"); + const prefixes = values.map( + ({ name }, index) => + name ? `${name}: ` : `Component #${index + 1}: ` + ); + const maxLength = Math.max(...prefixes.map(prefix => prefix.length)); + const paddedPrefixes = prefixes.map(prefix => + prefix.padStart(maxLength) + ); + for (let index = 0; index < values.length; index++) { + const { value } = values[index]; + const prefix = paddedPrefixes[index]; + const formatted = DebugUtils.formatValue(value, maxLength); + this.config.logger.log(prefix + formatted); + } + } + this.config.logger.log(""); + } + } + printStacktrace(final) { this.config.logger.log("Stacktrace:"); let report = final diff --git a/packages/core/lib/networks.js b/packages/core/lib/networks.js index 1bc1504ceab..269a8402113 100644 --- a/packages/core/lib/networks.js +++ b/packages/core/lib/networks.js @@ -3,7 +3,6 @@ const path = require("path"); const OS = require("os"); const BlockchainUtils = require("@truffle/blockchain-utils"); const Provider = require("@truffle/provider"); -const async = require("async"); const { createInterfaceAdapter } = require("@truffle/interface-adapter"); const Networks = { @@ -199,68 +198,52 @@ const Networks = { }, // Try to connect to every named network except for "test" and "development" - asURIs: function(options, networks, callback) { - if (typeof networks === "function") { - callback = networks; - networks = Object.keys(options.networks); - } - + asURIs: async function(options, networks) { const result = { uris: {}, failed: [] }; - async.each( - networks, - (network_name, finished) => { - const provider = Provider.create(options.networks[network_name]); - BlockchainUtils.asURI(provider, (err, uri) => { - if (err) { - result.failed.push(network_name); - } else { - result.uris[network_name] = uri; - } - finished(); - }); - }, - error => { - if (error) return callback(error); - callback(null, result); + for (const networkName of networks) { + const provider = Provider.create(options.networks[networkName]); + try { + const uri = await BlockchainUtils.asURI(provider); + result.uris[networkName] = uri; + } catch (error) { + result.failed.push(networkName); } - ); + } + + return result; }, - matchesNetwork: async function(network_id, network_options, callback) { + matchesNetwork: async function(network_id, network_options) { const provider = Provider.create(network_options); const first = network_id + ""; const second = network_options.network_id + ""; - if (first === second) return callback(null, true); + if (first === second) return true; const isFirstANumber = isNaN(parseInt(network_id)) === false; const isSecondANumber = isNaN(parseInt(network_options.network_id)) === false; // If both network ids are numbers, then they don't match, and we should quit. - if (isFirstANumber && isSecondANumber) return callback(null, false); + if (isFirstANumber && isSecondANumber) return false; const interfaceAdapter = createInterfaceAdapter({ provider, networkType: network_options.type }); - try { - const currentNetworkID = await interfaceAdapter.getNetworkId(); - if (first === currentNetworkID) return callback(null, true); - if (isFirstANumber === false) - BlockchainUtils.matches(first, provider, callback); - else { - // Nothing else to compare. - return callback(null, false); - } - } catch (error) { - return callback(error); + const currentNetworkID = await interfaceAdapter.getNetworkId(); + if (first === currentNetworkID) return true; + if (isFirstANumber === false) + await BlockchainUtils.matches(first, provider); + else { + // Nothing else to compare. + return false; } } }; diff --git a/packages/core/lib/package.js b/packages/core/lib/package.js index 52b199aaa07..782a991cbea 100644 --- a/packages/core/lib/package.js +++ b/packages/core/lib/package.js @@ -5,7 +5,6 @@ const EthPM = require("ethpm"); const EthPMRegistry = require("ethpm-registry"); const Web3 = require("web3"); const { createInterfaceAdapter } = require("@truffle/interface-adapter"); -const async = require("async"); const path = require("path"); const fs = require("fs"); const OS = require("os"); @@ -156,7 +155,7 @@ const Package = { }); var host = options.ethpm.ipfs_host; - if ( ! (host instanceof EthPM.hosts.IPFS) ) { + if (!(host instanceof EthPM.hosts.IPFS)) { host = new EthPM.hosts.IPFS( options.ethpm.ipfs_host, options.ethpm.ipfs_port, @@ -210,169 +209,144 @@ const Package = { }, digest: function(options, callback) { - // async.parallel({ - // contracts: provision.bind(provision, options, false), - // files: dir.files.bind(dir, options.contracts_directory) - // }, function(err, results) { - // if (err) return callback(err); - // - // results.contracts = results.contracts.map(function(contract) { - // return contract.contract_name; - // }); - // - // callback(null, results); - // }); callback(new Error("Not yet implemented")); }, // Return a list of publishable artifacts - publishable_artifacts: function(options, callback) { + publishable_artifacts: async function(options, callback) { const callbackPassed = typeof callback === "function"; // Filter out "test" and "development" networks. - const ifReservedNetworks = new Set(['test', 'development']); - var deployed_networks = Object.keys(options.networks).filter(name => !ifReservedNetworks.has(name)); + const ifReservedNetworks = new Set(["test", "development"]); + var deployed_networks = Object.keys(options.networks).filter( + name => !ifReservedNetworks.has(name) + ); // Now get the URIs of each network that's been deployed to. - Networks.asURIs(options, deployed_networks, function(err, result) { - if (err) { - if (callbackPassed) { - return callback(err); - } - throw err; + let result; + try { + await Networks.asURIs(options, deployed_networks); + } catch (error) { + if (callbackPassed) { + return callback(err); } + throw err; + } - var uris = result.uris; - - if (result.failed.length > 0) { - const message = - "Could not connect to the following networks: " + - result.failed.join(", ") + - ". These networks have deployed " + - "artifacts that can't be published as a package without an active " + - "and accessible connection. Please ensure clients for each " + - "network are up and running prior to publishing, or use the -n " + - "option to specify specific networks you'd like published."; - if (callbackPassed) { - return callback(new Error(message)); - } - throw new Error(message); + var uris = result.uris; + + if (result.failed.length > 0) { + const message = + "Could not connect to the following networks: " + + result.failed.join(", ") + + ". These networks have deployed " + + "artifacts that can't be published as a package without an active " + + "and accessible connection. Please ensure clients for each " + + "network are up and running prior to publishing, or use the -n " + + "option to specify specific networks you'd like published."; + if (callbackPassed) { + return callback(new Error(message)); } + throw new Error(message); + } - var files = fs.readdirSync(options.contracts_build_directory); - files = files.filter(file => file.endsWith(".json")); + var files = fs.readdirSync(options.contracts_build_directory); + files = files.filter(file => file.endsWith(".json")); - if (!files.length) { - const message = - "Could not locate any publishable artifacts in " + - options.contracts_build_directory + - ". " + - "Run `truffle compile` before publishing."; - if (callbackPassed) { - return callback(new Error(message)); - } - throw new Error(message); + if (!files.length) { + const message = + "Could not locate any publishable artifacts in " + + options.contracts_build_directory + + ". " + + "Run `truffle compile` before publishing."; + if (callbackPassed) { + return callback(new Error(message)); } + throw new Error(message); + } - var promises = files.map(file => new Promise((resolve, reject) => { + const promises = files.map(file => { + return new Promise((resolve, reject) => { fs.readFile( path.join(options.contracts_build_directory, file), "utf8", - function(err, body) { - if (err) return reject(err); + (error, data) => { + if (error) { + reject(error); + } + resolve(JSON.parse(data)); + } + ); + }); + }); + const contracts = await Promise.all(promises); + + var contract_types = {}; + var deployments = {}; + + // contract_types first. + contracts.forEach(data => { + contract_types[data.contractName] = { + contract_name: data.contractName, + bytecode: data.bytecode, + abi: data.abi + }; + }); + + //var network_cache = {}; + const matchingPromises = []; + + contracts.forEach(data => { + Object.keys(data.networks).forEach(network_id => { + matchingPromises.push( + new Promise(async (accept, reject) => { try { - body = JSON.parse(body); - } catch (e) { - return reject(e); + // Go through each deployed network and see if this network matches. + for (const deployedNetwork of deployed_networks) { + const matches = await Networks.matchesNetwork( + network_id, + options.networks[deployedNetwork] + ); + if (matches) { + var uri = uris[deployed_network]; + + if (!deployments[uri]) { + deployments[uri] = {}; + } + + deployments[uri][data.contractName] = { + contract_type: data.contractName, // TODO: Handle conflict resolution + address: data.networks[network_id].address + }; + + accept(); + } + } + } catch (error) { + reject(error); } - - resolve(body); - } + }) ); - })); - - var contract_types = {}; - var deployments = {}; - - Promise.all(promises) - .then(function(contracts) { - // contract_types first. - contracts.forEach(function(data) { - contract_types[data.contractName] = { - contract_name: data.contractName, - bytecode: data.bytecode, - abi: data.abi - }; - }); - - //var network_cache = {}; - var matching_promises = []; - - contracts.forEach(function(data) { - Object.keys(data.networks).forEach(function(network_id) { - matching_promises.push( - new Promise(function(accept, reject) { - // Go through each deployed network and see if this network matches. - // Bail early if we foun done. - async.each( - deployed_networks, - function(deployed_network, finished) { - Networks.matchesNetwork( - network_id, - options.networks[deployed_network], - function(err, matches) { - if (err) return finished(err); - if (matches) { - var uri = uris[deployed_network]; - - if (!deployments[uri]) { - deployments[uri] = {}; - } - - deployments[uri][data.contractName] = { - contract_type: data.contractName, // TODO: Handle conflict resolution - address: data.networks[network_id].address - }; - - return finished("bail early"); - } - finished(); - } - ); - }, - function(err) { - if (err && err !== "bail early") { - return reject(err); - } - - accept(); - } - ); - }) - ); - }); - }); - - return Promise.all(matching_promises); - }) - .then(function() { - var to_return = { - contract_types: contract_types, - deployments: deployments - }; - if (callbackPassed) { - callback(null, to_return); - return; - } - return to_return; - }) - .catch(error => { - if (callbackPassed) { - callback(error); - } - throw error; - }); + }); }); + + try { + await Promise.all(matchingPromises); + const toReturn = { + contract_types: contract_types, + deployments: deployments + }; + if (callbackPassed) { + callback(null, toReturn); + return; + } + return toReturn; + } catch (error) { + if (callbackPassed) { + return callback(error); + } + throw error; + } } }; diff --git a/packages/core/lib/test.js b/packages/core/lib/test.js index f3f468855fd..9d31d1e6a19 100644 --- a/packages/core/lib/test.js +++ b/packages/core/lib/test.js @@ -204,8 +204,10 @@ const Test = { quiet: config.runnerOutputOnly || config.quiet, quietWrite: true }); - if (config.stacktraceExtra) { - let versionString = ((compileConfig.compilers || {}).solc || {}).version; + if (config.compileAllDebug) { + let versionString = + ((compileConfig.compilers || {}).solc || {}).version || + ((compileConfig.compilers || {}).solc || {}).docker; //note: I'm relying here on the fact that the current //default version, 0.5.16, is <0.6.3 //the following line works with prereleases @@ -214,7 +216,7 @@ const Test = { }); //the following line doesn't, despite the flag, but does work with version ranges const intersects = - versionString !== undefined && + semver.validRange(versionString) && semver.intersects(versionString, ">=0.6.3", { includePrerelease: true }); //intersects will throw if given undefined so must ward against @@ -232,7 +234,9 @@ const Test = { }); } else { config.logger.log( - "Warning: --stacktrace-extra acts like --stacktrace on Solidity <0.6.3" + `\n${colors.bold( + "Warning:" + )} Extra revert string info requires Solidity v0.6.3 or higher. For more\n information, see release notes ` ); } } @@ -278,8 +282,15 @@ const Test = { global.assert = chai.assert; global.expect = chai.expect; global.artifacts = { - require: import_path => { - let contract = testResolver.require(import_path); + require: importPath => { + let contract = testResolver.require(importPath); + //HACK: both of the following should go by means + //of the provisioner, but I'm not sure how to make + //that work at the moment + contract.reloadJson = function() { + const reloaded = testResolver.require(importPath); + this._json = reloaded._json; + }; if (bugger) { contract.debugger = bugger; } diff --git a/packages/core/lib/testing/Assert.sol b/packages/core/lib/testing/Assert.sol index 7347911b4f5..68630c84c01 100644 --- a/packages/core/lib/testing/Assert.sol +++ b/packages/core/lib/testing/Assert.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT // This file taken from here: https://raw.githubusercontent.com/smartcontractproduction/sol-unit/master/contracts/src/Assertions.sol // It was renamed to Assert.sol by Tim Coulter. Refactored for solidity 0.5.0 by Cruz Molina. diff --git a/packages/core/lib/testing/AssertAddress.sol b/packages/core/lib/testing/AssertAddress.sol index b72a4bacd6c..e3a092b5e0b 100644 --- a/packages/core/lib/testing/AssertAddress.sol +++ b/packages/core/lib/testing/AssertAddress.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertAddress { diff --git a/packages/core/lib/testing/AssertAddressArray.sol b/packages/core/lib/testing/AssertAddressArray.sol index bfe73f6b53a..785b3dc837e 100644 --- a/packages/core/lib/testing/AssertAddressArray.sol +++ b/packages/core/lib/testing/AssertAddressArray.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertAddressArray { diff --git a/packages/core/lib/testing/AssertAddressPayableArray.sol b/packages/core/lib/testing/AssertAddressPayableArray.sol index cf02a588138..d4fa78afa15 100644 --- a/packages/core/lib/testing/AssertAddressPayableArray.sol +++ b/packages/core/lib/testing/AssertAddressPayableArray.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity ^0.6.0; library AssertAddressPayableArray { diff --git a/packages/core/lib/testing/AssertBalance.sol b/packages/core/lib/testing/AssertBalance.sol index dd9bcbce7b6..9fd9cf7664e 100644 --- a/packages/core/lib/testing/AssertBalance.sol +++ b/packages/core/lib/testing/AssertBalance.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertBalance { diff --git a/packages/core/lib/testing/AssertBool.sol b/packages/core/lib/testing/AssertBool.sol index 5d887be9f1f..39657c48e84 100644 --- a/packages/core/lib/testing/AssertBool.sol +++ b/packages/core/lib/testing/AssertBool.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertBool { diff --git a/packages/core/lib/testing/AssertBytes32Array.sol b/packages/core/lib/testing/AssertBytes32Array.sol index 4a6dbd5f88e..d3633ad3658 100644 --- a/packages/core/lib/testing/AssertBytes32Array.sol +++ b/packages/core/lib/testing/AssertBytes32Array.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertBytes32Array { diff --git a/packages/core/lib/testing/AssertGeneral.sol b/packages/core/lib/testing/AssertGeneral.sol index 602c3987b69..6043cec3f43 100644 --- a/packages/core/lib/testing/AssertGeneral.sol +++ b/packages/core/lib/testing/AssertGeneral.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertGeneral { diff --git a/packages/core/lib/testing/AssertInt.sol b/packages/core/lib/testing/AssertInt.sol index cca95793f9b..26feaf110d1 100644 --- a/packages/core/lib/testing/AssertInt.sol +++ b/packages/core/lib/testing/AssertInt.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertInt { diff --git a/packages/core/lib/testing/AssertIntArray.sol b/packages/core/lib/testing/AssertIntArray.sol index 4eee37d8e61..1bc5427155a 100644 --- a/packages/core/lib/testing/AssertIntArray.sol +++ b/packages/core/lib/testing/AssertIntArray.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertIntArray { diff --git a/packages/core/lib/testing/AssertString.sol b/packages/core/lib/testing/AssertString.sol index 2f534847c88..8fd5e2b861d 100644 --- a/packages/core/lib/testing/AssertString.sol +++ b/packages/core/lib/testing/AssertString.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertString { diff --git a/packages/core/lib/testing/AssertUint.sol b/packages/core/lib/testing/AssertUint.sol index ec3aec4cb52..6411b4f64fb 100644 --- a/packages/core/lib/testing/AssertUint.sol +++ b/packages/core/lib/testing/AssertUint.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertUint { diff --git a/packages/core/lib/testing/AssertUintArray.sol b/packages/core/lib/testing/AssertUintArray.sol index d4edd96148c..7f69ac5f28e 100644 --- a/packages/core/lib/testing/AssertUintArray.sol +++ b/packages/core/lib/testing/AssertUintArray.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.4.15 < 0.7.0; library AssertUintArray { diff --git a/packages/core/lib/testing/NewSafeSend.sol b/packages/core/lib/testing/NewSafeSend.sol index 2da2d8bf0aa..146352fc293 100644 --- a/packages/core/lib/testing/NewSafeSend.sol +++ b/packages/core/lib/testing/NewSafeSend.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity >= 0.5.0 < 0.7.0; contract NewSafeSend { diff --git a/packages/core/lib/testing/OldSafeSend.sol b/packages/core/lib/testing/OldSafeSend.sol index 472d75f8f18..efe11bdb8f7 100644 --- a/packages/core/lib/testing/OldSafeSend.sol +++ b/packages/core/lib/testing/OldSafeSend.sol @@ -1,3 +1,4 @@ +//SPDX-License-Identifier: MIT pragma solidity ^0.4.22; contract OldSafeSend { diff --git a/packages/core/lib/testing/deployed.js b/packages/core/lib/testing/deployed.js index 5ab61353f4b..c3b151a2aaf 100644 --- a/packages/core/lib/testing/deployed.js +++ b/packages/core/lib/testing/deployed.js @@ -11,6 +11,7 @@ var Deployed = { var source = ""; source += + "//SPDX-License-Identifier: MIT\n" + "pragma solidity >= 0.5.0 < 0.7.0; \n\n library DeployedAddresses {" + "\n"; diff --git a/packages/core/lib/testing/testresolver.js b/packages/core/lib/testing/testresolver.js index bd3cd03cabc..ea14cac6602 100644 --- a/packages/core/lib/testing/testresolver.js +++ b/packages/core/lib/testing/testresolver.js @@ -1,42 +1,39 @@ const path = require("path"); -function TestResolver(resolver, source, search_path) { - this.resolver = resolver; - this.source = source; - this.search_path = search_path; - - this.seen = []; - this.require_cache = {}; - this.cache_on = true; -} - -TestResolver.prototype.require = function(import_path) { - if (this.cache_on && this.require_cache[import_path]) { - return this.require_cache[import_path]; +module.exports = class TestResolver { + constructor(resolver, source, searchPath) { + this.resolver = resolver; + this.source = source; + this.searchPath = searchPath; + + this.seen = []; + this.require_cache = {}; + this.cache_on = true; } - // For Windows: Allow import paths to be either path separator ('\' or '/') - // by converting all '/' to the default (path.sep); - import_path = import_path.replace(/\//g, path.sep); + require(import_path) { + if (this.cache_on && this.require_cache[import_path]) { + return this.require_cache[import_path]; + } - // Remember: This throws if not found. - var result = this.resolver.require(import_path, this.search_path); + // For Windows: Allow import paths to be either path separator ('\' or '/') + // by converting all '/' to the default (path.sep); + import_path = import_path.replace(/\//g, path.sep); - this.require_cache[import_path] = result; + // Remember: This throws if not found. + var result = this.resolver.require(import_path, this.searchPath); - return result; -}; + this.require_cache[import_path] = result; -TestResolver.prototype.resolve = function(importPath, importedFrom, callback) { - var self = this; - this.source - .resolve(importPath) - .then(result => { - if (result && result.body) - return callback(null, result.body, result.resolvedPath); - self.resolver.resolve(importPath, importedFrom, callback); - }) - .catch(callback); -}; + return result; + } -module.exports = TestResolver; + async resolve(importPath, importedFrom) { + const result = await this.source.resolve(importPath); + if (result && result.body) { + return result; + } + + return await this.resolver.resolve(importPath, importedFrom); + } +}; diff --git a/packages/core/lib/testing/testrunner.js b/packages/core/lib/testing/testrunner.js index 69d413a7ebb..625089754e1 100644 --- a/packages/core/lib/testing/testrunner.js +++ b/packages/core/lib/testing/testrunner.js @@ -104,13 +104,14 @@ TestRunner.prototype.endTest = async function(mocha) { return; } - function indent(unindented, indentation, initialPrefix = "") { + function indent(input, indentation, initialPrefix = "") { + const unindented = typeof input === "string" ? input.split("\n") : input; return unindented - .split("\n") - .map((line, index) => - index === 0 - ? initialPrefix + " ".repeat(indentation - initialPrefix) + line - : " ".repeat(indentation) + line + .map( + (line, index) => + index === 0 + ? initialPrefix + " ".repeat(indentation - initialPrefix) + line + : " ".repeat(indentation) + line ) .join("\n"); } @@ -122,25 +123,27 @@ TestRunner.prototype.endTest = async function(mocha) { : decoding.class.typeName; const eventName = decoding.abi.name; const fullEventName = anonymousPrefix + `${className}.${eventName}`; - const eventArgs = decoding.arguments - .map(({ name, indexed, value }) => { - let namePrefix = name ? `${name}: ` : ""; - let indexedPrefix = indexed ? " " : ""; - let displayValue = util.inspect( - new Codec.Format.Utils.Inspect.ResultInspector(value), - { - depth: null, - colors: true, - maxArrayLength: null, - breakLength: 80 - indentation //should this include prefix lengths as well? - } - ); - let typeString = ` (type: ${Codec.Format.Types.typeStringWithoutLocation( - value.type - )})`; - return namePrefix + indexedPrefix + displayValue + typeString; - }) - .join(",\n"); + const eventArgs = decoding.arguments.map(({ name, indexed, value }) => { + let namePrefix = name ? `${name}: ` : ""; + let indexedPrefix = indexed ? " " : ""; + let displayValue = util.inspect( + new Codec.Format.Utils.Inspect.ResultInspector(value), + { + depth: null, + colors: true, + maxArrayLength: null, + breakLength: 80 - indentation //should this include prefix lengths as well? + } + ); + let typeString = ` (type: ${Codec.Format.Types.typeStringWithoutLocation( + value.type + )})`; + return namePrefix + indexedPrefix + displayValue + typeString + ","; + }); + { + const len = eventArgs.length - 1; + eventArgs[len] = eventArgs[len].slice(0, -1); // remove the final comma + } if (decoding.arguments.length > 0) { return indent( `${fullEventName}(\n${indent(eventArgs, 2)}\n)`, diff --git a/packages/core/lib/testing/testsource.js b/packages/core/lib/testing/testsource.js index f3f371fb42c..55b19f90bef 100644 --- a/packages/core/lib/testing/testsource.js +++ b/packages/core/lib/testing/testsource.js @@ -4,104 +4,102 @@ const fse = require("fs-extra"); const contract = require("@truffle/contract"); const find_contracts = require("@truffle/contract-sources"); -function TestSource(config) { - this.config = config; -} +module.exports = class TestSource { + constructor(config) { + this.config = config; + } -TestSource.prototype.require = function() { - return null; // FSSource will get it. -}; + require() { + return null; // FSSource will get it. + } -TestSource.prototype.resolve = async function(importPath) { - const self = this; + async resolve(importPath) { + const self = this; - if (importPath === "truffle/DeployedAddresses.sol") { - const sourceFiles = await find_contracts(this.config.contracts_directory); + if (importPath === "truffle/DeployedAddresses.sol") { + const sourceFiles = await find_contracts(this.config.contracts_directory); - let abstractionFiles; - const buildDirFiles = (abstractionFiles = fse.readdirSync( - self.config.contracts_build_directory - )); - abstractionFiles = buildDirFiles.filter(file => file.match(/^.*.json$/)); + let abstractionFiles; + const buildDirFiles = (abstractionFiles = fse.readdirSync( + self.config.contracts_build_directory + )); + abstractionFiles = buildDirFiles.filter(file => file.match(/^.*.json$/)); - const mapping = {}; + const mapping = {}; - const blacklist = new Set(["Assert", "DeployedAddresses"]); + const blacklist = new Set(["Assert", "DeployedAddresses"]); - // Ensure we have a mapping for source files and abstraction files - // to prevent any compile errors in tests. - sourceFiles.forEach(file => { - const name = path.basename(file, ".sol"); - if (blacklist.has(name)) return; - mapping[name] = false; - }); + // Ensure we have a mapping for source files and abstraction files + // to prevent any compile errors in tests. + sourceFiles.forEach(file => { + const name = path.basename(file, ".sol"); + if (blacklist.has(name)) return; + mapping[name] = false; + }); - abstractionFiles.forEach(file => { - const name = path.basename(file, ".json"); - if (blacklist.has(name)) return; - mapping[name] = false; - }); + abstractionFiles.forEach(file => { + const name = path.basename(file, ".json"); + if (blacklist.has(name)) return; + mapping[name] = false; + }); - const filesData = abstractionFiles.map(file => { - return fse.readFileSync( - path.join(self.config.contracts_build_directory, file), - "utf8" - ); - }); + const filesData = abstractionFiles.map(file => { + return fse.readFileSync( + path.join(self.config.contracts_build_directory, file), + "utf8" + ); + }); - const addresses = filesData - .map(data => JSON.parse(data)) - .map(json => contract(json)) - .map(c => { + const addresses = filesData.map(data => { + const c = contract(JSON.parse(data)); c.setNetwork(self.config.network_id); if (c.isDeployed()) return c.address; return null; }); - addresses.forEach((address, i) => { - const name = path.basename(abstractionFiles[i], ".json"); + addresses.forEach((address, i) => { + const name = path.basename(abstractionFiles[i], ".json"); - if (blacklist.has(name)) return; + if (blacklist.has(name)) return; - mapping[name] = address; - }); + mapping[name] = address; + }); - const addressSource = Deployed.makeSolidityDeployedAddressesLibrary( - mapping, - self.config.compilers - ); - return { body: addressSource, resolvedPath: importPath }; - } - const assertLibraries = [ - "Assert", - "AssertAddress", - "AssertAddressArray", - // "AssertAddressPayableArray", only compatible w/ ^0.5.0 - "AssertBalance", - "AssertBool", - "AssertBytes32", - "AssertBytes32Array", - "AssertGeneral", - "AssertInt", - "AssertIntArray", - "AssertString", - "AssertUint", - "AssertUintArray" - ]; - - for (const lib of assertLibraries) { - if (importPath === `truffle/${lib}.sol`) { - const body = fse.readFileSync( - path.resolve(path.join(__dirname, `${lib}.sol`)), - { encoding: "utf8" } + const addressSource = Deployed.makeSolidityDeployedAddressesLibrary( + mapping, + self.config.compilers ); - return { body, resolvedPath: importPath }; + return { body: addressSource, filePath: importPath }; + } + const assertLibraries = [ + "Assert", + "AssertAddress", + "AssertAddressArray", + // "AssertAddressPayableArray", only compatible w/ ^0.5.0 + "AssertBalance", + "AssertBool", + "AssertBytes32", + "AssertBytes32Array", + "AssertGeneral", + "AssertInt", + "AssertIntArray", + "AssertString", + "AssertUint", + "AssertUintArray" + ]; + + for (const lib of assertLibraries) { + if (importPath === `truffle/${lib}.sol`) { + const body = fse.readFileSync( + path.resolve(path.join(__dirname, `${lib}.sol`)), + { encoding: "utf8" } + ); + return { body, filePath: importPath }; + } } } -}; -TestSource.prototype.resolve_dependency_path = (importPath, dependencyPath) => { - return dependencyPath; + resolveDependencyPath(importPath, dependencyPath) { + return dependencyPath; + } }; - -module.exports = TestSource; diff --git a/packages/core/package.json b/packages/core/package.json index 704ebf8299f..b12e481215b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -7,7 +7,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "5.1.23", + "version": "5.1.26", "bin": { "truffle": "./cli.js", "truffle-exec": "./exec.js" @@ -16,29 +16,28 @@ "test": "mocha ./test/** ./test/**/*" }, "dependencies": { - "@truffle/artifactor": "^4.0.57", - "@truffle/box": "^1.0.59", - "@truffle/codec": "^0.5.1", - "@truffle/compile-solidity": "^4.3.2", - "@truffle/config": "^1.2.17", - "@truffle/contract": "^4.2.2", + "@truffle/artifactor": "^4.0.60", + "@truffle/box": "^1.0.60", + "@truffle/codec": "^0.5.3", + "@truffle/compile-solidity": "^4.3.5", + "@truffle/config": "^1.2.18", + "@truffle/contract": "^4.2.5", "@truffle/contract-sources": "^0.1.7", - "@truffle/debug-utils": "^4.1.0", - "@truffle/debugger": "^7.2.0", - "@truffle/decoder": "^4.3.2", - "@truffle/deployer": "^3.1.18", - "@truffle/environment": "^0.2.4", + "@truffle/debug-utils": "^4.1.3", + "@truffle/debugger": "^7.3.0", + "@truffle/decoder": "^4.3.4", + "@truffle/deployer": "^3.1.21", + "@truffle/environment": "^0.2.7", "@truffle/error": "^0.0.8", "@truffle/expect": "^0.0.13", - "@truffle/interface-adapter": "^0.4.6", - "@truffle/migrate": "^3.1.18", - "@truffle/provider": "^0.2.9", + "@truffle/interface-adapter": "^0.4.7", + "@truffle/migrate": "^3.1.21", + "@truffle/provider": "^0.2.10", "@truffle/provisioner": "^0.2.0", - "@truffle/require": "^2.0.39", - "@truffle/resolver": "^5.1.11", - "@truffle/workflow-compile": "^2.1.31", + "@truffle/require": "^2.0.40", + "@truffle/resolver": "^6.0.1", + "@truffle/workflow-compile": "^2.1.34", "app-module-path": "^2.2.0", - "async": "2.6.1", "bip39": "^2.2.0", "chai": "4.2.0", "colors": "^1.1.2", @@ -54,7 +53,7 @@ "ganache-core": "2.10.2", "glob": "^7.1.4", "hdkey": "^1.1.0", - "mocha": "5.2.0", + "mocha": "5.1.1", "node-emoji": "^1.8.1", "node-ipc": "^9.1.1", "ora": "^3.4.0", @@ -62,7 +61,7 @@ "safe-eval": "^0.4.1", "sane": "^4.0.2", "semver": "^6.3.0", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "spawn-args": "^0.1.0", "temp": "^0.8.3", "universal-analytics": "^0.4.17", @@ -72,7 +71,7 @@ "yargs": "^8.0.2" }, "devDependencies": { - "@truffle/blockchain-utils": "^0.0.18", + "@truffle/blockchain-utils": "^0.0.19", "memorystream": "^0.3.1" }, "publishConfig": { diff --git a/packages/core/test/npm.js b/packages/core/test/npm.js index 7e125d13e20..9a46cf407d1 100644 --- a/packages/core/test/npm.js +++ b/packages/core/test/npm.js @@ -1,10 +1,8 @@ var assert = require("chai").assert; var Box = require("@truffle/box"); -var fs = require("fs-extra"); var glob = require("glob"); var path = require("path"); var fse = require("fs-extra"); -var async = require("async"); var Resolver = require("@truffle/resolver"); var Artifactor = require("@truffle/artifactor"); var Contracts = require("@truffle/workflow-compile"); @@ -29,78 +27,65 @@ describe("NPM integration", function() { }; config.network = "development"; - fs.writeFileSync( + fse.writeFileSync( path.join(config.contracts_directory, "Parent.sol"), parentContractSource, { encoding: "utf8" } ); }); - before("Create a fake npm source", function(done) { - var fake_source_path = path.join( + before("Create a fake npm source", () => { + const fakeSourcePath = path.join( config.working_directory, "node_modules", "fake_source", "contracts" ); - async.series( - [ - fse.ensureDir.bind(fse.ensureDir, fake_source_path), - fs.writeFile.bind( - fs, - path.join(fake_source_path, "Module.sol"), - moduleSource, - { encoding: "utf8" } - ), - fs.writeFile.bind( - fs, - path.join(fake_source_path, "ModuleDependency.sol"), - moduleDependencySource, - { encoding: "utf8" } - ) - ], - done + fse.ensureDirSync(fakeSourcePath); + fse.writeFileSync(path.join(fakeSourcePath, "Module.sol"), moduleSource, { + encoding: "utf8" + }); + fse.writeFileSync( + path.join(fakeSourcePath, "ModuleDependency.sol"), + moduleDependencySource, + { encoding: "utf8" } ); }); after("Cleanup tmp files", function(done) { glob("tmp-*", (err, files) => { if (err) done(err); - files.forEach(file => fs.removeSync(file)); + files.forEach(file => fse.removeSync(file)); done(); }); }); - it("successfully finds the correct source via Sources lookup", function(done) { - config.resolver.resolve( + it("successfully finds the correct source via Sources lookup", async function() { + const { body } = await config.resolver.resolve( "fake_source/contracts/Module.sol", - config.sources, - function(err, body) { - if (err) return done(err); - - assert.equal(body, moduleSource); - done(); - } + config.sources ); + assert.equal(body, moduleSource); }); - it("errors when module does not exist from any source", function(done) { - config.resolver.resolve( - "some_source/contracts/SourceDoesNotExist.sol", - config.sources, - function(err) { - if (!err) { - return assert.fail("Source lookup should have errored but didn't"); - } + it("errors when module does not exist from any source", async function() { + try { + await config.resolver.resolve( + "some_source/contracts/SourceDoesNotExist.sol", + config.sources + ); + } catch (err) { + assert.equal( + err.message, + "Could not find some_source/contracts/SourceDoesNotExist.sol from any sources" + ); - assert.equal( - err.message, - "Could not find some_source/contracts/SourceDoesNotExist.sol from any sources" - ); - done(); - } - ); + return; + } + + // should not be reached + assert.fail("Source lookup should have errored but didn't"); }); it("contract compiliation successfully picks up modules and their dependencies", function(done) { diff --git a/packages/debug-utils/package.json b/packages/debug-utils/package.json index 3914ccfda38..809b690932b 100644 --- a/packages/debug-utils/package.json +++ b/packages/debug-utils/package.json @@ -1,14 +1,14 @@ { "name": "@truffle/debug-utils", - "version": "4.1.0", + "version": "4.1.3", "description": "Integration utils for truffle/debugger", "dependencies": { - "@truffle/codec": "^0.5.1", + "@truffle/codec": "^0.5.3", "@trufflesuite/chromafi": "^2.1.2", "chalk": "^2.4.2", "debug": "^4.1.0", "highlight.js": "^9.15.8", - "highlightjs-solidity": "^1.0.12", + "highlightjs-solidity": "^1.0.15", "node-dir": "0.1.17" }, "main": "index.js", diff --git a/packages/debugger/lib/data/actions/index.js b/packages/debugger/lib/data/actions/index.js index fef068f05bc..721d859e024 100644 --- a/packages/debugger/lib/data/actions/index.js +++ b/packages/debugger/lib/data/actions/index.js @@ -62,12 +62,13 @@ export function defineType(node, compilationId) { } export const ALLOCATE = "DATA_ALLOCATE"; -export function allocate(storage, memory, abi, state) { +export function allocate(storage, memory, abi, calldata, state) { return { type: ALLOCATE, storage, memory, abi, + calldata, state }; } diff --git a/packages/debugger/lib/data/reducers.js b/packages/debugger/lib/data/reducers.js index 35e8cbfea80..79c100824a0 100644 --- a/packages/debugger/lib/data/reducers.js +++ b/packages/debugger/lib/data/reducers.js @@ -126,6 +126,7 @@ function allocations(state = DEFAULT_ALLOCATIONS, action) { storage: action.storage, memory: action.memory, abi: action.abi, + calldata: action.calldata, state: action.state }; } else { diff --git a/packages/debugger/lib/data/sagas/index.js b/packages/debugger/lib/data/sagas/index.js index 08a21740737..4ac5ef9fbbd 100644 --- a/packages/debugger/lib/data/sagas/index.js +++ b/packages/debugger/lib/data/sagas/index.js @@ -65,22 +65,19 @@ function* tickSaga() { } export function* decode(definition, ref, compilationId) { - let userDefinedTypes = yield select(data.views.userDefinedTypes); - let state = yield select(data.current.state); - let mappingKeys = yield select(data.views.mappingKeys); - let allocations = yield select(data.info.allocations); - let instances = yield select(data.views.instances); - let contexts = yield select(data.views.contexts); - let currentContext = yield select(data.current.context); - let internalFunctionsTable = yield select( + const userDefinedTypes = yield select(data.views.userDefinedTypes); + const state = yield select(data.current.state); + const mappingKeys = yield select(data.views.mappingKeys); + const allocations = yield select(data.info.allocations); + const contexts = yield select(data.views.contexts); + const currentContext = yield select(data.current.context); + const internalFunctionsTable = yield select( data.current.functionsByProgramCounter ); - let blockNumber = yield select(data.views.blockNumber); - let ZERO_WORD = new Uint8Array(Codec.Evm.Utils.WORD_SIZE); //automatically filled with zeroes - let NO_CODE = new Uint8Array(); //empty array + const ZERO_WORD = new Uint8Array(Codec.Evm.Utils.WORD_SIZE); //automatically filled with zeroes - let decoder = Codec.decodeVariable( + const decoder = Codec.decodeVariable( definition, ref, { @@ -108,24 +105,7 @@ export function* decode(definition, ref, compilationId) { response = ZERO_WORD; break; case "code": - let address = request.address; - if (address in instances) { - response = instances[address]; - } else if (address === Codec.Evm.Utils.ZERO_ADDRESS) { - //HACK: to avoid displaying the zero address to the user as an - //affected address just because they decoded a contract or external - //function variable that hadn't been initialized yet, we give the - //zero address's codelessness its own private cache :P - response = NO_CODE; - } else { - //I don't want to write a new web3 saga, so let's just use - //obtainBinaries with a one-element array - debug("fetching binary"); - let binary = (yield* web3.obtainBinaries([address], blockNumber))[0]; - debug("adding instance"); - yield* evm.addInstance(address, binary); - response = Codec.Conversion.toBytes(binary); - } + response = yield* requestCode(request.address); break; default: debug("unrecognized request type!"); @@ -139,6 +119,74 @@ export function* decode(definition, ref, compilationId) { return result.value; } +export function* decodeReturnValue() { + const userDefinedTypes = yield select(data.views.userDefinedTypes); + const state = yield select(data.next.state); //next state has the return data + const allocations = yield select(data.info.allocations); + const contexts = yield select(data.views.contexts); + const status = yield select(data.current.returnStatus); //may be undefined + const returnAllocation = yield select(data.current.returnAllocation); //may be null + + const decoder = Codec.decodeReturndata( + { + userDefinedTypes, + state, + allocations, + contexts + }, + returnAllocation, + status + ); + + debug("beginning decoding"); + let result = decoder.next(); + while (!result.done) { + debug("request received"); + let request = result.value; + let response; + switch (request.type) { + //skip storage case, it won't happen here + case "code": + response = yield* requestCode(request.address); + break; + default: + debug("unrecognized request type!"); + } + debug("sending response"); + result = decoder.next(response); + } + //at this point, result.value holds the final value + debug("done decoding"); + return result.value; +} + +//NOTE: calling this *can* add a new instance, which will not +//go away on a reset! Yes, this is a little weird, but we +//decided this is OK for now +function* requestCode(address) { + const NO_CODE = new Uint8Array(); //empty array + const blockNumber = yield select(data.views.blockNumber); + const instances = yield select(data.views.instances); + + if (address in instances) { + return instances[address]; + } else if (address === Codec.Evm.Utils.ZERO_ADDRESS) { + //HACK: to avoid displaying the zero address to the user as an + //affected address just because they decoded a contract or external + //function variable that hadn't been initialized yet, we give the + //zero address's codelessness its own private cache :P + return NO_CODE; + } else { + //I don't want to write a new web3 saga, so let's just use + //obtainBinaries with a one-element array + debug("fetching binary"); + let binary = (yield* web3.obtainBinaries([address], blockNumber))[0]; + debug("adding instance"); + yield* evm.addInstance(address, binary); + return Codec.Conversion.toBytes(binary); + } +} + function* variablesAndMappingsSaga() { let node = yield select(data.current.node); let pointer = yield select(data.current.pointer); @@ -865,9 +913,15 @@ export function* recordAllocations() { const memoryAllocations = Codec.Memory.Allocate.getMemoryAllocations( userDefinedTypes ); - const calldataAllocations = Codec.AbiData.Allocate.getAbiAllocations( + const abiAllocations = Codec.AbiData.Allocate.getAbiAllocations( userDefinedTypes ); + const calldataAllocations = Codec.AbiData.Allocate.getCalldataAllocations( + contracts, + referenceDeclarations, + userDefinedTypes, + abiAllocations + ); const stateAllocations = Codec.Storage.Allocate.getStateAllocations( contracts, referenceDeclarations, @@ -878,6 +932,7 @@ export function* recordAllocations() { actions.allocate( storageAllocations, memoryAllocations, + abiAllocations, calldataAllocations, stateAllocations ) diff --git a/packages/debugger/lib/data/selectors/index.js b/packages/debugger/lib/data/selectors/index.js index 045c0d613c6..0115ea372ab 100644 --- a/packages/debugger/lib/data/selectors/index.js +++ b/packages/debugger/lib/data/selectors/index.js @@ -381,6 +381,12 @@ const data = createSelectorTree({ context.compilationId === compilationId && context.contractId === id ); + let constructorContext = Object.values(contexts).find( + context => + context.isConstructor && + context.compilationId === compilationId && + context.contractId === id + ); let immutableReferences = deployedContext ? deployedContext.immutableReferences : undefined; @@ -388,10 +394,14 @@ const data = createSelectorTree({ contractNode: scopes[compilationId][id].definition, compilationId, immutableReferences, - //we don't just use deployedContext because it might not exist! + //we don't just use deployedContext to get compiler because it might not exist! compiler: sources[compilationId].byId[scopes[compilationId][id].sourceId] - .compiler + .compiler, + //the following three are only needed for decoding return values + abi: (deployedContext || {}).abi, + deployedContext, + constructorContext }; }) ), @@ -508,7 +518,12 @@ const data = createSelectorTree({ /* * data.info.allocations.abi */ - abi: createLeaf(["/state"], state => state.info.allocations.abi) + abi: createLeaf(["/state"], state => state.info.allocations.abi), + + /* + * data.info.allocations.calldata + */ + calldata: createLeaf(["/state"], state => state.info.allocations.calldata) }, /** @@ -882,7 +897,7 @@ const data = createSelectorTree({ address: createLeaf([evm.current.call], call => call.storageAddress), - /* + /** * data.current.functionsByProgramCounter */ functionsByProgramCounter: createLeaf( @@ -890,7 +905,7 @@ const data = createSelectorTree({ functions => functions ), - /* + /** * data.current.context */ context: createLeaf([evm.current.context], debuggerContextToDecoderContext), @@ -1254,7 +1269,46 @@ const data = createSelectorTree({ ) ) ) - } + }, + + /** + * data.current.returnStatus + */ + returnStatus: createLeaf( + [evm.current.step.returnStatus], + status => (status === null ? undefined : status) //convert null to undefined to be safe + ), + + /** + * data.current.returnAllocation + */ + returnAllocation: createLeaf( + [evm.current.call, "/current/context", "/info/allocations/calldata"], + ( + { data: calldata }, + { context, isConstructor }, + { constructorAllocations, functionAllocations } + ) => { + if (isConstructor) { + //we're in a constructor call + let allocation = constructorAllocations[context]; + if (!allocation) { + return null; + } + return allocation.output; + } else { + //usual case + let selector = calldata.slice(0, 2 + 4 * 2); //extract first 4 bytes of hex string + debug("selector: %s", selector); + debug("bySelector: %o", functionAllocations[context]); + let allocation = (functionAllocations[context] || {})[selector]; + if (!allocation) { + return null; + } + return allocation.output; + } + } + ) }, /** @@ -1274,6 +1328,16 @@ const data = createSelectorTree({ [evm.next.state.stack], words => (words || []).map(word => Codec.Conversion.toBytes(word)) + ), + + /** + * data.next.state.returndata + * NOTE: this is only for use by returnValue(); this is *not* + * an accurate reflection of the current contents of returndata! + * we don't track that at the moment + */ + returndata: createLeaf([evm.current.step.returnValue], data => + Codec.Conversion.toBytes(data) ) }, diff --git a/packages/debugger/lib/debugger.js b/packages/debugger/lib/debugger.js index 61d245f3ce2..7e174f0997e 100644 --- a/packages/debugger/lib/debugger.js +++ b/packages/debugger/lib/debugger.js @@ -74,16 +74,18 @@ const Debugger = { * @example * Debugger.selectors.trace.steps */ - selectors: createNestedSelector({ - ast: astSelector, - data: dataSelector, - trace: traceSelector, - evm: evmSelector, - solidity: soliditySelector, - stacktrace: stacktraceSelector, - session: sessionSelector, - controller: controllerSelector - }) + get selectors() { + return createNestedSelector({ + ast: astSelector, + data: dataSelector, + trace: traceSelector, + evm: evmSelector, + solidity: soliditySelector, + stacktrace: stacktraceSelector, + session: sessionSelector, + controller: controllerSelector + }); + } }; export default Debugger; diff --git a/packages/debugger/lib/evm/sagas/index.js b/packages/debugger/lib/evm/sagas/index.js index 6f02d0adb89..e0331956b9c 100644 --- a/packages/debugger/lib/evm/sagas/index.js +++ b/packages/debugger/lib/evm/sagas/index.js @@ -75,6 +75,12 @@ function* tickSaga() { yield* trace.signalTickSagaCompletion(); } +//NOTE: We don't account here for multiple simultaneous returns. +//Such a case is *vanishingly* unlikely to come up in real code +//so it's simply not worth the trouble. Such a case will screw +//up the debugger pretty good as a result. +//(...but I might go back and do it later. :P ) + export function* callstackAndCodexSaga() { if (yield select(evm.current.step.isExceptionalHalting)) { //let's handle this case first so we can be sure everything else is *not* @@ -121,7 +127,7 @@ export function* callstackAndCodexSaga() { yield put(actions.create(binary, createdAddress, sender, value)); //as above, storageAddress handles when calling from a creation call - } else if (yield select(evm.current.step.isHalting)) { + } else if (yield select(evm.current.step.isNormalHalting)) { debug("got return"); let { binary, storageAddress } = yield select(evm.current.call); diff --git a/packages/debugger/lib/evm/selectors/index.js b/packages/debugger/lib/evm/selectors/index.js index 966d70072ba..8851e9c28d1 100644 --- a/packages/debugger/lib/evm/selectors/index.js +++ b/packages/debugger/lib/evm/selectors/index.js @@ -14,8 +14,7 @@ import { isShortCallMnemonic, isDelegateCallMnemonicBroad, isDelegateCallMnemonicStrict, - isStaticCallMnemonic, - isNormalHaltingMnemonic + isStaticCallMnemonic } from "lib/helpers"; const ZERO_WORD = "00".repeat(Codec.Evm.Utils.WORD_SIZE); @@ -132,18 +131,6 @@ function createStepSelectors(step, state = null) { */ isCreate2: createLeaf(["./trace"], step => step.op === "CREATE2"), - /** - * .isHalting - * - * whether the instruction halts or returns from a calling context - * NOTE: this covers only ordinary halts, not exceptional halts; - * but it doesn't check the return status, so any normal halting - * instruction will qualify here - */ - isHalting: createLeaf(["./trace"], step => - isNormalHaltingMnemonic(step.op) - ), - /* * .isStore */ @@ -221,7 +208,13 @@ function createStepSelectors(step, state = null) { const offset = parseInt(stack[stack.length - 2], 16) * 2; const length = parseInt(stack[stack.length - 3], 16) * 2; - return "0x" + memory.join("").substring(offset, offset + length); + return ( + "0x" + + memory + .join("") + .substring(offset, offset + length) + .padEnd(length, "00") + ); } ), @@ -247,7 +240,13 @@ function createStepSelectors(step, state = null) { const offset = parseInt(stack[stack.length - 4 + argOffset], 16) * 2; const length = parseInt(stack[stack.length - 5 + argOffset], 16) * 2; - return "0x" + memory.join("").substring(offset, offset + length); + return ( + "0x" + + memory + .join("") + .substring(offset, offset + length) + .padEnd(length, "00") + ); } ), @@ -513,14 +512,13 @@ const evm = createSelectorTree({ * are we doing a call or create for which there are no trace steps? * This can happen if: * 1. we call a precompile - * 2. we call an externally-owned account + * 2. we call an externally-owned account (or other account w/no code) * 3. we do a call or create but the call stack is exhausted * 4. we attempt to transfer more ether than we have */ isInstantCallOrCreate: createLeaf( - ["./isCall", "./isCreate", "/current/state/depth", "/next/state/depth"], - (calls, creates, currentDepth, nextDepth) => - (calls || creates) && currentDepth === nextDepth + ["./isCall", "./isCreate", "./isContextChange"], + (calls, creates, contextChange) => (calls || creates) && !contextChange ), /** @@ -532,27 +530,39 @@ const evm = createSelectorTree({ (currentDepth, nextDepth) => currentDepth !== nextDepth ), + /** + * .isNormalHalting + */ + isNormalHalting: createLeaf( + ["./isHalting", "./returnStatus"], + (isHalting, status) => isHalting && status + ), + + /** + * .isHalting + * + * whether the instruction halts or returns from a calling context + * NOTE: this covers only ordinary halts, not exceptional halts; + * but it doesn't check the return status, so any normal halting + * instruction will qualify here + */ + isHalting: createLeaf( + ["/current/state/depth", "/next/state/depth"], + (currentDepth, nextDepth) => nextDepth < currentDepth + ), + /** * evm.current.step.isExceptionalHalting */ isExceptionalHalting: createLeaf( - [ - "./isHalting", - "/current/state/depth", - "/next/state/depth", - "./returnStatus" - ], - (halting, currentDepth, nextDepth, status) => - halting - ? !status //if deliberately halting, check the return status - : nextDepth < currentDepth //if not on a deliberate halt, any halt - //is an exceptional halt + ["./isHalting", "./returnStatus"], + (isHalting, status) => isHalting && !status ), /** * evm.current.step.returnStatus - * checks the return status of the *current* halting instruction (for - * normal halts only) + * checks the return status of the *current* halting instruction + * returns null if not halting * (returns a boolean -- true for success, false for failure) */ returnStatus: createLeaf( @@ -601,7 +611,13 @@ const evm = createSelectorTree({ const offset = parseInt(stack[stack.length - 1], 16) * 2; const length = parseInt(stack[stack.length - 2], 16) * 2; - return "0x" + memory.join("").substring(offset, offset + length); + return ( + "0x" + + memory + .join("") + .substring(offset, offset + length) + .padEnd(length, "00") + ); } ) }, diff --git a/packages/debugger/lib/helpers/index.js b/packages/debugger/lib/helpers/index.js index c84ec8fcf39..a362db545e1 100644 --- a/packages/debugger/lib/helpers/index.js +++ b/packages/debugger/lib/helpers/index.js @@ -138,13 +138,3 @@ export function isCreateMnemonic(op) { const creates = ["CREATE", "CREATE2"]; return creates.includes(op); } - -/* - * Given a mmemonic, determine whether it's the mnemonic of a normal - * halting instruction - */ -export function isNormalHaltingMnemonic(op) { - const halts = ["STOP", "RETURN", "SELFDESTRUCT", "SUICIDE"]; - //the mnemonic SUICIDE is no longer used, but just in case, I'm including it - return halts.includes(op); -} diff --git a/packages/debugger/lib/session/index.js b/packages/debugger/lib/session/index.js index 022a7669cbd..e751aa783de 100644 --- a/packages/debugger/lib/session/index.js +++ b/packages/debugger/lib/session/index.js @@ -386,6 +386,16 @@ export default class Session { return decoded; } + async returnValue() { + if ( + !this.view(session.status.loaded) || + !this.view(evm.current.step.isHalting) + ) { + return null; + } + return await this._runSaga(dataSagas.decodeReturnValue); + } + callstack() { if (!this.view(session.status.loaded)) { return null; diff --git a/packages/debugger/lib/solidity/sagas/index.js b/packages/debugger/lib/solidity/sagas/index.js index 0c7e4a35b4e..081b1c6142b 100644 --- a/packages/debugger/lib/solidity/sagas/index.js +++ b/packages/debugger/lib/solidity/sagas/index.js @@ -23,7 +23,7 @@ function* tickSaga() { } function* functionDepthSaga() { - if (yield select(solidity.current.willFail)) { + if (yield select(solidity.current.willReturn)) { //we do this case first so we can be sure we're not failing in any of the //other cases below! yield put(actions.externalReturn()); @@ -41,8 +41,6 @@ function* functionDepthSaga() { debug("checking if guard needed"); let guard = yield select(solidity.current.callRequiresPhantomFrame); yield put(actions.externalCall(guard)); - } else if (yield select(solidity.current.willReturn)) { - yield put(actions.externalReturn()); } } diff --git a/packages/debugger/lib/solidity/selectors/index.js b/packages/debugger/lib/solidity/selectors/index.js index 6c473f535aa..025319a2f2b 100644 --- a/packages/debugger/lib/solidity/selectors/index.js +++ b/packages/debugger/lib/solidity/selectors/index.js @@ -312,17 +312,14 @@ let solidity = createSelectorTree({ /** * solidity.current.willReturn + * + * covers both normal returns & failures */ willReturn: createLeaf( [evm.current.step.isHalting], isHalting => isHalting ), - /** - * solidity.current.willFail - */ - willFail: createLeaf([evm.current.step.isExceptionalHalting], x => x), - /** * solidity.current.nextMapped * returns the next trace step after this one which is sourcemapped diff --git a/packages/debugger/lib/stacktrace/sagas/index.js b/packages/debugger/lib/stacktrace/sagas/index.js index 6c76bdb59ea..0f2f8f5b387 100644 --- a/packages/debugger/lib/stacktrace/sagas/index.js +++ b/packages/debugger/lib/stacktrace/sagas/index.js @@ -27,7 +27,7 @@ function* stacktraceSaga() { let positionUpdated = false; //different possible outcomes: //first: are we returning? - if (yield select(stacktrace.current.willReturnOrFail)) { + if (yield select(stacktrace.current.willReturn)) { const status = yield select(stacktrace.current.returnStatus); debug("returning!"); yield put(actions.externalReturn(lastLocation, status, currentLocation)); diff --git a/packages/debugger/lib/stacktrace/selectors/index.js b/packages/debugger/lib/stacktrace/selectors/index.js index fa4858922f1..8a5fad249b8 100644 --- a/packages/debugger/lib/stacktrace/selectors/index.js +++ b/packages/debugger/lib/stacktrace/selectors/index.js @@ -175,26 +175,10 @@ let stacktrace = createSelectorTree({ */ willReturn: createLeaf([solidity.current.willReturn], identity), - /** - * stacktrace.current.willFail - */ - willFail: createLeaf([solidity.current.willFail], identity), - - /** - * stacktrace.current.willReturnOrFail - */ - willReturnOrFail: createLeaf( - ["./willReturn", "./willFail"], - (willReturn, willFail) => willReturn || willFail - ), - /** * stacktrace.current.returnStatus */ - returnStatus: createLeaf( - ["./willReturn", "./willFail"], - (returns, fails) => (returns ? true : fails ? false : null) - ), + returnStatus: createLeaf([evm.current.step.returnStatus], identity), /** * stacktrace.current.revertString diff --git a/packages/debugger/package.json b/packages/debugger/package.json index cf9caabf323..a050fc9d796 100644 --- a/packages/debugger/package.json +++ b/packages/debugger/package.json @@ -8,7 +8,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "7.2.0", + "version": "7.3.0", "main": "dist/debugger.js", "scripts": { "build": "webpack --config webpack/webpack.config.js", @@ -20,10 +20,10 @@ "test:debug": "NODE_ENV=testing node --inspect ./node_modules/.bin/mocha-webpack --webpack-config webpack/webpack.config-test.js --recursive" }, "dependencies": { - "@truffle/codec": "^0.5.1", - "@truffle/compile-solidity": "^4.3.2", + "@truffle/codec": "^0.5.3", + "@truffle/compile-solidity": "^4.3.5", "@truffle/expect": "^0.0.13", - "@truffle/solidity-utils": "^1.3.4", + "@truffle/solidity-utils": "^1.3.6", "bn.js": "^4.11.8", "debug": "^4.1.0", "json-pointer": "^0.6.0", @@ -35,19 +35,19 @@ "redux-cli-logger": "^2.0.1", "redux-saga": "1.0.0", "remote-redux-devtools": "^0.5.12", - "reselect-tree": "^1.3.1", + "reselect-tree": "^1.3.3", "semver": "^6.3.0", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "web3": "1.2.1", "web3-eth-abi": "1.2.1" }, "devDependencies": { - "@truffle/artifactor": "^4.0.57", - "@truffle/box": "^1.0.59", - "@truffle/debug-utils": "^4.1.0", - "@truffle/migrate": "^3.1.18", - "@truffle/resolver": "^5.1.11", - "@truffle/workflow-compile": "^2.1.31", + "@truffle/artifactor": "^4.0.60", + "@truffle/box": "^1.0.60", + "@truffle/debug-utils": "^4.1.3", + "@truffle/migrate": "^3.1.21", + "@truffle/resolver": "^6.0.1", + "@truffle/workflow-compile": "^2.1.34", "babel-core": "^6.26.0", "babel-loader": "^7.1.2", "babel-plugin-transform-object-rest-spread": "^6.26.0", diff --git a/packages/debugger/test/data/returnvalue.js b/packages/debugger/test/data/returnvalue.js new file mode 100644 index 00000000000..e96e59e71a8 --- /dev/null +++ b/packages/debugger/test/data/returnvalue.js @@ -0,0 +1,193 @@ +import debugModule from "debug"; +const debug = debugModule("test:data:returnvalue"); + +import { assert } from "chai"; + +import Ganache from "ganache-core"; + +import { prepareContracts } from "../helpers"; +import Debugger from "lib/debugger"; + +import * as Codec from "@truffle/codec"; + +const __RETURNVALUES = ` +pragma solidity ^0.6.6; + +contract ReturnValues { + constructor(bool fail) public { + if(fail) { + selfdestruct(tx.origin); + } + } + + function fail() public { + revert(); + } + + function failNoisy() public { + revert("Noise!"); + } + + function pair() public returns (int x, int) { + return (-1, -2); + } +} + +library ReturnLibrary { +} +`; + +const __MIGRATION = ` +var ReturnValues = artifacts.require("ReturnValues"); +var ReturnLibrary = artifacts.require("ReturnLibrary"); + +module.exports = function(deployer) { + deployer.deploy(ReturnValues, false); + deployer.deploy(ReturnLibrary); +}; +`; + +let sources = { + "ReturnValues.sol": __RETURNVALUES +}; + +let migrations = { + "2_deploy_contracts.js": __MIGRATION +}; + +describe("Return value decoding", function() { + var provider; + + var abstractions; + var compilations; + + before("Create Provider", async function() { + provider = Ganache.provider({ seed: "debugger", gasLimit: 7000000 }); + }); + + before("Prepare contracts and artifacts", async function() { + this.timeout(30000); + + let prepared = await prepareContracts(provider, sources, migrations); + abstractions = prepared.abstractions; + compilations = prepared.compilations; + }); + + it("Decodes return values correctly", async function() { + this.timeout(9000); + + let instance = await abstractions.ReturnValues.deployed(); + let receipt = await instance.pair(); + let txHash = receipt.tx; + + let bugger = await Debugger.forTx(txHash, { provider, compilations }); + + await bugger.continueUntilBreakpoint(); //run till end + + const decodings = await bugger.returnValue(); + assert.lengthOf(decodings, 1); + const decoding = decodings[0]; + assert.strictEqual(decoding.kind, "return"); + const outputs = decoding.arguments; + assert.lengthOf(outputs, 2); + assert.strictEqual(outputs[0].name, "x"); + assert.isUndefined(outputs[1].name); + const values = outputs.map(({ value }) => + Codec.Format.Utils.Inspect.nativize(value) + ); + assert.deepEqual(values, [-1, -2]); + }); + + it("Decodes bytecode", async function() { + this.timeout(12000); + + let instance = await abstractions.ReturnValues.new(false); + let txHash = instance.transactionHash; + debug("txHash: %s", txHash); + + let bugger = await Debugger.forTx(txHash, { provider, compilations }); + + debug("about to run!"); + await bugger.continueUntilBreakpoint(); //run till end + debug("ran!"); + + const decodings = await bugger.returnValue(); + assert.lengthOf(decodings, 1); + const decoding = decodings[0]; + assert.strictEqual(decoding.kind, "bytecode"); + assert.strictEqual(decoding.class.typeName, "ReturnValues"); + }); + + it("Decodes library bytecode", async function() { + this.timeout(12000); + + let instance = await abstractions.ReturnLibrary.new(); + let txHash = instance.transactionHash; + debug("txHash: %s", txHash); + + let bugger = await Debugger.forTx(txHash, { provider, compilations }); + + debug("about to run!"); + await bugger.continueUntilBreakpoint(); //run till end + debug("ran!"); + + const decodings = await bugger.returnValue(); + assert.lengthOf(decodings, 1); + const decoding = decodings[0]; + assert.strictEqual(decoding.kind, "bytecode"); + assert.strictEqual(decoding.class.typeName, "ReturnLibrary"); + assert.strictEqual(decoding.address, instance.address); + }); + + it("Decodes messageless revert", async function() { + this.timeout(9000); + + //HACK: because this transaction makes web3 throw, we have to extract the hash from + //the resulting exception (there is supposed to be a non-hacky way but it + //does not presently work) + let instance = await abstractions.ReturnValues.deployed(); + let txHash; + try { + await instance.fail(); //web3 throws on failure + } catch (error) { + txHash = error.hashes[0]; //it's the only hash involved + } + + let bugger = await Debugger.forTx(txHash, { provider, compilations }); + + await bugger.continueUntilBreakpoint(); //run till end + + const decodings = await bugger.returnValue(); + assert.lengthOf(decodings, 1); + const decoding = decodings[0]; + assert.strictEqual(decoding.kind, "failure"); + }); + + it("Decodes revert string", async function() { + this.timeout(9000); + + //HACK: because this transaction makes web3 throw, we have to extract the hash from + //the resulting exception (there is supposed to be a non-hacky way but it + //does not presently work) + let instance = await abstractions.ReturnValues.deployed(); + let txHash; + try { + await instance.failNoisy(); //web3 throws on failure + } catch (error) { + txHash = error.hashes[0]; //it's the only hash involved + } + + let bugger = await Debugger.forTx(txHash, { provider, compilations }); + + await bugger.continueUntilBreakpoint(); //run till end + + const decodings = await bugger.returnValue(); + assert.lengthOf(decodings, 1); + const decoding = decodings[0]; + assert.strictEqual(decoding.kind, "revert"); + const outputs = decoding.arguments; + assert.lengthOf(outputs, 1); + const message = Codec.Format.Utils.Inspect.nativize(outputs[0].value); + assert.strictEqual(message, "Noise!"); + }); +}); diff --git a/packages/debugger/test/helpers.js b/packages/debugger/test/helpers.js index 0e595ea8dbd..863fb608eca 100644 --- a/packages/debugger/test/helpers.js +++ b/packages/debugger/test/helpers.js @@ -80,7 +80,6 @@ export async function createSandbox() { name: "default" }); config.resolver = new Resolver(config); - config.resolver = new Resolver(config); config.artifactor = new Artifactor(config.contracts_build_directory); config.networks = {}; diff --git a/packages/decoder/package.json b/packages/decoder/package.json index 0ce066cf4e3..1a062f7d4a8 100644 --- a/packages/decoder/package.json +++ b/packages/decoder/package.json @@ -1,6 +1,6 @@ { "name": "@truffle/decoder", - "version": "4.3.2", + "version": "4.3.4", "description": "A decoder and encoder for Solidity variables of all sorts", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -14,12 +14,12 @@ "test": "cd test/current && npx truffle test && cd ../legacy && npx truffle test" }, "dependencies": { - "@truffle/codec": "^0.5.1", - "@truffle/compile-solidity": "^4.3.2", - "@truffle/solidity-utils": "^1.3.4", + "@truffle/codec": "^0.5.3", + "@truffle/compile-solidity": "^4.3.5", + "@truffle/solidity-utils": "^1.3.6", "bn.js": "^4.11.8", "debug": "^4.1.0", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "web3": "1.2.1" }, "repository": "https://github.com/trufflesuite/truffle/tree/master/packages/codec", @@ -42,13 +42,12 @@ "access": "public" }, "devDependencies": { - "@truffle/config": "^1.2.17", + "@truffle/config": "^1.2.18", "@truffle/contract-schema": "^3.1.0", - "@truffle/provider": "^0.2.9", + "@truffle/provider": "^0.2.10", "@types/big.js": "^4.0.5", "@types/bn.js": "^4.11.2", "@types/debug": "^0.0.31", - "@types/utf8": "^2.1.6", "@types/web3": "1.0.19", "chai": "^4.2.0", "lodash.clonedeep": "^4.5.0", diff --git a/packages/deployer/package.json b/packages/deployer/package.json index 98e46c9258d..48439ea3229 100644 --- a/packages/deployer/package.json +++ b/packages/deployer/package.json @@ -8,7 +8,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "3.1.18", + "version": "3.1.21", "main": "index.js", "scripts": { "test": "mocha --no-warnings --timeout 10000 --exit" @@ -16,7 +16,7 @@ "dependencies": { "@ensdomains/ens": "^0.4.0", "@ensdomains/resolver": "^0.2.0", - "@truffle/contract": "^4.2.2", + "@truffle/contract": "^4.2.5", "@truffle/expect": "^0.0.13", "emittery": "^0.4.0", "eth-ens-namehash": "^2.0.8", @@ -25,7 +25,7 @@ }, "devDependencies": { "@truffle/reporters": "^1.1.0", - "@truffle/workflow-compile": "^2.1.31", + "@truffle/workflow-compile": "^2.1.34", "ganache-core": "2.10.2", "mocha": "5.2.0", "sinon": "^7.3.2", diff --git a/packages/environment/package.json b/packages/environment/package.json index 2fe37068fed..dbc2ece6b14 100644 --- a/packages/environment/package.json +++ b/packages/environment/package.json @@ -9,17 +9,17 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "0.2.4", + "version": "0.2.7", "main": "index.js", "dependencies": { - "@truffle/artifactor": "^4.0.57", + "@truffle/artifactor": "^4.0.60", "@truffle/error": "^0.0.8", "@truffle/expect": "^0.0.13", - "@truffle/interface-adapter": "^0.4.6", - "@truffle/resolver": "^5.1.11", + "@truffle/interface-adapter": "^0.4.7", + "@truffle/resolver": "^6.0.1", "ganache-core": "2.10.2", "node-ipc": "^9.1.1", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "web3": "1.2.1" }, "devDependencies": { diff --git a/packages/hdwallet-provider/package.json b/packages/hdwallet-provider/package.json index acdfe2982a3..bb01bd72185 100644 --- a/packages/hdwallet-provider/package.json +++ b/packages/hdwallet-provider/package.json @@ -8,7 +8,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "1.0.34", + "version": "1.0.35", "main": "dist/index.js", "scripts": { "build": "tsc", @@ -24,7 +24,7 @@ "ethereumjs-tx": "^1.0.0", "ethereumjs-util": "^6.1.0", "ethereumjs-wallet": "^0.6.3", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "web3": "1.2.1", "web3-provider-engine": "https://github.com/trufflesuite/provider-engine#web3-one" }, diff --git a/packages/hdwallet-provider/src/index.ts b/packages/hdwallet-provider/src/index.ts index 44d9193fbe9..0f3b3f8bcb9 100644 --- a/packages/hdwallet-provider/src/index.ts +++ b/packages/hdwallet-provider/src/index.ts @@ -183,7 +183,11 @@ class HDWalletProvider { } else { this.engine.addProvider(new ProviderSubprovider(provider)); } - this.engine.start(); // Required by the provider engine. + + // Required by the provider engine. + this.engine.start(err => { + if (err) throw err; + }); } public send( diff --git a/packages/hdwallet-provider/typings/web3-provider-engine/index.d.ts b/packages/hdwallet-provider/typings/web3-provider-engine/index.d.ts index 351578a2eb0..b45e61ef120 100644 --- a/packages/hdwallet-provider/typings/web3-provider-engine/index.d.ts +++ b/packages/hdwallet-provider/typings/web3-provider-engine/index.d.ts @@ -23,7 +23,7 @@ declare class Web3ProviderEngine implements Provider { ): void; addProvider(provider: any): void; // start block polling - start(callback?: () => void): void; + start(callback?: (error?: Error) => void): void; // stop block polling stop(): void; } diff --git a/packages/interface-adapter/package.json b/packages/interface-adapter/package.json index 2a72c0a03a2..4009f052695 100644 --- a/packages/interface-adapter/package.json +++ b/packages/interface-adapter/package.json @@ -7,7 +7,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "0.4.6", + "version": "0.4.7", "main": "dist/index.js", "directories": { "lib": "lib" @@ -21,11 +21,11 @@ "dependencies": { "bn.js": "^4.11.8", "ethers": "^4.0.32", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "web3": "1.2.1" }, "devDependencies": { - "@truffle/provider": "^0.2.9", + "@truffle/provider": "^0.2.10", "@types/bn.js": "^4.11.4", "@types/mocha": "^5.2.6", "@types/web3": "1.0.19", diff --git a/packages/migrate/package.json b/packages/migrate/package.json index 3a35da51379..4b53d0cb493 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -8,18 +8,18 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "3.1.18", + "version": "3.1.21", "main": "index.js", "scripts": { "test": "mocha ./test/* ./test/**/*" }, "dependencies": { - "@truffle/config": "^1.2.17", - "@truffle/deployer": "^3.1.18", + "@truffle/config": "^1.2.18", + "@truffle/deployer": "^3.1.21", "@truffle/expect": "^0.0.13", - "@truffle/interface-adapter": "^0.4.6", + "@truffle/interface-adapter": "^0.4.7", "@truffle/reporters": "^1.1.0", - "@truffle/require": "^2.0.39", + "@truffle/require": "^2.0.40", "emittery": "^0.4.0", "glob": "^7.1.6", "web3": "1.2.1" diff --git a/packages/provider/package.json b/packages/provider/package.json index bb8ab4d1c83..81dde34d491 100644 --- a/packages/provider/package.json +++ b/packages/provider/package.json @@ -8,7 +8,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "0.2.9", + "version": "0.2.10", "main": "index.js", "scripts": { "test": "mocha" @@ -16,7 +16,7 @@ "types": "./typings/index.d.ts", "dependencies": { "@truffle/error": "^0.0.8", - "@truffle/interface-adapter": "^0.4.6", + "@truffle/interface-adapter": "^0.4.7", "web3": "1.2.1" }, "devDependencies": { diff --git a/packages/require/package.json b/packages/require/package.json index 5a9ba9f9cf1..f096272146e 100644 --- a/packages/require/package.json +++ b/packages/require/package.json @@ -8,15 +8,15 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "2.0.39", + "version": "2.0.40", "main": "require.js", "scripts": { "test": "mocha" }, "dependencies": { - "@truffle/config": "^1.2.17", + "@truffle/config": "^1.2.18", "@truffle/expect": "^0.0.13", - "@truffle/interface-adapter": "^0.4.6", + "@truffle/interface-adapter": "^0.4.7", "original-require": "1.0.1", "web3": "1.2.1" }, diff --git a/packages/resolver/lib/resolver.ts b/packages/resolver/lib/resolver.ts index accfce80ea1..f0a5eff08cb 100644 --- a/packages/resolver/lib/resolver.ts +++ b/packages/resolver/lib/resolver.ts @@ -5,13 +5,6 @@ const provision = require("@truffle/provisioner"); import { ResolverSource } from "./source"; import { constructSources } from "./sources"; -type Callback = ( - err: Error | null, - body?: string, - filePath?: string, - source?: ResolverSource -) => void; - export class Resolver { options: any; sources: ResolverSource[]; @@ -39,20 +32,7 @@ export class Resolver { ); } - resolve(importPath: string, importedFrom: string, callback: Callback) { - if (typeof importedFrom === "function") { - callback = importedFrom; - importedFrom = null; - } - - this._resolve(importPath, importedFrom) - .then(({ body, filePath, source }) => - callback(null, body, filePath, source) - ) - .catch(error => callback(error)); - } - - private async _resolve( + async resolve( importPath: string, importedFrom: string ): Promise<{ body: string; filePath: string; source: ResolverSource }> { diff --git a/packages/resolver/lib/source.ts b/packages/resolver/lib/source.ts index 2666d89b8b2..d669cc5d7ff 100644 --- a/packages/resolver/lib/source.ts +++ b/packages/resolver/lib/source.ts @@ -3,7 +3,7 @@ import { ContractObject } from "@truffle/contract-schema/spec"; export interface ResolverSource { require(importPath: string, searchPath?: string): ContractObject | null; resolve(importPath: string, importedFrom: string): Promise; - resolve_dependency_path(importPath: string, dependencyPath: string): string; + resolveDependencyPath(importPath: string, dependencyPath: string): string; } export interface SourceResolution { diff --git a/packages/resolver/lib/sources/ethpm-v1.ts b/packages/resolver/lib/sources/ethpm-v1.ts index 9bed04efb24..4165fce4c1e 100644 --- a/packages/resolver/lib/sources/ethpm-v1.ts +++ b/packages/resolver/lib/sources/ethpm-v1.ts @@ -117,7 +117,7 @@ export class EthPMv1 implements ResolverSource { // i.e., if some_module/contracts/MyContract.sol imported "./AnotherContract.sol", // we're going to resolve it to some_module/contracts/AnotherContract.sol, ensuring // that when this path is evaluated this source is used again. - resolve_dependency_path(importPath: string, dependencyPath: string) { + resolveDependencyPath(importPath: string, dependencyPath: string) { var dirname = path.dirname(importPath); var resolved_dependency_path = path.join(dirname, dependencyPath); diff --git a/packages/resolver/lib/sources/fs.ts b/packages/resolver/lib/sources/fs.ts index a955c386c0d..137c1e17207 100644 --- a/packages/resolver/lib/sources/fs.ts +++ b/packages/resolver/lib/sources/fs.ts @@ -80,7 +80,7 @@ export class FS implements ResolverSource { } // Here we're resolving from local files to local files, all absolute. - resolve_dependency_path(importPath: string, dependencyPath: string) { + resolveDependencyPath(importPath: string, dependencyPath: string) { const dirname = path.dirname(importPath); return path.resolve(path.join(dirname, dependencyPath)); } diff --git a/packages/resolver/lib/sources/globalnpm.ts b/packages/resolver/lib/sources/globalnpm.ts index 14525b27de8..75f800ebe90 100644 --- a/packages/resolver/lib/sources/globalnpm.ts +++ b/packages/resolver/lib/sources/globalnpm.ts @@ -57,7 +57,7 @@ export class GlobalNPM implements ResolverSource { // i.e., if some_module/contracts/MyContract.sol imported "./AnotherContract.sol", // we're going to resolve it to some_module/contracts/AnotherContract.sol, ensuring // that when this path is evaluated this source is used again. - resolve_dependency_path(importPath: string, dependencyPath: string) { + resolveDependencyPath(importPath: string, dependencyPath: string) { var dirname = path.dirname(importPath); return path.join(dirname, dependencyPath); } diff --git a/packages/resolver/lib/sources/npm.ts b/packages/resolver/lib/sources/npm.ts index bf0add15682..f9f630f5458 100644 --- a/packages/resolver/lib/sources/npm.ts +++ b/packages/resolver/lib/sources/npm.ts @@ -65,7 +65,7 @@ export class NPM implements ResolverSource { // i.e., if some_module/contracts/MyContract.sol imported "./AnotherContract.sol", // we're going to resolve it to some_module/contracts/AnotherContract.sol, ensuring // that when this path is evaluated this source is used again. - resolve_dependency_path(import_path: string, dependency_path: string) { + resolveDependencyPath(import_path: string, dependency_path: string) { var dirname = path.dirname(import_path); return path.join(dirname, dependency_path); } diff --git a/packages/resolver/package.json b/packages/resolver/package.json index 5e35ecf9ef6..0947822d7fa 100644 --- a/packages/resolver/package.json +++ b/packages/resolver/package.json @@ -1,6 +1,6 @@ { "name": "@truffle/resolver", - "version": "5.1.11", + "version": "6.0.1", "description": "Resolve contract dependencies given multiple configurable dependency sources", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts", @@ -26,14 +26,14 @@ }, "homepage": "https://github.com/trufflesuite/truffle/tree/master/packages/resolver#readme", "dependencies": { - "@truffle/contract": "^4.2.2", + "@truffle/contract": "^4.2.5", "@truffle/expect": "^0.0.13", "@truffle/provisioner": "^0.2.0", "debug": "^4.1.1", "detect-installed": "^2.0.4", "get-installed-path": "^4.0.8", "glob": "^7.1.6", - "source-map-support": "^0.5.16", + "source-map-support": "^0.5.19", "supports-color": "^7.1.0" }, "devDependencies": { diff --git a/packages/solidity-utils/package.json b/packages/solidity-utils/package.json index 51a6bace2fe..8a355d5bddf 100644 --- a/packages/solidity-utils/package.json +++ b/packages/solidity-utils/package.json @@ -1,6 +1,6 @@ { "name": "@truffle/solidity-utils", - "version": "1.3.4", + "version": "1.3.6", "description": "Utilities for Solidity contracts", "main": "index.js", "scripts": {}, @@ -21,8 +21,8 @@ "access": "public" }, "dependencies": { - "@truffle/code-utils": "^1.2.14", - "@truffle/codec": "^0.5.1", + "@truffle/code-utils": "^1.2.15", + "@truffle/codec": "^0.5.3", "debug": "^4.1.1", "json-pointer": "^0.6.0", "node-interval-tree": "^1.3.3" diff --git a/packages/truffle/package.json b/packages/truffle/package.json index 4a3a51cf798..f511e6c28a9 100644 --- a/packages/truffle/package.json +++ b/packages/truffle/package.json @@ -7,7 +7,7 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "5.1.23", + "version": "5.1.26", "main": "./build/library.bundled.js", "bin": { "truffle": "./build/cli.bundled.js" @@ -15,7 +15,7 @@ "scripts": { "analyze": "./scripts/analyze.sh", "build": "yarn build-cli", - "build-cli": "NODE_OPTIONS='--max-old-space-size=4096' webpack --config ./webpack.config.js", + "build-cli": "webpack --config ./webpack.config.js", "postinstall": "node ./scripts/postinstall.js", "prepare": "yarn build", "publish:byoc": "node ./scripts/prereleaseVersion.js byoc-safe byoc", @@ -31,11 +31,11 @@ "original-require": "1.0.1" }, "devDependencies": { - "@truffle/box": "^1.0.59", - "@truffle/contract": "^4.2.2", - "@truffle/core": "^5.1.23", - "@truffle/debugger": "^7.2.0", - "@truffle/interface-adapter": "^0.4.6", + "@truffle/box": "^1.0.60", + "@truffle/contract": "^4.2.5", + "@truffle/core": "^5.1.26", + "@truffle/debugger": "^7.3.0", + "@truffle/interface-adapter": "^0.4.7", "clean-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^5.1.1", "eslint": "^5.7.0", diff --git a/packages/truffle/test/scenarios/migrations/errors.js b/packages/truffle/test/scenarios/migrations/errors.js index 80590d2dbd1..17d0cad62a1 100644 --- a/packages/truffle/test/scenarios/migrations/errors.js +++ b/packages/truffle/test/scenarios/migrations/errors.js @@ -142,9 +142,7 @@ describe("migration errors", function() { console.log(output); assert(output.includes("6_migrations_funds.js")); assert(output.includes("Deploying 'Example'")); - assert(output.includes("generic error from Geth")); - assert(output.includes("gas required exceeds allowance")); - assert(output.includes("always failing transaction")); + assert(output.includes("insufficient funds")); } }); diff --git a/packages/truffle/test/scenarios/migrations/quorum.js b/packages/truffle/test/scenarios/migrations/quorum.js index cc68b217cca..63a5fb409ed 100644 --- a/packages/truffle/test/scenarios/migrations/quorum.js +++ b/packages/truffle/test/scenarios/migrations/quorum.js @@ -27,6 +27,8 @@ describe("migrate with [ @quorum ] interface", () => { }); web3 = new Web3(provider); networkId = await web3.eth.net.getId(); + const accounts = await web3.eth.getAccounts(); + await web3.eth.personal.unlockAccount(accounts[0], "", 8000); }); it("runs migrations (sync & async/await)", async () => { diff --git a/packages/truffle/webpack.config.js b/packages/truffle/webpack.config.js index 5ab5306e797..231a0464b6a 100644 --- a/packages/truffle/webpack.config.js +++ b/packages/truffle/webpack.config.js @@ -7,6 +7,7 @@ const rootDir = path.join(__dirname, "../.."); const outputDir = path.join(__dirname, "build"); module.exports = { + mode: "production", entry: { cli: path.join( __dirname, @@ -57,6 +58,10 @@ module.exports = { }, devtool: "source-map", + optimization: { + minimize: false + }, + module: { rules: [ // ignores "#!/bin..." lines inside files @@ -79,6 +84,26 @@ module.exports = { /^mocha$/ ], + resolve: { + alias: { + "ws": path.join(__dirname, "./nil.js"), + "bn.js": path.join( + __dirname, + "../..", + "node_modules", + "bn.js", + "lib", + "bn.js" + ), + "original-fs": path.join(__dirname, "./nil.js"), + "scrypt": "js-scrypt" + } + }, + + stats: { + warnings: false + }, + plugins: [ new webpack.DefinePlugin({ BUNDLE_VERSION: JSON.stringify(pkg.version), @@ -288,25 +313,5 @@ module.exports = { // Make web3 1.0 packable new webpack.IgnorePlugin(/^electron$/) - ], - - resolve: { - alias: { - "ws": path.join(__dirname, "./nil.js"), - "bn.js": path.join( - __dirname, - "../..", - "node_modules", - "bn.js", - "lib", - "bn.js" - ), - "original-fs": path.join(__dirname, "./nil.js"), - "scrypt": "js-scrypt" - } - }, - - stats: { - warnings: false - } + ] }; diff --git a/packages/workflow-compile/legacy/index.js b/packages/workflow-compile/legacy/index.js index c99d64e132f..6cc38e30823 100644 --- a/packages/workflow-compile/legacy/index.js +++ b/packages/workflow-compile/legacy/index.js @@ -76,7 +76,7 @@ const Contracts = { return result; } catch (error) { if (callbackPassed) return callback(error); - throw new Error(error); + throw error; } }, diff --git a/packages/workflow-compile/package.json b/packages/workflow-compile/package.json index 519b98c4c6c..11e4e8354e2 100644 --- a/packages/workflow-compile/package.json +++ b/packages/workflow-compile/package.json @@ -8,19 +8,19 @@ "bugs": { "url": "https://github.com/trufflesuite/truffle/issues" }, - "version": "2.1.31", + "version": "2.1.34", "main": "index.js", "scripts": { "test": "mocha" }, "dependencies": { - "@truffle/artifactor": "^4.0.57", - "@truffle/compile-solidity": "^4.3.2", - "@truffle/compile-vyper": "^1.0.53", - "@truffle/config": "^1.2.17", + "@truffle/artifactor": "^4.0.60", + "@truffle/compile-solidity": "^4.3.5", + "@truffle/compile-vyper": "^1.0.55", + "@truffle/config": "^1.2.18", "@truffle/expect": "^0.0.13", "@truffle/external-compile": "^1.0.29", - "@truffle/resolver": "^5.1.11", + "@truffle/resolver": "^6.0.1", "fs-extra": "^8.1.0" }, "devDependencies": { diff --git a/scripts/ci.sh b/scripts/ci.sh index 3e1d22aab0b..2eb602b3e1f 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -50,7 +50,7 @@ elif [ "$QUORUM" = true ]; then git clone https://github.com/jpmorganchase/quorum-examples cd quorum-examples docker-compose up -d - sleep 60 + sleep 90 lerna run --scope truffle test --stream -- --exit elif [ "$COLONY" = true ]; then diff --git a/yarn.lock b/yarn.lock index 31a468f35cf..dfc86e73c29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1863,6 +1863,13 @@ ansi-colors@3.2.3: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== +ansi-colors@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" + integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== + dependencies: + ansi-wrap "^0.1.0" + ansi-colors@^3.0.0: version "3.2.4" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" @@ -1885,6 +1892,13 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.8.1" +ansi-gray@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" + integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= + dependencies: + ansi-wrap "0.1.0" + ansi-mark@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/ansi-mark/-/ansi-mark-1.0.4.tgz#1cd4ba8d57f15f109d6aaf6ec9ca9786c8a4ee6c" @@ -1936,6 +1950,11 @@ ansi-styles@^4.1.0: "@types/color-name" "^1.1.1" color-convert "^2.0.1" +ansi-wrap@0.1.0, ansi-wrap@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" + integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= + any-observable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" @@ -2015,6 +2034,13 @@ app-module-path@^2.2.0: resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" integrity sha1-ZBqlXft9am8KgUHEucCqULbCTdU= +append-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" + integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= + dependencies: + buffer-equal "^1.0.0" + append-transform@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-1.0.0.tgz#046a52ae582a228bd72f58acfbe2967c678759ab" @@ -2069,11 +2095,25 @@ arr-diff@^4.0.0: resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= +arr-filter@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" + integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= + dependencies: + make-iterator "^1.0.0" + arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== +arr-map@^2.0.0, arr-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" + integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= + dependencies: + make-iterator "^1.0.0" + arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" @@ -2084,7 +2124,7 @@ array-differ@^2.0.3: resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-2.1.0.tgz#4b9c1c3f14b906757082925769e8ab904f4801b1" integrity sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w== -array-each@^1.0.1: +array-each@^1.0.0, array-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= @@ -2109,11 +2149,35 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= +array-initial@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" + integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= + dependencies: + array-slice "^1.0.0" + is-number "^4.0.0" + +array-last@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" + integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== + dependencies: + is-number "^4.0.0" + array-slice@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== +array-sort@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" + integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== + dependencies: + default-compare "^1.0.0" + get-value "^2.0.6" + kind-of "^5.0.2" + array-union@^1.0.1, array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -2190,6 +2254,16 @@ astral-regex@^1.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== +async-done@^1.2.0, async-done@^1.2.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" + integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.2" + process-nextick-args "^2.0.0" + stream-exhaust "^1.0.1" + async-each@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" @@ -2207,6 +2281,13 @@ async-limiter@^1.0.0, async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== +async-settle@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" + integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= + dependencies: + async-done "^1.2.2" + async@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/async/-/async-2.0.0.tgz#d0900ad385af13804540a109c42166e3ae7b2b9d" @@ -2221,13 +2302,6 @@ async@2.3.0: dependencies: lodash "^4.14.0" -async@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" - integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== - dependencies: - lodash "^4.17.10" - async@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381" @@ -2851,6 +2925,21 @@ babylon@6.18.0, babylon@^6.18.0: resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== +bach@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" + integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= + dependencies: + arr-filter "^1.1.1" + arr-flatten "^1.0.1" + arr-map "^2.0.0" + array-each "^1.0.0" + array-initial "^1.0.0" + array-last "^1.1.1" + async-done "^1.2.2" + async-settle "^1.0.0" + now-and-later "^2.0.0" + backbone@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/backbone/-/backbone-1.4.0.tgz#54db4de9df7c3811c3f032f34749a4cd27f3bd12" @@ -3287,6 +3376,11 @@ buffer-equal-constant-time@1.0.1: resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= +buffer-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" + integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= + buffer-fill@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c" @@ -3720,7 +3814,7 @@ cheerio@^1.0.0-rc.2: lodash "^4.15.0" parse5 "^3.0.1" -chokidar@^2.0.2, chokidar@^2.1.8: +chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== @@ -3872,6 +3966,11 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +clone-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= + clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -3893,12 +3992,17 @@ clone-stats@^0.0.1: resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" integrity sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE= +clone-stats@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= + clone@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" integrity sha1-0hfR6WERjjrJpLi7oyhVU79kfNs= -clone@2.1.2, clone@^2.0.0: +clone@2.1.2, clone@^2.0.0, clone@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= @@ -3908,6 +4012,15 @@ clone@^1.0.0, clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= +cloneable-readable@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" + integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== + dependencies: + inherits "^2.0.1" + process-nextick-args "^2.0.0" + readable-stream "^2.3.5" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -3926,6 +4039,15 @@ coinstring@^2.0.0: bs58 "^2.0.1" create-hash "^1.1.1" +collection-map@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" + integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= + dependencies: + arr-map "^2.0.2" + for-own "^1.0.0" + make-iterator "^1.0.0" + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -3968,6 +4090,11 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-support@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== + colors@^1.1.2: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -4003,6 +4130,11 @@ command-exists@^1.2.8: resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.8.tgz#715acefdd1223b9c9b37110a149c6392c2852291" integrity sha512-PM54PkseWbiiD/mMsbvW351/u+dafwTJ0ye2qB60G1aGQP9j3xK2gmMDc+R34L3nDtx4qMCitXT75mkbkGJDLw== +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== + commander@2.15.1: version "2.15.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" @@ -4072,7 +4204,7 @@ concat-stream@1.5.1: readable-stream "~2.0.0" typedarray "~0.0.5" -concat-stream@^1.5.0, concat-stream@^1.5.1, concat-stream@^1.6.1: +concat-stream@^1.5.0, concat-stream@^1.5.1, concat-stream@^1.6.0, concat-stream@^1.6.1: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -4283,6 +4415,14 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= +copy-props@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.4.tgz#93bb1cadfafd31da5bb8a9d4b41f471ec3a72dfe" + integrity sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A== + dependencies: + each-props "^1.3.0" + is-plain-object "^2.0.1" + copy-webpack-plugin@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-5.1.1.tgz#5481a03dea1123d88a988c6ff8b78247214f0b88" @@ -4689,6 +4829,13 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= +default-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" + integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== + dependencies: + kind-of "^5.0.2" + default-require-extensions@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-2.0.0.tgz#f5f8fbb18a7d6d50b21f641f649ebb522cfe24f7" @@ -4696,6 +4843,11 @@ default-require-extensions@^2.0.0: dependencies: strip-bom "^3.0.0" +default-resolution@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" + integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= + defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" @@ -5059,6 +5211,14 @@ duplexify@^3.2.0, duplexify@^3.4.2, duplexify@^3.6.0: readable-stream "^2.0.0" stream-shift "^1.0.0" +each-props@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" + integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== + dependencies: + is-plain-object "^2.0.1" + object.defaults "^1.1.0" + easy-stack@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/easy-stack/-/easy-stack-1.0.0.tgz#12c91b3085a37f0baa336e9486eac4bf94e3e788" @@ -5284,7 +5444,7 @@ es6-error@^4.0.1: resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== -es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: +es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= @@ -6320,6 +6480,16 @@ faker@^4.1.0: resolved "https://registry.yarnpkg.com/faker/-/faker-4.1.0.tgz#1e45bbbecc6774b3c195fad2835109c6d748cc3f" integrity sha1-HkW7vsxndLPBlfrSg1EJxtdIzD8= +fancy-log@^1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" + integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== + dependencies: + ansi-gray "^0.1.1" + color-support "^1.1.3" + parse-node-version "^1.0.0" + time-stamp "^1.0.0" + fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" @@ -6536,7 +6706,7 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" -findup-sync@3.0.0: +findup-sync@3.0.0, findup-sync@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== @@ -6618,7 +6788,7 @@ flow-stoplight@^1.0.0: resolved "https://registry.yarnpkg.com/flow-stoplight/-/flow-stoplight-1.0.0.tgz#4a292c5bcff8b39fa6cc0cb1a853d86f27eeff7b" integrity sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s= -flush-write-stream@^1.0.0: +flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== @@ -6819,6 +6989,14 @@ fs-minipass@^1.2.5: dependencies: minipass "^2.6.0" +fs-mkdirp-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" + integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= + dependencies: + graceful-fs "^4.1.11" + through2 "^2.0.3" + fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" @@ -7168,11 +7346,39 @@ glob-stream@^5.3.2: to-absolute-glob "^0.1.1" unique-stream "^2.0.2" +glob-stream@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" + integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= + dependencies: + extend "^3.0.0" + glob "^7.1.1" + glob-parent "^3.1.0" + is-negated-glob "^1.0.0" + ordered-read-streams "^1.0.0" + pumpify "^1.3.5" + readable-stream "^2.1.5" + remove-trailing-separator "^1.0.1" + to-absolute-glob "^2.0.0" + unique-stream "^2.0.2" + glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= +glob-watcher@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.3.tgz#88a8abf1c4d131eb93928994bc4a593c2e5dd626" + integrity sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg== + dependencies: + anymatch "^2.0.0" + async-done "^1.2.0" + chokidar "^2.0.0" + is-negated-glob "^1.0.0" + just-debounce "^1.0.0" + object.defaults "^1.1.0" + glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -7363,6 +7569,13 @@ globby@^9.2.0: pify "^4.0.1" slash "^2.0.0" +glogg@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" + integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== + dependencies: + sparkles "^1.0.0" + got@9.6.0: version "9.6.0" resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85" @@ -7443,11 +7656,40 @@ graphql@^0.13.0: dependencies: iterall "^1.2.1" +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" + integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== + growl@1.10.5: version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== +gulp-cli@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.2.0.tgz#5533126eeb7fe415a7e3e84a297d334d5cf70ebc" + integrity sha512-rGs3bVYHdyJpLqR0TUBnlcZ1O5O++Zs4bA0ajm+zr3WFCfiSLjGwoCBqFs18wzN+ZxahT9DkOK5nDf26iDsWjA== + dependencies: + ansi-colors "^1.0.1" + archy "^1.0.0" + array-sort "^1.0.0" + color-support "^1.1.3" + concat-stream "^1.6.0" + copy-props "^2.0.1" + fancy-log "^1.3.2" + gulplog "^1.0.0" + interpret "^1.1.0" + isobject "^3.0.1" + liftoff "^3.1.0" + matchdep "^2.0.0" + mute-stdout "^1.0.0" + pretty-hrtime "^1.0.0" + replace-homedir "^1.0.0" + semver-greatest-satisfied-range "^1.1.0" + v8flags "^3.0.1" + yargs "^7.1.0" + gulp-sourcemaps@^1.5.2: version "1.12.1" resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.12.1.tgz#b437d1f3d980cf26e81184823718ce15ae6597b6" @@ -7465,6 +7707,23 @@ gulp-sourcemaps@^1.5.2: through2 "2.X" vinyl "1.X" +gulp@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" + integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== + dependencies: + glob-watcher "^5.0.3" + gulp-cli "^2.2.0" + undertaker "^1.2.1" + vinyl-fs "^3.0.0" + +gulplog@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" + integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= + dependencies: + glogg "^1.0.0" + gzip-size@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" @@ -7649,10 +7908,10 @@ highlight.js@^9.12.0, highlight.js@^9.15.8: dependencies: handlebars "^4.5.3" -highlightjs-solidity@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/highlightjs-solidity/-/highlightjs-solidity-1.0.12.tgz#74c481916873cf2ca9b036f6173535ad1abd824b" - integrity sha512-kx91S0PiprCTjMtFhl1lNphjDu8ZL75N/4tHxUJiY0j+DDJjQ0UtV8TXYoU9hg8UDZ5pKaKUxhynjfVWWPxMsg== +highlightjs-solidity@^1.0.15: + version "1.0.15" + resolved "https://registry.yarnpkg.com/highlightjs-solidity/-/highlightjs-solidity-1.0.15.tgz#a5977220bef8d22dd49b3a5f4f05168300a85355" + integrity sha512-ZC9mcL7vLOD8aqy3+EVaX9FgQceSVYFMzrmjsMI0l1f9yCEcbcFqEf+G+DtmLcathOmMnNP5l+UdnrZ4zJJ8rQ== hmac-drbg@^1.0.0: version "1.0.1" @@ -8368,6 +8627,11 @@ is-natural-number@^4.0.1: resolved "https://registry.yarnpkg.com/is-natural-number/-/is-natural-number-4.0.1.tgz#ab9d76e1db4ced51e35de0c72ebecf09f734cde8" integrity sha1-q5124dtM7VHjXeDHLr7PCfc0zeg= +is-negated-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -8452,7 +8716,7 @@ is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= -is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== @@ -8550,7 +8814,7 @@ is-upper-case@^1.1.0: dependencies: upper-case "^1.1.0" -is-utf8@^0.2.0: +is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= @@ -8560,6 +8824,11 @@ is-valid-glob@^0.3.0: resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe" integrity sha1-1LVcafUYhvm2XHDWwmItN+KfSP4= +is-valid-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" + integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= + is-windows@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" @@ -9016,6 +9285,11 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +just-debounce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea" + integrity sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= + just-extend@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.0.2.tgz#f3f47f7dfca0f989c55410a7ebc8854b07108afc" @@ -9087,7 +9361,7 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0: +kind-of@^5.0.0, kind-of@^5.0.2: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== @@ -9134,6 +9408,14 @@ labeled-stream-splicer@^2.0.0: inherits "^2.0.1" stream-splicer "^2.0.0" +last-run@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" + integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= + dependencies: + default-resolution "^2.0.0" + es6-weak-map "^2.0.1" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" @@ -9170,6 +9452,13 @@ lcov-parse@^1.0.0: resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= +lead@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" + integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= + dependencies: + flush-write-stream "^1.0.2" + left-pad@^1.1.3: version "1.3.0" resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" @@ -9370,6 +9659,20 @@ liftoff@2.5.0: rechoir "^0.6.2" resolve "^1.1.7" +liftoff@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" + integrity sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog== + dependencies: + extend "^3.0.0" + findup-sync "^3.0.0" + fined "^1.0.1" + flagged-respawn "^1.0.0" + is-plain-object "^2.0.4" + object.map "^1.0.0" + rechoir "^0.6.2" + resolve "^1.1.7" + linked-list@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/linked-list/-/linked-list-0.1.0.tgz#798b0ff97d1b92a4fd08480f55aea4e9d49d37bf" @@ -10030,6 +10333,16 @@ marked@^0.7.0: resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e" integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg== +matchdep@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" + integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= + dependencies: + findup-sync "^2.0.0" + micromatch "^3.0.4" + resolve "^1.4.0" + stack-trace "0.0.10" + math-random@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" @@ -10510,6 +10823,23 @@ mocha-webpack@2.0.0-beta.0: toposort "^1.0.0" yargs "^11.0.0" +mocha@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.1.1.tgz#b774c75609dac05eb48f4d9ba1d827b97fde8a7b" + integrity sha512-kKKs/H1KrMMQIEsWNxGmb4/BGsmj0dkeyotEvbrAuQ01FcWRLssUNXCEUZk6SZtyJBi6EE7SL0zDDtItw1rGhw== + dependencies: + browser-stdout "1.3.1" + commander "2.11.0" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "4.4.0" + mocha@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" @@ -10690,6 +11020,11 @@ multimatch@^3.0.0: arrify "^1.0.1" minimatch "^3.0.4" +mute-stdout@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" + integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== + mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -10992,6 +11327,13 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129" integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ== +now-and-later@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" + integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== + dependencies: + once "^1.3.2" + npm-bundled@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.1.tgz#1edd570865a94cdb1bc8220775e29466c9fb234b" @@ -11184,7 +11526,7 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@4.1.0, object.assign@^4.1.0: +object.assign@4.1.0, object.assign@^4.0.4, object.assign@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== @@ -11194,7 +11536,7 @@ object.assign@4.1.0, object.assign@^4.1.0: has-symbols "^1.0.0" object-keys "^1.0.11" -object.defaults@^1.1.0: +object.defaults@^1.0.0, object.defaults@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= @@ -11235,6 +11577,14 @@ object.pick@^1.2.0, object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.reduce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" + integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= + dependencies: + for-own "^1.0.0" + make-iterator "^1.0.0" + oboe@2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/oboe/-/oboe-2.1.4.tgz#20c88cdb0c15371bb04119257d4fdd34b0aa49f6" @@ -11259,7 +11609,7 @@ on-headers@~1.0.1: resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= @@ -11344,6 +11694,13 @@ ordered-read-streams@^0.3.0: is-stream "^1.0.1" readable-stream "^2.0.1" +ordered-read-streams@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" + integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= + dependencies: + readable-stream "^2.0.1" + original-require@1.0.1, original-require@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/original-require/-/original-require-1.0.1.tgz#0f130471584cd33511c5ec38c8d59213f9ac5e20" @@ -11631,6 +11988,11 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse-node-version@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" + integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== + parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" @@ -11940,7 +12302,7 @@ pretty-format@^23.6.0: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -pretty-hrtime@^1.0.3: +pretty-hrtime@^1.0.0, pretty-hrtime@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= @@ -11950,16 +12312,16 @@ private@^0.1.6, private@^0.1.8: resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== +process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - process@^0.11.10, process@~0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -12135,7 +12497,7 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -pumpify@^1.3.3: +pumpify@^1.3.3, pumpify@^1.3.5: version "1.5.1" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== @@ -12651,7 +13013,24 @@ remotedev-server@^0.3.1: sqlite3 "^4.0.4" uuid "^3.0.1" -remove-trailing-separator@^1.0.1: +remove-bom-buffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" + integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== + dependencies: + is-buffer "^1.1.5" + is-utf8 "^0.2.1" + +remove-bom-stream@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" + integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= + dependencies: + remove-bom-buffer "^3.0.0" + safe-buffer "^5.1.0" + through2 "^2.0.3" + +remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= @@ -12685,6 +13064,20 @@ replace-ext@0.0.1: resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" integrity sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ= +replace-ext@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" + integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== + +replace-homedir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" + integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= + dependencies: + homedir-polyfill "^1.0.1" + is-absolute "^1.0.0" + remove-trailing-separator "^1.1.0" + request-promise-core@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9" @@ -12767,10 +13160,10 @@ require-nocache@^1.0.0: resolved "https://registry.yarnpkg.com/require-nocache/-/require-nocache-1.0.0.tgz#a665d0b60a07e8249875790a4d350219d3c85fa3" integrity sha1-pmXQtgoH6CSYdXkKTTUCGdPIX6M= -reselect-tree@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/reselect-tree/-/reselect-tree-1.3.1.tgz#e721f4c110d0e3d50edf24f0347e9e85e7d3c617" - integrity sha512-odL2qQPc5Wu5fGLH0zAWn3vLh9IOvrWEckvQL/mDiKAV48t3mpsTYbIZsNcu0CcVYAvkDxvcMvRB+19TOgyODg== +reselect-tree@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/reselect-tree/-/reselect-tree-1.3.3.tgz#999f5fd7167d0d2610d5e48dcf8a7c03b28d159a" + integrity sha512-sG5sRWghWuWx+E2GolRZIGTVVNkMMvJpjI36gQYSOEtwca11mHtfZre6A6HNztxQcZCYdIwOB6qXt7HrAHrx0w== dependencies: debug "^3.1.0" esdoc "^1.0.4" @@ -12808,6 +13201,13 @@ resolve-from@^4.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== +resolve-options@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" + integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= + dependencies: + value-or-function "^3.0.0" + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -12825,6 +13225,13 @@ resolve@^1.1.3, resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, dependencies: path-parse "^1.0.6" +resolve@^1.4.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + resolve@~1.13.1: version "1.13.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.13.1.tgz#be0aa4c06acd53083505abb35f4d66932ab35d16" @@ -13182,6 +13589,13 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= +semver-greatest-satisfied-range@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" + integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= + dependencies: + sver-compat "^1.5.0" + "semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -13676,7 +14090,7 @@ source-map-support@^0.4.15: dependencies: source-map "^0.5.6" -source-map-support@^0.5.0, source-map-support@^0.5.1, source-map-support@^0.5.16, source-map-support@^0.5.3, source-map-support@^0.5.6: +source-map-support@^0.5.0, source-map-support@^0.5.1, source-map-support@^0.5.3, source-map-support@^0.5.6: version "0.5.16" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== @@ -13684,6 +14098,14 @@ source-map-support@^0.5.0, source-map-support@^0.5.1, source-map-support@^0.5.16 buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@^0.5.19: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-support@~0.5.12: version "0.5.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.18.tgz#f5f33489e270bd7f7d7e7b8debf283f3a4066960" @@ -13707,6 +14129,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +sparkles@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" + integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== + spawn-args@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/spawn-args/-/spawn-args-0.1.0.tgz#3e0232a0571b387907f8b3f544aa531c6224848c" @@ -13807,6 +14234,11 @@ ssri@^6.0.0, ssri@^6.0.1: dependencies: figgy-pudding "^3.5.1" +stack-trace@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= + staged-git-files@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" @@ -13864,6 +14296,11 @@ stream-each@^1.1.0: end-of-stream "^1.1.0" stream-shift "^1.0.0" +stream-exhaust@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" + integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== + stream-http@^2.0.0, stream-http@^2.7.2: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" @@ -13906,7 +14343,7 @@ string-argv@^0.0.2: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= -string-width@^1.0.1: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= @@ -14106,6 +14543,13 @@ super-split@^1.1.0: resolved "https://registry.yarnpkg.com/super-split/-/super-split-1.1.0.tgz#43b3ba719155f4d43891a32729d59b213d9155fc" integrity sha512-I4bA5mgcb6Fw5UJ+EkpzqXfiuvVGS/7MuND+oBxNFmxu3ugLNrdIatzBLfhFRMVMLxgSsRy+TjIktgkF9RFSNQ== +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" + integrity sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ== + dependencies: + has-flag "^2.0.0" + supports-color@5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" @@ -14153,6 +14597,14 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +sver-compat@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" + integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= + dependencies: + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + swap-case@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-1.1.2.tgz#c39203a4587385fad3c850a0bd1bcafa081974e3" @@ -14448,6 +14900,11 @@ tildify@^2.0.0: resolved "https://registry.yarnpkg.com/tildify/-/tildify-2.0.0.tgz#f205f3674d677ce698b7067a99e949ce03b4754a" integrity sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw== +time-stamp@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" + integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= + timed-out@^4.0.0, timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" @@ -14509,6 +14966,14 @@ to-absolute-glob@^0.1.1: dependencies: extend-shallow "^2.0.1" +to-absolute-glob@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" + integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= + dependencies: + is-absolute "^1.0.0" + is-negated-glob "^1.0.0" + to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" @@ -14566,6 +15031,13 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +to-through@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" + integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= + dependencies: + through2 "^2.0.3" + toidentifier@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" @@ -14981,6 +15453,26 @@ underscore@1.9.1, underscore@>=1.8.3, underscore@^1.8.3, underscore@^1.9.1: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961" integrity sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg== +undertaker-registry@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" + integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= + +undertaker@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.2.1.tgz#701662ff8ce358715324dfd492a4f036055dfe4b" + integrity sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA== + dependencies: + arr-flatten "^1.0.1" + arr-map "^2.0.0" + bach "^1.0.0" + collection-map "^1.0.0" + es6-weak-map "^2.0.1" + last-run "^1.1.0" + object.defaults "^1.0.0" + object.reduce "^1.0.0" + undertaker-registry "^1.0.0" + union-value@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" @@ -15223,7 +15715,7 @@ v8-compile-cache@2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz#00f7494d2ae2b688cfe2899df6ed2c54bef91dbe" integrity sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w== -v8flags@^3.1.1: +v8flags@^3.0.1, v8flags@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8" integrity sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w== @@ -15250,6 +15742,11 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" +value-or-function@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" + integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= + vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" @@ -15292,6 +15789,42 @@ vinyl-fs@2.4.3: vali-date "^1.0.0" vinyl "^1.0.0" +vinyl-fs@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" + integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== + dependencies: + fs-mkdirp-stream "^1.0.0" + glob-stream "^6.1.0" + graceful-fs "^4.0.0" + is-valid-glob "^1.0.0" + lazystream "^1.0.0" + lead "^1.0.0" + object.assign "^4.0.4" + pumpify "^1.3.5" + readable-stream "^2.3.3" + remove-bom-buffer "^3.0.0" + remove-bom-stream "^1.2.0" + resolve-options "^1.1.0" + through2 "^2.0.0" + to-through "^2.0.0" + value-or-function "^3.0.0" + vinyl "^2.0.0" + vinyl-sourcemap "^1.1.0" + +vinyl-sourcemap@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" + integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= + dependencies: + append-buffer "^1.0.2" + convert-source-map "^1.5.0" + graceful-fs "^4.1.6" + normalize-path "^2.1.1" + now-and-later "^2.0.0" + remove-bom-buffer "^3.0.0" + vinyl "^2.0.0" + vinyl@1.X, vinyl@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" @@ -15301,6 +15834,18 @@ vinyl@1.X, vinyl@^1.0.0: clone-stats "^0.0.1" replace-ext "0.0.1" +vinyl@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.0.tgz#d85b07da96e458d25b2ffe19fece9f2caa13ed86" + integrity sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg== + dependencies: + clone "^2.1.1" + clone-buffer "^1.0.0" + clone-stats "^1.0.0" + cloneable-readable "^1.0.0" + remove-trailing-separator "^1.0.1" + replace-ext "^1.0.0" + vm-browserify@^1.0.1: version "1.1.2" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" @@ -16046,6 +16591,7 @@ websocket@1.0.29, "websocket@github:web3-js/WebSocket-Node#polyfill/globalThis": dependencies: debug "^2.2.0" es5-ext "^0.10.50" + gulp "^4.0.2" nan "^2.14.0" typedarray-to-buffer "^3.1.5" yaeti "^0.0.6" @@ -16406,6 +16952,13 @@ yargs-parser@^2.4.0, yargs-parser@^2.4.1: camelcase "^3.0.0" lodash.assign "^4.0.6" +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + integrity sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo= + dependencies: + camelcase "^3.0.0" + yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" @@ -16579,6 +17132,25 @@ yargs@^4.7.1: y18n "^3.2.1" yargs-parser "^2.4.1" +yargs@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + integrity sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg= + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + yargs@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360"