fixing linting for remix-lib

pull/4771/head
lianahus 7 months ago
parent 4716cfa2e7
commit 4e94496f32
  1. 2
      libs/remix-lib/project.json
  2. 4
      libs/remix-lib/src/execution/eventsDecoder.ts
  3. 6
      libs/remix-lib/src/execution/logsManager.ts
  4. 2
      libs/remix-lib/src/execution/txHelper.ts
  5. 6
      libs/remix-lib/src/execution/txRunnerWeb3.ts
  6. 4
      libs/remix-lib/src/init.ts
  7. 1
      libs/remix-lib/test/txFormat.ts
  8. 2
      libs/remix-lib/test/txHelper.ts
  9. 13
      libs/remix-lib/test/util.ts

@ -22,7 +22,7 @@
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/remix-lib/**/*.ts"],
"eslintConfig": "libs/remix-lib/.eslinrc"
"eslintConfig": "libs/remix-lib/.eslintrc"
}
}
},

@ -21,7 +21,7 @@ export class EventsDecoder {
* @param {Function} cb - callback
*/
parseLogs (tx, contractName, compiledContracts, cb) {
if (tx.isCall) return cb(null, { decoded: [], raw: [] })
if (tx.isCall) return cb(null, { decoded: [], raw: []})
this.resolveReceipt(tx, (error, receipt) => {
if (error) return cb(error)
this._decodeLogs(tx, receipt, contractName, compiledContracts, cb)
@ -33,7 +33,7 @@ export class EventsDecoder {
return cb('cannot decode logs - contract or receipt not resolved ')
}
if (!receipt.logs) {
return cb(null, { decoded: [], raw: [] })
return cb(null, { decoded: [], raw: []})
}
this._decodeEvents(tx, receipt.logs, contract, contracts, cb)
}

@ -24,7 +24,7 @@ export class LogsManager {
if (!receipt) return next()
for (const log of receipt.logs) {
this.oldLogs.push({ type: 'block', blockNumber, block, tx, log, txNumber: i, receipt })
const subscriptions = this.getSubscriptionsFor({ type: 'block', blockNumber, block, tx, log, receipt})
const subscriptions = this.getSubscriptionsFor({ type: 'block', blockNumber, block, tx, log, receipt })
for (const subscriptionId of subscriptions) {
const result = {
logIndex: '0x1', // 1
@ -76,7 +76,7 @@ export class LogsManager {
const subscriptionParams = this.subscriptions[subscriptionId]
const [queryType, queryFilter] = subscriptionParams
if (this.eventMatchesFilter(changeEvent, queryType, queryFilter || { topics: [] })) {
if (this.eventMatchesFilter(changeEvent, queryType, queryFilter || { topics: []})) {
matchedSubscriptions.push(subscriptionId)
}
}
@ -135,7 +135,7 @@ export class LogsManager {
const tracking = this.filterTracking[filterId]
if (logsOnly || filterType === 'filter') {
return this.getLogsFor(params || { topics: [] })
return this.getLogsFor(params || { topics: []})
}
if (filterType === 'block') {
const blocks = this.oldLogs.filter(x => x.type === 'block').filter(x => tracking.block === undefined || x.blockNumber >= tracking.block)

@ -66,7 +66,7 @@ export function sortAbiFunction (contractabi) {
}
export function getConstructorInterface (abi) {
const funABI = { name: '', inputs: [], type: 'constructor', payable: false, outputs: [] }
const funABI = { name: '', inputs: [], type: 'constructor', payable: false, outputs: []}
if (typeof abi === 'string') {
try {
abi = JSON.parse(abi)

@ -2,7 +2,7 @@
import { EventManager } from '../eventManager'
import type { Transaction as InternalTransaction } from './txRunner'
import Web3 from 'web3'
import {toBigInt, toHex} from 'web3-utils'
import { toBigInt, toHex } from 'web3-utils'
export class TxRunnerWeb3 {
event
@ -65,7 +65,7 @@ export class TxRunnerWeb3 {
promptCb(
async (value) => {
try {
const res = await (this.getWeb3() as any).eth.personal.sendTransaction({...tx, value}, { checkRevertBeforeSending: false, ignoreGasPricing: true })
const res = await (this.getWeb3() as any).eth.personal.sendTransaction({ ...tx, value }, { checkRevertBeforeSending: false, ignoreGasPricing: true })
cb(null, res.transactionHash)
} catch (e) {
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)
@ -81,7 +81,7 @@ export class TxRunnerWeb3 {
)
} else {
try {
const res = await this.getWeb3().eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true})
const res = await this.getWeb3().eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
cb(null, res.transactionHash)
} catch (e) {
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)

@ -1,9 +1,9 @@
'use strict'
import Web3, { Web3PluginBase } from 'web3'
import {toNumber} from 'web3-utils'
import { toNumber } from 'web3-utils'
export function extendWeb3 (web3) {
if(!web3.debug){
if (!web3.debug){
web3.registerPlugin(new Web3DebugPlugin())
}
}

@ -45,7 +45,6 @@ function testWithInput (st, params, expected) {
}, () => {}, () => {})
}
tape('ContractStringParameters - (TxFormat.buildData) - format string input parameters', function (t) {
let output = compiler.compile(compilerInput(stringContract))
output = JSON.parse(output)

@ -165,4 +165,4 @@ const abi = `[
}
]`
const testTupleAbi = [{"inputs":[{"components":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"age","type":"uint256"}],"internalType":"struct Example.User","name":"user","type":"tuple"}],"name":"setUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userByAddress","outputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"age","type":"uint256"}],"stateMutability":"view","type":"function"}]
const testTupleAbi = [{ "inputs":[{ "components":[{ "internalType":"string","name":"name","type":"string" },{ "internalType":"uint256","name":"age","type":"uint256" }],"internalType":"struct Example.User","name":"user","type":"tuple" }],"name":"setUser","outputs":[],"stateMutability":"nonpayable","type":"function" },{ "inputs":[{ "internalType":"address","name":"","type":"address" }],"name":"userByAddress","outputs":[{ "internalType":"string","name":"name","type":"string" },{ "internalType":"uint256","name":"age","type":"uint256" }],"stateMutability":"view","type":"function" }]

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save