fix: type checker and linter errors on master after recent PR merges

This commit is contained in:
Michael Bradley, Jr 2019-09-04 18:05:53 -05:00 committed by Michael Bradley
parent 58ad62f32b
commit 8716373be2
11 changed files with 699 additions and 62 deletions

View File

@ -13,6 +13,7 @@
"chalk": "2.4.2",
"coveralls": "3.0.2",
"eslint-plugin-react": "7.14.3",
"form-data": "2.5.1",
"fs-extra": "7.0.1",
"lerna": "3.16.4",
"lodash.clonedeep": "4.5.0",

View File

@ -5,7 +5,7 @@ import {Embark, Plugins} /* supplied by @types/embark in packages/embark-typings
import { __ } from "embark-i18n";
import { embarkPath } from "embark-utils";
import express, {NextFunction, Request, Response} from "express";
import expressWs from "express-ws";
import expressWs, { Application } from "express-ws";
import findUp from "find-up";
import helmet from "helmet";
import * as http from "http";
@ -292,7 +292,7 @@ export default class Server {
if (callDescription.method === "ws") {
instance.app.ws(callDescription.endpoint, this.applyWSFunction.bind(this, callDescription.cb));
} else {
instance.app[callDescription.method].apply(instance.app, [callDescription.endpoint, this.applyHTTPFunction.bind(this, callDescription.cb)]);
instance.app[callDescription.method].apply(instance.app, [callDescription.endpoint, (this.applyHTTPFunction.bind(this, callDescription.cb) as Application)]);
}
}

View File

@ -83,16 +83,6 @@ class ContractsManager {
});
}
get web3() {
return (async () => {
if (!this._web3) {
const provider = await this.events.request2("blockchain:client:provider", "ethereum");
this._web3 = new Web3(provider);
}
return this._web3;
})();
}
registerAPIs() {
let embark = this.embark;
const self = this;

View File

@ -44,7 +44,8 @@
"@babel/runtime-corejs2": "7.3.1",
"ajv": "6.10.2",
"embark-i18n": "^4.1.1",
"embark-utils": "^4.1.1"
"embark-utils": "^4.1.1",
"handlebars": "4.2.0"
},
"devDependencies": {
"@babel/cli": "7.2.3",

View File

@ -46,8 +46,8 @@
"extends": "../../.eslintrc.json"
},
"dependencies": {
"async": "^2.6.0",
"semver": "^5.6.0",
"async": "2.6.1",
"semver": "5.6.0",
"shelljs": "0.8.3"
},
"devDependencies": {

View File

@ -10,10 +10,10 @@ class Reporter {
this.file = payload.filename;
break;
case 'testPass':
this.reporter.report(`${ this.contract } ${ payload.value }`, payload.time, true);
this.reporter.report(`${this.contract} ${payload.value}`, payload.time, true);
break;
case 'testFailure':
this.reporter.report(`${ this.contract } ${ payload.value }`, payload.time, false, payload.errMsg);
this.reporter.report(`${this.contract} ${payload.value}`, payload.time, false, payload.errMsg);
break;
default:
console.log('dont know how to handle');

View File

@ -20,7 +20,7 @@ class Reporter {
return;
}
const gas = parseInt(result.gasUsed);
const gas = parseInt(result.gasUsed, 16);
this.gasAccumulator += gas;
});
}
@ -55,10 +55,10 @@ class Reporter {
if (passed) {
this.passes++;
process.stdout.write(chalk`{bgGreen.white.bold ${' PASS '}} {underline ${ test }} {bold >} {${ timeFormat } ${ time }s} {bold >} {bold ${ formattedGas } gas}\n`);
process.stdout.write(chalk`{bgGreen.white.bold ${' PASS '}} {underline ${test}} {bold >} {${timeFormat} ${time}s} {bold >} {bold ${formattedGas} gas}\n`);
} else {
this.fails++;
process.stdout.write(chalk`{bgRed.white.bold ${' FAIL '}} {underline ${ test }} {bold >} {${ timeFormat } ${ time }s} {bold >} {bold ${ formattedGas } gas} > {red ${message || 'no error message'}}\n`);
process.stdout.write(chalk`{bgRed.white.bold ${' FAIL '}} {underline ${test}} {bold >} {${timeFormat} ${time}s} {bold >} {bold ${formattedGas} gas} > {red ${message || 'no error message'}}\n`);
}
this.resetGas();
@ -66,7 +66,7 @@ class Reporter {
// stolen from https://blog.abelotech.com/posts/number-currency-formatting-javascript/
formatNumber(num) {
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,')
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
}
}

View File

@ -1,6 +1,21 @@
import { Logger } from "./logger";
import { Plugins } from "./plugins";
type CommandCallback = (
opt1?: any,
opt2?: any,
opt3?: any,
opt4?: any,
opt5?: any,
opt6?: any,
opt7?: any,
opt8?: any,
opt9?: any,
opt10?: any,
opt11?: any,
opt12?: any,
) => any;
export interface Events {
on: any;
request: any;
@ -9,11 +24,7 @@ export interface Events {
once: any;
setCommandHandler(
name: string,
callback: (options: any, cb: (...args: any[]) => void) => void,
): void;
setCommandHandler(
name: string,
callback: (option: string, option2: string, cb: (...args: any[]) => void) => void,
callback: CommandCallback,
): void;
}

View File

@ -152,7 +152,6 @@
"ganache-cli": "6.4.3",
"glob": "7.1.3",
"globule": "1.2.1",
"handlebars": "4.0.14",
"hard-source-webpack-plugin": "0.13.1",
"helmet": "3.13.0",
"hosted-git-info": "2.7.1",
@ -225,7 +224,6 @@
"@types/express-ws": "3.0.0",
"@types/find-up": "2.1.0",
"@types/globule": "1.1.3",
"@types/handlebars": "4.0.39",
"@types/helmet": "0.0.42",
"@types/i18n": "0.8.3",
"@types/node": "10.11.7",

View File

@ -2,7 +2,7 @@ const Web3 = require('web3');
class BlockchainClient {
constructor(embark, options) {
constructor(embark, _options) {
this.embark = embark;
this.events = embark.events;

702
yarn.lock

File diff suppressed because it is too large Load Diff