-
+
+
{ tip &&
DID YOU KNOW
diff --git a/apps/remix-ide/src/app/components/side-panel.tsx b/apps/remix-ide/src/app/components/side-panel.tsx
index 6ea715f420..8b30bf200b 100644
--- a/apps/remix-ide/src/app/components/side-panel.tsx
+++ b/apps/remix-ide/src/app/components/side-panel.tsx
@@ -1,10 +1,10 @@
// eslint-disable-next-line no-use-before-define
import React from 'react'
-import {AbstractPanel} from './panel'
-import {RemixPluginPanel} from '@remix-ui/panel'
+import { AbstractPanel } from './panel'
+import { RemixPluginPanel } from '@remix-ui/panel'
import packageJson from '../../../../../package.json'
-import {RemixUIPanelHeader} from '@remix-ui/panel'
-import {PluginViewWrapper} from '@remix-ui/helper'
+import { RemixUIPanelHeader } from '@remix-ui/panel'
+import { PluginViewWrapper } from '@remix-ui/helper'
// const csjs = require('csjs-inject')
const sidePanel = {
diff --git a/apps/remix-ide/src/app/components/vertical-icons.tsx b/apps/remix-ide/src/app/components/vertical-icons.tsx
index 2f69d5bee3..0d78b22fb7 100644
--- a/apps/remix-ide/src/app/components/vertical-icons.tsx
+++ b/apps/remix-ide/src/app/components/vertical-icons.tsx
@@ -1,11 +1,11 @@
// eslint-disable-next-line no-use-before-define
import React from 'react'
import packageJson from '../../../../../package.json'
-import {Plugin} from '@remixproject/engine'
-import {EventEmitter} from 'events'
-import {IconRecord, RemixUiVerticalIconsPanel} from '@remix-ui/vertical-icons-panel'
-import {Profile} from '@remixproject/plugin-utils'
-import {PluginViewWrapper} from '@remix-ui/helper'
+import { Plugin } from '@remixproject/engine'
+import { EventEmitter } from 'events'
+import { IconRecord, RemixUiVerticalIconsPanel } from '@remix-ui/vertical-icons-panel'
+import { Profile } from '@remixproject/plugin-utils'
+import { PluginViewWrapper } from '@remix-ui/helper'
const profile = {
name: 'menuicons',
diff --git a/apps/remix-ide/src/app/files/dgitProvider.ts b/apps/remix-ide/src/app/files/dgitProvider.ts
index e914aba2c4..10d2c76c7a 100644
--- a/apps/remix-ide/src/app/files/dgitProvider.ts
+++ b/apps/remix-ide/src/app/files/dgitProvider.ts
@@ -14,7 +14,7 @@ import JSZip from 'jszip'
import path from 'path'
import FormData from 'form-data'
import axios from 'axios'
-import {Registry} from '@remix-project/remix-lib'
+import { Registry } from '@remix-project/remix-lib'
const profile = {
name: 'dGitProvider',
@@ -121,7 +121,6 @@ class DGitProvider extends Plugin {
return status
}
-
const status = await git.statusMatrix({
...await this.getGitConfig(),
...cmd
@@ -189,7 +188,7 @@ class DGitProvider extends Plugin {
return newmodule.name === module.name
})
})
-
+
for (const module of toRemove) {
const path = (await this.getGitConfig(module.path)).dir
if (await window.remixFileSystem.exists(path)) {
@@ -224,7 +223,6 @@ class DGitProvider extends Plugin {
return status
}
-
const status = await git.log({
...await this.getGitConfig(),
...cmd,
@@ -269,8 +267,6 @@ class DGitProvider extends Plugin {
async currentbranch(config) {
-
-
if ((Registry.getInstance().get('platform').api.isDesktop())) {
return await this.call('isogit', 'currentbranch')
}
@@ -426,11 +422,11 @@ class DGitProvider extends Plugin {
input
}
this.call('terminal', 'logHtml', `Cloning ${input.url}... please wait...`)
- try{
+ try {
const result = await this.call('isogit', 'clone', cmd)
this.call('fs', 'openWindow', folder)
return result
- }catch(e){
+ } catch (e){
this.call('notification', 'alert', {
id: 'dgitAlert',
message: 'Unexpected error while cloning the repository: \n' + e.toString(),
@@ -516,7 +512,7 @@ class DGitProvider extends Plugin {
for (const module of gitmodules) {
const dir = path.join(currentDir, module.path)
// if url contains git@github.com: convert it
- if(module.url && module.url.startsWith('git@github.com:')) {
+ if (module.url && module.url.startsWith('git@github.com:')) {
module.url = module.url.replace('git@github.com:', 'https://github.com/')
}
try {
@@ -530,7 +526,7 @@ class DGitProvider extends Plugin {
this.call('terminal', 'logHtml', `Cloning submodule ${dir}...`)
await git.clone(cmd)
this.call('terminal', 'logHtml', `Cloned successfully submodule ${dir}...`)
-
+
const commitHash = await git.resolveRef({
...await this.getGitConfig(currentDir),
ref: 'HEAD'
@@ -540,12 +536,12 @@ class DGitProvider extends Plugin {
...await this.getGitConfig(currentDir),
trees: [git.TREE({ ref: commitHash })],
map: async function (filepath, [A]) {
- if(filepath === module.path) {
+ if (filepath === module.path) {
return await A.oid()
}
}
})
- if(result && result.length) {
+ if (result && result.length) {
this.call('terminal', 'logHtml', `Checking out submodule ${dir} to ${result[0]} in directory ${dir}`)
await git.fetch({
...await this.parseInput(input),
@@ -558,16 +554,16 @@ class DGitProvider extends Plugin {
...await this.getGitConfig(dir),
ref: result[0]
})
-
+
const log = await git.log({
...await this.getGitConfig(dir),
})
- if(log[0].oid !== result[0]) {
+ if (log[0].oid !== result[0]) {
this.call('terminal', 'log', {
type: 'error',
value: `Could not checkout submodule to ${result[0]}`
- })} else {
+ })} else {
this.call('terminal', 'logHtml',`Checked out submodule ${dir} to ${result[0]}`)
}
}
diff --git a/apps/remix-ide/src/app/files/electronProvider.ts b/apps/remix-ide/src/app/files/electronProvider.ts
index 99edb76962..992b9d0c21 100644
--- a/apps/remix-ide/src/app/files/electronProvider.ts
+++ b/apps/remix-ide/src/app/files/electronProvider.ts
@@ -1,6 +1,5 @@
import FileProvider from "./fileProvider"
-
declare global {
interface Window {
remixFileSystem: any
@@ -50,7 +49,6 @@ export class ElectronProvider extends FileProvider {
}
}
-
// isDirectory is already included
// this is a more efficient version of the default implementation
async resolveDirectory(path, cb) {
diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts
index b4b1a1ab9c..b2d0117246 100644
--- a/apps/remix-ide/src/app/files/fileManager.ts
+++ b/apps/remix-ide/src/app/files/fileManager.ts
@@ -4,7 +4,7 @@ import { saveAs } from 'file-saver'
import JSZip from 'jszip'
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json'
-import {Registry} from '@remix-project/remix-lib'
+import { Registry } from '@remix-project/remix-lib'
import { fileChangedToastMsg, recursivePasteToastMsg, storageFullMessage } from '@remix-ui/helper'
import helper from '../../lib/helper.js'
import { RemixAppManager } from '../../remixAppManager'
@@ -251,7 +251,7 @@ class FileManager extends Plugin {
throw new Error(e)
}
}
-
+
/**
* Set the content of a specific file, does nnot rewrite file if it exists but creates a new unique name
* @param {string} path path of the file
@@ -265,11 +265,11 @@ class FileManager extends Plugin {
if (await this.exists(path)) {
const newPath = await helper.createNonClashingNameAsync(path, this)
const content = await this.setFileContent(newPath, data)
- return {newContent: content, newPath}
+ return { newContent: content, newPath }
} else {
const ret = await this.setFileContent(path, data)
this.emit('fileAdded', path)
- return {newContent: ret, newpath: path}
+ return { newContent: ret, newpath: path }
}
} catch (e) {
throw new Error(e)
@@ -523,7 +523,7 @@ class FileManager extends Plugin {
this._deps.electronExplorer.event.on('fileRenamed', (oldName, newName, isFolder) => { this.fileRenamedEvent(oldName, newName, isFolder) })
this._deps.electronExplorer.event.on('fileRemoved', (path) => { this.fileRemovedEvent(path) })
this._deps.electronExplorer.event.on('fileAdded', (path) => { this.fileAddedEvent(path) })
-
+
this.getCurrentFile = this.file
this.getFile = this.readFile
this.getFolder = this.readdir
@@ -726,7 +726,7 @@ class FileManager extends Plugin {
}
try {
// This make sure dependencies are loaded in the editor context.
- // This ensure monaco is aware of deps artifacts, so it can provide basic features like "go to" symbols.
+ // This ensure monaco is aware of deps artifacts, so it can provide basic features like "go to" symbols.
await this.editor.handleTypeScriptDependenciesOf(file, content, path => this.readFile(path), path => this.exists(path))
} catch (e) {
console.log('unable to handle TypeScript dependencies of', file)
@@ -927,7 +927,6 @@ class FileManager extends Plugin {
return exists
}
-
async moveFileIsAllowed (src: string, dest: string) {
try {
src = this.normalize(src)
@@ -970,7 +969,7 @@ class FileManager extends Plugin {
if (provider.isSubDirectory(src, dest)) {
this.call('notification', 'toast', recursivePasteToastMsg())
return false
- }
+ }
return true
} catch (e) {
console.log(e)
@@ -1033,7 +1032,7 @@ class FileManager extends Plugin {
if (provider.isSubDirectory(src, dest)) {
this.call('notification', 'toast', recursivePasteToastMsg())
return false
- }
+ }
await this.inDepthCopy(src, dest, dirName)
await this.remove(src)
@@ -1047,7 +1046,7 @@ class FileManager extends Plugin {
if (provider && provider.copyFolderToJson) {
return await provider.copyFolderToJson(folder)
}
- throw new Error('copyFolderToJson not available')
+ throw new Error('copyFolderToJson not available')
}
}
diff --git a/apps/remix-ide/src/app/files/fileProvider.ts b/apps/remix-ide/src/app/files/fileProvider.ts
index 715b5d3bff..4cc13a9c10 100644
--- a/apps/remix-ide/src/app/files/fileProvider.ts
+++ b/apps/remix-ide/src/app/files/fileProvider.ts
@@ -5,7 +5,6 @@ import EventManager from 'events'
import { Storage } from '@remix-project/remix-lib'
import pathModule from 'path'
-
export default class FileProvider {
event: any
type: any
@@ -189,7 +188,7 @@ export default class FileProvider {
return await this.removeFile(path)
} else {
await window.remixFileSystem.unlink(path)
- this.event.emit('fileRemoved', this._normalizePath(path))
+ this.event.emit('fileRemoved', this._normalizePath(path))
}
} catch (e) {
console.log(e)
diff --git a/apps/remix-ide/src/app/files/fileSystem.ts b/apps/remix-ide/src/app/files/fileSystem.ts
index 80840f617f..8401563687 100644
--- a/apps/remix-ide/src/app/files/fileSystem.ts
+++ b/apps/remix-ide/src/app/files/fileSystem.ts
@@ -67,6 +67,5 @@ export class fileSystems {
return null
}
-
}
diff --git a/apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts b/apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts
index 9fc716b5c1..43c6ee8f82 100644
--- a/apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts
+++ b/apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts
@@ -72,7 +72,6 @@ export class fileSystemUtility {
}
}
-
/**
* copy the folder recursively
* @param {string} path is the folder to be copied over
@@ -150,7 +149,6 @@ export class fileSystemUtility {
}
}
-
/* eslint-disable no-template-curly-in-string */
export const migrationTestData = {
'.workspaces': {
diff --git a/apps/remix-ide/src/app/files/filesystems/indexedDB.ts b/apps/remix-ide/src/app/files/filesystems/indexedDB.ts
index aae0d6a5eb..f1a9936193 100644
--- a/apps/remix-ide/src/app/files/filesystems/indexedDB.ts
+++ b/apps/remix-ide/src/app/files/filesystems/indexedDB.ts
@@ -47,7 +47,6 @@ export class IndexedDBStorage extends LightningFS {
}
}
-
export class indexedDBFileSystem extends fileSystem {
constructor() {
super()
diff --git a/apps/remix-ide/src/app/files/filesystems/localStorage.ts b/apps/remix-ide/src/app/files/filesystems/localStorage.ts
index d99c3ae296..0a5f0c6d3f 100644
--- a/apps/remix-ide/src/app/files/filesystems/localStorage.ts
+++ b/apps/remix-ide/src/app/files/filesystems/localStorage.ts
@@ -48,7 +48,7 @@ export class localStorageFS extends fileSystem {
localStorage.setItem(test, test);
localStorage.removeItem(test);
resolve(true)
- } catch(e) {
+ } catch (e) {
reject(e)
}
})
diff --git a/apps/remix-ide/src/app/panels/terminal.tsx b/apps/remix-ide/src/app/panels/terminal.tsx
index 3b93cd5c22..2cb89e3fcb 100644
--- a/apps/remix-ide/src/app/panels/terminal.tsx
+++ b/apps/remix-ide/src/app/panels/terminal.tsx
@@ -3,7 +3,7 @@ import React from 'react' // eslint-disable-line
import { RemixUiTerminal, RemixUITerminalWrapper } from '@remix-ui/terminal' // eslint-disable-line
import { Plugin } from '@remixproject/engine'
import * as packageJson from '../../../../../package.json'
-import {Registry} from '@remix-project/remix-lib'
+import { Registry } from '@remix-project/remix-lib'
import { PluginViewWrapper } from '@remix-ui/helper'
import vm from 'vm'
import EventManager from '../../lib/events'
@@ -11,7 +11,6 @@ import EventManager from '../../lib/events'
import { CompilerImports } from '@remix-project/core-plugin' // eslint-disable-line
import { RemixUiXterminals } from '@remix-ui/xterm'
-
const KONSOLES = []
function register(api) { KONSOLES.push(api) }
@@ -113,7 +112,6 @@ class Terminal extends Plugin {
}
-
onActivation() {
this.renderComponent()
}
@@ -142,7 +140,7 @@ class Terminal extends Plugin {
}
updateComponent(state) {
- return(
+ return (
{
-
+
this.on('solidity', 'loadingCompiler', async (url) => {
await this.call('compilerloader', 'downloadCompiler', url)
})
diff --git a/apps/remix-ide/src/app/plugins/electron/fsPlugin.ts b/apps/remix-ide/src/app/plugins/electron/fsPlugin.ts
index 679b6199ea..bd2e3b971d 100644
--- a/apps/remix-ide/src/app/plugins/electron/fsPlugin.ts
+++ b/apps/remix-ide/src/app/plugins/electron/fsPlugin.ts
@@ -78,7 +78,7 @@ export class fsPlugin extends ElectronPlugin {
try {
path = fixPath(path)
const stat = await this.call('fs', 'stat', path)
- if(!stat) return undefined
+ if (!stat) return undefined
stat.isDirectory = () => stat.isDirectoryValue
stat.isFile = () => !stat.isDirectoryValue
return stat
@@ -90,7 +90,7 @@ export class fsPlugin extends ElectronPlugin {
try {
path = fixPath(path)
const stat = await this.call('fs', 'lstat', path)
- if(!stat) return undefined
+ if (!stat) return undefined
stat.isDirectory = () => stat.isDirectoryValue
stat.isFile = () => !stat.isDirectoryValue
return stat
@@ -116,7 +116,7 @@ export class fsPlugin extends ElectronPlugin {
await this.call('fileManager', 'refresh')
})
this.on('fs', 'error', async (error: string) => {
- if(error === 'ENOSPC'){
+ if (error === 'ENOSPC'){
this.call('notification', 'alert', {
id: 'fsError',
message: 'Cannot watch file changes. There are too many files in your project.'
diff --git a/apps/remix-ide/src/app/plugins/file-decorator.ts b/apps/remix-ide/src/app/plugins/file-decorator.ts
index 071b62f4df..6136140383 100644
--- a/apps/remix-ide/src/app/plugins/file-decorator.ts
+++ b/apps/remix-ide/src/app/plugins/file-decorator.ts
@@ -55,8 +55,8 @@ export class FileDecorator extends Plugin {
if (!from) return
const filteredState = this._fileStates.filter((state) => {
- if(state.owner != from) return true
- if(path && state.path != path) return true
+ if (state.owner != from) return true
+ if (path && state.path != path) return true
})
const newState = [...filteredState].sort(sortByPath)
diff --git a/apps/remix-ide/src/app/plugins/notification.tsx b/apps/remix-ide/src/app/plugins/notification.tsx
index ca2b27437a..2d0455a31d 100644
--- a/apps/remix-ide/src/app/plugins/notification.tsx
+++ b/apps/remix-ide/src/app/plugins/notification.tsx
@@ -1,8 +1,8 @@
-import {Plugin} from '@remixproject/engine'
-import {LibraryProfile, MethodApi, StatusEvents} from '@remixproject/plugin-utils'
-import {AppModal} from '@remix-ui/app'
-import {AlertModal} from '@remix-ui/app'
-import {dispatchModalInterface} from '@remix-ui/app'
+import { Plugin } from '@remixproject/engine'
+import { LibraryProfile, MethodApi, StatusEvents } from '@remixproject/plugin-utils'
+import { AppModal } from '@remix-ui/app'
+import { AlertModal } from '@remix-ui/app'
+import { dispatchModalInterface } from '@remix-ui/app'
interface INotificationApi {
events: StatusEvents
diff --git a/apps/remix-ide/src/app/plugins/openaigpt.tsx b/apps/remix-ide/src/app/plugins/openaigpt.tsx
index cc120a0d1e..e436d7c9d7 100644
--- a/apps/remix-ide/src/app/plugins/openaigpt.tsx
+++ b/apps/remix-ide/src/app/plugins/openaigpt.tsx
@@ -19,7 +19,7 @@ export class OpenAIGpt extends Plugin {
async message(prompt): Promise {
this.call('layout', 'maximizeTerminal')
- this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'Waiting for GPT answer...'})
+ this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'Waiting for GPT answer...' })
let result
try {
result = await (
@@ -36,10 +36,10 @@ export class OpenAIGpt extends Plugin {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return
}
-
+
if (result && result.choices && result.choices.length) {
- this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.choices[0].message.content })
- } else if (result.error) {
+ this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.choices[0].message.content })
+ } else if (result.error) {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.error })
} else {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: 'No response...' })
diff --git a/apps/remix-ide/src/app/plugins/parser/code-parser.tsx b/apps/remix-ide/src/app/plugins/parser/code-parser.tsx
index 65efcf35b5..b4c7b181f0 100644
--- a/apps/remix-ide/src/app/plugins/parser/code-parser.tsx
+++ b/apps/remix-ide/src/app/plugins/parser/code-parser.tsx
@@ -524,8 +524,8 @@ export class CodeParser extends Plugin {
nodeDefinition.parser = parserNodeDefinition
}
- /* if the AST node name & type is the same as the parser node name & type,
- / then we can assume that the AST node is the definition,
+ /* if the AST node name & type is the same as the parser node name & type,
+ / then we can assume that the AST node is the definition,
/ because the parser will always return most nodes it can find even with an error in the code
*/
@@ -544,7 +544,6 @@ export class CodeParser extends Plugin {
return nodeDefinition.ast
}
-
return nodeDefinition.parser
}
diff --git a/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts b/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts
index 2da19bdaa6..1796405a22 100644
--- a/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts
+++ b/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts
@@ -4,7 +4,7 @@ import { AstNode } from "@remix-project/remix-solidity"
import { CodeParser } from "../code-parser"
import { antlr } from '../types'
import { pathToFileURL } from 'url'
-import {Registry} from '@remix-project/remix-lib'
+import { Registry } from '@remix-project/remix-lib'
const SolidityParser = (window as any).SolidityParser = (window as any).SolidityParser || []
@@ -117,8 +117,8 @@ export default class CodeParserAntlrService {
/**
* Tries to parse the current file or the given text and returns the AST
* If the parsing fails it returns the last successful AST for this file
- * @param text
- * @returns
+ * @param text
+ * @returns
*/
async setCurrentFileAST(text: string | null = null) {
try {
@@ -149,7 +149,7 @@ export default class CodeParserAntlrService {
/**
* Lists the AST nodes from the current file parser
* These nodes need to be changed to match the node types returned by the compiler
- * @returns
+ * @returns
*/
async listAstNodes() {
this.plugin.currentFile = await this.plugin.call('fileManager', 'file')
@@ -201,11 +201,10 @@ export default class CodeParserAntlrService {
return nodes
}
-
/**
- *
- * @param ast
- * @returns
+ *
+ * @param ast
+ * @returns
*/
async getLastNodeInLine(ast: string) {
let lastNode: any
@@ -247,7 +246,7 @@ export default class CodeParserAntlrService {
try {
const startTime = Date.now()
const blocks = (SolidityParser as any).parseBlock(fileContent, { loc: true, range: true, tolerant: true })
- if(this.cache[this.plugin.currentFile] && this.cache[this.plugin.currentFile].blockDurations){
+ if (this.cache[this.plugin.currentFile] && this.cache[this.plugin.currentFile].blockDurations){
this.cache[this.plugin.currentFile].blockDurations = [...this.cache[this.plugin.currentFile].blockDurations.slice(-this.parserThresholdSampleAmount), Date.now() - startTime]
this.setFileParsingState(this.plugin.currentFile)
}
diff --git a/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts b/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts
index b1dc5f8c7a..6f1d5f9152 100644
--- a/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts
+++ b/apps/remix-ide/src/app/plugins/parser/services/code-parser-compiler.ts
@@ -75,7 +75,6 @@ export default class CodeParserCompiler {
length: error.sourceLocation.end - error.sourceLocation.start
}, lineBreaks)
-
const filePath = error.sourceLocation.file
const fileTarget = await this.plugin.call('fileManager', 'getUrlFromPath', filePath)
@@ -103,24 +102,23 @@ export default class CodeParserCompiler {
if (data.sources && Object.keys(data.sources).length === 0) return
this.plugin.compilerAbstract = new CompilerAbstract('soljson', data, source, input)
this.errorState = false
-
+
this.plugin.nodeIndex = {
declarations: {},
flatReferences: {},
nodesPerFile: {},
}
-
this.plugin._buildIndex(data, source)
// cast from the remix-plugin interface to the solidity one. Should be fixed when remix-plugin move to the remix-project repository
const extractedFiledNodes = this.plugin._extractFileNodes(this.plugin.currentFile, this.plugin.compilerAbstract as unknown as lastCompilationResult)
- if(extractedFiledNodes) {
+ if (extractedFiledNodes) {
this.plugin.nodeIndex.nodesPerFile[this.plugin.currentFile] = extractedFiledNodes
}
await this.plugin.gasService.showGasEstimates()
this.plugin.emit('astFinished')
}
-
+
this.compiler = new Compiler((url, cb) => this.plugin.call('contentImport', 'resolveAndSave', url, undefined).then((result) => cb(null, result)).catch((error) => cb(error.message)))
this.compiler.event.register('compilationFinished', this.onAstFinished)
}
@@ -128,8 +126,8 @@ export default class CodeParserCompiler {
// COMPILER
/**
- *
- * @returns
+ *
+ * @returns
*/
async compile() {
try {
@@ -149,7 +147,7 @@ export default class CodeParserCompiler {
} else {
this.compiler.set('remappings', [])
}
-
+
const configFileContent = {
"language": "Solidity",
"settings": {
@@ -227,7 +225,7 @@ export default class CodeParserCompiler {
const fileTarget = await this.plugin.call('fileManager', 'getPathFromUrl', fileName)
await this.plugin.call('fileDecorator', 'clearFileDecorators', fileTarget.file)
}
- if(decorators.length > 0)
+ if (decorators.length > 0)
await this.plugin.call('fileDecorator', 'setFileDecorators', decorators)
await this.plugin.call('editor', 'clearErrorMarkers', filesWithOutErrors)
diff --git a/apps/remix-ide/src/app/plugins/parser/services/code-parser-gas-service.ts b/apps/remix-ide/src/app/plugins/parser/services/code-parser-gas-service.ts
index 34e86290c1..dd2cb7af4d 100644
--- a/apps/remix-ide/src/app/plugins/parser/services/code-parser-gas-service.ts
+++ b/apps/remix-ide/src/app/plugins/parser/services/code-parser-gas-service.ts
@@ -33,17 +33,16 @@ export default class CodeParserGasService {
}
-
async showGasEstimates() {
const showGasConfig = await this.plugin.call('config', 'getAppParameter', 'show-gas')
- if(!showGasConfig) {
+ if (!showGasConfig) {
await this.plugin.call('editor', 'discardLineTexts')
return
}
this.plugin.currentFile = await this.plugin.call('fileManager', 'file')
// cast from the remix-plugin interface to the solidity one. Should be fixed when remix-plugin move to the remix-project repository
- const extractedFiledNodes = await this.plugin._extractFileNodes(this.plugin.currentFile, this.plugin.compilerAbstract as unknown as lastCompilationResult)
- if(extractedFiledNodes) {
+ const extractedFiledNodes = await this.plugin._extractFileNodes(this.plugin.currentFile, this.plugin.compilerAbstract as unknown as lastCompilationResult)
+ if (extractedFiledNodes) {
this.plugin.nodeIndex.nodesPerFile[this.plugin.currentFile] = extractedFiledNodes
}
@@ -72,10 +71,8 @@ export default class CodeParserGasService {
this.plugin.call('editor', 'addLineText', linetext, estimate.range.fileName)
-
}
}
}
-
}
\ No newline at end of file
diff --git a/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts b/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts
index a95a663e71..4f144d6a76 100644
--- a/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts
+++ b/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts
@@ -1,5 +1,5 @@
'use strict'
-import {Registry} from '@remix-project/remix-lib'
+import { Registry } from '@remix-project/remix-lib'
import { CodeParser } from "../code-parser";
export type CodeParserImportsData = {
@@ -20,7 +20,7 @@ export default class CodeParserImports {
}
async getImports(){
- if(!this.data || !this.data.files || !this.data.timestamp || this.data.timestamp != this.directoryUpdateCacheTimeStamp){
+ if (!this.data || !this.data.files || !this.data.timestamp || this.data.timestamp != this.directoryUpdateCacheTimeStamp){
await this.setFileTree()
}
return this.data
@@ -33,13 +33,13 @@ export default class CodeParserImports {
.filter(x => x !== '')
.map(x => x.replace('./node_modules/', ''))
.filter(x => {
- if(x.includes('@openzeppelin')) {
+ if (x.includes('@openzeppelin')) {
return !x.includes('mock')
- }else{
+ } else {
return true
- }
+ }
})
-
+
// get unique first words of the values in the array
this.data.packages = [...new Set(this.data.modules.map(x => x.split('/')[0]))]
}
@@ -79,7 +79,7 @@ export default class CodeParserImports {
files = await this.plugin.call('fileManager', 'readdir', dir)
}
} catch (e) {}
-
+
const fileArray = this.normalize(files)
for (const fi of fileArray) {
if (fi) {
diff --git a/apps/remix-ide/src/app/plugins/parser/types/antlr-types.ts b/apps/remix-ide/src/app/plugins/parser/types/antlr-types.ts
index 3e2675c43a..7efe851d93 100644
--- a/apps/remix-ide/src/app/plugins/parser/types/antlr-types.ts
+++ b/apps/remix-ide/src/app/plugins/parser/types/antlr-types.ts
@@ -24,7 +24,6 @@ interface Token {
}
}
-
interface Location {
start: {
line: number
@@ -594,7 +593,6 @@ export type Statement =
type ASTMap = { [K in ASTNodeTypeString]: U extends { type: K } ? U : never }
type ASTTypeMap = ASTMap
-
export const astNodeTypes = [
'SourceUnit',
'PragmaDirective',
@@ -673,9 +671,6 @@ export const astNodeTypes = [
'InvalidNode'
] as const
-
-
-
export const binaryOpValues = [
'+',
'-',
@@ -725,8 +720,3 @@ export const unaryOpValues = [
] as const
export type UnaryOp = typeof unaryOpValues[number]
-
-
-
-
-
diff --git a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx
index 813567831d..a01425088a 100644
--- a/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx
+++ b/apps/remix-ide/src/app/plugins/permission-handler-plugin.tsx
@@ -1,9 +1,9 @@
import React from 'react' // eslint-disable-line
-import {FormattedMessage} from 'react-intl'
-import {Plugin} from '@remixproject/engine'
-import {AppModal} from '@remix-ui/app'
-import {PermissionHandlerDialog, PermissionHandlerValue} from '@remix-ui/permission-handler'
-import {Profile} from '@remixproject/plugin-utils'
+import { FormattedMessage } from 'react-intl'
+import { Plugin } from '@remixproject/engine'
+import { AppModal } from '@remix-ui/app'
+import { PermissionHandlerDialog, PermissionHandlerValue } from '@remix-ui/permission-handler'
+import { Profile } from '@remixproject/plugin-utils'
const profile = {
name: 'permissionhandler',
@@ -89,7 +89,7 @@ export class PermissionHandlerPlugin extends Plugin {
if (!this.permissions[to.name][method][from.name]) return this.openPermission(from, to, method, message, sensitiveCall)
}
- const {allow, hash} = sensitiveCall ? this.sessionPermissions[to.name][method][from.name] : this.permissions[to.name][method][from.name]
+ const { allow, hash } = sensitiveCall ? this.sessionPermissions[to.name][method][from.name] : this.permissions[to.name][method][from.name]
if (!allow) {
const warning = this.notAllowWarning(from, to, method)
const warnEl =
@@ -97,9 +97,9 @@ export class PermissionHandlerPlugin extends Plugin {
{ warning }
{}}>To change the permission go to
-
Plugin Manager
-
-
/ Permissions
+
Plugin Manager
+
+
/ Permissions
this.call('notification', 'toast', warnEl)
@@ -130,7 +130,7 @@ export class PermissionHandlerPlugin extends Plugin {
}
const modal: AppModal = {
id: 'PermissionHandler',
- title:
,
+ title:
,
message:
,
okLabel:
,
cancelLabel:
diff --git a/apps/remix-ide/src/app/plugins/remixGuide.tsx b/apps/remix-ide/src/app/plugins/remixGuide.tsx
index d782e11ff3..037f4f8cf5 100644
--- a/apps/remix-ide/src/app/plugins/remixGuide.tsx
+++ b/apps/remix-ide/src/app/plugins/remixGuide.tsx
@@ -30,7 +30,7 @@ export class RemixGuidePlugin extends ViewPlugin {
super(profile)
this.appManager = appManager
this.element = document.createElement('div')
- this.element.setAttribute('id', 'remixGuideEl')
+ this.element.setAttribute('id', 'remixGuideEl')
}
async onActivation() {
@@ -49,13 +49,13 @@ export class RemixGuidePlugin extends ViewPlugin {
this.profile.displayName = `${contractName[0]}`
this.payload = sentPayload
const active = await this.call('theme', 'currentTheme')
-
+
this.renderComponent()
}
private handleThemeChange() {
this.on('theme', 'themeChanged', (theme: any) => {
-
+
this.renderComponent()
})
}
@@ -114,7 +114,7 @@ export class RemixGuidePlugin extends ViewPlugin {
tagList={['L2', 'AI']}
logo='/assets/img/soliditySurvey2023.webp'
>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/apps/remix-ide/src/app/plugins/remixd-handle.tsx b/apps/remix-ide/src/app/plugins/remixd-handle.tsx
index cb627cb4b7..62b9c75b52 100644
--- a/apps/remix-ide/src/app/plugins/remixd-handle.tsx
+++ b/apps/remix-ide/src/app/plugins/remixd-handle.tsx
@@ -1,13 +1,13 @@
/* eslint-disable no-unused-vars */
import React, {useRef, useState, useEffect} from 'react' // eslint-disable-line
-import {FormattedMessage} from 'react-intl'
-import {WebsocketPlugin} from '@remixproject/engine-web'
+import { FormattedMessage } from 'react-intl'
+import { WebsocketPlugin } from '@remixproject/engine-web'
import * as packageJson from '../../../../../package.json'
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
-import {version as remixdVersion} from '../../../../../libs/remixd/package.json'
-import {PluginManager} from '@remixproject/engine'
-import {AppModal, AlertModal, appPlatformTypes} from '@remix-ui/app'
-import {Registry} from '@remix-project/remix-lib'
+import { version as remixdVersion } from '../../../../../libs/remixd/package.json'
+import { PluginManager } from '@remixproject/engine'
+import { AppModal, AlertModal, appPlatformTypes } from '@remix-ui/app'
+import { Registry } from '@remix-project/remix-lib'
const LOCALHOST = ' - connect to localhost - '
@@ -85,7 +85,7 @@ export class RemixdHandle extends WebsocketPlugin {
console.log(error)
const alert: AlertModal = {
id: 'connectionAlert',
- message: window._intl.formatMessage({id: 'remixd.connectionAlert1'}),
+ message: window._intl.formatMessage({ id: 'remixd.connectionAlert1' }),
}
this.call('notification', 'alert', alert)
this.canceled()
@@ -96,14 +96,14 @@ export class RemixdHandle extends WebsocketPlugin {
clearInterval(intervalId)
const alert: AlertModal = {
id: 'connectionAlert',
- message: window._intl.formatMessage({id: 'remixd.connectionAlert2'}),
+ message: window._intl.formatMessage({ id: 'remixd.connectionAlert2' }),
}
this.call('notification', 'alert', alert)
this.canceled()
}
}, 3000)
this.localhostProvider.init(() => {
- this.call('filePanel', 'setWorkspace', {name: LOCALHOST, isLocalhost: true}, true)
+ this.call('filePanel', 'setWorkspace', { name: LOCALHOST, isLocalhost: true }, true)
})
for (const plugin of this.dependentPlugins) {
await this.appManager.activatePlugin(plugin)
@@ -116,10 +116,10 @@ export class RemixdHandle extends WebsocketPlugin {
// warn the user only if he/she is in the browser context
const mod: AppModal = {
id: 'remixdConnect',
- title: window._intl.formatMessage({id: 'remixd.remixdConnect'}),
+ title: window._intl.formatMessage({ id: 'remixd.remixdConnect' }),
message: remixdDialog(),
- okLabel: window._intl.formatMessage({id: 'remixd.connect'}),
- cancelLabel: window._intl.formatMessage({id: 'remixd.cancel'}),
+ okLabel: window._intl.formatMessage({ id: 'remixd.connect' }),
+ cancelLabel: window._intl.formatMessage({ id: 'remixd.cancel' }),
}
const result = await this.call('notification', 'modal', mod)
if (result) {
diff --git a/apps/remix-ide/src/app/plugins/solcoderAI.tsx b/apps/remix-ide/src/app/plugins/solcoderAI.tsx
index 9e52dd0d11..99fcbbe0c3 100644
--- a/apps/remix-ide/src/app/plugins/solcoderAI.tsx
+++ b/apps/remix-ide/src/app/plugins/solcoderAI.tsx
@@ -1,11 +1,11 @@
import { Plugin } from '@remixproject/engine'
export type SuggestOptions = {
- max_new_tokens: number,
+ max_new_tokens: number,
temperature: number,
do_sample:boolean
top_k: number,
- top_p:number,
+ top_p:number,
stream_result:boolean
}
@@ -41,18 +41,18 @@ export class SolCoder extends Plugin {
Accept: 'application/json',
'Content-Type': 'application/json',
},
- body: JSON.stringify({"data":[prompt, "code_completion", "", false,1000,0.9,0.92,50]}),
+ body: JSON.stringify({ "data":[prompt, "code_completion", "", false,1000,0.9,0.92,50]}),
})
).json()
if ("error" in result){
- this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.error })
+ this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.error })
return result
}
return result.data
} catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return
- }finally {
+ } finally {
this.emit("aiInferingDone")
}
}
@@ -69,18 +69,18 @@ export class SolCoder extends Plugin {
Accept: 'application/json',
'Content-Type': 'application/json',
},
- body: JSON.stringify({"data":[prompt, "solidity_answer", false,1000,0.9,0.8,50]}),
+ body: JSON.stringify({ "data":[prompt, "solidity_answer", false,1000,0.9,0.8,50]}),
})
).json()
} catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return
- }finally {
+ } finally {
this.emit("aiInferingDone")
}
if (result) {
- this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0]})
- } else if (result.error) {
+ this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0] })
+ } else if (result.error) {
this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "Error on request" })
}
@@ -98,17 +98,17 @@ export class SolCoder extends Plugin {
Accept: 'application/json',
'Content-Type': 'application/json',
},
- body: JSON.stringify({"data":[prompt, "code_explaining", false,2000,0.9,0.8,50, context]}),
+ body: JSON.stringify({ "data":[prompt, "code_explaining", false,2000,0.9,0.8,50, context]}),
})
).json()
if (result) {
- this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0]})
+ this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result.data[0] })
}
return result.data[0]
} catch (e) {
this.call('terminal', 'log', { type: 'typewritererror', value: `Unable to get a response ${e.message}` })
return
- }finally {
+ } finally {
this.emit("aiInferingDone")
}
}
@@ -124,14 +124,14 @@ export class SolCoder extends Plugin {
Accept: 'application/json',
'Content-Type': 'application/json',
},
- body: JSON.stringify({"data": !options? [
- prompt, // string in 'context_code' Textbox component
+ body: JSON.stringify({ "data": !options? [
+ prompt, // string in 'context_code' Textbox component
"code_completion",
- "", // string in 'comment' Textbox component
- false, // boolean in 'stream_result' Checkbox component
- 30, // number (numeric value between 0 and 2000) in 'max_new_tokens' Slider component
- 0.9, // number (numeric value between 0.01 and 1) in 'temperature' Slider component
- 0.90, // number (numeric value between 0 and 1) in 'top_p' Slider component
+ "", // string in 'comment' Textbox component
+ false, // boolean in 'stream_result' Checkbox component
+ 30, // number (numeric value between 0 and 2000) in 'max_new_tokens' Slider component
+ 0.9, // number (numeric value between 0.01 and 1) in 'temperature' Slider component
+ 0.90, // number (numeric value between 0 and 1) in 'top_p' Slider component
50, // number (numeric value between 1 and 200) in 'top_k' Slider component
] : [
prompt,
@@ -170,15 +170,15 @@ export class SolCoder extends Plugin {
Accept: 'application/json',
'Content-Type': 'application/json',
},
- body: JSON.stringify({"data":[
+ body: JSON.stringify({ "data":[
msg_pfx, // Text before current cursor line
"code_insertion",
msg_sfx, // Text after current cursor line
- 1024,
+ 1024,
0.5,
0.92,
50
- ] }),
+ ]}),
})
).json()
@@ -195,6 +195,4 @@ export class SolCoder extends Plugin {
}
}
-
-
}
diff --git a/apps/remix-ide/src/app/plugins/solidity-script.tsx b/apps/remix-ide/src/app/plugins/solidity-script.tsx
index 5ca2f47b58..3b418c88db 100644
--- a/apps/remix-ide/src/app/plugins/solidity-script.tsx
+++ b/apps/remix-ide/src/app/plugins/solidity-script.tsx
@@ -1,8 +1,8 @@
import React from 'react' // eslint-disable-line
-import {format} from 'util'
-import {Plugin} from '@remixproject/engine'
-import {compile} from '@remix-project/remix-solidity'
-import {Transaction} from 'web3-types'
+import { format } from 'util'
+import { Plugin } from '@remixproject/engine'
+import { compile } from '@remix-project/remix-solidity'
+import { Transaction } from 'web3-types'
const _paq = (window._paq = window._paq || []) //eslint-disable-line
const profile = {
@@ -37,7 +37,7 @@ export class SolidityScript extends Plugin {
${functionName}();
}
}`
- const targets = {'script.sol': {content}}
+ const targets = { 'script.sol': { content } }
// compile
const compilation = await compile(targets, params, async (url, cb) => {
@@ -81,20 +81,20 @@ export class SolidityScript extends Plugin {
this.call('terminal', 'logHtml', e.message)
return
}
-
+
tx = {
from: accounts[0],
to: receipt.contractAddress,
data: '0x69d4394b' // function remixRun() public
}
- let receiptCall
-
+ let receiptCall
+
try {
receiptCall = await web3.eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
} catch (e) {
this.call('terminal', 'logHtml', e.message)
return
- }
+ }
const hhlogs = await web3.remix.getHHLogsForTx(receiptCall.transactionHash)
diff --git a/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx b/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx
index 3fd6b6bd51..9ae582f29f 100644
--- a/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx
+++ b/apps/remix-ide/src/app/plugins/solidity-umlgen.tsx
@@ -1,17 +1,17 @@
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
-import {ViewPlugin} from '@remixproject/engine-web'
+import { ViewPlugin } from '@remixproject/engine-web'
import React from 'react'
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
-import {RemixUiSolidityUmlGen} from '@remix-ui/solidity-uml-gen'
-import {ISolidityUmlGen, ThemeQualityType, ThemeSummary} from 'libs/remix-ui/solidity-uml-gen/src/types'
-import {RemixAppManager} from 'libs/remix-ui/plugin-manager/src/types'
-import {normalizeContractPath} from 'libs/remix-ui/solidity-compiler/src/lib/logic/flattenerUtilities'
-import {convertAST2UmlClasses} from 'sol2uml/lib/converterAST2Classes'
+import { RemixUiSolidityUmlGen } from '@remix-ui/solidity-uml-gen'
+import { ISolidityUmlGen, ThemeQualityType, ThemeSummary } from 'libs/remix-ui/solidity-uml-gen/src/types'
+import { RemixAppManager } from 'libs/remix-ui/plugin-manager/src/types'
+import { normalizeContractPath } from 'libs/remix-ui/solidity-compiler/src/lib/logic/flattenerUtilities'
+import { convertAST2UmlClasses } from 'sol2uml/lib/converterAST2Classes'
import vizRenderStringSync from '@aduh95/viz.js/sync'
-import {PluginViewWrapper} from '@remix-ui/helper'
-import {customAction} from '@remixproject/plugin-api'
-import {ClassOptions} from 'sol2uml/lib/converterClass2Dot'
-import type {CompilerInput} from '@remix-project/remix-solidity'
+import { PluginViewWrapper } from '@remix-ui/helper'
+import { customAction } from '@remixproject/plugin-api'
+import { ClassOptions } from 'sol2uml/lib/converterClass2Dot'
+import type { CompilerInput } from '@remix-project/remix-solidity'
const parser = (window as any).SolidityParser
const _paq = (window._paq = window._paq || [])
@@ -207,10 +207,10 @@ interface Sol2umlClassOptions extends ClassOptions {
textColor?: string
}
-import {dirname} from 'path'
-import {convertClass2Dot} from 'sol2uml/lib/converterClass2Dot'
-import {Association, ClassStereotype, ReferenceType, UmlClass} from 'sol2uml/lib/umlClass'
-import {findAssociatedClass} from 'sol2uml/lib/associations'
+import { dirname } from 'path'
+import { convertClass2Dot } from 'sol2uml/lib/converterClass2Dot'
+import { Association, ClassStereotype, ReferenceType, UmlClass } from 'sol2uml/lib/umlClass'
+import { findAssociatedClass } from 'sol2uml/lib/associations'
// const debug = require('debug')('sol2uml')
diff --git a/apps/remix-ide/src/app/plugins/vyper-compilation-details.tsx b/apps/remix-ide/src/app/plugins/vyper-compilation-details.tsx
index 463d79dd85..5d3893aa75 100644
--- a/apps/remix-ide/src/app/plugins/vyper-compilation-details.tsx
+++ b/apps/remix-ide/src/app/plugins/vyper-compilation-details.tsx
@@ -1,6 +1,6 @@
import React from 'react'
import { ViewPlugin } from '@remixproject/engine-web'
-import {PluginViewWrapper} from '@remix-ui/helper'
+import { PluginViewWrapper } from '@remix-ui/helper'
import { RemixAppManager } from '../../remixAppManager'
import { RemixUiVyperCompileDetails } from '@remix-ui/vyper-compile-details'
import { ThemeKeys, ThemeObject } from '@microlink/react-json-view'
@@ -49,13 +49,13 @@ export class VyperCompilationDetailsPlugin extends ViewPlugin {
}
async showDetails(sentPayload: any) {
- const contractName = Object.entries(sentPayload).find(([key, value]) => key )
+ const contractName = Object.entries(sentPayload).find(([key, value]) => key )
await this.call('tabs', 'focus', 'vyperCompilationDetails')
this.profile.displayName = `${contractName[0]}`
this.payload = sentPayload
const active = await this.call('theme', 'currentTheme')
if (active.quality === 'dark') {
- switch(active.name) {
+ switch (active.name) {
case 'HackerOwl':
this.theme = 'harmonic'
this.themeStyle = { backgroundColor: active.backgroundColor }
@@ -78,7 +78,7 @@ export class VyperCompilationDetailsPlugin extends ViewPlugin {
break
}
} else {
- switch(active.name) {
+ switch (active.name) {
case 'Candy':
this.theme = 'apathy:inverted'
this.themeStyle = { backgroundColor: active.backgroundColor }
@@ -106,7 +106,7 @@ export class VyperCompilationDetailsPlugin extends ViewPlugin {
private handleThemeChange() {
this.on('theme', 'themeChanged', (theme: any) => {
if (theme.quality === 'dark') {
- switch(theme.name) {
+ switch (theme.name) {
case 'HackerOwl':
this.theme = 'solarized'
this.themeStyle = { backgroundColor: theme.backgroundColor }
diff --git a/apps/remix-ide/src/app/providers/abstract-provider.tsx b/apps/remix-ide/src/app/providers/abstract-provider.tsx
index 60c6032cc9..01e26df1f4 100644
--- a/apps/remix-ide/src/app/providers/abstract-provider.tsx
+++ b/apps/remix-ide/src/app/providers/abstract-provider.tsx
@@ -1,7 +1,7 @@
-import {Plugin} from '@remixproject/engine'
-import {AppModal, AlertModal, ModalTypes} from '@remix-ui/app'
-import {Blockchain} from '../../blockchain/blockchain'
-import {ethers} from 'ethers'
+import { Plugin } from '@remixproject/engine'
+import { AppModal, AlertModal, ModalTypes } from '@remix-ui/app'
+import { Blockchain } from '../../blockchain/blockchain'
+import { ethers } from 'ethers'
export type JsonDataRequest = {
id: number
@@ -66,7 +66,7 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
okLabel: 'OK',
cancelLabel: 'Cancel',
validationFn: (value) => {
- if (!value) return {valid: false, message: 'value is empty'}
+ if (!value) return { valid: false, message: 'value is empty' }
if (value.startsWith('https://') || value.startsWith('http://')) {
return {
valid: true,
@@ -102,7 +102,7 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
sendAsync(data: JsonDataRequest): Promise
{
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve, reject) => {
- if (!this.provider) return reject({jsonrpc: '2.0', id: data.id, error: { message: 'provider node set', code: -32603 } } as JsonDataResult)
+ if (!this.provider) return reject({ jsonrpc: '2.0', id: data.id, error: { message: 'provider node set', code: -32603 } } as JsonDataResult)
this.sendAsyncInternal(data, resolve, reject)
})
}
@@ -119,7 +119,7 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
}
this.call('notification', 'alert', modalContent)
}
- await this.call('udapp', 'setEnvironmentMode', {context: 'vm-cancun'})
+ await this.call('udapp', 'setEnvironmentMode', { context: 'vm-cancun' })
return
}
@@ -127,17 +127,17 @@ export abstract class AbstractProvider extends Plugin implements IProvider {
if (this.provider) {
try {
const result = await this.provider.send(data.method, data.params)
- resolve({jsonrpc: '2.0', result, id: data.id})
+ resolve({ jsonrpc: '2.0', result, id: data.id })
} catch (error) {
if (error && error.message && error.message.includes('net_version') && error.message.includes('SERVER_ERROR')) {
this.switchAway(true)
}
error.code = -32603
- reject({jsonrpc: '2.0', error, id: data.id})
+ reject({ jsonrpc: '2.0', error, id: data.id })
}
} else {
const result = data.method === 'net_listening' ? 'canceled' : []
- resolve({jsonrpc: '2.0', result: result, id: data.id})
+ resolve({ jsonrpc: '2.0', result: result, id: data.id })
}
}
}
diff --git a/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx b/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx
index d25208bbb9..b9aa95b6c6 100644
--- a/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx
+++ b/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx
@@ -1,9 +1,9 @@
import React, {useRef} from 'react' // eslint-disable-line
-import {FormattedMessage} from 'react-intl'
+import { FormattedMessage } from 'react-intl'
import * as packageJson from '../../../../../package.json'
-import {AppModal, ModalTypes} from '@remix-ui/app'
-import {BasicVMProvider} from './vm-provider'
-import {Hardfork} from '@ethereumjs/common'
+import { AppModal, ModalTypes } from '@remix-ui/app'
+import { BasicVMProvider } from './vm-provider'
+import { Hardfork } from '@ethereumjs/common'
export class CustomForkVMProvider extends BasicVMProvider {
nodeUrl: string
diff --git a/apps/remix-ide/src/app/providers/external-http-provider.tsx b/apps/remix-ide/src/app/providers/external-http-provider.tsx
index a3b51f9a5d..81feb39bd7 100644
--- a/apps/remix-ide/src/app/providers/external-http-provider.tsx
+++ b/apps/remix-ide/src/app/providers/external-http-provider.tsx
@@ -1,7 +1,7 @@
import * as packageJson from '../../../../../package.json'
import React from 'react' // eslint-disable-line
-import {FormattedMessage} from 'react-intl'
-import {AbstractProvider} from './abstract-provider'
+import { FormattedMessage } from 'react-intl'
+import { AbstractProvider } from './abstract-provider'
const profile = {
name: 'basic-http-provider',
@@ -49,7 +49,7 @@ export class ExternalHttpProvider extends AbstractProvider {