fixed linting for vyper and walletconnect

pull/4771/head
lianahus 7 months ago
parent e0a2012a78
commit dde16c2bd4
  1. 4
      apps/vyper/project.json
  2. 4
      apps/vyper/src/app/utils/types.ts
  3. 4
      apps/walletconnect/project.json
  4. 16
      apps/walletconnect/src/services/WalletConnectRemixClient.ts

@ -42,8 +42,8 @@
"executor": "@nrwl/linter:eslint", "executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/vyper/**/*.ts"], "lintFilePatterns": ["apps/vyper/**/*.ts"],
"eslintConfig": "libs/vyper/.eslintrc" "eslintConfig": "apps/vyper/.eslintrc"
} }
}, },
"serve": { "serve": {

@ -1,4 +1,4 @@
import {CompilationResult, ABIDescription} from '@remixproject/plugin-api' import { CompilationResult, ABIDescription } from '@remixproject/plugin-api'
export interface VyperCompilationResult { export interface VyperCompilationResult {
status: 'success' status: 'success'
@ -18,7 +18,6 @@ export interface VyperCompilationError {
message: string message: string
} }
export type VyperCompilationResultType = { export type VyperCompilationResultType = {
buildDependencies: any buildDependencies: any
compilers: [ compilers: [
@ -448,7 +447,6 @@ deployments: {
[contractName: string]: ContractInstanceObject [contractName: string]: ContractInstanceObject
} }
} }
export type CompilerInformationObject = { export type CompilerInformationObject = {

@ -39,8 +39,8 @@
"executor": "@nrwl/linter:eslint", "executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"], "outputs": ["{options.outputFile}"],
"options": { "options": {
"lintFilePatterns": ["libs/walletconnect/**/*.ts"], "lintFilePatterns": ["apps/walletconnect/**/*.ts"],
"eslintConfig": "libs/walletconnect/.eslintrc" "eslintConfig": "apps/walletconnect/.eslintrc"
} }
}, },
"serve": { "serve": {

@ -1,9 +1,9 @@
import {PluginClient} from '@remixproject/plugin' import { PluginClient } from '@remixproject/plugin'
import {createClient} from '@remixproject/plugin-webview' import { createClient } from '@remixproject/plugin-webview'
import { createWeb3Modal, defaultConfig } from '@web3modal/ethers5/react' import { createWeb3Modal, defaultConfig } from '@web3modal/ethers5/react'
import { constants } from '../utils/constants' import { constants } from '../utils/constants'
import EventManager from 'events' import EventManager from 'events'
import {PROJECT_ID as projectId, METADATA as metadata} from './constant' import { PROJECT_ID as projectId, METADATA as metadata } from './constant'
import { Chain, RequestArguments } from '../types' import { Chain, RequestArguments } from '../types'
export class WalletConnectRemixClient extends PluginClient { export class WalletConnectRemixClient extends PluginClient {
@ -50,7 +50,7 @@ export class WalletConnectRemixClient extends PluginClient {
subscribeToEvents() { subscribeToEvents() {
this.web3modal.subscribeProvider(({ address, isConnected, chainId })=>{ this.web3modal.subscribeProvider(({ address, isConnected, chainId })=>{
if(isConnected){ if (isConnected){
if (address !== this.currentAccount) { if (address !== this.currentAccount) {
this.currentAccount = address this.currentAccount = address
this.emit('accountsChanged', [address]) this.emit('accountsChanged', [address])
@ -59,7 +59,7 @@ export class WalletConnectRemixClient extends PluginClient {
this.currentChain = chainId this.currentChain = chainId
this.emit('chainChanged', chainId) this.emit('chainChanged', chainId)
} }
}else{ } else {
this.emit('accountsChanged', []) this.emit('accountsChanged', [])
this.currentAccount = '' this.currentAccount = ''
this.emit('chainChanged', 0) this.emit('chainChanged', 0)
@ -114,16 +114,16 @@ export class WalletConnectRemixClient extends PluginClient {
} else { } else {
try { try {
const message = await provider.request(data) const message = await provider.request(data)
return {jsonrpc: '2.0', result: message, id: data.id} return { jsonrpc: '2.0', result: message, id: data.id }
} catch (e) { } catch (e) {
return {jsonrpc: '2.0', error: { message: e.message, code: -32603 }, id: data.id} return { jsonrpc: '2.0', error: { message: e.message, code: -32603 }, id: data.id }
} }
} }
} }
} else { } else {
const err = `Cannot make ${data.method} request. Remix client is not connected to walletconnect client` const err = `Cannot make ${data.method} request. Remix client is not connected to walletconnect client`
console.error(err) console.error(err)
return {jsonrpc: '2.0', error: { message: err, code: -32603 }, id: data.id} return { jsonrpc: '2.0', error: { message: err, code: -32603 }, id: data.id }
} }
} }

Loading…
Cancel
Save