diff --git a/dist/truffle.plugin.js b/dist/truffle.plugin.js index 2446d1b..70a4dfa 100644 --- a/dist/truffle.plugin.js +++ b/dist/truffle.plugin.js @@ -25,10 +25,10 @@ test: await truffle.test.run(config) */ -const SolidityCoverage = require('./../lib/app.js'); +const App = require('./../lib/app'); const req = require('req-cwd'); -module.exports = async (config) => +module.exports = async (truffleConfig) => let error; try { @@ -38,26 +38,26 @@ module.exports = async (config) => const coverageConfig = req.silent('./.solcover.js') || {}; // Start - const app = new SolidityCoverage(coverageConfig); + const app = new App(coverageConfig); // Write instrumented sources to temp folder - app.contractsDirectory = coveragePaths.contracts(config, app); - app.generateEnvironment(config.contracts_directory, app.contractsDirectory); + app.contractsDirectory = coveragePaths.contracts(truffleConfig, app); + app.generateEnvironment(truffleConfig.contracts_directory, app.contractsDirectory); app.instrument(); // Have truffle use temp folders - config.contracts_directory = app.contractsDirectory; - config.build_directory = coveragePaths.artifacts.root(config, app); - config.contracts_build_directory = coveragePaths.artifacts.contracts(config, app); + truffleConfig.contracts_directory = app.contractsDirectory; + truffleConfig.build_directory = coveragePaths.artifacts.root(truffleConfig, app); + truffleConfig.contracts_build_directory = coveragePaths.artifacts.contracts(truffleConfig, app); // Compile w/out optimization - config.compilers.solc.settings.optimization.enabled = false; - await truffle.contracts.compile(config); + truffleConfig.compilers.solc.settings.optimization.enabled = false; + await truffle.contracts.compile(truffleConfig); // Launch provider & run tests - config.provider = await app.getCoverageProvider(truffle); + truffleConfig.provider = await app.getCoverageProvider(truffle); try { - await truffle.test.run(config) + await truffle.test.run(truffleConfig) } catch (e) { error = e; app.testsErrored = true; diff --git a/package.json b/package.json index c9067fc..faf3de8 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "@nomiclabs/buidler-web3": "^1.0.0-beta.8", "mocha": "5.2.0", "solc": "^0.5.10", - "truffle": "^5.0.26", + "truffle": "^5.0.31", "web3": "1.0.0-beta.37" } } diff --git a/test/soliditySources/errors/SimpleError.sol b/test/integration/truffle/assets/SimpleError.sol similarity index 83% rename from test/soliditySources/errors/SimpleError.sol rename to test/integration/truffle/assets/SimpleError.sol index a50bacb..56d257e 100644 --- a/test/soliditySources/errors/SimpleError.sol +++ b/test/integration/truffle/assets/SimpleError.sol @@ -3,12 +3,12 @@ pragma solidity ^0.5.0; contract SimpleError { uint x = 0; - + function test(uint val) public { - x = x + val // <-- no semi-colon + x = x + val // <-- no semi-colon } function getX() public returns (uint){ return x; } -} \ No newline at end of file +} diff --git a/test/integration/truffle/assets/asset.js b/test/integration/truffle/assets/asset.js new file mode 100644 index 0000000..c961045 --- /dev/null +++ b/test/integration/truffle/assets/asset.js @@ -0,0 +1 @@ +module.exports = { value: true }; diff --git a/test/soliditySources/contracts/cli/Migrations.sol b/test/integration/truffle/contracts/Migrations.sol similarity index 100% rename from test/soliditySources/contracts/cli/Migrations.sol rename to test/integration/truffle/contracts/Migrations.sol diff --git a/test/integration/truffle/migrations/1_initial.js b/test/integration/truffle/migrations/1_initial.js new file mode 100644 index 0000000..e69de29 diff --git a/test/jsSources/block-gas-limit.js b/test/sources/js/block-gas-limit.js similarity index 100% rename from test/jsSources/block-gas-limit.js rename to test/sources/js/block-gas-limit.js diff --git a/test/jsSources/empty.js b/test/sources/js/empty.js similarity index 100% rename from test/jsSources/empty.js rename to test/sources/js/empty.js diff --git a/test/jsSources/inheritance.js b/test/sources/js/inheritance.js similarity index 100% rename from test/jsSources/inheritance.js rename to test/sources/js/inheritance.js diff --git a/test/jsSources/only-call.js b/test/sources/js/only-call.js similarity index 100% rename from test/jsSources/only-call.js rename to test/sources/js/only-call.js diff --git a/test/jsSources/oraclize.js b/test/sources/js/oraclize.js similarity index 100% rename from test/jsSources/oraclize.js rename to test/sources/js/oraclize.js diff --git a/test/jsSources/pureview.js b/test/sources/js/pureview.js similarity index 100% rename from test/jsSources/pureview.js rename to test/sources/js/pureview.js diff --git a/test/jsSources/requires-externally.js b/test/sources/js/requires-externally.js similarity index 100% rename from test/jsSources/requires-externally.js rename to test/sources/js/requires-externally.js diff --git a/test/jsSources/sign.js b/test/sources/js/sign.js similarity index 100% rename from test/jsSources/sign.js rename to test/sources/js/sign.js diff --git a/test/jsSources/simple.js b/test/sources/js/simple.js similarity index 100% rename from test/jsSources/simple.js rename to test/sources/js/simple.js diff --git a/test/jsSources/sol-parse-fail.js b/test/sources/js/sol-parse-fail.js similarity index 100% rename from test/jsSources/sol-parse-fail.js rename to test/sources/js/sol-parse-fail.js diff --git a/test/jsSources/testrpc-options.js b/test/sources/js/testrpc-options.js similarity index 100% rename from test/jsSources/testrpc-options.js rename to test/sources/js/testrpc-options.js diff --git a/test/jsSources/totallyPure.js b/test/sources/js/totallyPure.js similarity index 100% rename from test/jsSources/totallyPure.js rename to test/sources/js/totallyPure.js diff --git a/test/jsSources/truffle-crash.js b/test/sources/js/truffle-crash.js similarity index 100% rename from test/jsSources/truffle-crash.js rename to test/sources/js/truffle-crash.js diff --git a/test/jsSources/truffle-test-fail.js b/test/sources/js/truffle-test-fail.js similarity index 100% rename from test/jsSources/truffle-test-fail.js rename to test/sources/js/truffle-test-fail.js diff --git a/test/jsSources/wallet.js b/test/sources/js/wallet.js similarity index 100% rename from test/jsSources/wallet.js rename to test/sources/js/wallet.js diff --git a/test/soliditySources/contracts/cli/CLibrary.sol b/test/sources/solidity/contracts/app/CLibrary.sol similarity index 100% rename from test/soliditySources/contracts/cli/CLibrary.sol rename to test/sources/solidity/contracts/app/CLibrary.sol diff --git a/test/soliditySources/contracts/cli/Empty.sol b/test/sources/solidity/contracts/app/Empty.sol similarity index 100% rename from test/soliditySources/contracts/cli/Empty.sol rename to test/sources/solidity/contracts/app/Empty.sol diff --git a/test/soliditySources/contracts/cli/Events.sol b/test/sources/solidity/contracts/app/Events.sol similarity index 100% rename from test/soliditySources/contracts/cli/Events.sol rename to test/sources/solidity/contracts/app/Events.sol diff --git a/test/soliditySources/contracts/cli/Expensive.sol b/test/sources/solidity/contracts/app/Expensive.sol similarity index 100% rename from test/soliditySources/contracts/cli/Expensive.sol rename to test/sources/solidity/contracts/app/Expensive.sol diff --git a/test/soliditySources/contracts/cli/Face.sol b/test/sources/solidity/contracts/app/Face.sol similarity index 100% rename from test/soliditySources/contracts/cli/Face.sol rename to test/sources/solidity/contracts/app/Face.sol diff --git a/test/sources/solidity/contracts/app/Migrations.sol b/test/sources/solidity/contracts/app/Migrations.sol new file mode 100644 index 0000000..2dcecea --- /dev/null +++ b/test/sources/solidity/contracts/app/Migrations.sol @@ -0,0 +1,25 @@ +pragma solidity ^0.5.0; + + +contract Migrations { + address public owner; + + uint public last_completed_migration; + + modifier restricted() { + if (msg.sender == owner) { _; } + } + + constructor() public { + owner = msg.sender; + } + + function setCompleted(uint completed) public restricted { + last_completed_migration = completed; + } + + function upgrade(address new_address) public restricted { + Migrations upgraded = Migrations(new_address); + upgraded.setCompleted(last_completed_migration); + } +} diff --git a/test/soliditySources/contracts/cli/OnlyCall.sol b/test/sources/solidity/contracts/app/OnlyCall.sol similarity index 100% rename from test/soliditySources/contracts/cli/OnlyCall.sol rename to test/sources/solidity/contracts/app/OnlyCall.sol diff --git a/test/soliditySources/contracts/cli/Owned.sol b/test/sources/solidity/contracts/app/Owned.sol similarity index 100% rename from test/soliditySources/contracts/cli/Owned.sol rename to test/sources/solidity/contracts/app/Owned.sol diff --git a/test/soliditySources/contracts/cli/Proxy.sol b/test/sources/solidity/contracts/app/Proxy.sol similarity index 100% rename from test/soliditySources/contracts/cli/Proxy.sol rename to test/sources/solidity/contracts/app/Proxy.sol diff --git a/test/soliditySources/contracts/cli/PureView.sol b/test/sources/solidity/contracts/app/PureView.sol similarity index 100% rename from test/soliditySources/contracts/cli/PureView.sol rename to test/sources/solidity/contracts/app/PureView.sol diff --git a/test/soliditySources/contracts/cli/Simple.sol b/test/sources/solidity/contracts/app/Simple.sol similarity index 100% rename from test/soliditySources/contracts/cli/Simple.sol rename to test/sources/solidity/contracts/app/Simple.sol diff --git a/test/soliditySources/contracts/cli/TotallyPure.sol b/test/sources/solidity/contracts/app/TotallyPure.sol similarity index 100% rename from test/soliditySources/contracts/cli/TotallyPure.sol rename to test/sources/solidity/contracts/app/TotallyPure.sol diff --git a/test/soliditySources/contracts/cli/Wallet.sol b/test/sources/solidity/contracts/app/Wallet.sol similarity index 100% rename from test/soliditySources/contracts/cli/Wallet.sol rename to test/sources/solidity/contracts/app/Wallet.sol diff --git a/test/soliditySources/contracts/assembly/if.sol b/test/sources/solidity/contracts/assembly/if.sol similarity index 100% rename from test/soliditySources/contracts/assembly/if.sol rename to test/sources/solidity/contracts/assembly/if.sol diff --git a/test/soliditySources/contracts/assembly/spaces-in-function.sol b/test/sources/solidity/contracts/assembly/spaces-in-function.sol similarity index 100% rename from test/soliditySources/contracts/assembly/spaces-in-function.sol rename to test/sources/solidity/contracts/assembly/spaces-in-function.sol diff --git a/test/soliditySources/contracts/assert/Assert.sol b/test/sources/solidity/contracts/assert/Assert.sol similarity index 100% rename from test/soliditySources/contracts/assert/Assert.sol rename to test/sources/solidity/contracts/assert/Assert.sol diff --git a/test/soliditySources/contracts/assert/RequireMultiline.sol b/test/sources/solidity/contracts/assert/RequireMultiline.sol similarity index 100% rename from test/soliditySources/contracts/assert/RequireMultiline.sol rename to test/sources/solidity/contracts/assert/RequireMultiline.sol diff --git a/test/soliditySources/contracts/comments/postContractComment.sol b/test/sources/solidity/contracts/comments/postContractComment.sol similarity index 100% rename from test/soliditySources/contracts/comments/postContractComment.sol rename to test/sources/solidity/contracts/comments/postContractComment.sol diff --git a/test/soliditySources/contracts/comments/postFunctionDeclarationComment.sol b/test/sources/solidity/contracts/comments/postFunctionDeclarationComment.sol similarity index 100% rename from test/soliditySources/contracts/comments/postFunctionDeclarationComment.sol rename to test/sources/solidity/contracts/comments/postFunctionDeclarationComment.sol diff --git a/test/soliditySources/contracts/comments/postIfStatementComment.sol b/test/sources/solidity/contracts/comments/postIfStatementComment.sol similarity index 100% rename from test/soliditySources/contracts/comments/postIfStatementComment.sol rename to test/sources/solidity/contracts/comments/postIfStatementComment.sol diff --git a/test/soliditySources/contracts/comments/postLineComment.sol b/test/sources/solidity/contracts/comments/postLineComment.sol similarity index 100% rename from test/soliditySources/contracts/comments/postLineComment.sol rename to test/sources/solidity/contracts/comments/postLineComment.sol diff --git a/test/soliditySources/contracts/conditional/declarative-exp-assignment-alternate.sol b/test/sources/solidity/contracts/conditional/declarative-exp-assignment-alternate.sol similarity index 100% rename from test/soliditySources/contracts/conditional/declarative-exp-assignment-alternate.sol rename to test/sources/solidity/contracts/conditional/declarative-exp-assignment-alternate.sol diff --git a/test/soliditySources/contracts/conditional/identifier-assignment-alternate.sol b/test/sources/solidity/contracts/conditional/identifier-assignment-alternate.sol similarity index 100% rename from test/soliditySources/contracts/conditional/identifier-assignment-alternate.sol rename to test/sources/solidity/contracts/conditional/identifier-assignment-alternate.sol diff --git a/test/soliditySources/contracts/conditional/mapping-assignment.sol b/test/sources/solidity/contracts/conditional/mapping-assignment.sol similarity index 100% rename from test/soliditySources/contracts/conditional/mapping-assignment.sol rename to test/sources/solidity/contracts/conditional/mapping-assignment.sol diff --git a/test/soliditySources/contracts/conditional/multiline-alternate.sol b/test/sources/solidity/contracts/conditional/multiline-alternate.sol similarity index 100% rename from test/soliditySources/contracts/conditional/multiline-alternate.sol rename to test/sources/solidity/contracts/conditional/multiline-alternate.sol diff --git a/test/soliditySources/contracts/conditional/multiline-consequent.sol b/test/sources/solidity/contracts/conditional/multiline-consequent.sol similarity index 100% rename from test/soliditySources/contracts/conditional/multiline-consequent.sol rename to test/sources/solidity/contracts/conditional/multiline-consequent.sol diff --git a/test/soliditySources/contracts/conditional/sameline-alternate.sol b/test/sources/solidity/contracts/conditional/sameline-alternate.sol similarity index 100% rename from test/soliditySources/contracts/conditional/sameline-alternate.sol rename to test/sources/solidity/contracts/conditional/sameline-alternate.sol diff --git a/test/soliditySources/contracts/conditional/sameline-consequent.sol b/test/sources/solidity/contracts/conditional/sameline-consequent.sol similarity index 100% rename from test/soliditySources/contracts/conditional/sameline-consequent.sol rename to test/sources/solidity/contracts/conditional/sameline-consequent.sol diff --git a/test/soliditySources/contracts/conditional/variable-decl-assignment-alternate.sol b/test/sources/solidity/contracts/conditional/variable-decl-assignment-alternate.sol similarity index 100% rename from test/soliditySources/contracts/conditional/variable-decl-assignment-alternate.sol rename to test/sources/solidity/contracts/conditional/variable-decl-assignment-alternate.sol diff --git a/test/soliditySources/contracts/expressions/new-expression.sol b/test/sources/solidity/contracts/expressions/new-expression.sol similarity index 100% rename from test/soliditySources/contracts/expressions/new-expression.sol rename to test/sources/solidity/contracts/expressions/new-expression.sol diff --git a/test/soliditySources/contracts/expressions/single-binary-expression.sol b/test/sources/solidity/contracts/expressions/single-binary-expression.sol similarity index 100% rename from test/soliditySources/contracts/expressions/single-binary-expression.sol rename to test/sources/solidity/contracts/expressions/single-binary-expression.sol diff --git a/test/soliditySources/contracts/function/abstract.sol b/test/sources/solidity/contracts/function/abstract.sol similarity index 100% rename from test/soliditySources/contracts/function/abstract.sol rename to test/sources/solidity/contracts/function/abstract.sol diff --git a/test/soliditySources/contracts/function/calldata.sol b/test/sources/solidity/contracts/function/calldata.sol similarity index 100% rename from test/soliditySources/contracts/function/calldata.sol rename to test/sources/solidity/contracts/function/calldata.sol diff --git a/test/soliditySources/contracts/function/chainable-new.sol b/test/sources/solidity/contracts/function/chainable-new.sol similarity index 100% rename from test/soliditySources/contracts/function/chainable-new.sol rename to test/sources/solidity/contracts/function/chainable-new.sol diff --git a/test/soliditySources/contracts/function/chainable-value.sol b/test/sources/solidity/contracts/function/chainable-value.sol similarity index 100% rename from test/soliditySources/contracts/function/chainable-value.sol rename to test/sources/solidity/contracts/function/chainable-value.sol diff --git a/test/soliditySources/contracts/function/chainable.sol b/test/sources/solidity/contracts/function/chainable.sol similarity index 100% rename from test/soliditySources/contracts/function/chainable.sol rename to test/sources/solidity/contracts/function/chainable.sol diff --git a/test/soliditySources/contracts/function/constructor-keyword.sol b/test/sources/solidity/contracts/function/constructor-keyword.sol similarity index 100% rename from test/soliditySources/contracts/function/constructor-keyword.sol rename to test/sources/solidity/contracts/function/constructor-keyword.sol diff --git a/test/soliditySources/contracts/function/empty-body.sol b/test/sources/solidity/contracts/function/empty-body.sol similarity index 100% rename from test/soliditySources/contracts/function/empty-body.sol rename to test/sources/solidity/contracts/function/empty-body.sol diff --git a/test/soliditySources/contracts/function/function-call.sol b/test/sources/solidity/contracts/function/function-call.sol similarity index 100% rename from test/soliditySources/contracts/function/function-call.sol rename to test/sources/solidity/contracts/function/function-call.sol diff --git a/test/soliditySources/contracts/function/function.sol b/test/sources/solidity/contracts/function/function.sol similarity index 100% rename from test/soliditySources/contracts/function/function.sol rename to test/sources/solidity/contracts/function/function.sol diff --git a/test/soliditySources/contracts/function/modifier.sol b/test/sources/solidity/contracts/function/modifier.sol similarity index 100% rename from test/soliditySources/contracts/function/modifier.sol rename to test/sources/solidity/contracts/function/modifier.sol diff --git a/test/soliditySources/contracts/function/multiple.sol b/test/sources/solidity/contracts/function/multiple.sol similarity index 100% rename from test/soliditySources/contracts/function/multiple.sol rename to test/sources/solidity/contracts/function/multiple.sol diff --git a/test/soliditySources/contracts/if/else-if-unbracketed-multi.sol b/test/sources/solidity/contracts/if/else-if-unbracketed-multi.sol similarity index 100% rename from test/soliditySources/contracts/if/else-if-unbracketed-multi.sol rename to test/sources/solidity/contracts/if/else-if-unbracketed-multi.sol diff --git a/test/soliditySources/contracts/if/else-if-without-brackets.sol b/test/sources/solidity/contracts/if/else-if-without-brackets.sol similarity index 100% rename from test/soliditySources/contracts/if/else-if-without-brackets.sol rename to test/sources/solidity/contracts/if/else-if-without-brackets.sol diff --git a/test/soliditySources/contracts/if/else-with-brackets.sol b/test/sources/solidity/contracts/if/else-with-brackets.sol similarity index 100% rename from test/soliditySources/contracts/if/else-with-brackets.sol rename to test/sources/solidity/contracts/if/else-with-brackets.sol diff --git a/test/soliditySources/contracts/if/else-without-brackets.sol b/test/sources/solidity/contracts/if/else-without-brackets.sol similarity index 100% rename from test/soliditySources/contracts/if/else-without-brackets.sol rename to test/sources/solidity/contracts/if/else-without-brackets.sol diff --git a/test/soliditySources/contracts/if/if-else-no-brackets.sol b/test/sources/solidity/contracts/if/if-else-no-brackets.sol similarity index 100% rename from test/soliditySources/contracts/if/if-else-no-brackets.sol rename to test/sources/solidity/contracts/if/if-else-no-brackets.sol diff --git a/test/soliditySources/contracts/if/if-elseif-else.sol b/test/sources/solidity/contracts/if/if-elseif-else.sol similarity index 100% rename from test/soliditySources/contracts/if/if-elseif-else.sol rename to test/sources/solidity/contracts/if/if-elseif-else.sol diff --git a/test/soliditySources/contracts/if/if-no-brackets-multiline.sol b/test/sources/solidity/contracts/if/if-no-brackets-multiline.sol similarity index 100% rename from test/soliditySources/contracts/if/if-no-brackets-multiline.sol rename to test/sources/solidity/contracts/if/if-no-brackets-multiline.sol diff --git a/test/soliditySources/contracts/if/if-no-brackets.sol b/test/sources/solidity/contracts/if/if-no-brackets.sol similarity index 100% rename from test/soliditySources/contracts/if/if-no-brackets.sol rename to test/sources/solidity/contracts/if/if-no-brackets.sol diff --git a/test/soliditySources/contracts/if/if-with-brackets-multiline.sol b/test/sources/solidity/contracts/if/if-with-brackets-multiline.sol similarity index 100% rename from test/soliditySources/contracts/if/if-with-brackets-multiline.sol rename to test/sources/solidity/contracts/if/if-with-brackets-multiline.sol diff --git a/test/soliditySources/contracts/if/if-with-brackets.sol b/test/sources/solidity/contracts/if/if-with-brackets.sol similarity index 100% rename from test/soliditySources/contracts/if/if-with-brackets.sol rename to test/sources/solidity/contracts/if/if-with-brackets.sol diff --git a/test/soliditySources/contracts/if/nested-if-missing-else.sol b/test/sources/solidity/contracts/if/nested-if-missing-else.sol similarity index 100% rename from test/soliditySources/contracts/if/nested-if-missing-else.sol rename to test/sources/solidity/contracts/if/nested-if-missing-else.sol diff --git a/test/soliditySources/contracts/loops/for-no-brackets.sol b/test/sources/solidity/contracts/loops/for-no-brackets.sol similarity index 100% rename from test/soliditySources/contracts/loops/for-no-brackets.sol rename to test/sources/solidity/contracts/loops/for-no-brackets.sol diff --git a/test/soliditySources/contracts/loops/for-with-brackets.sol b/test/sources/solidity/contracts/loops/for-with-brackets.sol similarity index 100% rename from test/soliditySources/contracts/loops/for-with-brackets.sol rename to test/sources/solidity/contracts/loops/for-with-brackets.sol diff --git a/test/soliditySources/contracts/loops/while-no-brackets.sol b/test/sources/solidity/contracts/loops/while-no-brackets.sol similarity index 100% rename from test/soliditySources/contracts/loops/while-no-brackets.sol rename to test/sources/solidity/contracts/loops/while-no-brackets.sol diff --git a/test/soliditySources/contracts/loops/while-with-brackets.sol b/test/sources/solidity/contracts/loops/while-with-brackets.sol similarity index 100% rename from test/soliditySources/contracts/loops/while-with-brackets.sol rename to test/sources/solidity/contracts/loops/while-with-brackets.sol diff --git a/test/soliditySources/contracts/return/return.sol b/test/sources/solidity/contracts/return/return.sol similarity index 100% rename from test/soliditySources/contracts/return/return.sol rename to test/sources/solidity/contracts/return/return.sol diff --git a/test/soliditySources/contracts/statements/emit-coverage.sol b/test/sources/solidity/contracts/statements/emit-coverage.sol similarity index 100% rename from test/soliditySources/contracts/statements/emit-coverage.sol rename to test/sources/solidity/contracts/statements/emit-coverage.sol diff --git a/test/soliditySources/contracts/statements/emit-instrument.sol b/test/sources/solidity/contracts/statements/emit-instrument.sol similarity index 100% rename from test/soliditySources/contracts/statements/emit-instrument.sol rename to test/sources/solidity/contracts/statements/emit-instrument.sol diff --git a/test/soliditySources/contracts/statements/empty-contract-ala-melonport.sol b/test/sources/solidity/contracts/statements/empty-contract-ala-melonport.sol similarity index 100% rename from test/soliditySources/contracts/statements/empty-contract-ala-melonport.sol rename to test/sources/solidity/contracts/statements/empty-contract-ala-melonport.sol diff --git a/test/soliditySources/contracts/statements/empty-contract-body.sol b/test/sources/solidity/contracts/statements/empty-contract-body.sol similarity index 100% rename from test/soliditySources/contracts/statements/empty-contract-body.sol rename to test/sources/solidity/contracts/statements/empty-contract-body.sol diff --git a/test/soliditySources/contracts/statements/fn-argument-multiline.sol b/test/sources/solidity/contracts/statements/fn-argument-multiline.sol similarity index 100% rename from test/soliditySources/contracts/statements/fn-argument-multiline.sol rename to test/sources/solidity/contracts/statements/fn-argument-multiline.sol diff --git a/test/soliditySources/contracts/statements/fn-argument.sol b/test/sources/solidity/contracts/statements/fn-argument.sol similarity index 100% rename from test/soliditySources/contracts/statements/fn-argument.sol rename to test/sources/solidity/contracts/statements/fn-argument.sol diff --git a/test/soliditySources/contracts/statements/fn-struct.sol b/test/sources/solidity/contracts/statements/fn-struct.sol similarity index 100% rename from test/soliditySources/contracts/statements/fn-struct.sol rename to test/sources/solidity/contracts/statements/fn-struct.sol diff --git a/test/soliditySources/contracts/statements/library.sol b/test/sources/solidity/contracts/statements/library.sol similarity index 100% rename from test/soliditySources/contracts/statements/library.sol rename to test/sources/solidity/contracts/statements/library.sol diff --git a/test/soliditySources/contracts/statements/multiple.sol b/test/sources/solidity/contracts/statements/multiple.sol similarity index 100% rename from test/soliditySources/contracts/statements/multiple.sol rename to test/sources/solidity/contracts/statements/multiple.sol diff --git a/test/soliditySources/contracts/statements/post-close-brace.sol b/test/sources/solidity/contracts/statements/post-close-brace.sol similarity index 100% rename from test/soliditySources/contracts/statements/post-close-brace.sol rename to test/sources/solidity/contracts/statements/post-close-brace.sol diff --git a/test/soliditySources/contracts/statements/single.sol b/test/sources/solidity/contracts/statements/single.sol similarity index 100% rename from test/soliditySources/contracts/statements/single.sol rename to test/sources/solidity/contracts/statements/single.sol diff --git a/test/soliditySources/contracts/statements/tuple.sol b/test/sources/solidity/contracts/statements/tuple.sol similarity index 100% rename from test/soliditySources/contracts/statements/tuple.sol rename to test/sources/solidity/contracts/statements/tuple.sol diff --git a/test/soliditySources/contracts/statements/type-keyword.sol b/test/sources/solidity/contracts/statements/type-keyword.sol similarity index 100% rename from test/soliditySources/contracts/statements/type-keyword.sol rename to test/sources/solidity/contracts/statements/type-keyword.sol diff --git a/test/soliditySources/errors/Oraclize.sol b/test/sources/solidity/errors/Oraclize.sol similarity index 100% rename from test/soliditySources/errors/Oraclize.sol rename to test/sources/solidity/errors/Oraclize.sol diff --git a/test/soliditySources/errors/compilation-error.sol b/test/sources/solidity/errors/compilation-error.sol similarity index 100% rename from test/soliditySources/errors/compilation-error.sol rename to test/sources/solidity/errors/compilation-error.sol diff --git a/test/soliditySources/external/CLibrary.sol b/test/sources/solidity/external/CLibrary.sol similarity index 100% rename from test/soliditySources/external/CLibrary.sol rename to test/sources/solidity/external/CLibrary.sol diff --git a/test/soliditySources/external/Face.sol b/test/sources/solidity/external/Face.sol similarity index 100% rename from test/soliditySources/external/Face.sol rename to test/sources/solidity/external/Face.sol diff --git a/test/soliditySources/external/PureView.sol b/test/sources/solidity/external/PureView.sol similarity index 100% rename from test/soliditySources/external/PureView.sol rename to test/sources/solidity/external/PureView.sol diff --git a/test/units/app.js b/test/units/app.js index b519f15..08d028c 100644 --- a/test/units/app.js +++ b/test/units/app.js @@ -35,6 +35,25 @@ function assertExecutionFails(){ describe.skip('app', function() { afterEach(() => mock.remove()); + it('simple contract: should generate coverage, cleanup & exit(0)', () => { + assertCleanInitialState(); + + // Run script (exits 0); + mock.install('Simple.sol', 'simple.js', config); + shell.exec(script); + assert(shell.error() === null, 'script should not error'); + + assertCoverageGenerated(); + + // Coverage should be real. + // This test is tightly bound to the function names in Simple.sol + const produced = JSON.parse(fs.readFileSync('./coverage.json', 'utf8')); + const path = Object.keys(produced)[0]; + assert(produced[path].fnMap['1'].name === 'test', 'coverage.json should map "test"'); + assert(produced[path].fnMap['2'].name === 'getX', 'coverage.json should map "getX"'); + + }); + it('config with testrpc options string: should generate coverage, cleanup & exit(0)', () => { const privateKey = '0x3af46c9ac38ee1f01b05f9915080133f644bf57443f504d339082cb5285ccae4'; @@ -71,25 +90,6 @@ describe.skip('app', function() { }); - it('simple contract: should generate coverage, cleanup & exit(0)', () => { - assertCleanInitialState(); - - // Run script (exits 0); - mock.install('Simple.sol', 'simple.js', config); - shell.exec(script); - assert(shell.error() === null, 'script should not error'); - - assertCoverageGenerated(); - - // Coverage should be real. - // This test is tightly bound to the function names in Simple.sol - const produced = JSON.parse(fs.readFileSync('./coverage.json', 'utf8')); - const path = Object.keys(produced)[0]; - assert(produced[path].fnMap['1'].name === 'test', 'coverage.json should map "test"'); - assert(produced[path].fnMap['2'].name === 'getX', 'coverage.json should map "getX"'); - - }); - it('Oraclize @ solc v.0.4.24 (large, many unbracketed statements)', () => { const trufflejs = `module.exports = { diff --git a/test/util/mock.truffle.js b/test/util/mock.truffle.js new file mode 100644 index 0000000..65e1369 --- /dev/null +++ b/test/util/mock.truffle.js @@ -0,0 +1,121 @@ + +/* + Utilities for generating a mock truffle project to test plugin. +*/ + +const fs = require('fs'); +const shell = require('shelljs'); + +const configPath = './mock/.solcover.js'; +const testPath = './test/sources/js/'; +const sourcesPath = './test/sources/solidity/contracts/app/'; +const migrationPath = './mock/migrations/2_deploy.js'; + +const defaultTruffleConfig = ` + module.exports = { + networks: { + development: { + host: "localhost", + port: 8545, + network_id: "*" + } + }, + compilers: { + solc: { + version: "0.5.3", + } + } + }; +` + +/** + * Installs mock truffle project at ./mock with a single contract + * and test specified by the params. + * @param {String} contract located in /test/sources/cli/ + * @param {[type]} test located in /test/cli/ + */ +function install( + contract, + test, + config, + _truffleConfig, + _trufflejsName, + noMigrations +) { + + const configjs = `module.exports = ${JSON.stringify(config)}`; + + const migration = ` + const A = artifacts.require('${contract}'); + module.exports = function(deployer) { deployer.deploy(A) }; + `; + + // Mock truffle-config.js + const trufflejsName = _trufflejsName || 'truffle-config.js'; + const trufflejs = _truffleConfig || defaultTruffleConfig; + + // Generate mock + shell.mkdir('./mock'); + shell.cp('-Rf', './test/integration/truffle', './mock'); + shell.cp(`${sourcesPath}${contract}.sol`, `./mock/contracts/${contract}.sol`); + + if (!noMigrations){ + fs.writeFileSync(migrationPath, migration); + } + + fs.writeFileSync(`./mock/${trufflejsName}`, trufflejs); + fs.writeFileSync(`${configPath}`, configjs); + + shell.cp(`${testPath}${test}`, `./mock/test/${test}`); +}; + +/** + * Installs mock truffle project with two contracts (for inheritance, libraries, etc) + * @param {config} .solcover.js configuration + */ +function installMultiple(contracts, test, config) { + const configjs = `module.exports = ${JSON.stringify(config)}`; + + const deployContracts = ` + var A = artifacts.require(`${contracts[0]}`); + var B = artifacts.require(`${contracts[1]}`); + module.exports = function(deployer) { + deployer.deploy(A); + deployer.link(A, B); + deployer.deploy(B); + }; + `; + + shell.mkdir('./mock'); + shell.cp('-Rf', './test/integration/truffle', './mock'); + + contracts.forEach(item => { + shell.cp(`${sourcesPath}${item}.sol`, `./mock/contracts/${item}.sol`) + }); + + shell.cp(`${testPath}${test}`, `./mock/test/${test}`); + fs.writeFileSync('./mock/truffle-config.js', defaultTruffleJs); + fs.writeFileSync('./.solcover.js', configjs); + fs.writeFileSync(migrationPath, migration) +}; + + +/** + * Removes mock truffle project and coverage reports generated by exec.js + */ +function remove() { + shell.config.silent = true; + shell.rm('./.solcover.js'); + shell.rm('-Rf', 'mock'); + shell.rm('-Rf', 'coverage'); + shell.rm('coverage.json'); + shell.config.silent = false; +}; + + +module.exports = { + install: install, + installMultiple: installMultiple, + remove: remove +} + diff --git a/test/util/mockTruffle.js b/test/util/mockTruffle.js deleted file mode 100644 index 8b0fc5a..0000000 --- a/test/util/mockTruffle.js +++ /dev/null @@ -1,199 +0,0 @@ - -/* - This file contains utilities for generating a mock truffle project to test solcover's - run script against. - */ -const fs = require('fs'); -const shell = require('shelljs'); - -const defaultTruffleJs = `module.exports = { - networks: { - development: { - host: "localhost", - port: 8545, - network_id: "*" - } - }, - compilers: { - solc: { - version: "0.5.3", - } - } - };` - -/** - * Installs mock truffle project at ./mock with a single contract - * and test specified by the params. - * @param {String} contract located in /test/sources/cli/ - * @param {[type]} test located in /test/cli/ - */ -module.exports.install = function install( - contract, - test, - config, - _trufflejs, - _trufflejsName, - noMigrations -) { - const configjs = `module.exports = ${JSON.stringify(config)}`; - const contractLocation = `./${contract}`; - const trufflejsName = _trufflejsName || 'truffle-config.js'; - - // Mock migrations - const initialMigration = ` - let Migrations = artifacts.require('Migrations.sol'); - module.exports = function(deployer) { - deployer.deploy(Migrations); - };`; - - const deployContracts = ` - var contract = artifacts.require('${contractLocation}'); - module.exports = function(deployer) { - deployer.deploy(contract); - };`; - - // Mock external asset - const asset = 'module.exports = { value: true };'; - - // Mock truffle-config.js - const trufflejs = _trufflejs || defaultTruffleJs; - - // Generate mock - shell.mkdir('./mock'); - shell.mkdir('./mock/contracts'); - shell.mkdir('./mock/migrations'); - shell.mkdir('./mock/assets'); - shell.cp('./test/sources/cli/SimpleError.sol', './mock/assets/SimpleError.sol'); - shell.mkdir('./mock/node_modules'); - shell.mkdir('./mock/test'); - - if (Array.isArray(contract)) { - contract.forEach(item => { - shell.cp(`./test/sources/cli/${item}`, `./mock/contracts/${item}`); - }); - } else { - shell.cp(`./test/sources/cli/${contract}`, `./mock/contracts/${contract}`); - } - - if (!noMigrations){ - shell.cp('./test/sources/cli/Migrations.sol', './mock/contracts/Migrations.sol'); - fs.writeFileSync('./mock/migrations/1_initial_migration.js', initialMigration); - fs.writeFileSync('./mock/migrations/2_deploy_contracts.js', deployContracts); - } - - fs.writeFileSync(`./mock/${trufflejsName}`, trufflejs); - fs.writeFileSync('./mock/assets/asset.js', asset); - fs.writeFileSync('./.solcover.js', configjs); - - shell.cp(`./test/cli/${test}`, `./mock/test/${test}`); -}; - -/** - * Installs mock truffle project at ./mock with two contracts - one inherits from the other - * and test specified by the params. - * @param {config} .solcover.js configuration - */ -module.exports.installInheritanceTest = function installInheritanceTest(config) { - shell.mkdir('./mock'); - shell.mkdir('./mock/contracts'); - shell.mkdir('./mock/migrations'); - shell.mkdir('./mock/test'); - - // Mock contracts - shell.cp('./test/sources/cli/Proxy.sol', './mock/contracts/Proxy.sol'); - shell.cp('./test/sources/cli/Owned.sol', './mock/contracts/Owned.sol'); - shell.cp('./test/sources/cli/Migrations.sol', './mock/contracts/Migrations.sol'); - - // Mock migrations - const initialMigration = ` - let Migrations = artifacts.require('Migrations.sol'); - module.exports = function(deployer) { - deployer.deploy(Migrations); - };`; - - const deployContracts = ` - var Owned = artifacts.require('./Owned.sol'); - var Proxy = artifacts.require('./Proxy.sol'); - module.exports = function(deployer) { - deployer.deploy(Owned); - deployer.link(Owned, Proxy); - deployer.deploy(Proxy); - };`; - - fs.writeFileSync('./mock/migrations/1_initial_migration.js', initialMigration); - fs.writeFileSync('./mock/migrations/2_deploy_contracts.js', deployContracts); - - // Mock test - shell.cp('./test/cli/inheritance.js', './mock/test/inheritance.js'); - - // Mock truffle-config.js - const trufflejs = defaultTruffleJs; - - const configjs = `module.exports = ${JSON.stringify(config)}`; - - fs.writeFileSync('./mock/truffle-config.js', trufflejs); - fs.writeFileSync('./.solcover.js', configjs); -}; - - -/** - * Installs mock truffle project at ./mock with two contracts - one is a library the other - * uses, and test specified by the params. - * @param {config} .solcover.js configuration - */ -module.exports.installLibraryTest = function installInheritanceTest(config) { - shell.mkdir('./mock'); - shell.mkdir('./mock/contracts'); - shell.mkdir('./mock/migrations'); - shell.mkdir('./mock/test'); - shell.mkdir('./mock/assets'); - - // Mock contracts - shell.cp('./test/sources/cli/TotallyPure.sol', './mock/contracts/TotallyPure.sol'); - shell.cp('./test/sources/cli/Migrations.sol', './mock/contracts/Migrations.sol'); - - // Mock migrations - const initialMigration = ` - let Migrations = artifacts.require('Migrations.sol'); - module.exports = function(deployer) { - deployer.deploy(Migrations); - };`; - - const deployContracts = ` - var CLibrary = artifacts.require('CLibrary.sol'); - var TotallyPure = artifacts.require('./TotallyPure.sol'); - module.exports = function(deployer) { - deployer.deploy(CLibrary); - deployer.link(CLibrary, TotallyPure); - deployer.deploy(TotallyPure); - };`; - - fs.writeFileSync('./mock/migrations/1_initial_migration.js', initialMigration); - fs.writeFileSync('./mock/migrations/2_deploy_contracts.js', deployContracts); - - // Mock test - shell.cp('./test/cli/totallyPure.js', './mock/test/totallyPure.js'); - shell.cp('./test/sources/cli/PureView.sol', './mock/assets/PureView.sol'); - shell.cp('./test/sources/cli/CLibrary.sol', './mock/assets/CLibrary.sol'); - shell.cp('./test/sources/cli/Face.sol', './mock/assets/Face.sol'); - - // Mock truffle-config.js - const trufflejs = defaultTruffleJs; - - const configjs = `module.exports = ${JSON.stringify(config)}`; - - fs.writeFileSync('./mock/truffle-config.js', trufflejs); - fs.writeFileSync('./.solcover.js', configjs); -}; - -/** - * Removes mock truffle project and coverage reports generated by exec.js - */ -module.exports.remove = function remove() { - shell.config.silent = true; - shell.rm('./.solcover.js'); - shell.rm('-Rf', 'mock'); - shell.rm('-Rf', 'coverage'); - shell.rm('coverage.json'); - shell.config.silent = false; -}; diff --git a/test/util/util.js b/test/util/util.js index 1faa8d4..17dda48 100644 --- a/test/util/util.js +++ b/test/util/util.js @@ -10,7 +10,7 @@ const filePath = path.resolve('./test.sol'); const pathPrefix = './'; function getCode(_path) { - const pathToSources = `./../soliditySources/contracts/${_path}`; + const pathToSources = `./../sources/solidity/contracts/${_path}`; return fs.readFileSync(path.join(__dirname, pathToSources), 'utf8'); }; diff --git a/yarn.lock b/yarn.lock index 184a70f..038a9ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -186,7 +186,7 @@ ansi-styles@^2.2.1: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -581,7 +581,7 @@ camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -957,7 +957,7 @@ debug@^4.1.0, debug@^4.1.1: dependencies: ms "^2.1.1" -decamelize@^1.1.1, decamelize@^1.2.0: +decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -1367,7 +1367,7 @@ ethereumjs-util@^6.1.0: dependencies: bn.js "^4.11.0" create-hash "^1.1.2" - ethjs-util "^0.1.6" + ethjs-util "0.1.6" keccak "^1.0.2" rlp "^2.0.0" safe-buffer "^5.1.1" @@ -1413,7 +1413,7 @@ ethjs-unit@0.1.6: bn.js "4.11.6" number-to-bn "1.7.0" -ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: +ethjs-util@0.1.6, ethjs-util@^0.1.3: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== @@ -1447,19 +1447,6 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - express@^4.14.0: version "4.17.1" resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" @@ -1637,11 +1624,6 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -flow-stoplight@^1.0.0: - version "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: version "1.1.1" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" @@ -2638,11 +2620,6 @@ lowercase-keys@1.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" integrity sha1-TjNms55/VFfjXxMkvfb4jQv8cwY= -lodash@^4.17.14: - version "4.17.15" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" - integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== - lowercase-keys@^1.0.0, lowercase-keys@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" @@ -2692,13 +2669,6 @@ make-fetch-happen@^5.0.0: socks-proxy-agent "^4.0.0" ssri "^6.0.0" -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -2765,11 +2735,6 @@ mimic-fn@^1.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -mimic-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - mimic-response@^1.0.0, mimic-response@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" @@ -2952,11 +2917,6 @@ nested-error-stacks@~2.0.1: resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.0.1.tgz#d2cc9fc5235ddb371fc44d506234339c8e4b0a4b" integrity sha512-SrQrok4CATudVzBS7coSz26QRSmlK9TzzoFbeKfcPBUFPjcQM9Rqvr/DlJkOrwI/0KcgvMub1n1g5Jt9EgRn4A== -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - node-alias@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/node-alias/-/node-alias-1.0.4.tgz#1f1b916b56b9ea241c0135f97ced6940f556f292" @@ -3384,7 +3344,7 @@ path-is-inside@^1.0.1: resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= -path-key@^2.0.0, path-key@^2.0.1: +path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= @@ -3747,11 +3707,6 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - requireg@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/requireg/-/requireg-0.2.2.tgz#437e77a5316a54c9bcdbbf5d1f755fe093089830" @@ -4248,7 +4203,7 @@ string-width@^2.0.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0, string-width@^3.1.0: +string-width@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== @@ -4287,7 +4242,7 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: +strip-ansi@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== @@ -4554,10 +4509,10 @@ truffle-interface-adapter@^0.2.0: ethers "^4.0.32" web3 "1.0.0-beta.37" -truffle@^5.0.26: - version "5.0.28" - resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.0.28.tgz#383c6c4ae082c52fe6dda6620f924ae3a0f5ac49" - integrity sha512-ccpvgrHW7EGfJ4cowMgh5dCAILG5Ie8q2QNBhnGtHxyPTDxb8o2/sgVIi5BZhaueijOPb47sYe2ojKlY6dk8+Q== +truffle@^5.0.31: + version "5.0.31" + resolved "https://registry.yarnpkg.com/truffle/-/truffle-5.0.31.tgz#372a826e330720e29514458ff25750aa2b5efa65" + integrity sha512-dNBH5OFcqHXCaaQO0YGcEtNarIPcToU+tbq+lBph4tI2YjboiwakguvrNCL+cTP4sySKqeg+2QA1W5miyOQGpA== dependencies: app-module-path "^2.2.0" mocha "5.2.0" @@ -5115,15 +5070,6 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" -wrap-ansi@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" - integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== - dependencies: - ansi-styles "^3.2.0" - string-width "^3.0.0" - strip-ansi "^5.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -5231,14 +5177,6 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== -yargs-parser@^13.1.0: - version "13.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" - integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - yargs-parser@^9.0.2: version "9.0.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077" @@ -5246,24 +5184,7 @@ yargs-parser@^9.0.2: dependencies: camelcase "^4.1.0" -yargs@13.2.4: - version "13.2.4" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.4.tgz#0b562b794016eb9651b98bd37acf364aa5d6dc83" - integrity sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg== - dependencies: - cliui "^5.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - os-locale "^3.1.0" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.1.0" - -yargs@^11.0.0: +yargs@11.1.0, yargs@^11.0.0: version "11.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.1.0.tgz#90b869934ed6e871115ea2ff58b03f4724ed2d77" integrity sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==