From 353dc67a2b14dd0d23ee570098498efedbba7fa6 Mon Sep 17 00:00:00 2001 From: lianahus Date: Fri, 10 Mar 2023 14:05:13 +0100 Subject: [PATCH 01/60] UI fixes in UDAPP --- .../run-tab/src/lib/components/account.tsx | 56 +++++++++---------- libs/remix-ui/run-tab/src/lib/css/run-tab.css | 1 - 2 files changed, 26 insertions(+), 31 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/account.tsx b/libs/remix-ui/run-tab/src/lib/components/account.tsx index 34c994977e..7bb5df6380 100644 --- a/libs/remix-ui/run-tab/src/lib/components/account.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/account.tsx @@ -103,42 +103,38 @@ export function AccountUI (props: AccountProps) { const passphraseCreationPrompt = () => { return ( -
Please provide a Passphrase for the account creation -
- -
-
- -
+
+ Please provide a Passphrase for the account creation + +
) } const signMessagePrompt = () => { return ( -
-
- -
+
+ +
) } const signedMessagePrompt = (msgHash: string, signedData: string) => { return ( -
- :
+
+ {msgHash} -
:
+ {signedData}
) @@ -154,16 +150,16 @@ export function AccountUI (props: AccountProps) { tooltipId="remixPlusWrapperTooltip" tooltipText={plusOpt.title} > - - - + + +
- { props.setAccount(e.target.value) }}> + { + accounts.map((value, index) => ) + }
Date: Thu, 9 Mar 2023 12:37:51 +0100 Subject: [PATCH 02/60] Utilize new changes from simulator --- libs/ghaction-helper/package.json | 8 ++++---- libs/ghaction-helper/src/methods.ts | 24 +++++++++++------------- libs/remix-analyzer/package.json | 8 ++++---- libs/remix-astwalker/package.json | 6 +++--- libs/remix-debug/package.json | 12 ++++++------ libs/remix-lib/package.json | 4 ++-- libs/remix-simulator/package.json | 6 +++--- libs/remix-simulator/src/provider.ts | 18 ++++++++++++++++-- libs/remix-solidity/package.json | 6 +++--- libs/remix-tests/package.json | 10 +++++----- libs/remix-url-resolver/package.json | 4 ++-- libs/remix-ws-templates/package.json | 4 ++-- 12 files changed, 61 insertions(+), 49 deletions(-) diff --git a/libs/ghaction-helper/package.json b/libs/ghaction-helper/package.json index e307cac4b1..70faee6c6d 100644 --- a/libs/ghaction-helper/package.json +++ b/libs/ghaction-helper/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/ghaction-helper", - "version": "0.1.7-alpha.10", + "version": "0.1.7-alpha.14", "description": "Solidity Tests GitHub Action Helper", "main": "src/index.js", "scripts": { @@ -19,17 +19,17 @@ }, "homepage": "https://github.com/ethereum/remix-project#readme", "devDependencies": { - "@remix-project/remix-solidity": "^0.5.11-alpha.10", + "@remix-project/remix-solidity": "^0.5.11-alpha.14", "@types/chai": "^4.3.4", "typescript": "^4.9.3" }, "dependencies": { "@ethereum-waffle/chai": "^3.4.4", - "@remix-project/remix-simulator": "^0.2.25-alpha.10", + "@remix-project/remix-simulator": "^0.2.25-alpha.14", "chai": "^4.3.7", "ethers": "^5.7.2", "web3": "^1.5.3" }, "types": "./src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c" + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" } \ No newline at end of file diff --git a/libs/ghaction-helper/src/methods.ts b/libs/ghaction-helper/src/methods.ts index fe82378018..8bea9f5532 100644 --- a/libs/ghaction-helper/src/methods.ts +++ b/libs/ghaction-helper/src/methods.ts @@ -5,20 +5,18 @@ import { getArtifactsByContractName } from './artifacts-helper' import { SignerWithAddress } from './signer' import Web3 from "web3" -(async () => { - const providerConfig = { - fork: global.fork || null, - nodeUrl: global.nodeUrl || null, - blockNumber: global.blockNumber || null - } +const providerConfig = { + fork: global.fork || null, + nodeUrl: global.nodeUrl || null, + blockNumber: global.blockNumber || null +} - global.remixProvider = new Provider(providerConfig) - await global.remixProvider.init() - global.web3Provider = new ethers.providers.Web3Provider(global.remixProvider) - global.provider = global.web3Provider - global.ethereum = global.web3Provider - global.web3 = new Web3(global.web3Provider) -})() +global.remixProvider = new Provider(providerConfig) +global.remixProvider.init() +global.web3Provider = new ethers.providers.Web3Provider(global.remixProvider) +global.provider = global.web3Provider +global.ethereum = global.web3Provider +global.web3 = new Web3(global.web3Provider) const isFactoryOptions = (signerOrOptions: any) => { if (!signerOrOptions || signerOrOptions === undefined || signerOrOptions instanceof ethers.Signer) return false diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 6fdd00e1e8..3a3cb656c9 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.34-alpha.10", + "version": "0.5.34-alpha.14", "description": "Tool to perform static analysis on Solidity smart contracts", "scripts": { "test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts" @@ -25,8 +25,8 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.10", - "@remix-project/remix-lib": "^0.5.25-alpha.10", + "@remix-project/remix-astwalker": "^0.0.55-alpha.14", + "@remix-project/remix-lib": "^0.5.25-alpha.14", "async": "^2.6.2", "ethers": "^5.4.2", "ethjs-util": "^0.1.6", @@ -50,6 +50,6 @@ "typescript": "^3.7.5" }, "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c", + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", "main": "./src/index.js" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index 0546e8aa05..5a3f6e9ac6 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.55-alpha.10", + "version": "0.0.55-alpha.14", "description": "Tool to walk through Solidity AST", "main": "src/index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.10", + "@remix-project/remix-lib": "^0.5.25-alpha.14", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethers": "^5.4.2", @@ -53,6 +53,6 @@ "tap-spec": "^5.0.0" }, "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c", + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index 7da35447cf..5c0cf525bc 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.5.25-alpha.10", + "version": "0.5.25-alpha.14", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -26,10 +26,10 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.10", - "@remix-project/remix-lib": "^0.5.25-alpha.10", - "@remix-project/remix-simulator": "^0.2.25-alpha.10", - "@remix-project/remix-solidity": "^0.5.11-alpha.10", + "@remix-project/remix-astwalker": "^0.0.55-alpha.14", + "@remix-project/remix-lib": "^0.5.25-alpha.14", + "@remix-project/remix-simulator": "^0.2.25-alpha.14", + "@remix-project/remix-solidity": "^0.5.11-alpha.14", "ansi-gray": "^0.1.1", "async": "^2.6.2", "color-support": "^1.1.3", @@ -69,6 +69,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c", + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index 5230b21bcb..0ed7be2811 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.5.25-alpha.10", + "version": "0.5.25-alpha.14", "description": "Library to various Remix tools", "contributors": [ { @@ -51,6 +51,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c", + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index 07c815e95e..a6f1dd255f 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.2.25-alpha.10", + "version": "0.2.25-alpha.14", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.10", + "@remix-project/remix-lib": "^0.5.25-alpha.14", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -67,6 +67,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c", + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-simulator/src/provider.ts b/libs/remix-simulator/src/provider.ts index 264a9f7b4c..03b2840943 100644 --- a/libs/remix-simulator/src/provider.ts +++ b/libs/remix-simulator/src/provider.ts @@ -18,7 +18,9 @@ export class Provider { Accounts Transactions methods - connected: boolean; + connected: boolean + initialized: boolean + pendingRequests: Array constructor (options: Record = {}) { this.options = options @@ -39,15 +41,27 @@ export class Provider { } async init () { + this.initialized = false + this.pendingRequests = [] await this.vmContext.init() await generateBlock(this.vmContext) await this.Accounts.resetAccounts() this.Transactions.init(this.Accounts.accounts) + this.initialized = true + if (this.pendingRequests.length > 0) { + this.pendingRequests.map((req) => { + this.sendAsync(req.payload, req.callback) + }) + this.pendingRequests = [] + } } sendAsync (payload, callback) { // log.info('payload method is ', payload.method) // commented because, this floods the IDE console - + if (!this.initialized) { + this.pendingRequests.push({ payload, callback }) + return + } const method = this.methods[payload.method] if (this.options.logDetails) { info(payload) diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index 42ee0db087..fb39eb43e5 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.5.11-alpha.10", + "version": "0.5.11-alpha.14", "description": "Tool to load and run Solidity compiler", "main": "src/index.js", "types": "src/index.d.ts", @@ -19,7 +19,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.10", + "@remix-project/remix-lib": "^0.5.25-alpha.14", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethers": "^5.4.2", @@ -57,5 +57,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c" + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 849bb6ee00..ade96aa227 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.2.25-alpha.10", + "version": "0.2.25-alpha.14", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -41,9 +41,9 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.10", - "@remix-project/remix-simulator": "^0.2.25-alpha.10", - "@remix-project/remix-solidity": "^0.5.11-alpha.10", + "@remix-project/remix-lib": "^0.5.25-alpha.14", + "@remix-project/remix-simulator": "^0.2.25-alpha.14", + "@remix-project/remix-solidity": "^0.5.11-alpha.14", "@remix-project/remix-url-resolver": "^0.0.42", "ansi-gray": "^0.1.1", "async": "^2.6.0", @@ -78,5 +78,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c" + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" } \ No newline at end of file diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 1a771656dc..9a821c1a56 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-url-resolver", - "version": "0.0.47-alpha.10", + "version": "0.0.47-alpha.14", "description": "Solidity import url resolver engine", "main": "src/index.js", "types": "src/index.d.ts", @@ -40,5 +40,5 @@ "typescript": "^3.1.6" }, "typings": "src/index.d.ts", - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c" + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" } \ No newline at end of file diff --git a/libs/remix-ws-templates/package.json b/libs/remix-ws-templates/package.json index 3825d35506..bfb5b6e603 100644 --- a/libs/remix-ws-templates/package.json +++ b/libs/remix-ws-templates/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-ws-templates", - "version": "1.0.12-alpha.10", + "version": "1.0.12-alpha.14", "description": "Create a Remix IDE workspace using different templates", "main": "src/index.js", "types": "src/index.d.ts", @@ -24,5 +24,5 @@ "ethers": "^5.4.2", "web3": "^1.5.1" }, - "gitHead": "4ea0d9afb03f04df480fdc57a60b8f85b771ed7c" + "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" } \ No newline at end of file From f28f8ebb96938b543adb13a6bd0b2755c6cc238a Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 9 Mar 2023 13:19:58 +0100 Subject: [PATCH 03/60] Exit process if failing test is found --- libs/ghaction-helper/package.json | 8 ++++---- libs/remix-analyzer/package.json | 8 ++++---- libs/remix-astwalker/package.json | 6 +++--- libs/remix-debug/package.json | 12 ++++++------ libs/remix-lib/package.json | 4 ++-- libs/remix-simulator/package.json | 6 +++--- libs/remix-solidity/package.json | 6 +++--- libs/remix-tests/package.json | 10 +++++----- libs/remix-tests/src/run.ts | 6 +++++- libs/remix-tests/src/runTestFiles.ts | 3 +-- libs/remix-url-resolver/package.json | 4 ++-- libs/remix-ws-templates/package.json | 4 ++-- 12 files changed, 40 insertions(+), 37 deletions(-) diff --git a/libs/ghaction-helper/package.json b/libs/ghaction-helper/package.json index 70faee6c6d..9fdb7484c1 100644 --- a/libs/ghaction-helper/package.json +++ b/libs/ghaction-helper/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/ghaction-helper", - "version": "0.1.7-alpha.14", + "version": "0.1.7-alpha.15", "description": "Solidity Tests GitHub Action Helper", "main": "src/index.js", "scripts": { @@ -19,17 +19,17 @@ }, "homepage": "https://github.com/ethereum/remix-project#readme", "devDependencies": { - "@remix-project/remix-solidity": "^0.5.11-alpha.14", + "@remix-project/remix-solidity": "^0.5.11-alpha.15", "@types/chai": "^4.3.4", "typescript": "^4.9.3" }, "dependencies": { "@ethereum-waffle/chai": "^3.4.4", - "@remix-project/remix-simulator": "^0.2.25-alpha.14", + "@remix-project/remix-simulator": "^0.2.25-alpha.15", "chai": "^4.3.7", "ethers": "^5.7.2", "web3": "^1.5.3" }, "types": "./src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" } \ No newline at end of file diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 3a3cb656c9..19cf33d1f3 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.34-alpha.14", + "version": "0.5.34-alpha.15", "description": "Tool to perform static analysis on Solidity smart contracts", "scripts": { "test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts" @@ -25,8 +25,8 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.14", - "@remix-project/remix-lib": "^0.5.25-alpha.14", + "@remix-project/remix-astwalker": "^0.0.55-alpha.15", + "@remix-project/remix-lib": "^0.5.25-alpha.15", "async": "^2.6.2", "ethers": "^5.4.2", "ethjs-util": "^0.1.6", @@ -50,6 +50,6 @@ "typescript": "^3.7.5" }, "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", "main": "./src/index.js" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index 5a3f6e9ac6..c97a2c8dba 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.55-alpha.14", + "version": "0.0.55-alpha.15", "description": "Tool to walk through Solidity AST", "main": "src/index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.14", + "@remix-project/remix-lib": "^0.5.25-alpha.15", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethers": "^5.4.2", @@ -53,6 +53,6 @@ "tap-spec": "^5.0.0" }, "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index 5c0cf525bc..89f4b613a2 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.5.25-alpha.14", + "version": "0.5.25-alpha.15", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -26,10 +26,10 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.14", - "@remix-project/remix-lib": "^0.5.25-alpha.14", - "@remix-project/remix-simulator": "^0.2.25-alpha.14", - "@remix-project/remix-solidity": "^0.5.11-alpha.14", + "@remix-project/remix-astwalker": "^0.0.55-alpha.15", + "@remix-project/remix-lib": "^0.5.25-alpha.15", + "@remix-project/remix-simulator": "^0.2.25-alpha.15", + "@remix-project/remix-solidity": "^0.5.11-alpha.15", "ansi-gray": "^0.1.1", "async": "^2.6.2", "color-support": "^1.1.3", @@ -69,6 +69,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index 0ed7be2811..b2a0e6e845 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.5.25-alpha.14", + "version": "0.5.25-alpha.15", "description": "Library to various Remix tools", "contributors": [ { @@ -51,6 +51,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index a6f1dd255f..6798e695c5 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.2.25-alpha.14", + "version": "0.2.25-alpha.15", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.14", + "@remix-project/remix-lib": "^0.5.25-alpha.15", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -67,6 +67,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8", + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index fb39eb43e5..3707dc63c1 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.5.11-alpha.14", + "version": "0.5.11-alpha.15", "description": "Tool to load and run Solidity compiler", "main": "src/index.js", "types": "src/index.d.ts", @@ -19,7 +19,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.14", + "@remix-project/remix-lib": "^0.5.25-alpha.15", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethers": "^5.4.2", @@ -57,5 +57,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index ade96aa227..592640ddb9 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.2.25-alpha.14", + "version": "0.2.25-alpha.15", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -41,9 +41,9 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.14", - "@remix-project/remix-simulator": "^0.2.25-alpha.14", - "@remix-project/remix-solidity": "^0.5.11-alpha.14", + "@remix-project/remix-lib": "^0.5.25-alpha.15", + "@remix-project/remix-simulator": "^0.2.25-alpha.15", + "@remix-project/remix-solidity": "^0.5.11-alpha.15", "@remix-project/remix-url-resolver": "^0.0.42", "ansi-gray": "^0.1.1", "async": "^2.6.0", @@ -78,5 +78,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" } \ No newline at end of file diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index ada8ab2ea8..8df0caeadf 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -131,8 +131,12 @@ commander await provider.init() web3.setProvider(provider) extend(web3) - runTestFiles(path.resolve(file_path), isDirectory, web3, compilerConfig, (error) => { + runTestFiles(path.resolve(file_path), isDirectory, web3, compilerConfig, (error, totalPassing, totalFailing) => { if (error) process.exit(1) + if (totalFailing > 0) { + log.error(`\n\t${totalFailing} test${totalFailing > 1 ? 's' : ''} failed`) + process.exit(1) + } }) }) diff --git a/libs/remix-tests/src/runTestFiles.ts b/libs/remix-tests/src/runTestFiles.ts index 143f38e45c..a811f9b441 100644 --- a/libs/remix-tests/src/runTestFiles.ts +++ b/libs/remix-tests/src/runTestFiles.ts @@ -173,8 +173,7 @@ export function runTestFiles (filepath: string, isDirectory: boolean, web3: Web3 } console.log(colors.white('Time Taken: ' + totalTime + 's')) console.log('') - - next() + next(null, totalPassing, totalFailing) }) } ], finalCallback) diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 9a821c1a56..861be7dac7 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-url-resolver", - "version": "0.0.47-alpha.14", + "version": "0.0.47-alpha.15", "description": "Solidity import url resolver engine", "main": "src/index.js", "types": "src/index.d.ts", @@ -40,5 +40,5 @@ "typescript": "^3.1.6" }, "typings": "src/index.d.ts", - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" } \ No newline at end of file diff --git a/libs/remix-ws-templates/package.json b/libs/remix-ws-templates/package.json index bfb5b6e603..b3ff40f9be 100644 --- a/libs/remix-ws-templates/package.json +++ b/libs/remix-ws-templates/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-ws-templates", - "version": "1.0.12-alpha.14", + "version": "1.0.12-alpha.15", "description": "Create a Remix IDE workspace using different templates", "main": "src/index.js", "types": "src/index.d.ts", @@ -24,5 +24,5 @@ "ethers": "^5.4.2", "web3": "^1.5.1" }, - "gitHead": "924dca66c2d2261d916a3c764ed99f5b671ac0c8" + "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" } \ No newline at end of file From 512c907fe7ad7bd4919bbef1570d27c2afc80810 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Mar 2023 13:36:47 +0100 Subject: [PATCH 04/60] Exit process without logging output --- libs/ghaction-helper/package.json | 8 ++++---- libs/remix-analyzer/package.json | 8 ++++---- libs/remix-astwalker/package.json | 6 +++--- libs/remix-debug/package.json | 12 ++++++------ libs/remix-lib/package.json | 4 ++-- libs/remix-simulator/package.json | 6 +++--- libs/remix-solidity/package.json | 6 +++--- libs/remix-tests/package.json | 10 +++++----- libs/remix-tests/src/run.ts | 5 +---- libs/remix-url-resolver/package.json | 4 ++-- libs/remix-ws-templates/package.json | 4 ++-- 11 files changed, 35 insertions(+), 38 deletions(-) diff --git a/libs/ghaction-helper/package.json b/libs/ghaction-helper/package.json index 9fdb7484c1..33e733a9ab 100644 --- a/libs/ghaction-helper/package.json +++ b/libs/ghaction-helper/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/ghaction-helper", - "version": "0.1.7-alpha.15", + "version": "0.1.7-alpha.16", "description": "Solidity Tests GitHub Action Helper", "main": "src/index.js", "scripts": { @@ -19,17 +19,17 @@ }, "homepage": "https://github.com/ethereum/remix-project#readme", "devDependencies": { - "@remix-project/remix-solidity": "^0.5.11-alpha.15", + "@remix-project/remix-solidity": "^0.5.11-alpha.16", "@types/chai": "^4.3.4", "typescript": "^4.9.3" }, "dependencies": { "@ethereum-waffle/chai": "^3.4.4", - "@remix-project/remix-simulator": "^0.2.25-alpha.15", + "@remix-project/remix-simulator": "^0.2.25-alpha.16", "chai": "^4.3.7", "ethers": "^5.7.2", "web3": "^1.5.3" }, "types": "./src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" } \ No newline at end of file diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 19cf33d1f3..85a76181f2 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.34-alpha.15", + "version": "0.5.34-alpha.16", "description": "Tool to perform static analysis on Solidity smart contracts", "scripts": { "test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts" @@ -25,8 +25,8 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.15", - "@remix-project/remix-lib": "^0.5.25-alpha.15", + "@remix-project/remix-astwalker": "^0.0.55-alpha.16", + "@remix-project/remix-lib": "^0.5.25-alpha.16", "async": "^2.6.2", "ethers": "^5.4.2", "ethjs-util": "^0.1.6", @@ -50,6 +50,6 @@ "typescript": "^3.7.5" }, "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", "main": "./src/index.js" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index c97a2c8dba..f9040710b2 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.55-alpha.15", + "version": "0.0.55-alpha.16", "description": "Tool to walk through Solidity AST", "main": "src/index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.15", + "@remix-project/remix-lib": "^0.5.25-alpha.16", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethers": "^5.4.2", @@ -53,6 +53,6 @@ "tap-spec": "^5.0.0" }, "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index 89f4b613a2..be62226144 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.5.25-alpha.15", + "version": "0.5.25-alpha.16", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -26,10 +26,10 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.15", - "@remix-project/remix-lib": "^0.5.25-alpha.15", - "@remix-project/remix-simulator": "^0.2.25-alpha.15", - "@remix-project/remix-solidity": "^0.5.11-alpha.15", + "@remix-project/remix-astwalker": "^0.0.55-alpha.16", + "@remix-project/remix-lib": "^0.5.25-alpha.16", + "@remix-project/remix-simulator": "^0.2.25-alpha.16", + "@remix-project/remix-solidity": "^0.5.11-alpha.16", "ansi-gray": "^0.1.1", "async": "^2.6.2", "color-support": "^1.1.3", @@ -69,6 +69,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index b2a0e6e845..e2e9ea40c2 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.5.25-alpha.15", + "version": "0.5.25-alpha.16", "description": "Library to various Remix tools", "contributors": [ { @@ -51,6 +51,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index 6798e695c5..1d3f19207e 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.2.25-alpha.15", + "version": "0.2.25-alpha.16", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.15", + "@remix-project/remix-lib": "^0.5.25-alpha.16", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -67,6 +67,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d", + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index 3707dc63c1..8b5c0dcd84 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.5.11-alpha.15", + "version": "0.5.11-alpha.16", "description": "Tool to load and run Solidity compiler", "main": "src/index.js", "types": "src/index.d.ts", @@ -19,7 +19,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.15", + "@remix-project/remix-lib": "^0.5.25-alpha.16", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethers": "^5.4.2", @@ -57,5 +57,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 592640ddb9..335b549771 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.2.25-alpha.15", + "version": "0.2.25-alpha.16", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -41,9 +41,9 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.15", - "@remix-project/remix-simulator": "^0.2.25-alpha.15", - "@remix-project/remix-solidity": "^0.5.11-alpha.15", + "@remix-project/remix-lib": "^0.5.25-alpha.16", + "@remix-project/remix-simulator": "^0.2.25-alpha.16", + "@remix-project/remix-solidity": "^0.5.11-alpha.16", "@remix-project/remix-url-resolver": "^0.0.42", "ansi-gray": "^0.1.1", "async": "^2.6.0", @@ -78,5 +78,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" } \ No newline at end of file diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 8df0caeadf..52c5247290 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -133,10 +133,7 @@ commander extend(web3) runTestFiles(path.resolve(file_path), isDirectory, web3, compilerConfig, (error, totalPassing, totalFailing) => { if (error) process.exit(1) - if (totalFailing > 0) { - log.error(`\n\t${totalFailing} test${totalFailing > 1 ? 's' : ''} failed`) - process.exit(1) - } + if (totalFailing > 0) process.exit(1) }) }) diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index 861be7dac7..f5be3dc49c 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-url-resolver", - "version": "0.0.47-alpha.15", + "version": "0.0.47-alpha.16", "description": "Solidity import url resolver engine", "main": "src/index.js", "types": "src/index.d.ts", @@ -40,5 +40,5 @@ "typescript": "^3.1.6" }, "typings": "src/index.d.ts", - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" } \ No newline at end of file diff --git a/libs/remix-ws-templates/package.json b/libs/remix-ws-templates/package.json index b3ff40f9be..5ace0de2dd 100644 --- a/libs/remix-ws-templates/package.json +++ b/libs/remix-ws-templates/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-ws-templates", - "version": "1.0.12-alpha.15", + "version": "1.0.12-alpha.16", "description": "Create a Remix IDE workspace using different templates", "main": "src/index.js", "types": "src/index.d.ts", @@ -24,5 +24,5 @@ "ethers": "^5.4.2", "web3": "^1.5.1" }, - "gitHead": "0498a7a2496981838ff937a8bdaa150dfde88a0d" + "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" } \ No newline at end of file From dddf05c14e0a5c587ceda62f49d596315c4d47e7 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Mar 2023 13:41:44 +0100 Subject: [PATCH 05/60] Log test output] --- libs/remix-tests/tests/testRunner.cli.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 16bd565cce..e5d770e059 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -68,6 +68,7 @@ Commands: expect(res.stdout.toString().trim()).to.match(/AssertOkTest okPassTest/) // check if console.log is printed expect(res.stdout.toString().trim()).to.match(/Ok pass test/) expect(res.stdout.toString().trim()).to.match(/AssertOkTest okFailTest/) // check if console.log is printed + console.log('output: ', res.stdout.toString().trim()) expect(res.stdout.toString().trim()).to.match(/Ok fail test/) // match fail test details expect(res.stdout.toString().trim()).to.match(/Expected value should be ok to: true/) From e959c61bb78dcca584832e22feef84048016f782 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Mar 2023 15:46:22 +0100 Subject: [PATCH 06/60] Exit if killProcess flag is set to true --- libs/ghaction-helper/package.json | 8 ++++---- libs/remix-analyzer/package.json | 8 ++++---- libs/remix-astwalker/package.json | 6 +++--- libs/remix-debug/package.json | 12 ++++++------ libs/remix-lib/package.json | 4 ++-- libs/remix-simulator/package.json | 6 +++--- libs/remix-solidity/package.json | 6 +++--- libs/remix-tests/package.json | 10 +++++----- libs/remix-tests/src/run.ts | 4 ++-- libs/remix-tests/tests/testRunner.cli.spec.ts | 1 - .../helper/src/lib/components/custom-tooltip.tsx | 3 ++- libs/remix-url-resolver/package.json | 4 ++-- libs/remix-ws-templates/package.json | 4 ++-- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/libs/ghaction-helper/package.json b/libs/ghaction-helper/package.json index 33e733a9ab..3da2205e87 100644 --- a/libs/ghaction-helper/package.json +++ b/libs/ghaction-helper/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/ghaction-helper", - "version": "0.1.7-alpha.16", + "version": "0.1.7-alpha.17", "description": "Solidity Tests GitHub Action Helper", "main": "src/index.js", "scripts": { @@ -19,17 +19,17 @@ }, "homepage": "https://github.com/ethereum/remix-project#readme", "devDependencies": { - "@remix-project/remix-solidity": "^0.5.11-alpha.16", + "@remix-project/remix-solidity": "^0.5.11-alpha.17", "@types/chai": "^4.3.4", "typescript": "^4.9.3" }, "dependencies": { "@ethereum-waffle/chai": "^3.4.4", - "@remix-project/remix-simulator": "^0.2.25-alpha.16", + "@remix-project/remix-simulator": "^0.2.25-alpha.17", "chai": "^4.3.7", "ethers": "^5.7.2", "web3": "^1.5.3" }, "types": "./src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81" } \ No newline at end of file diff --git a/libs/remix-analyzer/package.json b/libs/remix-analyzer/package.json index 85a76181f2..7bfa11b8cd 100644 --- a/libs/remix-analyzer/package.json +++ b/libs/remix-analyzer/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-analyzer", - "version": "0.5.34-alpha.16", + "version": "0.5.34-alpha.17", "description": "Tool to perform static analysis on Solidity smart contracts", "scripts": { "test": "./../../node_modules/.bin/ts-node --project ../../tsconfig.base.json --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts" @@ -25,8 +25,8 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.16", - "@remix-project/remix-lib": "^0.5.25-alpha.16", + "@remix-project/remix-astwalker": "^0.0.55-alpha.17", + "@remix-project/remix-lib": "^0.5.25-alpha.17", "async": "^2.6.2", "ethers": "^5.4.2", "ethjs-util": "^0.1.6", @@ -50,6 +50,6 @@ "typescript": "^3.7.5" }, "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81", "main": "./src/index.js" } \ No newline at end of file diff --git a/libs/remix-astwalker/package.json b/libs/remix-astwalker/package.json index f9040710b2..4935c4698c 100644 --- a/libs/remix-astwalker/package.json +++ b/libs/remix-astwalker/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-astwalker", - "version": "0.0.55-alpha.16", + "version": "0.0.55-alpha.17", "description": "Tool to walk through Solidity AST", "main": "src/index.js", "scripts": { @@ -37,7 +37,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.16", + "@remix-project/remix-lib": "^0.5.25-alpha.17", "@types/tape": "^4.2.33", "async": "^2.6.2", "ethers": "^5.4.2", @@ -53,6 +53,6 @@ "tap-spec": "^5.0.0" }, "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-debug/package.json b/libs/remix-debug/package.json index be62226144..bd3640f4a6 100644 --- a/libs/remix-debug/package.json +++ b/libs/remix-debug/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-debug", - "version": "0.5.25-alpha.16", + "version": "0.5.25-alpha.17", "description": "Tool to debug Ethereum transactions", "contributors": [ { @@ -26,10 +26,10 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-astwalker": "^0.0.55-alpha.16", - "@remix-project/remix-lib": "^0.5.25-alpha.16", - "@remix-project/remix-simulator": "^0.2.25-alpha.16", - "@remix-project/remix-solidity": "^0.5.11-alpha.16", + "@remix-project/remix-astwalker": "^0.0.55-alpha.17", + "@remix-project/remix-lib": "^0.5.25-alpha.17", + "@remix-project/remix-simulator": "^0.2.25-alpha.17", + "@remix-project/remix-solidity": "^0.5.11-alpha.17", "ansi-gray": "^0.1.1", "async": "^2.6.2", "color-support": "^1.1.3", @@ -69,6 +69,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-debug#readme", "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-lib/package.json b/libs/remix-lib/package.json index e2e9ea40c2..5b07a0760a 100644 --- a/libs/remix-lib/package.json +++ b/libs/remix-lib/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-lib", - "version": "0.5.25-alpha.16", + "version": "0.5.25-alpha.17", "description": "Library to various Remix tools", "contributors": [ { @@ -51,6 +51,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-lib#readme", "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-simulator/package.json b/libs/remix-simulator/package.json index 1d3f19207e..d4f83939b4 100644 --- a/libs/remix-simulator/package.json +++ b/libs/remix-simulator/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-simulator", - "version": "0.2.25-alpha.16", + "version": "0.2.25-alpha.17", "description": "Ethereum IDE and tools for the web", "contributors": [ { @@ -22,7 +22,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.16", + "@remix-project/remix-lib": "^0.5.25-alpha.17", "ansi-gray": "^0.1.1", "async": "^3.1.0", "body-parser": "^1.18.2", @@ -67,6 +67,6 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator#readme", "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3", + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81", "types": "./src/index.d.ts" } \ No newline at end of file diff --git a/libs/remix-solidity/package.json b/libs/remix-solidity/package.json index 8b5c0dcd84..10e2076bec 100644 --- a/libs/remix-solidity/package.json +++ b/libs/remix-solidity/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-solidity", - "version": "0.5.11-alpha.16", + "version": "0.5.11-alpha.17", "description": "Tool to load and run Solidity compiler", "main": "src/index.js", "types": "src/index.d.ts", @@ -19,7 +19,7 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.16", + "@remix-project/remix-lib": "^0.5.25-alpha.17", "async": "^2.6.2", "eslint-scope": "^5.0.0", "ethers": "^5.4.2", @@ -57,5 +57,5 @@ }, "homepage": "https://github.com/ethereum/remix-project/tree/master/libs/remix-solidity#readme", "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81" } \ No newline at end of file diff --git a/libs/remix-tests/package.json b/libs/remix-tests/package.json index 335b549771..cd92586fb8 100644 --- a/libs/remix-tests/package.json +++ b/libs/remix-tests/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-tests", - "version": "0.2.25-alpha.16", + "version": "0.2.25-alpha.17", "description": "Tool to test Solidity smart contracts", "main": "src/index.js", "types": "./src/index.d.ts", @@ -41,9 +41,9 @@ "@ethereumjs/tx": "^4.0.2", "@ethereumjs/util": "^8.0.3", "@ethereumjs/vm": "^6.3.0", - "@remix-project/remix-lib": "^0.5.25-alpha.16", - "@remix-project/remix-simulator": "^0.2.25-alpha.16", - "@remix-project/remix-solidity": "^0.5.11-alpha.16", + "@remix-project/remix-lib": "^0.5.25-alpha.17", + "@remix-project/remix-simulator": "^0.2.25-alpha.17", + "@remix-project/remix-solidity": "^0.5.11-alpha.17", "@remix-project/remix-url-resolver": "^0.0.42", "ansi-gray": "^0.1.1", "async": "^2.6.0", @@ -78,5 +78,5 @@ "typescript": "^3.3.1" }, "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81" } \ No newline at end of file diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 52c5247290..0b64f1de1b 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -55,6 +55,7 @@ commander .option('-f, --fork ', 'set hard fork (e.g: istanbul, berlin etc. See full list of hard forks here: https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common/src/hardforks)') .option('-n, --nodeUrl ', 'set node url (e.g: https://mainnet.infura.io/v3/your-api-key)') .option('-b, --blockNumber ', 'set block number (e.g: 123456)') + .option('-k, --killProcess ', 'enable/disable process exit with code 1 if there are failing tests.') .argument('file_path', 'path to test file or directory') .action(async (file_path) => { const options = commander.opts(); @@ -133,7 +134,7 @@ commander extend(web3) runTestFiles(path.resolve(file_path), isDirectory, web3, compilerConfig, (error, totalPassing, totalFailing) => { if (error) process.exit(1) - if (totalFailing > 0) process.exit(1) + if (totalFailing > 0 && options.killProcess) process.exit(1) }) }) @@ -141,5 +142,4 @@ if (!process.argv.slice(2).length) { log.error('Please specify a file or directory path') process.exit(1) } - commander.parse(process.argv) diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index e5d770e059..16bd565cce 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -68,7 +68,6 @@ Commands: expect(res.stdout.toString().trim()).to.match(/AssertOkTest okPassTest/) // check if console.log is printed expect(res.stdout.toString().trim()).to.match(/Ok pass test/) expect(res.stdout.toString().trim()).to.match(/AssertOkTest okFailTest/) // check if console.log is printed - console.log('output: ', res.stdout.toString().trim()) expect(res.stdout.toString().trim()).to.match(/Ok fail test/) // match fail test details expect(res.stdout.toString().trim()).to.match(/Expected value should be ok to: true/) diff --git a/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx b/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx index 6c55ed06c8..c322d2f924 100644 --- a/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx +++ b/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx @@ -11,11 +11,12 @@ export function CustomTooltip({ children, placement, tooltipId, tooltipClasses, + {typeof tooltipText === 'string' ? ({tooltipText}) : (tooltipText)} } delay={delay} + show={true} > {children} diff --git a/libs/remix-url-resolver/package.json b/libs/remix-url-resolver/package.json index f5be3dc49c..3d20660020 100644 --- a/libs/remix-url-resolver/package.json +++ b/libs/remix-url-resolver/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-url-resolver", - "version": "0.0.47-alpha.16", + "version": "0.0.47-alpha.17", "description": "Solidity import url resolver engine", "main": "src/index.js", "types": "src/index.d.ts", @@ -40,5 +40,5 @@ "typescript": "^3.1.6" }, "typings": "src/index.d.ts", - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81" } \ No newline at end of file diff --git a/libs/remix-ws-templates/package.json b/libs/remix-ws-templates/package.json index 5ace0de2dd..07e9a42c53 100644 --- a/libs/remix-ws-templates/package.json +++ b/libs/remix-ws-templates/package.json @@ -1,6 +1,6 @@ { "name": "@remix-project/remix-ws-templates", - "version": "1.0.12-alpha.16", + "version": "1.0.12-alpha.17", "description": "Create a Remix IDE workspace using different templates", "main": "src/index.js", "types": "src/index.d.ts", @@ -24,5 +24,5 @@ "ethers": "^5.4.2", "web3": "^1.5.1" }, - "gitHead": "c915b9ab496d9e6902eb8b747425f4d267d8dce3" + "gitHead": "4806543bb099b558872793ca7a215468e0bffc81" } \ No newline at end of file From 8d6335ee76062b5b82583347b9432d85f12bf409 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Mar 2023 16:00:57 +0100 Subject: [PATCH 07/60] Fix remix-libs test --- libs/remix-tests/src/run.ts | 2 +- libs/remix-tests/tests/testRunner.cli.spec.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 0b64f1de1b..50ff7ca24e 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -55,7 +55,7 @@ commander .option('-f, --fork ', 'set hard fork (e.g: istanbul, berlin etc. See full list of hard forks here: https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common/src/hardforks)') .option('-n, --nodeUrl ', 'set node url (e.g: https://mainnet.infura.io/v3/your-api-key)') .option('-b, --blockNumber ', 'set block number (e.g: 123456)') - .option('-k, --killProcess ', 'enable/disable process exit with code 1 if there are failing tests.') + .option('-k, --killProcess ', 'enable/disable process exit with code 1 if there are failing tests') .argument('file_path', 'path to test file or directory') .action(async (file_path) => { const options = commander.opts(); diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 16bd565cce..23b801dde3 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -49,6 +49,7 @@ Options: -n, --nodeUrl set node url (e.g: https://mainnet.infura.io/v3/your-api-key) -b, --blockNumber set block number (e.g: 123456) + -k, --killProcess enable/disable process exit with code 1 if there are failing tests -h, --help display help for command Commands: From 04808764d204e7beb76f07a26dec212d77863059 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Mar 2023 16:14:58 +0100 Subject: [PATCH 08/60] Fix remix-libs test --- libs/remix-tests/src/run.ts | 2 +- libs/remix-tests/tests/testRunner.cli.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 50ff7ca24e..4aac98af81 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -55,7 +55,7 @@ commander .option('-f, --fork ', 'set hard fork (e.g: istanbul, berlin etc. See full list of hard forks here: https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common/src/hardforks)') .option('-n, --nodeUrl ', 'set node url (e.g: https://mainnet.infura.io/v3/your-api-key)') .option('-b, --blockNumber ', 'set block number (e.g: 123456)') - .option('-k, --killProcess ', 'enable/disable process exit with code 1 if there are failing tests') + .option('-k, --killProcess ', 'enable/disable process exit with code 1') .argument('file_path', 'path to test file or directory') .action(async (file_path) => { const options = commander.opts(); diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 23b801dde3..23b00a7b2b 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -49,7 +49,7 @@ Options: -n, --nodeUrl set node url (e.g: https://mainnet.infura.io/v3/your-api-key) -b, --blockNumber set block number (e.g: 123456) - -k, --killProcess enable/disable process exit with code 1 if there are failing tests + -k, --killProcess enable/disable process exit with code 1 -h, --help display help for command Commands: From 288fb55adf16fcabe75ebca3eed07cf4d8219b93 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Mar 2023 16:33:17 +0100 Subject: [PATCH 09/60] Shorten description for killProcess flag --- libs/remix-tests/src/run.ts | 2 +- libs/remix-tests/tests/testRunner.cli.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 4aac98af81..116da1cb28 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -55,7 +55,7 @@ commander .option('-f, --fork ', 'set hard fork (e.g: istanbul, berlin etc. See full list of hard forks here: https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/common/src/hardforks)') .option('-n, --nodeUrl ', 'set node url (e.g: https://mainnet.infura.io/v3/your-api-key)') .option('-b, --blockNumber ', 'set block number (e.g: 123456)') - .option('-k, --killProcess ', 'enable/disable process exit with code 1') + .option('-k, --killProcess ', 'kill process when tests fail') .argument('file_path', 'path to test file or directory') .action(async (file_path) => { const options = commander.opts(); diff --git a/libs/remix-tests/tests/testRunner.cli.spec.ts b/libs/remix-tests/tests/testRunner.cli.spec.ts index 23b00a7b2b..c4824c9b8b 100644 --- a/libs/remix-tests/tests/testRunner.cli.spec.ts +++ b/libs/remix-tests/tests/testRunner.cli.spec.ts @@ -49,7 +49,7 @@ Options: -n, --nodeUrl set node url (e.g: https://mainnet.infura.io/v3/your-api-key) -b, --blockNumber set block number (e.g: 123456) - -k, --killProcess enable/disable process exit with code 1 + -k, --killProcess kill process when tests fail -h, --help display help for command Commands: From d1ba8968b4ea12558170a1844aad28247b586074 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Wed, 15 Mar 2023 17:24:29 +0100 Subject: [PATCH 10/60] Disable showing tooltip --- libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx b/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx index c322d2f924..6c55ed06c8 100644 --- a/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx +++ b/libs/remix-ui/helper/src/lib/components/custom-tooltip.tsx @@ -11,12 +11,11 @@ export function CustomTooltip({ children, placement, tooltipId, tooltipClasses, + {typeof tooltipText === 'string' ? ({tooltipText}) : (tooltipText)} } delay={delay} - show={true} > {children} From ba90e9445796616fa16adfb0cc6ec1a6de1f2a02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 09:13:52 +0000 Subject: [PATCH 11/60] Bump webpack from 5.75.0 to 5.76.0 Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- yarn.lock | 113 ++++++++++++------------------------------------------ 1 file changed, 25 insertions(+), 88 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb051fa3da..f2b64adf7c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5936,16 +5936,16 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@0.0.39": - version "0.0.39" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" - integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== - -"@types/estree@^0.0.51": +"@types/estree@*", "@types/estree@^0.0.51": version "0.0.51" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/estree@0.0.39": + version "0.0.39" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" + integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== + "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": version "4.17.31" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz#a1139efeab4e7323834bb0226e62ac019f474b2f" @@ -6822,16 +6822,11 @@ acorn@^7.0.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.0.4: +acorn@^8.0.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: version "8.8.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== -acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.0: - version "8.8.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== - adm-zip@^0.4.16: version "0.4.16" resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" @@ -8865,18 +8860,7 @@ browserslist@^3.2.6: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" -browserslist@^4.0.0, browserslist@^4.16.6: - version "4.17.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.3.tgz#2844cd6eebe14d12384b0122d217550160d2d624" - integrity sha512-59IqHJV5VGdcJZ+GZ2hU5n4Kv3YiASzW6Xk5g9tf5a/MAzGeFwgGWU39fVzNIOVcgB3+Gp+kiQu0HEfTVU/3VQ== - dependencies: - caniuse-lite "^1.0.30001264" - electron-to-chromium "^1.3.857" - escalade "^3.1.1" - node-releases "^1.1.77" - picocolors "^0.2.1" - -browserslist@^4.14.5, browserslist@^4.20.3, browserslist@^4.21.3, browserslist@^4.21.4: +browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.20.3, browserslist@^4.21.3, browserslist@^4.21.4: version "4.21.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== @@ -9266,7 +9250,7 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001264, caniuse-lite@^1.0.30001407: +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001407: version "1.0.30001426" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001426.tgz" integrity sha512-n7cosrHLl8AWt0wwZw/PJZgUg3lV0gk9LMI7ikGJwhyhgsd2Nb65vKvmSexCqq/J7rbH3mFG6yZZiPR5dLPW5A== @@ -11666,11 +11650,6 @@ electron-to-chromium@^1.3.47: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.308.tgz#39e7047579867c59973eec5168d8bf440780cb7a" integrity sha512-qyTx2aDFjEni4UnRWEME9ubd2Xc9c0zerTUl/ZinvD4QPsF0S7kJTV/Es/lPCTkNX6smyYar+z/n8Cl6pFr8yQ== -electron-to-chromium@^1.3.857: - version "1.3.866" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.866.tgz#d446338f5ad6948b27a50739760e7b0b5cc5032f" - integrity sha512-iYze6TpDXWxk+sfcpUUdTs6Pv/3kG45Pnjer2DxEeFw0N08bZeNLuz97s2lMgy8yObon48o0WHY2Bkg3xuAPOA== - electron-to-chromium@^1.4.251: version "1.4.264" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.264.tgz#2f68a062c38b7a04bf57f3e6954b868672fbdcd3" @@ -11750,15 +11729,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enhanced-resolve@^5.0.0: - version "5.8.3" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" - integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" - -enhanced-resolve@^5.10.0, enhanced-resolve@^5.7.0: +enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0, enhanced-resolve@^5.7.0: version "5.10.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== @@ -12529,7 +12500,7 @@ eventemitter3@^4.0.0, eventemitter3@^4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== -events@3.2.0, events@^3.0.0: +events@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/events/-/events-3.2.0.tgz#93b87c18f8efcd4202a461aec4dfc0556b639379" integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== @@ -12539,7 +12510,7 @@ events@^2.0.0: resolved "https://registry.yarnpkg.com/events/-/events-2.1.0.tgz#2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5" integrity sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg== -events@^3.2.0: +events@^3.0.0, events@^3.2.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -14342,21 +14313,16 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.15, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@~4.1.11: +graceful-fs@~4.1.11: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= -graceful-fs@^4.2.6, graceful-fs@^4.2.9: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== - grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" @@ -18200,42 +18166,23 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.51.0, "mime-db@>= 1.43.0 < 2": - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - mime-db@1.52.0: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-db@~1.26.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.26.0.tgz#eaffcd0e4fc6935cf8134da246e2e6c35305adff" - integrity sha1-6v/NDk/Gk1z4E02iRuLmw1MFrf8= - -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.0" +"mime-db@>= 1.43.0 < 2": + version "1.51.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" + integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== -mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.16, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34, mime-types@~2.1.7: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" -mime-types@~2.1.7: - version "2.1.14" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.14.tgz#f7ef7d97583fcaf3b7d282b6f8b5679dab1e94ee" - integrity sha1-9+99l1g/yvO30oK2+LVnnaselO4= - dependencies: - mime-db "~1.26.0" - mime@1.6.0, mime@^1.4.1, mime@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" @@ -19177,11 +19124,6 @@ node-notifier@^4.2.3: shellwords "^0.1.0" which "^1.0.5" -node-releases@^1.1.77: - version "1.1.77" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" - integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== - node-releases@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" @@ -20712,11 +20654,6 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picocolors@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" - integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -26267,9 +26204,9 @@ webpack-subresource-integrity@^5.1.0: typed-assert "^1.0.8" webpack@^5.75.0: - version "5.75.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.75.0.tgz#1e440468647b2505860e94c9ff3e44d5b582c152" - integrity sha512-piaIaoVJlqMsPtX/+3KTTO6jfvrSYgauFVdt8cr9LTHKmcq/AMd4mhzsiP7ZF/PGRNPGA8336jldh9l2Kt2ogQ== + version "5.76.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.76.0.tgz#f9fb9fb8c4a7dbdcd0d56a98e56b8a942ee2692c" + integrity sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51" From 42d100aa5513b9dc05ee71d72a9147ea1f02ba9d Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 1 Mar 2023 15:11:57 +0100 Subject: [PATCH 12/60] do less set interval --- .../src/app/providers/injected-provider.tsx | 18 ++++++++ apps/remix-ide/src/blockchain/blockchain.js | 46 +++++++++++++------ .../src/blockchain/execution-context.js | 1 + .../src/blockchain/providers/injected.js | 2 +- .../src/blockchain/providers/node.js | 2 +- apps/remix-ide/src/blockchain/providers/vm.js | 45 ++++++++++-------- .../src/lib/compiler-fetch-and-compile.ts | 13 +++++- .../run-tab/src/lib/actions/deploy.ts | 1 + .../run-tab/src/lib/actions/events.ts | 29 ++++++++++-- .../remix-ui/run-tab/src/lib/actions/index.ts | 8 +--- .../run-tab/src/lib/types/blockchain.d.ts | 2 +- .../run-tab/src/lib/types/injected.d.ts | 2 +- libs/remix-ui/run-tab/src/lib/types/node.d.ts | 2 +- libs/remix-ui/run-tab/src/lib/types/vm.d.ts | 2 +- 14 files changed, 121 insertions(+), 52 deletions(-) diff --git a/apps/remix-ide/src/app/providers/injected-provider.tsx b/apps/remix-ide/src/app/providers/injected-provider.tsx index 1ca363800b..915cc2735a 100644 --- a/apps/remix-ide/src/app/providers/injected-provider.tsx +++ b/apps/remix-ide/src/app/providers/injected-provider.tsx @@ -10,6 +10,8 @@ const noInjectedProviderMsg = 'No injected provider found. Make sure your provid export class InjectedProvider extends Plugin implements IProvider { provider: any options: { [id: string] : any } = {} + listenerAccountsChanged: (accounts: Array) => void + listenerChainChanged: (chainId: number) => void constructor (profile) { super(profile) @@ -18,6 +20,22 @@ export class InjectedProvider extends Plugin implements IProvider { } } + onActivation(): void { + this.listenerAccountsChanged = (accounts: Array) => { + this.emit('accountsChanged', accounts) + } + this.listenerChainChanged = (chainId: number) => { + this.emit('chainChanged', chainId) + } + (window as any).ethereum.on('accountsChanged', this.listenerAccountsChanged); + (window as any).ethereum.on('chainChanged', this.listenerChainChanged); + } + + onDeactivation(): void { + (window as any).ethereum.removeListener('accountsChanged', this.listenerAccountsChanged) + (window as any).ethereum.removeListener('chainChanged', this.listenerChainChanged) + } + askPermission (throwIfNoInjectedProvider) { if ((typeof (window as any).ethereum) !== "undefined" && (typeof (window as any).ethereum.request) === "function") { (window as any).ethereum.request({ method: "eth_requestAccounts" }) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 0047b786f9..3018606115 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -23,7 +23,7 @@ const profile = { name: 'blockchain', displayName: 'Blockchain', description: 'Blockchain - Logic', - methods: ['getCode', 'getTransactionReceipt', 'addProvider', 'removeProvider', 'getCurrentFork', 'web3VM'], + methods: ['getCode', 'getTransactionReceipt', 'addProvider', 'removeProvider', 'getCurrentFork', 'web3VM', 'getProvider'], version: packageJson.version } @@ -48,33 +48,50 @@ export class Blockchain extends Plugin { }, _ => this.executionContext.web3(), _ => this.executionContext.currentblockGasLimit()) this.txRunner = new TxRunner(web3Runner, { runAsync: true }) - this.executionContext.event.register('contextChanged', this.resetEnvironment.bind(this)) - this.networkcallid = 0 this.networkStatus = { name: ' - ', id: ' - ' } this.setupEvents() this.setupProviders() } + _triggerEvent (name, args) { + this.event.trigger(name, args) + this.emit(name, ...args) + } + + onActivation () { + this.on('injected', 'chainChanged', () => { + this.detectNetwork((error, network) => { + this.networkStatus = { network, error } + this._triggerEvent('networkStatus', [this.networkStatus]) + }) + }) + } + + onDeactivation () { + this.off('injected', 'chainChanged') + } + setupEvents () { - this.executionContext.event.register('contextChanged', (context, silent) => { - this.event.trigger('contextChanged', [context, silent]) + this.executionContext.event.register('contextChanged', async (context) => { + await this.resetEnvironment() + this._triggerEvent('contextChanged', [context]) }) this.executionContext.event.register('addProvider', (network) => { - this.event.trigger('addProvider', [network]) + this._triggerEvent('addProvider', [network]) }) this.executionContext.event.register('removeProvider', (name) => { - this.event.trigger('removeProvider', [name]) + this._triggerEvent('removeProvider', [name]) }) setInterval(() => { this.detectNetwork((error, network) => { this.networkStatus = { network, error } - this.event.trigger('networkStatus', [this.networkStatus]) + this._triggerEvent('networkStatus', [this.networkStatus]) }) - }, 1000) + }, 30000) } getCurrentNetworkStatus () { @@ -480,12 +497,11 @@ export class Blockchain extends Plugin { // NOTE: the config is only needed because exectuionContext.init does // if config.get('settings/always-use-vm'), we can simplify this later - resetAndInit (config, transactionContextAPI) { + async resetAndInit (config, transactionContextAPI) { this.transactionContextAPI = transactionContextAPI this.executionContext.init(config) this.executionContext.stopListenOnLastBlock() this.executionContext.listenOnLastBlock() - this.resetEnvironment() } addProvider (provider) { @@ -504,8 +520,8 @@ export class Blockchain extends Plugin { }) } - resetEnvironment () { - this.getCurrentProvider().resetEnvironment() + async resetEnvironment () { + await this.getCurrentProvider().resetEnvironment() // TODO: most params here can be refactored away in txRunner const web3Runner = new TxRunnerWeb3({ config: this.config, @@ -674,7 +690,7 @@ export class Blockchain extends Plugin { if (!tx.timestamp) tx.timestamp = Date.now() const timestamp = tx.timestamp - this.event.trigger('initiatingTransaction', [timestamp, tx, payLoad]) + this._triggerEvent('initiatingTransaction', [timestamp, tx, payLoad]) try { this.txRunner.rawRun(tx, confirmationCb, continueCb, promptCb, async (error, result) => { @@ -698,7 +714,7 @@ export class Blockchain extends Plugin { } const eventName = (tx.useCall ? 'callExecuted' : 'transactionExecuted') - this.event.trigger(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad]) + this._triggerEvent(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad]) return resolve({ result, tx }) } ) diff --git a/apps/remix-ide/src/blockchain/execution-context.js b/apps/remix-ide/src/blockchain/execution-context.js index b762f91484..40dd2a9717 100644 --- a/apps/remix-ide/src/blockchain/execution-context.js +++ b/apps/remix-ide/src/blockchain/execution-context.js @@ -37,6 +37,7 @@ export class ExecutionContext { if (config.get('settings/always-use-vm')) { this.executionContext = 'vm-merge' } + this.event.trigger('contextChanged', [this.executionContext]) } getProvider () { diff --git a/apps/remix-ide/src/blockchain/providers/injected.js b/apps/remix-ide/src/blockchain/providers/injected.js index 6e994b9a00..64c5094694 100644 --- a/apps/remix-ide/src/blockchain/providers/injected.js +++ b/apps/remix-ide/src/blockchain/providers/injected.js @@ -16,7 +16,7 @@ class InjectedProvider { }) } - resetEnvironment () { + async resetEnvironment () { /* Do nothing. */ } diff --git a/apps/remix-ide/src/blockchain/providers/node.js b/apps/remix-ide/src/blockchain/providers/node.js index b5ebd6ecc0..bcc00b553f 100644 --- a/apps/remix-ide/src/blockchain/providers/node.js +++ b/apps/remix-ide/src/blockchain/providers/node.js @@ -24,7 +24,7 @@ class NodeProvider { }) } - resetEnvironment () { + async resetEnvironment () { /* Do nothing. */ } diff --git a/apps/remix-ide/src/blockchain/providers/vm.js b/apps/remix-ide/src/blockchain/providers/vm.js index a4a600bbf8..527bdf1fbc 100644 --- a/apps/remix-ide/src/blockchain/providers/vm.js +++ b/apps/remix-ide/src/blockchain/providers/vm.js @@ -18,7 +18,7 @@ class VMProvider { }) } - resetEnvironment () { + async resetEnvironment () { if (this.worker) this.worker.terminate() this.accounts = {} this.worker = new Worker(new URL('./worker-vm', import.meta.url)) @@ -26,28 +26,33 @@ class VMProvider { let incr = 0 const stamps = {} - this.worker.addEventListener('message', (msg) => { - if (msg.data.cmd === 'sendAsyncResult' && stamps[msg.data.stamp]) { - stamps[msg.data.stamp](msg.data.error, msg.data.result) - } else if (msg.data.cmd === 'initiateResult') { - if (!msg.data.error) { - this.provider = { - sendAsync: (query, callback) => { - const stamp = Date.now() + incr - incr++ - stamps[stamp] = callback - this.worker.postMessage({ cmd: 'sendAsync', query, stamp }) + + return new Promise((resolve, reject) => { + this.worker.addEventListener('message', (msg) => { + if (msg.data.cmd === 'sendAsyncResult' && stamps[msg.data.stamp]) { + stamps[msg.data.stamp](msg.data.error, msg.data.result) + } else if (msg.data.cmd === 'initiateResult') { + if (!msg.data.error) { + this.provider = { + sendAsync: (query, callback) => { + const stamp = Date.now() + incr + incr++ + stamps[stamp] = callback + this.worker.postMessage({ cmd: 'sendAsync', query, stamp }) + } } + this.web3 = new Web3(this.provider) + extend(this.web3) + this.accounts = {} + this.executionContext.setWeb3(this.executionContext.getProvider(), this.web3) + resolve({}) + } else { + reject(new Error(msg.data.error)) } - this.web3 = new Web3(this.provider) - extend(this.web3) - this.accounts = {} - this.executionContext.setWeb3(this.executionContext.getProvider(), this.web3) } - } - }) - - this.worker.postMessage({ cmd: 'init', fork: this.executionContext.getCurrentFork(), nodeUrl: provider?.options['nodeUrl'], blockNumber: provider?.options['blockNumber']}) + }) + this.worker.postMessage({ cmd: 'init', fork: this.executionContext.getCurrentFork(), nodeUrl: provider?.options['nodeUrl'], blockNumber: provider?.options['blockNumber']}) + }) } // TODO: is still here because of the plugin API diff --git a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts index 810faadd2c..3030321f93 100644 --- a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts +++ b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts @@ -134,7 +134,18 @@ export class FetchAndCompile extends Plugin { if (!data) { setTimeout(_ => this.emit('notFound', contractAddress), 0) this.unresolvedAddresses.push(contractAddress) - return localCompilation() + const compilation = await localCompilation() + if (compilation) { + let found = false + compilation.visitContracts((contract) => { + found = util.compareByteCode(codeAtAddress, '0x' + contract.object.evm.deployedBytecode.object) + return found + }) + if (found) { + await this.call('compilerArtefacts', 'addResolvedContract', contractAddress, compilation) + return compilation + } + } } const { settings, compilationTargets } = data diff --git a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts index 7b6a4807f9..9a02243b01 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts @@ -322,6 +322,7 @@ export const updateInstanceBalance = (plugin: RunTab) => { if (plugin.REACT_API?.instances?.instanceList?.length) { for (const instance of plugin.REACT_API.instances.instanceList) { plugin.blockchain.getBalanceInEther(instance.address, (err, balInEth) => { + console.log('balance of ',instance.address, balInEth) if (!err) instance.balance = balInEth }) } diff --git a/libs/remix-ui/run-tab/src/lib/actions/events.ts b/libs/remix-ui/run-tab/src/lib/actions/events.ts index ed686bb887..ef32a08871 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/events.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/events.ts @@ -1,13 +1,15 @@ import { envChangeNotification } from "@remix-ui/helper" import { RunTab } from "../types/run-tab" -import { setExecutionContext, setFinalContext, updateAccountBalances } from "./account" +import { setExecutionContext, setFinalContext, updateAccountBalances, fillAccountsList } from "./account" import { addExternalProvider, addInstance, addNewProxyDeployment, removeExternalProvider, setNetworkNameFromProvider } from "./actions" -import { addDeployOption, clearAllInstances, clearRecorderCount, fetchContractListSuccess, resetProxyDeployments, resetUdapp, setCurrentContract, setCurrentFile, setLoadType, setRecorderCount, setRemixDActivated, setSendValue } from "./payload" +import { addDeployOption, clearAllInstances, clearRecorderCount, fetchContractListSuccess, resetProxyDeployments, resetUdapp, setCurrentContract, setCurrentFile, setLoadType, setRecorderCount, setRemixDActivated, setSendValue, fetchAccountsListSuccess } from "./payload" +import { updateInstanceBalance } from './deploy' import { CompilerAbstract } from '@remix-project/remix-solidity' import BN from 'bn.js' import Web3 from 'web3' import { Plugin } from "@remixproject/engine" import { getNetworkProxyAddresses } from "./deploy" +import { shortenAddress } from "@remix-ui/helper" const _paq = window._paq = window._paq || [] @@ -22,7 +24,7 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { updateAccountBalances(plugin, dispatch) }) - plugin.blockchain.event.register('contextChanged', (context, silent) => { + plugin.blockchain.event.register('contextChanged', (context) => { dispatch(resetProxyDeployments()) if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch) setFinalContext(plugin, dispatch) @@ -117,6 +119,25 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { plugin.event.register('cleared', () => { dispatch(clearRecorderCount()) }) + + plugin.on('injected', 'accountsChanged', (accounts: Array) => { + const accountsMap = {} + accounts.map(account => { accountsMap[account] = shortenAddress(account, '0')}) + dispatch(fetchAccountsListSuccess(accountsMap)) + }) + + plugin.on('blockchain', 'contextChanged', () => { + fillAccountsList(plugin, dispatch) + }) + + plugin.on('blockchain', 'transactionExecuted', () => { + updateInstanceBalance(plugin) + }) + + setInterval(() => { + fillAccountsList(plugin, dispatch) + updateInstanceBalance(plugin) + }, 30000) } const broadcastCompilationResult = async (compilerName: string, plugin: RunTab, dispatch: React.Dispatch, file, source, languageVersion, data, input?) => { @@ -159,7 +180,7 @@ const getCompiledContracts = (compiler) => { return contracts } -export const resetAndInit = (plugin: RunTab) => { +export const resetAndInit = async (plugin: RunTab) => { plugin.blockchain.resetAndInit(plugin.config, { getAddress: (cb) => { cb(null, plugin.REACT_API.accounts.selectedAccount) diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index 6b6447c566..d13c9d0bfd 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -2,7 +2,7 @@ import React from 'react' import { RunTab } from '../types/run-tab' import { resetAndInit, setupEvents } from './events' -import { createNewBlockchainAccount, fillAccountsList, setExecutionContext, signMessageWithAddress } from './account' +import { createNewBlockchainAccount, setExecutionContext, signMessageWithAddress } from './account' import { clearInstances, clearPopUp, removeInstance, setAccount, setGasFee, setMatchPassphrasePrompt, setNetworkNameFromProvider, setPassphrasePrompt, setSelectedContract, setSendTransactionValue, setUnit, updateBaseFeePerGas, updateConfirmSettings, updateGasPrice, updateGasPriceStatus, updateMaxFee, updateMaxPriorityFee, updateScenarioPath } from './actions' @@ -25,12 +25,8 @@ let plugin: RunTab, dispatch: React.Dispatch export const initRunTab = (udapp: RunTab) => async (reducerDispatch: React.Dispatch) => { plugin = udapp dispatch = reducerDispatch + setupEvents(plugin, dispatch) resetAndInit(plugin) - setupEvents(plugin, dispatch) - setInterval(() => { - fillAccountsList(plugin, dispatch) - updateInstanceBalance(plugin) - }, 1000) } export const setAccountAddress = (account: string) => setAccount(dispatch, account) diff --git a/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts b/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts index 0575d3988c..03b4560514 100644 --- a/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts @@ -60,7 +60,7 @@ export class Blockchain extends Plugin { removeProvider(name: any): void; /** Listen on New Transaction. (Cannot be done inside constructor because txlistener doesn't exist yet) */ startListening(txlistener: any): void; - resetEnvironment(): void; + resetEnvironment(): Promise; /** * Create a VM Account * @param {{privateKey: string, balance: string}} newAccount The new account to create diff --git a/libs/remix-ui/run-tab/src/lib/types/injected.d.ts b/libs/remix-ui/run-tab/src/lib/types/injected.d.ts index c12ab88933..2cc804c792 100644 --- a/libs/remix-ui/run-tab/src/lib/types/injected.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/injected.d.ts @@ -4,7 +4,7 @@ declare class InjectedProvider { executionContext: any; getAccounts(cb: any): any; newAccount(passwordPromptCb: any, cb: any): void; - resetEnvironment(): void; + resetEnvironment(): Promise; getBalanceInEther(address: any, cb: any): void; getGasPrice(cb: any): void; signMessage(message: any, account: any, _passphrase: any, cb: any): void; diff --git a/libs/remix-ui/run-tab/src/lib/types/node.d.ts b/libs/remix-ui/run-tab/src/lib/types/node.d.ts index 8979746943..726a4347eb 100644 --- a/libs/remix-ui/run-tab/src/lib/types/node.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/node.d.ts @@ -5,7 +5,7 @@ declare class NodeProvider { config: any; getAccounts(cb: any): any; newAccount(passwordPromptCb: any, cb: any): any; - resetEnvironment(): void; + resetEnvironment(): Promise; getBalanceInEther(address: any, cb: any): void; getGasPrice(cb: any): void; signMessage(message: any, account: any, passphrase: any, cb: any): void; diff --git a/libs/remix-ui/run-tab/src/lib/types/vm.d.ts b/libs/remix-ui/run-tab/src/lib/types/vm.d.ts index 95fe2ea803..1f8034d417 100644 --- a/libs/remix-ui/run-tab/src/lib/types/vm.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/vm.d.ts @@ -3,7 +3,7 @@ declare class VMProvider { constructor(executionContext: any); executionContext: any; getAccounts(cb: any): void; - resetEnvironment(): void; + resetEnvironment(): Promise; accounts: any; RemixSimulatorProvider: any; web3: any; From cb320747fb4e1cfd6cee24824002e7e622cb7db8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Mar 2023 12:10:23 +0100 Subject: [PATCH 13/60] update notify watcher --- apps/debugger/webpack.config.js | 4 ++++ apps/etherscan/webpack.config.js | 4 ++++ apps/remix-ide-e2e/src/local-plugin/webpack.config.js | 4 ++++ apps/remix-ide/webpack.config.js | 4 ++++ apps/solidity-compiler/webpack.config.js | 4 ++++ apps/vyper/webpack.config.js | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/apps/debugger/webpack.config.js b/apps/debugger/webpack.config.js index fa6f5e3b06..9feb0dc08d 100644 --- a/apps/debugger/webpack.config.js +++ b/apps/debugger/webpack.config.js @@ -79,5 +79,9 @@ module.exports = composePlugins(withNx(), (config) => { new CssMinimizerPlugin(), ]; + config.watchOptions = { + ignored: /node_modules/ + } + return config; }); diff --git a/apps/etherscan/webpack.config.js b/apps/etherscan/webpack.config.js index 45c7c5dd14..9d72c43a6c 100644 --- a/apps/etherscan/webpack.config.js +++ b/apps/etherscan/webpack.config.js @@ -78,5 +78,9 @@ module.exports = composePlugins(withNx(), (config) => { new CssMinimizerPlugin(), ]; + config.watchOptions = { + ignored: /node_modules/ + } + return config; }); diff --git a/apps/remix-ide-e2e/src/local-plugin/webpack.config.js b/apps/remix-ide-e2e/src/local-plugin/webpack.config.js index a98229d072..25932a1054 100644 --- a/apps/remix-ide-e2e/src/local-plugin/webpack.config.js +++ b/apps/remix-ide-e2e/src/local-plugin/webpack.config.js @@ -17,5 +17,9 @@ module.exports = composePlugins(withNx(), (config) => { config.ignoreWarnings = [/Failed to parse source map/] // ignore source-map-loader warnings + config.watchOptions = { + ignored: /node_modules/ + } + return config; }); diff --git a/apps/remix-ide/webpack.config.js b/apps/remix-ide/webpack.config.js index 8b08e62145..347f12371e 100644 --- a/apps/remix-ide/webpack.config.js +++ b/apps/remix-ide/webpack.config.js @@ -96,5 +96,9 @@ module.exports = composePlugins(withNx(), withReact(), (config) => { new CssMinimizerPlugin(), ]; + config.watchOptions = { + ignored: /node_modules/ + } + return config; }); diff --git a/apps/solidity-compiler/webpack.config.js b/apps/solidity-compiler/webpack.config.js index ad6144a8dc..e19684ca91 100644 --- a/apps/solidity-compiler/webpack.config.js +++ b/apps/solidity-compiler/webpack.config.js @@ -89,5 +89,9 @@ module.exports = composePlugins(withNx(), withReact(), (config) => { new CssMinimizerPlugin(), ]; + config.watchOptions = { + ignored: /node_modules/ + } + return config; }); diff --git a/apps/vyper/webpack.config.js b/apps/vyper/webpack.config.js index fa6f5e3b06..9feb0dc08d 100644 --- a/apps/vyper/webpack.config.js +++ b/apps/vyper/webpack.config.js @@ -79,5 +79,9 @@ module.exports = composePlugins(withNx(), (config) => { new CssMinimizerPlugin(), ]; + config.watchOptions = { + ignored: /node_modules/ + } + return config; }); From bfc1ee1b9ab87aa450e354e64c103fed403650f8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Mar 2023 12:12:28 +0100 Subject: [PATCH 14/60] use await for getBalance() --- apps/remix-ide/src/blockchain/blockchain.js | 4 +-- .../src/blockchain/providers/injected.js | 10 ++----- .../src/blockchain/providers/node.js | 10 ++----- apps/remix-ide/src/blockchain/providers/vm.js | 10 ++----- .../run-tab/src/lib/actions/account.ts | 30 +++++++------------ .../run-tab/src/lib/actions/deploy.ts | 16 +++++----- .../run-tab/src/lib/types/blockchain.d.ts | 2 +- .../run-tab/src/lib/types/injected.d.ts | 2 +- libs/remix-ui/run-tab/src/lib/types/node.d.ts | 2 +- libs/remix-ui/run-tab/src/lib/types/vm.d.ts | 2 +- 10 files changed, 33 insertions(+), 55 deletions(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 3018606115..d5f747d342 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -567,8 +567,8 @@ export class Blockchain extends Plugin { } /** Get the balance of an address, and convert wei to ether */ - getBalanceInEther (address, cb) { - this.getCurrentProvider().getBalanceInEther(address, cb) + getBalanceInEther (address) { + return this.getCurrentProvider().getBalanceInEther(address) } pendingTransactionsCount () { diff --git a/apps/remix-ide/src/blockchain/providers/injected.js b/apps/remix-ide/src/blockchain/providers/injected.js index 64c5094694..dbfc53f9de 100644 --- a/apps/remix-ide/src/blockchain/providers/injected.js +++ b/apps/remix-ide/src/blockchain/providers/injected.js @@ -20,13 +20,9 @@ class InjectedProvider { /* Do nothing. */ } - getBalanceInEther (address, cb) { - this.executionContext.web3().eth.getBalance(address, (err, res) => { - if (err) { - return cb(err) - } - cb(null, Web3.utils.fromWei(res.toString(10), 'ether')) - }) + async getBalanceInEther (address) { + const balance = await this.executionContext.web3().eth.getBalance(address) + return Web3.utils.fromWei(balance.toString(10), 'ether') } getGasPrice (cb) { diff --git a/apps/remix-ide/src/blockchain/providers/node.js b/apps/remix-ide/src/blockchain/providers/node.js index bcc00b553f..14350a45f7 100644 --- a/apps/remix-ide/src/blockchain/providers/node.js +++ b/apps/remix-ide/src/blockchain/providers/node.js @@ -28,13 +28,9 @@ class NodeProvider { /* Do nothing. */ } - getBalanceInEther (address, cb) { - this.executionContext.web3().eth.getBalance(address, (err, res) => { - if (err) { - return cb(err) - } - cb(null, Web3.utils.fromWei(res.toString(10), 'ether')) - }) + async getBalanceInEther (address) { + const balance = await this.executionContext.web3().eth.getBalance(address) + return Web3.utils.fromWei(balance.toString(10), 'ether') } getGasPrice (cb) { diff --git a/apps/remix-ide/src/blockchain/providers/vm.js b/apps/remix-ide/src/blockchain/providers/vm.js index 527bdf1fbc..f12d44c7b9 100644 --- a/apps/remix-ide/src/blockchain/providers/vm.js +++ b/apps/remix-ide/src/blockchain/providers/vm.js @@ -68,13 +68,9 @@ class VMProvider { this.RemixSimulatorProvider.Accounts.newAccount(cb) } - getBalanceInEther (address, cb) { - this.web3.eth.getBalance(address, (err, res) => { - if (err) { - return cb(err) - } - cb(null, Web3.utils.fromWei(new BN(res).toString(10), 'ether')) - }) + async getBalanceInEther (address) { + const balance = await this.web3.eth.getBalance(address) + return Web3.utils.fromWei(new BN(balance).toString(10), 'ether') } getGasPrice (cb) { diff --git a/libs/remix-ui/run-tab/src/lib/actions/account.ts b/libs/remix-ui/run-tab/src/lib/actions/account.ts index 461f928d43..c5c3046078 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/account.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/account.ts @@ -3,17 +3,14 @@ import { RunTab } from "../types/run-tab" import { clearInstances, setAccount, setExecEnv } from "./actions" import { displayNotification, displayPopUp, fetchAccountsListFailed, fetchAccountsListRequest, fetchAccountsListSuccess, setExternalEndpoint, setMatchPassphrase, setPassphrase } from "./payload" -export const updateAccountBalances = (plugin: RunTab, dispatch: React.Dispatch) => { +export const updateAccountBalances = async (plugin: RunTab, dispatch: React.Dispatch) => { const accounts = plugin.REACT_API.accounts.loadedAccounts - Object.keys(accounts).map((value) => { - plugin.blockchain.getBalanceInEther(value, (err, balance) => { - if (err) return - const updated = shortenAddress(value, balance) - - accounts[value] = updated - }) - }) + for (const account of Object.keys(accounts)) { + const balance = await plugin.blockchain.getBalanceInEther(account) + const updated = shortenAddress(account, balance) + accounts[account] = updated + } dispatch(fetchAccountsListSuccess(accounts)) } @@ -31,17 +28,10 @@ export const fillAccountsList = async (plugin: RunTab, dispatch: React.Dispatch< // - all the promises resolve // - at least one reject // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all - await (Promise as any).all(accounts.map((account) => { - return new Promise((resolve, reject) => { - plugin.blockchain.getBalanceInEther(account, (err, balance) => { - if (err) return reject(err) - const updated = shortenAddress(account, balance) - - loadedAccounts[account] = updated - resolve(account) - }) - }) - })) + for (const account of accounts) { + const balance = await plugin.blockchain.getBalanceInEther(account) + loadedAccounts[account] = shortenAddress(account, balance) + } const provider = plugin.blockchain.getProvider() if (provider === 'injected') { diff --git a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts index 9a02243b01..d2efbe71c1 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/deploy.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/deploy.ts @@ -6,7 +6,7 @@ import { SolcInput, SolcOutput } from "@openzeppelin/upgrades-core" // Used direct path to UpgradeableContract class to fix cyclic dependency error from @openzeppelin/upgrades-core library import { UpgradeableContract } from '../../../../../../node_modules/@openzeppelin/upgrades-core/dist/standalone' import { DeployMode, MainnetPrompt } from "../types" -import { displayNotification, displayPopUp, fetchProxyDeploymentsSuccess, setDecodedResponse } from "./payload" +import { displayNotification, displayPopUp, fetchProxyDeploymentsSuccess, setDecodedResponse, updateInstancesBalance } from "./payload" import { addInstance } from "./actions" import { addressToString, logBuilder } from "@remix-ui/helper" import Web3 from "web3" @@ -318,15 +318,15 @@ export const getFuncABIInputs = (plugin: RunTab, funcABI: FuncABI) => { return plugin.blockchain.getInputs(funcABI) } -export const updateInstanceBalance = (plugin: RunTab) => { +export const updateInstanceBalance = async (plugin: RunTab, dispatch: React.Dispatch) => { if (plugin.REACT_API?.instances?.instanceList?.length) { - for (const instance of plugin.REACT_API.instances.instanceList) { - plugin.blockchain.getBalanceInEther(instance.address, (err, balInEth) => { - console.log('balance of ',instance.address, balInEth) - if (!err) instance.balance = balInEth - }) + const instances = plugin.REACT_API?.instances?.instanceList + for (const instance of instances) { + const balInEth = await plugin.blockchain.getBalanceInEther(instance.address) + instance.balance = balInEth } - } + dispatch(updateInstanceBalance(instances, dispatch)) + } } export const isValidContractAddress = async (plugin: RunTab, address: string) => { diff --git a/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts b/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts index 03b4560514..137ff0e92c 100644 --- a/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts @@ -71,7 +71,7 @@ export class Blockchain extends Plugin { }): any; newAccount(_password: any, passwordPromptCb: any, cb: any): any; /** Get the balance of an address, and convert wei to ether */ - getBalanceInEther(address: any, cb: any): void; + getBalanceInEther(address: any): Promise; pendingTransactionsCount(): number; /** * This function send a tx only to Remix VM or testnet, will return an error for the mainnet diff --git a/libs/remix-ui/run-tab/src/lib/types/injected.d.ts b/libs/remix-ui/run-tab/src/lib/types/injected.d.ts index 2cc804c792..085faca4c5 100644 --- a/libs/remix-ui/run-tab/src/lib/types/injected.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/injected.d.ts @@ -5,7 +5,7 @@ declare class InjectedProvider { getAccounts(cb: any): any; newAccount(passwordPromptCb: any, cb: any): void; resetEnvironment(): Promise; - getBalanceInEther(address: any, cb: any): void; + getBalanceInEther(address: any): Promise; getGasPrice(cb: any): void; signMessage(message: any, account: any, _passphrase: any, cb: any): void; getProvider(): string; diff --git a/libs/remix-ui/run-tab/src/lib/types/node.d.ts b/libs/remix-ui/run-tab/src/lib/types/node.d.ts index 726a4347eb..365c95a2cb 100644 --- a/libs/remix-ui/run-tab/src/lib/types/node.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/node.d.ts @@ -6,7 +6,7 @@ declare class NodeProvider { getAccounts(cb: any): any; newAccount(passwordPromptCb: any, cb: any): any; resetEnvironment(): Promise; - getBalanceInEther(address: any, cb: any): void; + getBalanceInEther(address: any): Promise; getGasPrice(cb: any): void; signMessage(message: any, account: any, passphrase: any, cb: any): void; getProvider(): any; diff --git a/libs/remix-ui/run-tab/src/lib/types/vm.d.ts b/libs/remix-ui/run-tab/src/lib/types/vm.d.ts index 1f8034d417..5b94d5315d 100644 --- a/libs/remix-ui/run-tab/src/lib/types/vm.d.ts +++ b/libs/remix-ui/run-tab/src/lib/types/vm.d.ts @@ -9,7 +9,7 @@ declare class VMProvider { web3: any; createVMAccount(newAccount: any): string; newAccount(_passwordPromptCb: any, cb: any): void; - getBalanceInEther(address: any, cb: any): void; + getBalanceInEther(address: any): Promise; getGasPrice(cb: any): void; signMessage(message: any, account: any, _passphrase: any, cb: any): void; getProvider(): string; From 3d2955149205310e0a1651df016faa2a892b7636 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 6 Mar 2023 12:13:27 +0100 Subject: [PATCH 15/60] updateInstanceBalance use dispatch --- libs/remix-ui/run-tab/src/lib/actions/events.ts | 10 ++++------ libs/remix-ui/run-tab/src/lib/actions/payload.ts | 9 ++++++++- libs/remix-ui/run-tab/src/lib/constants/index.ts | 1 + libs/remix-ui/run-tab/src/lib/reducers/runTab.ts | 14 +++++++++++++- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/events.ts b/libs/remix-ui/run-tab/src/lib/actions/events.ts index ef32a08871..52727a5d7e 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/events.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/events.ts @@ -22,6 +22,7 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { if (!lookupOnly) dispatch(setSendValue('0')) if (error) return updateAccountBalances(plugin, dispatch) + updateInstanceBalance(plugin, dispatch) }) plugin.blockchain.event.register('contextChanged', (context) => { @@ -127,16 +128,13 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { }) plugin.on('blockchain', 'contextChanged', () => { - fillAccountsList(plugin, dispatch) - }) - - plugin.on('blockchain', 'transactionExecuted', () => { - updateInstanceBalance(plugin) + fillAccountsList(plugin, dispatch) + updateAccountBalances(plugin, dispatch) }) setInterval(() => { fillAccountsList(plugin, dispatch) - updateInstanceBalance(plugin) + updateInstanceBalance(plugin, dispatch) }, 30000) } diff --git a/libs/remix-ui/run-tab/src/lib/actions/payload.ts b/libs/remix-ui/run-tab/src/lib/actions/payload.ts index 98189d529a..c8bee7af2e 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/payload.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/payload.ts @@ -1,5 +1,5 @@ import { ContractData } from '@remix-project/core-plugin' -import { ADD_DEPLOY_OPTION, ADD_INSTANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_DEPLOY_OPTION, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE, SET_REMIXD_ACTIVATED, FETCH_PROXY_DEPLOYMENTS, NEW_PROXY_DEPLOYMENT, RESET_PROXY_DEPLOYMENTS } from '../constants' +import { ADD_DEPLOY_OPTION, ADD_INSTANCE, UPDATE_INSTANCES_BALANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_DEPLOY_OPTION, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE, SET_REMIXD_ACTIVATED, FETCH_PROXY_DEPLOYMENTS, NEW_PROXY_DEPLOYMENT, RESET_PROXY_DEPLOYMENTS } from '../constants' import { ContractList, DeployOptions } from '../types' export const fetchAccountsListRequest = () => { @@ -216,6 +216,13 @@ export const setGasPrice = (price: string) => { } } +export const updateInstancesBalance = (instances: Array<{ contractData?: ContractData, address: string, name: string, abi?: any }>) => { + return { + type: UPDATE_INSTANCES_BALANCE, + payload: instances + } +} + export const addNewInstance = (instance: { contractData?: ContractData, address: string, name: string, abi?: any }) => { return { type: ADD_INSTANCE, diff --git a/libs/remix-ui/run-tab/src/lib/constants/index.ts b/libs/remix-ui/run-tab/src/lib/constants/index.ts index dbd04e9e27..016bad8856 100644 --- a/libs/remix-ui/run-tab/src/lib/constants/index.ts +++ b/libs/remix-ui/run-tab/src/lib/constants/index.ts @@ -33,6 +33,7 @@ export const SET_MAX_PRIORITY_FEE = 'SET_MAX_PRIORITY_FEE' export const SET_BASE_FEE_PER_GAS = 'SET_BASE_FEE_PER_GAS' export const SET_GAS_PRICE = 'SET_GAS_PRICE' export const ADD_INSTANCE = 'ADD_INSTANCE' +export const UPDATE_INSTANCES_BALANCE = 'UPDATE_INSTANCES_BALANCE' export const REMOVE_INSTANCE = 'REMOVE_INSTANCE' export const CLEAR_INSTANCES = 'CLEAR_INSTANCES' export const SET_DECODED_RESPONSE = 'SET_DECODED_RESPONSE' diff --git a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts index 0495fc479e..3e9614af3f 100644 --- a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts +++ b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts @@ -1,6 +1,6 @@ import { ContractData } from '@remix-project/core-plugin' import { ContractList, DeployOptions, RunTabState } from '../types' -import { ADD_INSTANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, FETCH_PROVIDER_LIST_FAILED, FETCH_PROVIDER_LIST_REQUEST, FETCH_PROVIDER_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE, ADD_DEPLOY_OPTION, REMOVE_DEPLOY_OPTION, SET_REMIXD_ACTIVATED, FETCH_PROXY_DEPLOYMENTS, NEW_PROXY_DEPLOYMENT, RESET_PROXY_DEPLOYMENTS } from '../constants' +import { ADD_INSTANCE, UPDATE_INSTANCES_BALANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, FETCH_PROVIDER_LIST_FAILED, FETCH_PROVIDER_LIST_REQUEST, FETCH_PROVIDER_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE, ADD_DEPLOY_OPTION, REMOVE_DEPLOY_OPTION, SET_REMIXD_ACTIVATED, FETCH_PROXY_DEPLOYMENTS, NEW_PROXY_DEPLOYMENT, RESET_PROXY_DEPLOYMENTS } from '../constants' declare const window: any interface Action { @@ -487,6 +487,18 @@ export const runTabReducer = (state: RunTabState = runTabInitialState, action: A } } + case UPDATE_INSTANCES_BALANCE: { + const payload: Array<{ contractData: ContractData, address: string, balance: number, name: string, abi?: any, decodedResponse?: Record }> = action.payload + + return { + ...state, + instances: { + ...state.instances, + instanceList: payload + } + } + } + case REMOVE_INSTANCE: { const payload: number = action.payload From f7754fd3b4c0e65c83041df479ee7c866a012d0c Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 7 Mar 2023 11:17:01 +0100 Subject: [PATCH 16/60] fix event listening --- libs/remix-ui/run-tab/src/lib/actions/events.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/events.ts b/libs/remix-ui/run-tab/src/lib/actions/events.ts index 52727a5d7e..e53ba8e406 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/events.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/events.ts @@ -29,6 +29,8 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { dispatch(resetProxyDeployments()) if (!context.startsWith('vm')) getNetworkProxyAddresses(plugin, dispatch) setFinalContext(plugin, dispatch) + fillAccountsList(plugin, dispatch) + updateAccountBalances(plugin, dispatch) }) plugin.blockchain.event.register('networkStatus', ({ error, network }) => { @@ -127,11 +129,6 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch) => { dispatch(fetchAccountsListSuccess(accountsMap)) }) - plugin.on('blockchain', 'contextChanged', () => { - fillAccountsList(plugin, dispatch) - updateAccountBalances(plugin, dispatch) - }) - setInterval(() => { fillAccountsList(plugin, dispatch) updateInstanceBalance(plugin, dispatch) From cead3754e0dff7f2deff000cfd06b16cc107a0e5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 7 Mar 2023 11:53:15 +0100 Subject: [PATCH 17/60] fix networkStatus --- apps/remix-ide/src/blockchain/blockchain.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index d5f747d342..6e72f39b2c 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -49,7 +49,7 @@ export class Blockchain extends Plugin { this.txRunner = new TxRunner(web3Runner, { runAsync: true }) this.networkcallid = 0 - this.networkStatus = { name: ' - ', id: ' - ' } + this.networkStatus = { network: { name: ' - ', id: ' - ' } } this.setupEvents() this.setupProviders() } @@ -76,6 +76,10 @@ export class Blockchain extends Plugin { this.executionContext.event.register('contextChanged', async (context) => { await this.resetEnvironment() this._triggerEvent('contextChanged', [context]) + this.detectNetwork((error, network) => { + this.networkStatus = { network, error } + this._triggerEvent('networkStatus', [this.networkStatus]) + }) }) this.executionContext.event.register('addProvider', (network) => { From 9e7566a2e75e591f656e1216d6a7337c729291e4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Mar 2023 15:18:40 +0100 Subject: [PATCH 18/60] move the declaration --- .../src/app/providers/injected-provider.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/providers/injected-provider.tsx b/apps/remix-ide/src/app/providers/injected-provider.tsx index 915cc2735a..3c8a5a0ddb 100644 --- a/apps/remix-ide/src/app/providers/injected-provider.tsx +++ b/apps/remix-ide/src/app/providers/injected-provider.tsx @@ -15,18 +15,18 @@ export class InjectedProvider extends Plugin implements IProvider { constructor (profile) { super(profile) - if ((window as any).ethereum) { - this.provider = new Web3((window as any).ethereum) - } - } - - onActivation(): void { this.listenerAccountsChanged = (accounts: Array) => { this.emit('accountsChanged', accounts) } this.listenerChainChanged = (chainId: number) => { this.emit('chainChanged', chainId) } + if ((window as any).ethereum) { + this.provider = new Web3((window as any).ethereum) + } + } + + onActivation(): void { (window as any).ethereum.on('accountsChanged', this.listenerAccountsChanged); (window as any).ethereum.on('chainChanged', this.listenerChainChanged); } From 590ee083a24183b3b0dee1a6fa892b0b99373f0e Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Mar 2023 15:18:51 +0100 Subject: [PATCH 19/60] update function interface --- libs/remix-ui/run-tab/src/lib/actions/events.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/events.ts b/libs/remix-ui/run-tab/src/lib/actions/events.ts index e53ba8e406..46876b28e3 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/events.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/events.ts @@ -175,7 +175,7 @@ const getCompiledContracts = (compiler) => { return contracts } -export const resetAndInit = async (plugin: RunTab) => { +export const resetAndInit = (plugin: RunTab) => { plugin.blockchain.resetAndInit(plugin.config, { getAddress: (cb) => { cb(null, plugin.REACT_API.accounts.selectedAccount) From 0b2c032c6c617d545971d9b955eacc9938de8a1c Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Mar 2023 17:00:05 +0100 Subject: [PATCH 20/60] add loading icon --- libs/remix-ui/run-tab/src/lib/components/account.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/remix-ui/run-tab/src/lib/components/account.tsx b/libs/remix-ui/run-tab/src/lib/components/account.tsx index 7bb5df6380..9018357c68 100644 --- a/libs/remix-ui/run-tab/src/lib/components/account.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/account.tsx @@ -154,6 +154,9 @@ export function AccountUI (props: AccountProps) { + + +
{ props.setAccount(e.target.value) }}> From 60a00c5076a15be8a041cb3b92bc3c4a1e2ffa4f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Mar 2023 10:41:02 +0100 Subject: [PATCH 22/60] update default value --- libs/remix-ui/settings/src/lib/remix-ui-settings.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index f08d6279c7..c1a9170833 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -45,13 +45,13 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { if (javascriptVM === null || javascriptVM === undefined) ethereumVM(props.config, true, dispatch) const useAutoComplete = props.config.get('settings/auto-completion') - if (useAutoComplete === null || useAutoComplete === undefined) useAutoCompletion(props.config, false, dispatch) + if (useAutoComplete === null || useAutoComplete === undefined) useAutoCompletion(props.config, true, dispatch) const displayErrors = props.config.get('settings/display-errors') - if (displayErrors === null || displayErrors === undefined) useDisplayErrors(props.config, false, dispatch) + if (displayErrors === null || displayErrors === undefined) useDisplayErrors(props.config, true, dispatch) const useShowGas = props.config.get('settings/show-gas') - if (useShowGas === null || useShowGas === undefined) useShowGasInEditor(props.config, false, dispatch) + if (useShowGas === null || useShowGas === undefined) useShowGasInEditor(props.config, true, dispatch) } useEffect(() => initValue(), [resetState, props.config]) useEffect(() => initValue(), []) From 037b4be54628888f3c4d21bfc1f88a39cd49c1b2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 16 Mar 2023 10:42:38 +0100 Subject: [PATCH 23/60] remove ethereumjsvm at starts --- apps/remix-ide/src/blockchain/blockchain.js | 1 - apps/remix-ide/src/blockchain/execution-context.js | 3 --- libs/remix-ui/settings/src/lib/remix-ui-settings.tsx | 10 ---------- libs/remix-ui/settings/src/lib/settingsAction.ts | 5 ----- 4 files changed, 19 deletions(-) diff --git a/apps/remix-ide/src/blockchain/blockchain.js b/apps/remix-ide/src/blockchain/blockchain.js index 6e72f39b2c..2c51182370 100644 --- a/apps/remix-ide/src/blockchain/blockchain.js +++ b/apps/remix-ide/src/blockchain/blockchain.js @@ -500,7 +500,6 @@ export class Blockchain extends Plugin { } // NOTE: the config is only needed because exectuionContext.init does - // if config.get('settings/always-use-vm'), we can simplify this later async resetAndInit (config, transactionContextAPI) { this.transactionContextAPI = transactionContextAPI this.executionContext.init(config) diff --git a/apps/remix-ide/src/blockchain/execution-context.js b/apps/remix-ide/src/blockchain/execution-context.js index 40dd2a9717..df702702c7 100644 --- a/apps/remix-ide/src/blockchain/execution-context.js +++ b/apps/remix-ide/src/blockchain/execution-context.js @@ -34,9 +34,6 @@ export class ExecutionContext { } init (config) { - if (config.get('settings/always-use-vm')) { - this.executionContext = 'vm-merge' - } this.event.trigger('contextChanged', [this.executionContext]) } diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index c1a9170833..baba5a24c6 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -41,9 +41,6 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { const metadataConfig = props.config.get('settings/generate-contract-metadata') if (metadataConfig === undefined || metadataConfig === null) generateContractMetadat(props.config, true, dispatch) - const javascriptVM = props.config.get('settings/always-use-vm') - if (javascriptVM === null || javascriptVM === undefined) ethereumVM(props.config, true, dispatch) - const useAutoComplete = props.config.get('settings/auto-completion') if (useAutoComplete === null || useAutoComplete === undefined) useAutoCompletion(props.config, true, dispatch) @@ -148,7 +145,6 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => { const generalConfig = () => { const isMetadataChecked = props.config.get('settings/generate-contract-metadata') || false - const isEthereumVMChecked = props.config.get('settings/always-use-vm') || false const isEditorWrapChecked = props.config.get('settings/text-wrap') || false const isPersonalChecked = props.config.get('settings/personal-mode') || false const isMatomoChecked = props.config.get('settings/matomo-analytics') || false @@ -192,12 +188,6 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
-
- - -
) } From d2cb4edbfd3d69eac6fc1ab1399821f35fd8a650 Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 20 Mar 2023 17:07:21 +0100 Subject: [PATCH 56/60] indent --- libs/remix-ui/renderer/src/lib/renderer.css | 1 - libs/remix-ui/renderer/src/lib/renderer.tsx | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/renderer/src/lib/renderer.css b/libs/remix-ui/renderer/src/lib/renderer.css index 3d66a6afdc..e03e68502c 100644 --- a/libs/remix-ui/renderer/src/lib/renderer.css +++ b/libs/remix-ui/renderer/src/lib/renderer.css @@ -43,5 +43,4 @@ position: absolute; bottom: 0; right: 0; - padding: 0.5em; } diff --git a/libs/remix-ui/renderer/src/lib/renderer.tsx b/libs/remix-ui/renderer/src/lib/renderer.tsx index 11a4f1afd9..9873b84c07 100644 --- a/libs/remix-ui/renderer/src/lib/renderer.tsx +++ b/libs/remix-ui/renderer/src/lib/renderer.tsx @@ -79,7 +79,8 @@ export const Renderer = ({ message, opt = {}, plugin }: RendererProps) => {
-
) +
+ ) } ) From 81b84cb312ab63250075bbbbbc4aa19054e8bf78 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Thu, 23 Feb 2023 14:09:26 +0530 Subject: [PATCH 57/60] download contract compilation details --- .../solidity-compiler/src/lib/contract-selection.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index d9809d061c..e3510a5512 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -4,6 +4,7 @@ import { ContractSelectionProps } from './types' import { PublishToStorage } from '@remix-ui/publish-to-storage' // eslint-disable-line import { TreeView, TreeViewItem } from '@remix-ui/tree-view' // eslint-disable-line import { CopyToClipboard } from '@remix-ui/clipboard' // eslint-disable-line +import { saveAs } from 'file-saver' import './css/style.css' import { CustomTooltip } from '@remix-ui/helper' @@ -183,8 +184,10 @@ export const ContractSelection = (props: ContractSelectionProps) => { }
- - modal(selectedContract, log, 'Close', null) + const downloadFn = () => { + saveAs(new Blob([JSON.stringify(contractProperties, null, '\t')]), `${selectedContract}_compData.json`) + } + modal(selectedContract, log, 'Download', downloadFn, 'Close', null) } const copyBytecode = () => { From 099461c6c425f55d4be75383c2871fb1d372dab4 Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 28 Feb 2023 13:37:27 +0530 Subject: [PATCH 58/60] add matomo tracking --- libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index e3510a5512..e245ea8b62 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -8,6 +8,7 @@ import { saveAs } from 'file-saver' import './css/style.css' import { CustomTooltip } from '@remix-ui/helper' +const _paq = window._paq = window._paq || [] export const ContractSelection = (props: ContractSelectionProps) => { const { api, compiledFileName, contractsDetails, contractList, compilerInput, modal } = props @@ -142,6 +143,7 @@ export const ContractSelection = (props: ContractSelectionProps) => { } const details = () => { + _paq.push(['trackEvent', 'compiler', 'compilerDetails', 'display']) if (!selectedContract) throw new Error('No contract compiled yet') const help = { @@ -185,6 +187,7 @@ export const ContractSelection = (props: ContractSelectionProps) => { const downloadFn = () => { + _paq.push(['trackEvent', 'compiler', 'compilerDetails', 'download']) saveAs(new Blob([JSON.stringify(contractProperties, null, '\t')]), `${selectedContract}_compData.json`) } modal(selectedContract, log, 'Download', downloadFn, 'Close', null) From f8f46746d67b0018ea0ec44763f7827f1b41fd5a Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Mon, 20 Mar 2023 18:31:03 +0530 Subject: [PATCH 59/60] do not hide modal on download click --- .../modal-dialog/src/lib/remix-ui-modal-dialog.tsx | 3 ++- libs/remix-ui/modal-dialog/src/lib/types/index.ts | 1 + .../solidity-compiler/src/lib/compiler-container.tsx | 2 ++ .../solidity-compiler/src/lib/contract-selection.tsx | 2 +- .../solidity-compiler/src/lib/solidity-compiler.tsx | 7 +++++-- libs/remix-ui/solidity-compiler/src/lib/types/index.ts | 4 ++-- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx index f60309c24e..66330349b0 100644 --- a/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx +++ b/libs/remix-ui/modal-dialog/src/lib/remix-ui-modal-dialog.tsx @@ -103,7 +103,8 @@ export const ModalDialog = (props: ModalDialogProps) => { onClick={() => { if (props.validation && !props.validation.valid) return if (props.okFn) props.okFn() - handleHide() + if (props.donotHideOnOkClick) calledHideFunctionOnce.current = false + else handleHide() }} > {props.okLabel ? props.okLabel : 'OK'} diff --git a/libs/remix-ui/modal-dialog/src/lib/types/index.ts b/libs/remix-ui/modal-dialog/src/lib/types/index.ts index e469bffc61..0c96017bac 100644 --- a/libs/remix-ui/modal-dialog/src/lib/types/index.ts +++ b/libs/remix-ui/modal-dialog/src/lib/types/index.ts @@ -13,6 +13,7 @@ export interface ModalDialogProps { message?: string | JSX.Element, okLabel?: string | JSX.Element, okFn?: (value?:any) => void, + donotHideOnOkClick?: boolean, cancelLabel?: string | JSX.Element, cancelFn?: () => void, modalClass?: string, diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index afdab1cc68..7100b1dbf8 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -281,6 +281,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { 'New configuration file', `The file "${configFilePathInput.current.value}" you entered does not exist. Do you want to create a new one?`, 'Create', async () => await createNewConfigFile(), + false, 'Cancel', () => { setShowFilePathInput(false) @@ -580,6 +581,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { promptMessage('URL'), 'OK', addCustomCompiler, + false, 'Cancel', () => {} ) diff --git a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx index e245ea8b62..02c04893be 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx @@ -190,7 +190,7 @@ export const ContractSelection = (props: ContractSelectionProps) => { _paq.push(['trackEvent', 'compiler', 'compilerDetails', 'download']) saveAs(new Blob([JSON.stringify(contractProperties, null, '\t')]), `${selectedContract}_compData.json`) } - modal(selectedContract, log, 'Download', downloadFn, 'Close', null) + modal(selectedContract, log, 'Download', downloadFn, true, 'Close', null) } const copyBytecode = () => { diff --git a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx index 328797acf3..6277443121 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx @@ -27,6 +27,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { message: null, okLabel: '', okFn: () => { }, + donotHideOnOkClick: false, cancelLabel: '', cancelFn: () => { }, handleHide: null @@ -131,7 +132,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { api.setCompilerParameters({ version: value }) } - const modal = async (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => { + const modal = async (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, donotHideOnOkClick: boolean, cancelLabel?: string, cancelFn?: () => void) => { await setState(prevState => { return { ...prevState, @@ -142,6 +143,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { title, okLabel, okFn, + donotHideOnOkClick, cancelLabel, cancelFn } @@ -190,7 +192,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { <> {compileErrors[currentFile].error && } - {compileErrors[currentFile].error && (compileErrors[currentFile].error.mode === 'panic') && modal('Error', panicMessage(compileErrors[currentFile].error.formattedMessage), 'Close', null)} + {compileErrors[currentFile].error && (compileErrors[currentFile].error.mode === 'panic') && modal('Error', panicMessage(compileErrors[currentFile].error.formattedMessage), 'Close', null, false)} {compileErrors[currentFile].errors && compileErrors[currentFile].errors.length && compileErrors[currentFile].errors.map((err, index) => { if (hideWarnings) { if (err.severity !== 'warning') { @@ -212,6 +214,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { hide={state.modal.hide} okLabel={state.modal.okLabel} okFn={state.modal.okFn} + donotHideOnOkClick={state.modal.donotHideOnOkClick} cancelLabel={state.modal.cancelLabel} cancelFn={state.modal.cancelFn} handleHide={handleHideModal}> diff --git a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts index 7e14b71973..848596f5e0 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -14,7 +14,7 @@ export interface CompilerContainerProps { isFoundryProject: boolean, workspaceName: string, tooltip: (message: string | JSX.Element) => void, - modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, donotHideOnOkClick?: boolean, cancelLabel?: string, cancelFn?: () => void) => void, compiledFileName: string, updateCurrentVersion: any, configurationSettings: ConfigurationSettings, @@ -26,7 +26,7 @@ export interface ContractSelectionProps { compiledFileName: string, contractList: { file: string, name: string }[], compilerInput: Record - modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, + modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, donotHideOnOkClick?: boolean, cancelLabel?: string, cancelFn?: () => void) => void, contractsDetails: Record } From 8643ec9fb8ef2b6722aa010bd33f3be9cec6f26d Mon Sep 17 00:00:00 2001 From: Aniket-Engg Date: Tue, 21 Mar 2023 18:53:10 +0530 Subject: [PATCH 60/60] click on cancel in e2e --- apps/remix-ide-e2e/src/commands/verifyContracts.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/commands/verifyContracts.ts b/apps/remix-ide-e2e/src/commands/verifyContracts.ts index f29c3e42c6..718b3a84e2 100644 --- a/apps/remix-ide-e2e/src/commands/verifyContracts.ts +++ b/apps/remix-ide-e2e/src/commands/verifyContracts.ts @@ -31,7 +31,7 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str .click('*[data-id="treeViewDivtreeViewItemcompiler"]') .waitForElementVisible('*[data-id="treeViewLiversion"]') .assert.containsText('*[data-id="treeViewLiversion"]', `${opts.version}`) - .click('[data-id="workspacesModalDialog-modal-footer-ok-react"]') + .click('[data-id="workspacesModalDialog-modal-footer-cancel-react"]') .perform(() => { done() callback() @@ -49,7 +49,7 @@ function verifyContracts (browser: NightwatchBrowser, compiledContractNames: str .click('*[data-id="treeViewDivtreeViewItemoptimizer"]') .waitForElementVisible('*[data-id="treeViewDivruns"]') .assert.containsText('*[data-id="treeViewDivruns"]', `${opts.runs}`) - .click('[data-id="workspacesModalDialog-modal-footer-ok-react"]') + .click('[data-id="workspacesModalDialog-modal-footer-cancel-react"]') .perform(() => { done() callback()