linting for simulator done

pull/861/head
aniket-engg 4 years ago
parent 5db9b66087
commit ed562f01d0
  1. 3
      libs/remix-simulator/.eslintrc
  2. 1
      libs/remix-simulator/src/genesis.ts
  3. 3
      libs/remix-simulator/src/methods/misc.ts
  4. 2
      libs/remix-simulator/src/methods/txProcess.ts
  5. 6
      libs/remix-simulator/src/provider.ts
  6. 3
      libs/remix-simulator/src/server.ts
  7. 20
      libs/remix-simulator/src/utils/logs.ts

@ -5,7 +5,8 @@
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": "off",
"camelcase": "off",
"dot-notation": "off"
"dot-notation": "off",
"no-unused-vars": "off"
},
"env": {
"browser": true,

@ -18,4 +18,3 @@ export function generateBlock (executionContext) {
executionContext.addBlock(block)
})
}

@ -1,5 +1,5 @@
const version = require('../../package.json').version
import Web3 from 'web3'
const version = require('../../package.json').version
export function methods () {
return {
@ -57,4 +57,3 @@ export function eth_compileLLL (payload, cb) {
export function eth_compileSerpent (payload, cb) {
cb(null, 'unsupported')
}

@ -1,4 +1,4 @@
import { execution } from '@remix-project/remix-lib'
import { execution } from '@remix-project/remix-lib'
const TxExecution = execution.txExecution
const TxRunner = execution.txRunner

@ -1,6 +1,5 @@
import { Blocks } from './methods/blocks'
import { execution } from '@remix-project/remix-lib'
const { executionContext } = execution
import { info } from './utils/logs'
import merge from 'merge'
@ -12,6 +11,7 @@ import { methods as netMethods } from './methods/net'
import { Transactions } from './methods/transactions'
import { Debug } from './methods/debug'
import { generateBlock } from './genesis'
const { executionContext } = execution
export class Provider {
options: Record<string, unknown>
@ -79,13 +79,13 @@ export class Provider {
isConnected () {
return true
}
disconnect () {
return false
};
supportsSubscriptions () {
return true;
return true
};
on (type, cb) {

@ -1,13 +1,12 @@
import express from 'express'
import cors from 'cors'
import bodyParser from 'body-parser'
const app = express()
import expressWs from 'express-ws'
import { Provider } from './provider'
import { log } from './utils/logs'
const app = express()
class Server {
provider
rpcOnly

@ -4,11 +4,11 @@ import gray from 'ansi-gray'
import timestamp from 'time-stamp'
import supportsColor from 'color-support'
function hasFlag(flag) {
function hasFlag (flag) {
return ((typeof (process) !== 'undefined') && (process.argv.indexOf('--' + flag) !== -1))
}
function addColor(str) {
function addColor (str) {
if (this.hasFlag('no-color')) {
return str
}
@ -24,50 +24,50 @@ function addColor(str) {
return str
}
function stdout(arg) {
function stdout (arg) {
if (typeof (process) === 'undefined' || !process.stdout) return
process.stdout.write(arg)
}
function stderr(arg) {
function stderr (arg) {
if (typeof (process) === 'undefined' || process.stderr) return
process.stderr.write(arg)
}
function getTimestamp() {
function getTimestamp () {
const coloredTimestamp = this.addColor(timestamp('HH:mm:ss'))
return '[' + coloredTimestamp + ']'
}
export function log(...args: any[]) {
export function log (...args: any[]) {
const time = this.getTimestamp()
this.stdout(time + ' ')
console.log(args)
return this
}
export function info(...args: any[]) {
export function info (...args: any[]) {
const time = this.getTimestamp()
this.stdout(time + ' ')
console.info(args)
return this
}
export function dir(...args: any[]) {
export function dir (...args: any[]) {
const time = this.getTimestamp()
this.stdout(time + ' ')
console.dir(args)
return this
}
export function warn(...args: any[]) {
export function warn (...args: any[]) {
const time = this.getTimestamp()
this.stderr(time + ' ')
console.warn(args)
return this
}
export function error(...args: any[]) {
export function error (...args: any[]) {
const time = this.getTimestamp()
this.stderr(time + ' ')
console.error(args)

Loading…
Cancel
Save