From b2fe02ba96eaa4faa080819f28e5f78b1551c4ab Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 17 Feb 2020 16:36:30 +0530 Subject: [PATCH] more types & package.json scripts updated --- package.json | 6 +++--- .../src/solidity-analyzer/modules/gasCosts.ts | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index f8dbbc1b83..feabb5f6d4 100644 --- a/package.json +++ b/package.json @@ -7,15 +7,15 @@ "scripts": { "diff": "lerna diff", "updated": "lerna updated", - "bootstrap": "lerna bootstrap", - "build-ts-packages": "lerna run --scope 'remix-solidity' --scope 'remix-tests' --scope 'remix-url-resolver' --scope 'remix-astwalker' build", + "bootstrap": "npm run build-ts-packages; lerna bootstrap", + "build-ts-packages": "lerna run --scope 'remix-analyzer' --scope 'remix-astwalker' --scope 'remix-solidity' --scope 'remix-tests' --scope 'remix-url-resolver' build", "publish": "npm run build-ts-packages; lerna publish", "release": "lerna bootstrap; lerna publish;", "tag": "gulp; gulp publishTag;", "updateChangelog": "gulp; gulp updateChangelog --prev $previousVersion;", "remove-all-install": "npm run remove-install; npm run remove-install-analyzer; npm run remove-install-astwalker; npm run remove-install-debug; npm run remove-install-lib; npm run remove-install-simulator; npm run remove-install-tests; npm run remove-install-url-resolver; npm run remove-install-solidity;", "remove-install": "rm package-lock.json; rm -rf node_modules", - "remove-install-analyzer": "rm remix-analyzer/package-lock.json; rm -rf remix-analyzer/node_modules", + "remove-install-analyzer": "rm remix-analyzer/package-lock.json; rm -rf remix-analyzer/node_modules; rm -rf remix-analyzer/dist", "remove-install-astwalker": "rm remix-astwalker/package-lock.json; rm -rf remix-astwalker/node_modules; rm -rf remix-astwalker/dist", "remove-install-debug": "rm remix-debug/package-lock.json; rm -rf remix-debug/node_modules", "remove-install-lib": "rm remix-lib/package-lock.json; rm -rf remix-lib/node_modules", diff --git a/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts b/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts index f6b2c3de3b..8ceeeef09f 100644 --- a/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts +++ b/remix-analyzer/src/solidity-analyzer/modules/gasCosts.ts @@ -1,11 +1,12 @@ import { default as category } from './categories' import { default as algorithm } from './algorithmCategories' +import { ModuleAlgorithm, ModuleCategory, ReportObj, CompilationResult} from './../../types' export default class gasCosts { - name = 'Gas costs: ' - desc = 'Warn if the gas requirements of functions are too high.' - categories = category.GAS - algorithm = algorithm.EXACT + name: string = 'Gas costs: ' + description: string = 'Warn if the gas requirements of functions are too high.' + category: ModuleCategory = category.GAS + algorithm: ModuleAlgorithm = algorithm.EXACT /** @@ -22,7 +23,7 @@ export default class gasCosts { } } - report (compilationResults) { + report (compilationResults: CompilationResult): ReportObj[] { const report: any[] = [] this.visitContracts(compilationResults.contracts, (contract) => { if (