Merge branch 'master' into remixd_terminal

pull/1342/head
David Zagi 3 years ago committed by GitHub
commit 349387fafc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      apps/debugger/src/app/debugger-api.ts
  2. 3
      apps/debugger/src/app/debugger.ts
  3. 2
      apps/remix-ide/src/blockchain/providers/injected.js
  4. 4
      apps/remix-ide/src/blockchain/providers/node.js
  5. 6
      libs/remix-analyzer/package.json
  6. 6
      libs/remix-astwalker/package.json
  7. 6
      libs/remix-debug/package.json
  8. 4
      libs/remix-lib/package.json
  9. 6
      libs/remix-simulator/package.json
  10. 6
      libs/remix-solidity/package.json
  11. 10
      libs/remix-tests/package.json
  12. 17
      libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx
  13. 2
      libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts
  14. 4
      libs/remix-url-resolver/package.json
  15. 2
      libs/remixd/package.json

@ -62,6 +62,10 @@ export const DebuggerApiMixin = (Base) => class extends Base {
this.onEditorContentChangedListener = listener this.onEditorContentChangedListener = listener
} }
onEnvChanged (listener) {
this.onEnvChangedListener = listener
}
onDebugRequested (listener) { onDebugRequested (listener) {
this.onDebugRequestedListener = listener this.onDebugRequestedListener = listener
} }
@ -126,6 +130,7 @@ export const DebuggerApiMixin = (Base) => class extends Base {
this.on('editor', 'breakpointCleared', (fileName, row) => { if (this.onBreakpointClearedListener) this.onBreakpointClearedListener(fileName, row) }) this.on('editor', 'breakpointCleared', (fileName, row) => { if (this.onBreakpointClearedListener) this.onBreakpointClearedListener(fileName, row) })
this.on('editor', 'breakpointAdded', (fileName, row) => { if (this.onBreakpointAddedListener) this.onBreakpointAddedListener(fileName, row) }) this.on('editor', 'breakpointAdded', (fileName, row) => { if (this.onBreakpointAddedListener) this.onBreakpointAddedListener(fileName, row) })
this.on('editor', 'contentChanged', () => { if (this.onEditorContentChangedListener) this.onEditorContentChangedListener() }) this.on('editor', 'contentChanged', () => { if (this.onEditorContentChangedListener) this.onEditorContentChangedListener() })
this.on('network', 'providerChanged', (provider) => { if (this.onEnvChangedListener) this.onEnvChangedListener(provider) })
} }
onDeactivation () { onDeactivation () {

@ -1,7 +1,7 @@
import { PluginClient } from "@remixproject/plugin"; import { PluginClient } from "@remixproject/plugin";
import { createClient } from "@remixproject/plugin-webview"; import { createClient } from "@remixproject/plugin-webview";
import { IDebuggerApi, RawLocation, Sources, Asts, LineColumnLocation, import { IDebuggerApi, RawLocation, Sources, Asts, LineColumnLocation,
onBreakpointClearedListener, onBreakpointAddedListener, onEditorContentChanged, TransactionReceipt } from '@remix-ui/debugger-ui' onBreakpointClearedListener, onBreakpointAddedListener, onEditorContentChanged, onEnvChangedListener, TransactionReceipt } from '@remix-ui/debugger-ui'
import { DebuggerApiMixin, CompilerAbstract} from './debugger-api' import { DebuggerApiMixin, CompilerAbstract} from './debugger-api'
export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) { export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) {
@ -18,6 +18,7 @@ export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) {
onBreakpointCleared: (listener: onBreakpointClearedListener) => void onBreakpointCleared: (listener: onBreakpointClearedListener) => void
onBreakpointAdded: (listener: onBreakpointAddedListener) => void onBreakpointAdded: (listener: onBreakpointAddedListener) => void
onEditorContentChanged: (listener: onEditorContentChanged) => void onEditorContentChanged: (listener: onEditorContentChanged) => void
onEnvChanged: (listener: onEnvChangedListener) => void
discardHighlight: () => Promise<void> discardHighlight: () => Promise<void>
highlight: (lineColumnPos: LineColumnLocation, path: string) => Promise<void> highlight: (lineColumnPos: LineColumnLocation, path: string) => Promise<void>
fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise<CompilerAbstract> fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise<CompilerAbstract>

@ -12,7 +12,7 @@ class InjectedProvider {
newAccount (passwordPromptCb, cb) { newAccount (passwordPromptCb, cb) {
passwordPromptCb((passphrase) => { passwordPromptCb((passphrase) => {
this.executionContext.web3().personal.newAccount(passphrase, cb) this.executionContext.web3().eth.personal.newAccount(passphrase, cb)
}) })
} }

@ -10,7 +10,7 @@ class NodeProvider {
getAccounts (cb) { getAccounts (cb) {
if (this.config.get('settings/personal-mode')) { if (this.config.get('settings/personal-mode')) {
return this.executionContext.web3().personal.getListAccounts(cb) return this.executionContext.web3().eth.personal.getAccounts(cb)
} }
return this.executionContext.web3().eth.getAccounts(cb) return this.executionContext.web3().eth.getAccounts(cb)
} }
@ -20,7 +20,7 @@ class NodeProvider {
return cb('Not running in personal mode') return cb('Not running in personal mode')
} }
passwordPromptCb((passphrase) => { passwordPromptCb((passphrase) => {
this.executionContext.web3().personal.newAccount(passphrase, cb) this.executionContext.web3().eth.personal.newAccount(passphrase, cb)
}) })
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-analyzer", "name": "@remix-project/remix-analyzer",
"version": "0.5.14", "version": "0.5.15",
"description": "Tool to perform static analysis on Solidity smart contracts", "description": "Tool to perform static analysis on Solidity smart contracts",
"main": "index.js", "main": "index.js",
"types": ".index.d.ts", "types": ".index.d.ts",
@ -23,7 +23,7 @@
"@ethereumjs/tx": "^3.3.0", "@ethereumjs/tx": "^3.3.0",
"@ethereumjs/vm": "^5.5.0", "@ethereumjs/vm": "^5.5.0",
"@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-astwalker": "^0.0.26",
"@remix-project/remix-lib": "^0.5.5", "@remix-project/remix-lib": "^0.5.6",
"async": "^2.6.2", "async": "^2.6.2",
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
"ethers": "^5.4.2", "ethers": "^5.4.2",
@ -51,5 +51,5 @@
"typescript": "^3.7.5" "typescript": "^3.7.5"
}, },
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-astwalker", "name": "@remix-project/remix-astwalker",
"version": "0.0.35", "version": "0.0.36",
"description": "Tool to walk through Solidity AST", "description": "Tool to walk through Solidity AST",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -37,7 +37,7 @@
"@ethereumjs/block": "^3.4.0", "@ethereumjs/block": "^3.4.0",
"@ethereumjs/tx": "^3.3.0", "@ethereumjs/tx": "^3.3.0",
"@ethereumjs/vm": "^5.5.0", "@ethereumjs/vm": "^5.5.0",
"@remix-project/remix-lib": "^0.5.5", "@remix-project/remix-lib": "^0.5.6",
"@types/tape": "^4.2.33", "@types/tape": "^4.2.33",
"async": "^2.6.2", "async": "^2.6.2",
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
@ -53,5 +53,5 @@
"tap-spec": "^5.0.0" "tap-spec": "^5.0.0"
}, },
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-debug", "name": "@remix-project/remix-debug",
"version": "0.5.5", "version": "0.5.6",
"description": "Tool to debug Ethereum transactions", "description": "Tool to debug Ethereum transactions",
"contributors": [ "contributors": [
{ {
@ -23,7 +23,7 @@
"@ethereumjs/tx": "^3.3.0", "@ethereumjs/tx": "^3.3.0",
"@ethereumjs/vm": "^5.5.0", "@ethereumjs/vm": "^5.5.0",
"@remix-project/remix-astwalker": "^0.0.26", "@remix-project/remix-astwalker": "^0.0.26",
"@remix-project/remix-lib": "^0.5.5", "@remix-project/remix-lib": "^0.5.6",
"async": "^2.6.2", "async": "^2.6.2",
"commander": "^2.19.0", "commander": "^2.19.0",
"deep-equal": "^1.0.1", "deep-equal": "^1.0.1",
@ -61,5 +61,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-lib", "name": "@remix-project/remix-lib",
"version": "0.5.5", "version": "0.5.6",
"description": "Library to various Remix tools", "description": "Library to various Remix tools",
"contributors": [ "contributors": [
{ {
@ -53,5 +53,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-simulator", "name": "@remix-project/remix-simulator",
"version": "0.2.5", "version": "0.2.6",
"description": "Ethereum IDE and tools for the web", "description": "Ethereum IDE and tools for the web",
"contributors": [ "contributors": [
{ {
@ -18,7 +18,7 @@
"@ethereumjs/common": "^2.2.0", "@ethereumjs/common": "^2.2.0",
"@ethereumjs/tx": "^3.3.0", "@ethereumjs/tx": "^3.3.0",
"@ethereumjs/vm": "^5.5.0", "@ethereumjs/vm": "^5.5.0",
"@remix-project/remix-lib": "^0.5.5", "@remix-project/remix-lib": "^0.5.6",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^3.1.0", "async": "^3.1.0",
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
@ -66,5 +66,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-solidity", "name": "@remix-project/remix-solidity",
"version": "0.4.5", "version": "0.4.6",
"description": "Tool to load and run Solidity compiler", "description": "Tool to load and run Solidity compiler",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",
@ -18,7 +18,7 @@
"@ethereumjs/block": "^3.4.0", "@ethereumjs/block": "^3.4.0",
"@ethereumjs/tx": "^3.3.0", "@ethereumjs/tx": "^3.3.0",
"@ethereumjs/vm": "^5.5.0", "@ethereumjs/vm": "^5.5.0",
"@remix-project/remix-lib": "^0.5.5", "@remix-project/remix-lib": "^0.5.6",
"async": "^2.6.2", "async": "^2.6.2",
"eslint-scope": "^5.0.0", "eslint-scope": "^5.0.0",
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
@ -59,5 +59,5 @@
}, },
"homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme",
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-tests", "name": "@remix-project/remix-tests",
"version": "0.2.5", "version": "0.2.6",
"description": "Tool to test Solidity smart contracts", "description": "Tool to test Solidity smart contracts",
"main": "src/index.js", "main": "src/index.js",
"types": "./src/index.d.ts", "types": "./src/index.d.ts",
@ -39,9 +39,9 @@
"@ethereumjs/common": "^2.2.0", "@ethereumjs/common": "^2.2.0",
"@ethereumjs/tx": "^3.3.0", "@ethereumjs/tx": "^3.3.0",
"@ethereumjs/vm": "^5.5.0", "@ethereumjs/vm": "^5.5.0",
"@remix-project/remix-lib": "^0.5.5", "@remix-project/remix-lib": "^0.5.6",
"@remix-project/remix-simulator": "^0.2.5", "@remix-project/remix-simulator": "^0.2.6",
"@remix-project/remix-solidity": "^0.4.5", "@remix-project/remix-solidity": "^0.4.6",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^2.6.0", "async": "^2.6.0",
"axios": ">=0.21.1", "axios": ">=0.21.1",
@ -77,5 +77,5 @@
"typescript": "^3.3.1" "typescript": "^3.3.1"
}, },
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -31,7 +31,8 @@ export const DebuggerUI = (props: DebuggerUIProps) => {
}, },
toastMessage: '', toastMessage: '',
validationError: '', validationError: '',
txNumberIsEmpty: true txNumberIsEmpty: true,
isLocalNodeUsed: false
}) })
useEffect(() => { useEffect(() => {
@ -62,6 +63,17 @@ export const DebuggerUI = (props: DebuggerUIProps) => {
} }
setEditor() setEditor()
const providerChanged = () => {
debuggerModule.onEnvChanged((provider) => {
setState(prevState => {
const isLocalNodeUsed = provider !== 'vm' && provider !== 'injected'
return { ...prevState, isLocalNodeUsed: isLocalNodeUsed }
})
})
}
providerChanged()
}, [state.debugger]) }, [state.debugger])
const listenToEvents = (debuggerInstance, currentReceipt) => { const listenToEvents = (debuggerInstance, currentReceipt) => {
@ -289,7 +301,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => {
}} type="checkbox" title="Debug with generated sources" /> }} type="checkbox" title="Debug with generated sources" />
<label data-id="debugGeneratedSourcesLabel" className="form-check-label custom-control-label" htmlFor="debugGeneratedSourcesInput">Use generated sources (from Solidity v0.7.2)</label> <label data-id="debugGeneratedSourcesLabel" className="form-check-label custom-control-label" htmlFor="debugGeneratedSourcesInput">Use generated sources (from Solidity v0.7.2)</label>
</div> </div>
<div className="mt-2 mb-2 debuggerConfig custom-control custom-checkbox"> { state.isLocalNodeUsed && <div className="mt-2 mb-2 debuggerConfig custom-control custom-checkbox">
<input className="custom-control-input" id="debugWithLocalNodeInput" onChange={({ target: { checked } }) => { <input className="custom-control-input" id="debugWithLocalNodeInput" onChange={({ target: { checked } }) => {
setState(prevState => { setState(prevState => {
return { ...prevState, opt: { ...prevState.opt, debugWithLocalNode: checked } } return { ...prevState, opt: { ...prevState.opt, debugWithLocalNode: checked } }
@ -297,6 +309,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => {
}} type="checkbox" title="Force the debugger to use the current local node" /> }} type="checkbox" title="Force the debugger to use the current local node" />
<label data-id="debugLocaNodeLabel" className="form-check-label custom-control-label" htmlFor="debugWithLocalNodeInput">Force using local node</label> <label data-id="debugLocaNodeLabel" className="form-check-label custom-control-label" htmlFor="debugWithLocalNodeInput">Force using local node</label>
</div> </div>
}
{ state.validationError && <span className="w-100 py-1 text-danger validationError">{state.validationError}</span> } { state.validationError && <span className="w-100 py-1 text-danger validationError">{state.validationError}</span> }
</div> </div>
<TxBrowser requestDebug={ requestDebug } unloadRequested={ unloadRequested } updateTxNumberFlag={ updateTxNumberFlag } transactionNumber={ state.txNumber } debugging={ state.debugging } /> <TxBrowser requestDebug={ requestDebug } unloadRequested={ unloadRequested } updateTxNumberFlag={ updateTxNumberFlag } transactionNumber={ state.txNumber } debugging={ state.debugging } />

@ -46,6 +46,7 @@ export type onBreakpointClearedListener = (params: string, row: number) => void
export type onBreakpointAddedListener = (params: string, row: number) => void export type onBreakpointAddedListener = (params: string, row: number) => void
export type onEditorContentChanged = () => void export type onEditorContentChanged = () => void
export type onDebugRequested = (hash: string) => void export type onDebugRequested = (hash: string) => void
export type onEnvChangedListener = (provider: string) => void
export interface IDebuggerApi { export interface IDebuggerApi {
offsetToLineColumnConverter: { offsetToLineColumn: (sourceLocation: RawLocation, file: number, contents: Sources, asts: Asts) => Promise<LineColumnLocation> } offsetToLineColumnConverter: { offsetToLineColumn: (sourceLocation: RawLocation, file: number, contents: Sources, asts: Asts) => Promise<LineColumnLocation> }
@ -57,6 +58,7 @@ export interface IDebuggerApi {
onBreakpointCleared: (listener: onBreakpointClearedListener) => void onBreakpointCleared: (listener: onBreakpointClearedListener) => void
onBreakpointAdded: (listener: onBreakpointAddedListener) => void onBreakpointAdded: (listener: onBreakpointAddedListener) => void
onEditorContentChanged: (listener: onEditorContentChanged) => void onEditorContentChanged: (listener: onEditorContentChanged) => void
onEnvChanged: (listener: onEnvChangedListener) => void
discardHighlight: () => Promise<void> discardHighlight: () => Promise<void>
highlight: (lineColumnPos: LineColumnLocation, path: string) => Promise<void> highlight: (lineColumnPos: LineColumnLocation, path: string) => Promise<void>
fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise<CompilationOutput> fetchContractAndCompile: (address: string, currentReceipt: TransactionReceipt) => Promise<CompilationOutput>

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remix-url-resolver", "name": "@remix-project/remix-url-resolver",
"version": "0.0.26", "version": "0.0.27",
"description": "Solidity import url resolver engine", "description": "Solidity import url resolver engine",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",
@ -42,5 +42,5 @@
"typescript": "^3.1.6" "typescript": "^3.1.6"
}, },
"typings": "index.d.ts", "typings": "index.d.ts",
"gitHead": "df7abe1c219e361a947031d620f4ae6e3786a4d7" "gitHead": "39700b7c076d53d0f857f341774a8448ea5c8da9"
} }

@ -1,6 +1,6 @@
{ {
"name": "@remix-project/remixd", "name": "@remix-project/remixd",
"version": "0.5.0", "version": "0.5.1",
"description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)", "description": "remix server: allow accessing file system from remix.ethereum.org and start a dev environment (see help section)",
"main": "index.js", "main": "index.js",
"types": "./index.d.ts", "types": "./index.d.ts",

Loading…
Cancel
Save