From f5e12c63e7f205a050382a52cfd4713d987d2c93 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 27 Jan 2020 12:01:22 +0530 Subject: [PATCH] devdoc & type --- remix-tests/src/deployer.ts | 13 +++++++++++-- remix-tests/tests/testRunner.ts | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/remix-tests/src/deployer.ts b/remix-tests/src/deployer.ts index 078c5ab6af..91b5d58d66 100644 --- a/remix-tests/src/deployer.ts +++ b/remix-tests/src/deployer.ts @@ -1,8 +1,17 @@ import async from 'async' -var remixLib = require('remix-lib') +const remixLib = require('remix-lib') import Web3 from 'web3'; +import { compilationInterface } from 'types'; -export function deployAll(compileResult: object, web3: Web3, isAgain: boolean, callback) { +/** + * @dev Deploy all contracts from compilation result + * @param compileResult compilation result + * @param web3 web3 object + * @param isAgain If true, try deployment with gas double of estimation (used for Out-of-gas error only) + * @param callback Callback + */ + +export function deployAll(compileResult: compilationInterface, web3: Web3, isAgain: boolean, callback) { let compiledObject = {} let contracts = {} let accounts: string[] = [] diff --git a/remix-tests/tests/testRunner.ts b/remix-tests/tests/testRunner.ts index 30c032f829..5f5c17a9e5 100644 --- a/remix-tests/tests/testRunner.ts +++ b/remix-tests/tests/testRunner.ts @@ -6,7 +6,7 @@ import { Provider } from 'remix-simulator' import { compileFileOrFiles } from '../dist/compiler' import { deployAll } from '../dist/deployer' -import { runTest } from '../dist/index' +import { runTest, compilationInterface } from '../dist/index' import { ResultsInterface, TestCbInterface, ResultCbInterface } from '../dist/index' // deepEqualExcluding allows us to exclude specific keys whose values vary. @@ -60,7 +60,7 @@ async function compileAndDeploy(filename: string, callback: Function) { function compile(next: Function): void { compileFileOrFiles(filename, false, { accounts }, next) }, - function deployAllContracts(compilationResult: object, asts, next: Function): void { + function deployAllContracts(compilationResult: compilationInterface, asts, next: Function): void { for(const filename in asts) { if(filename.endsWith('_test.sol')) sourceASTs[filename] = asts[filename].ast