mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-10 13:55:45 +00:00
style: fix linter errors on master after recent PR merges
This commit is contained in:
parent
c46c52ff5c
commit
4e590991a8
@ -1,4 +1,4 @@
|
||||
import { __ } from 'embark-i18n';
|
||||
import { __ } from "embark-i18n";
|
||||
import * as fs from "./fs";
|
||||
import VM from "./vm";
|
||||
|
||||
|
@ -25,7 +25,7 @@ export default class Coverage {
|
||||
return;
|
||||
}
|
||||
|
||||
this.embark.registerActionForEvent('tests:contracts:compile:before', async (contractsFiles, cb) => {
|
||||
this.embark.registerActionForEvent("tests:contracts:compile:before", async (contractsFiles, cb) => {
|
||||
const solcVersion = this.embark.config.embarkConfig.versions.solc;
|
||||
const enhancedContracts = contractsFiles.map((file: File) => new ContractEnhanced(file.path, solcVersion));
|
||||
|
||||
|
@ -194,7 +194,7 @@ describe('embark.deploymentChecks', function () {
|
||||
});
|
||||
});
|
||||
it("should error (and not deploy) if tracked contract address is invalid", async function () {
|
||||
trackingFunctions._web3.eth.getCode = () => {throw new Error();};
|
||||
trackingFunctions._web3.eth.getCode = () => { throw new Error(); };
|
||||
return deploymentChecks.checkIfAlreadyDeployed(params, (err, _params) => {
|
||||
expect(err).to.not.be(null);
|
||||
});
|
||||
|
@ -81,9 +81,8 @@ export default class TrackingFunctions {
|
||||
} catch (err) {
|
||||
// Retry with block 1 (Block 0 fails with Ganache-cli using the --fork option)
|
||||
this._block = await web3.eth.getBlock(1, true);
|
||||
} finally {
|
||||
return this._block;
|
||||
}
|
||||
return this._block;
|
||||
})();
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ class MochaTestRunner {
|
||||
mocha.addFile(file);
|
||||
}
|
||||
|
||||
mocha.run((failures) => {
|
||||
mocha.run((_failures) => {
|
||||
next();
|
||||
});
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class TestRunner {
|
||||
|
||||
const cmd = `${embarkPath('node_modules/.bin/istanbul')} report --root .embark --format html --format lcov`;
|
||||
runCmd(cmd, {silent: false, exitOnError: false}, next);
|
||||
},
|
||||
}
|
||||
], (err) => {
|
||||
reporter.footer();
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
const {__} = require('embark-i18n');
|
||||
const Web3 = require('web3');
|
||||
const async = require('async');
|
||||
|
||||
require('ejs');
|
||||
const Templates = {
|
||||
vanilla_contract: require('./vanilla-contract.js.ejs'),
|
||||
contract_artifact: require('./contract-artifact.js.ejs'),
|
||||
web3_init: require('./web3_init.js.ejs')
|
||||
};
|
||||
// const Templates = {
|
||||
// vanilla_contract: require('./vanilla-contract.js.ejs'),
|
||||
// contract_artifact: require('./contract-artifact.js.ejs'),
|
||||
// web3_init: require('./web3_init.js.ejs')
|
||||
// };
|
||||
|
||||
class EmbarkWeb3 {
|
||||
constructor(embark, _options) {
|
||||
@ -30,7 +29,7 @@ class EmbarkWeb3 {
|
||||
this.events.request("embarkjs:plugin:register", 'blockchain', 'web3', 'embarkjs-web3');
|
||||
await this.events.request2("embarkjs:console:register", 'blockchain', 'web3', 'embarkjs-web3');
|
||||
this.events.on("blockchain:started", async () => {
|
||||
await this.registerWeb3Object()
|
||||
await this.registerWeb3Object();
|
||||
this.events.request("embarkjs:console:setProvider", 'blockchain', 'web3', '{web3}');
|
||||
});
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class SolidityTestRunner {
|
||||
|
||||
run(options, cb) {
|
||||
const reporter = new Reporter(options.reporter);
|
||||
const {events, plugins} = this;
|
||||
const {events, _plugins} = this;
|
||||
|
||||
if (this.files.length === 0) {
|
||||
return cb(null, 0);
|
||||
@ -88,6 +88,7 @@ class SolidityTestRunner {
|
||||
(next) => {
|
||||
events.request("contracts:reset", next);
|
||||
},
|
||||
|
||||
/*
|
||||
(next) => {
|
||||
plugins.emitAndRunActionsForEvent('tests:contracts:compile:before', contractFiles, next);
|
||||
@ -96,6 +97,7 @@ class SolidityTestRunner {
|
||||
(next) => {
|
||||
events.request("compiler:contracts:compile", contractFiles, next);
|
||||
},
|
||||
|
||||
/*
|
||||
(cc, next) => {
|
||||
plugins.emitAndRunActionsForEvent('tests:contracts:compile:after', cc, next);
|
||||
|
@ -89,8 +89,10 @@ class FunctionConfigs {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const contractRegisteredInVM = await this.checkContractRegisteredInVM(contract);
|
||||
if (!contractRegisteredInVM) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await this.events.request2("embarkjs:contract:runInVM", contract);
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
let contractInstance = await this.events.request2("runcode:eval", contract.className);
|
||||
args.contracts[contract.className] = contractInstance;
|
||||
}
|
||||
@ -109,7 +111,7 @@ class FunctionConfigs {
|
||||
const checkContract = `
|
||||
return typeof ${contract.className} !== 'undefined';
|
||||
`;
|
||||
return await this.events.request2('runcode:eval', checkContract);
|
||||
return this.events.request2('runcode:eval', checkContract);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,12 +37,14 @@ class ContractDeployer {
|
||||
}
|
||||
|
||||
// TODO: implement `blockchainType` a la `this.deployer[contract.blockchainType].apply(this.deployer, [contract, next])`
|
||||
this.deployer["ethereum"].apply(this.deployer, [contract, (err, receipt) => {
|
||||
if (!receipt) return next(err);
|
||||
this.plugins.emitAndRunActionsForEvent('deployment:contract:deployed', { contract, receipt }, (err, _params) => {
|
||||
next(err);
|
||||
});
|
||||
}]);
|
||||
this.deployer["ethereum"].apply(this.deployer, [
|
||||
contract, (err, receipt) => {
|
||||
if (!receipt) return next(err);
|
||||
this.plugins.emitAndRunActionsForEvent('deployment:contract:deployed', { contract, receipt }, (err, _params) => {
|
||||
next(err);
|
||||
});
|
||||
}
|
||||
]);
|
||||
}
|
||||
], (err) => {
|
||||
if (err) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {__} from 'embark-i18n';
|
||||
import {canonicalHost, defaultHost} from 'embark-utils';
|
||||
// import {canonicalHost, defaultHost} from 'embark-utils';
|
||||
|
||||
export default class Namesystem {
|
||||
constructor(embark, _options) {
|
||||
|
@ -45,7 +45,7 @@
|
||||
"// watch:typecheck": "npm run typecheck -- --preserveWatchOutput --watch"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "../../.eslintrc.json"
|
||||
"extends": "../../../.eslintrc.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime-corejs2": "7.3.1",
|
||||
|
Loading…
x
Reference in New Issue
Block a user