From 9d565b8b749cdb98d8a790f9adb9bfd09a8952e6 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Thu, 26 Jan 2023 11:05:49 +0100 Subject: [PATCH 01/12] Add publish dev command --- gulpfile.js | 3 ++- lerna.json | 3 ++- package.json | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c32e229f8f..8347a147db 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -52,7 +52,8 @@ task('syncLibVersions', async function () { 'remix-tests', 'remix-url-resolver', 'remix-ws-templates', - 'remixd' + 'remixd', + 'ghaction-helper' ] libs.forEach(lib => { diff --git a/lerna.json b/lerna.json index 708004a98a..b3891e8f1e 100644 --- a/lerna.json +++ b/lerna.json @@ -8,7 +8,8 @@ "dist/libs/remix-solidity", "dist/libs/remix-tests", "dist/libs/remix-url-resolver", - "dist/libs/remix-ws-templates" + "dist/libs/remix-ws-templates", + "dist/libs/ghaction-helper" ], "version": "independent", "command": { diff --git a/package.json b/package.json index 39d01427fb..b9bb6e82cd 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "build:libs": "nx run-many --target=build --parallel=false --with-deps=true --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remix-ws-templates,remixd,ghaction-helper", "test:libs": "nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-tests,remix-url-resolver,remixd", "publish:libs": "yarn run build:libs && lerna publish --skip-git && yarn run bumpVersion:libs", + "publishDev:libs": "yarn run build:libs && lerna publish --npm-tag alpha --skip-git && yarn run bumpVersion:libs", "build:e2e": "node apps/remix-ide-e2e/src/buildGroupTests.js && tsc -p apps/remix-ide-e2e/tsconfig.e2e.json", "babel": "babel", "watch:e2e": "nodemon", From b2247d481f8f9a9620dd022f6a98ce5ff74f5f76 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 23 Jan 2023 17:56:32 +0100 Subject: [PATCH 02/12] fix converting stack --- apps/debugger/src/app/debugger-api.ts | 7 ++++- libs/remix-debug/src/trace/traceAnalyser.ts | 16 ++++++----- libs/remix-debug/src/trace/traceCache.ts | 5 ++-- libs/remix-debug/src/trace/traceHelper.ts | 5 ++-- libs/remix-debug/src/trace/traceManager.ts | 24 ++++++++++++++--- libs/remix-lib/src/util.ts | 21 ++++++++++----- libs/remix-simulator/src/VmProxy.ts | 30 ++++++++++----------- 7 files changed, 71 insertions(+), 37 deletions(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index bd85ac2a4e..22807cb900 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -137,7 +137,12 @@ export const DebuggerApiMixin = (Base) => class extends Base { }, debugWithGeneratedSources: false }) - return await debug.debugger.traceManager.getTrace(hash) + const trace = await debug.debugger.traceManager.getTrace(hash) + trace.structLogs = trace.structLogs.map((step) => { + step.stack = [] + return step + }) + return trace } debug (hash, web3?) { diff --git a/libs/remix-debug/src/trace/traceAnalyser.ts b/libs/remix-debug/src/trace/traceAnalyser.ts index 74651b228d..e4183f9942 100644 --- a/libs/remix-debug/src/trace/traceAnalyser.ts +++ b/libs/remix-debug/src/trace/traceAnalyser.ts @@ -1,4 +1,6 @@ 'use strict' +import { util } from '@remix-project/remix-lib' +const { toHexPaddedString } = util import * as traceHelper from './traceHelper' export class TraceAnalyser { @@ -36,8 +38,8 @@ export class TraceAnalyser { buildReturnValues (index, step) { if (traceHelper.isReturnInstruction(step)) { - let offset = 2 * parseInt(step.stack[step.stack.length - 1], 16) - const size = 2 * parseInt(step.stack[step.stack.length - 2], 16) + let offset = 2 * parseInt(toHexPaddedString(step.stack[step.stack.length - 1]), 16) + const size = 2 * parseInt(toHexPaddedString(step.stack[step.stack.length - 2]), 16) const memory = this.trace[this.traceCache.memoryChanges[this.traceCache.memoryChanges.length - 1]].memory const noOfReturnParams = size / 64 const memoryInString = memory.join('') @@ -77,11 +79,11 @@ export class TraceAnalyser { let offset = 0 let size = 0 if (callStep.op === 'DELEGATECALL') { - offset = 2 * parseInt(stack[stack.length - 3], 16) - size = 2 * parseInt(stack[stack.length - 4], 16) + offset = 2 * parseInt(toHexPaddedString(stack[stack.length - 3]), 16) + size = 2 * parseInt(toHexPaddedString(stack[stack.length - 4]), 16) } else { - offset = 2 * parseInt(stack[stack.length - 4], 16) - size = 2 * parseInt(stack[stack.length - 5], 16) + offset = 2 * parseInt(toHexPaddedString(stack[stack.length - 4]), 16) + size = 2 * parseInt(toHexPaddedString(stack[stack.length - 5]), 16) } calldata = '0x' + memory.join('').substr(offset, size) this.traceCache.pushCallDataChanges(index + 1, calldata) @@ -104,7 +106,7 @@ export class TraceAnalyser { } this.traceCache.pushStoreChanges(index + 1, context.storageContext[context.storageContext.length - 1]) } else if (traceHelper.isSSTOREInstruction(step)) { - this.traceCache.pushStoreChanges(index + 1, context.storageContext[context.storageContext.length - 1], step.stack[step.stack.length - 1], step.stack[step.stack.length - 2]) + this.traceCache.pushStoreChanges(index + 1, context.storageContext[context.storageContext.length - 1], toHexPaddedString(step.stack[step.stack.length - 1]), toHexPaddedString(step.stack[step.stack.length - 2])) } else if (traceHelper.isReturnInstruction(step) || traceHelper.isStopInstruction(step)) { context.storageContext.pop() this.traceCache.pushStoreChanges(index + 1, context.storageContext[context.storageContext.length - 1]) diff --git a/libs/remix-debug/src/trace/traceCache.ts b/libs/remix-debug/src/trace/traceCache.ts index 2b2e0fc45c..7c6f115277 100644 --- a/libs/remix-debug/src/trace/traceCache.ts +++ b/libs/remix-debug/src/trace/traceCache.ts @@ -1,5 +1,6 @@ 'use strict' import { util } from '@remix-project/remix-lib' +const { toHexPaddedString } = util // eslint-disable-next-line camelcase const { sha3_256 } = util @@ -103,8 +104,8 @@ export class TraceCache { pushContractCreationFromMemory (index, token, trace, lastMemoryChange) { const memory = trace[lastMemoryChange].memory const stack = trace[index].stack - const offset = 2 * parseInt(stack[stack.length - 2], 16) - const size = 2 * parseInt(stack[stack.length - 3], 16) + const offset = 2 * parseInt(toHexPaddedString(stack[stack.length - 2]), 16) + const size = 2 * parseInt(toHexPaddedString(stack[stack.length - 3]), 16) this.contractCreation[token] = '0x' + memory.join('').substr(offset, size) } diff --git a/libs/remix-debug/src/trace/traceHelper.ts b/libs/remix-debug/src/trace/traceHelper.ts index ab37806d4b..0f49bde110 100644 --- a/libs/remix-debug/src/trace/traceHelper.ts +++ b/libs/remix-debug/src/trace/traceHelper.ts @@ -1,5 +1,6 @@ 'use strict' -import { helpers } from '@remix-project/remix-lib' +import { helpers, util } from '@remix-project/remix-lib' +const { toHexPaddedString } = util const { ui } = helpers // vmTraceIndex has to point to a CALL, CODECALL, ... @@ -9,7 +10,7 @@ export function resolveCalledAddress (vmTraceIndex, trace) { return contractCreationToken(vmTraceIndex) } else if (isCallInstruction(step)) { const stack = step.stack // callcode, delegatecall, ... - return ui.normalizeHexAddress(stack[stack.length - 2]) + return ui.normalizeHexAddress(toHexPaddedString(stack[stack.length - 2])) } return undefined } diff --git a/libs/remix-debug/src/trace/traceManager.ts b/libs/remix-debug/src/trace/traceManager.ts index 82f0716b66..70be4ab225 100644 --- a/libs/remix-debug/src/trace/traceManager.ts +++ b/libs/remix-debug/src/trace/traceManager.ts @@ -1,5 +1,6 @@ 'use strict' import { util, execution } from '@remix-project/remix-lib' +const { toHexPaddedString } = util import { TraceAnalyser } from './traceAnalyser' import { TraceCache } from './traceCache' import { TraceStepManager } from './traceStepManager' @@ -68,7 +69,7 @@ export class TraceManager { fullStorage: false } this.web3.debug.traceTransaction(txHash, options, function (error, result) { - if (error) return reject(error) + if (error) return reject(error) resolve(result) }) }) @@ -148,9 +149,24 @@ export class TraceManager { getStackAt (stepIndex) { this.checkRequestedStep(stepIndex) if (this.trace[stepIndex] && this.trace[stepIndex].stack) { // there's always a stack - const stack = this.trace[stepIndex].stack.slice(0) - stack.reverse() - return stack.map(el => el.startsWith('0x') ? el : '0x' + el) + if (Array.isArray(this.trace[stepIndex].stack)) { + const stack = this.trace[stepIndex].stack.slice(0) + stack.reverse() + return stack.map(el => toHexPaddedString(el)) + } else { + // it's an object coming from the VM. + // for performance reasons, + // we don't turn the stack coming from the VM into an array when the tx is executed + // but now when the app needs it. + const stack = [] + for (const prop in this.trace[stepIndex].stack) { + if (prop !== 'length') { + stack.push(toHexPaddedString(this.trace[stepIndex].stack[prop])) + } + } + stack.reverse() + return stack + } } else { throw new Error('no stack found') } diff --git a/libs/remix-lib/src/util.ts b/libs/remix-lib/src/util.ts index 9f835eb8c8..a01a3288bc 100644 --- a/libs/remix-lib/src/util.ts +++ b/libs/remix-lib/src/util.ts @@ -1,5 +1,6 @@ 'use strict' -import { BN, bufferToHex, keccak, setLengthLeft, toBuffer, addHexPrefix } from 'ethereumjs-util' +import { bufferToHex, keccak, setLengthLeft, toBuffer, addHexPrefix } from 'ethereumjs-util' +import { bigIntToHex } from '@ethereumjs/util' import stringSimilarity from 'string-similarity' /* @@ -35,14 +36,22 @@ export function hexToIntArray (hexString) { export function hexListFromBNs (bnList) { const ret = [] for (const k in bnList) { - const v = bnList[k] - if (BN.isBN(v)) { - ret.push('0x' + v.toString('hex', 64)) + const v = bnList[k].toString(16) + ret.push('0x' + v.padStart(64, '0')) + } + return ret +} + +export function toHexPaddedString(v: bigint | string): string { + if (v) { + if (typeof v === 'string') { + return v.startsWith('0x') ? v : '0x' + v } else { - ret.push('0x' + (new BN(v)).toString('hex', 64)) // TEMP FIX TO REMOVE ONCE https://github.com/ethereumjs/ethereumjs-vm/pull/293 is released + return '0x' + v.toString(16).padStart(64, '0') } } - return ret + else + return '0x' + '0'.padStart(64, '0') } /* diff --git a/libs/remix-simulator/src/VmProxy.ts b/libs/remix-simulator/src/VmProxy.ts index a7c6ae323a..12321fa6b7 100644 --- a/libs/remix-simulator/src/VmProxy.ts +++ b/libs/remix-simulator/src/VmProxy.ts @@ -1,5 +1,5 @@ import { util } from '@remix-project/remix-lib' -const { hexListFromBNs, formatMemory } = util +const { toHexPaddedString, formatMemory } = util import { helpers } from '@remix-project/remix-lib' const { normalizeHexAddress } = helpers.ui import { ConsoleLogs } from '@remix-project/remix-lib' @@ -240,7 +240,7 @@ export class VmProxy { previousOpcode.invalidDepthChange = previousOpcode.op !== 'RETURN' && previousOpcode.op !== 'STOP' } const step = { - stack: hexListFromBNs(data.stack), + stack: { ...data.stack }, storage: {}, memory: null, op: data.opcode.name, @@ -249,6 +249,7 @@ export class VmProxy { gas: data.gasLeft.toString(), depth: depth } + step.stack.length = Object.keys(data.stack).length if (previousOpcode && (previousOpcode.op === 'CALLDATACOPY' || previousOpcode.op === 'CODECOPY' || previousOpcode.op === 'EXTCODECOPY' || previousOpcode.op === 'RETURNDATACOPY' || previousOpcode.op === 'MSTORE' || previousOpcode.op === 'MSTORE8')) { step.memory = data.memory @@ -256,9 +257,8 @@ export class VmProxy { } this.vmTraces[this.processingHash].structLogs.push(step) // Track hardhat console.log call - if (step.op === 'STATICCALL' && step.stack[step.stack.length - 2] === '0x000000000000000000000000000000000000000000636f6e736f6c652e6c6f67') { - const stackLength = step.stack.length - const payloadStart = parseInt(step.stack[stackLength - 3], 16) + if (step.op === 'STATICCALL' && toHexPaddedString(step.stack[step.stack.length - 2]) === '0x000000000000000000000000000000000000000000636f6e736f6c652e6c6f67') { + const payloadStart = parseInt(toHexPaddedString(step.stack[step.stack.length - 3]), 16) const memory = formatMemory(data.memory) const memoryStr = memory.join('') let payload = memoryStr.substring(payloadStart * 2, memoryStr.length) @@ -290,7 +290,7 @@ export class VmProxy { this.processingAddress = '(Contract Creation - Step ' + this.processingIndex + ')' this.storageCache[this.processingHash][this.processingAddress] = {} } else { - this.processingAddress = normalizeHexAddress(step.stack[step.stack.length - 2]) + this.processingAddress = normalizeHexAddress(toHexPaddedString(step.stack[step.stack.length - 2])) this.processingAddress = toChecksumAddress(this.processingAddress) if (!this.storageCache[this.processingHash][this.processingAddress]) { (async (processingHash, processingAddress, self) => { @@ -307,7 +307,7 @@ export class VmProxy { } if (previousOpcode && previousOpcode.op === 'SHA3') { const preimage = this.getSha3Input(previousOpcode.stack, formatMemory(this.lastMemoryUpdate)) - const imageHash = step.stack[step.stack.length - 1].replace('0x', '') + const imageHash = toHexPaddedString(step.stack[step.stack.length - 1]).replace('0x', '') this.sha3Preimages[imageHash] = { preimage: preimage } @@ -421,26 +421,26 @@ export class VmProxy { } getSha3Input (stack, memory) { - let memoryStart = stack[stack.length - 1] - let memoryLength = stack[stack.length - 2] + const memoryStart = toHexPaddedString(stack[stack.length - 1]) + const memoryLength = toHexPaddedString(stack[stack.length - 2]) const memStartDec = (new BN(memoryStart.replace('0x', ''), 16)).toString(10) - memoryStart = parseInt(memStartDec) * 2 + const memoryStartInt = parseInt(memStartDec) * 2 const memLengthDec = (new BN(memoryLength.replace('0x', ''), 16).toString(10)) - memoryLength = parseInt(memLengthDec) * 2 + const memoryLengthInt = parseInt(memLengthDec) * 2 - let i = Math.floor(memoryStart / 32) - const maxIndex = Math.floor(memoryLength / 32) + i + let i = Math.floor(memoryStartInt / 32) + const maxIndex = Math.floor(memoryLengthInt / 32) + i if (!memory[i]) { return this.emptyFill(memoryLength) } - let sha3Input = memory[i].slice(memoryStart - 32 * i) + let sha3Input = memory[i].slice(memoryStartInt - 32 * i) i++ while (i < maxIndex) { sha3Input += memory[i] ? memory[i] : this.emptyFill(32) i++ } if (sha3Input.length < memoryLength) { - const leftSize = memoryLength - sha3Input.length + const leftSize = memoryLengthInt - sha3Input.length sha3Input += memory[i] ? memory[i].slice(0, leftSize) : this.emptyFill(leftSize) } return sha3Input From 3a392d701e79eba97b22786061a3eab19daa877c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 25 Jan 2023 11:04:57 +0100 Subject: [PATCH 03/12] fix getTrace with stack items --- apps/debugger/src/app/debugger-api.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 22807cb900..4830f0debb 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -1,7 +1,9 @@ import Web3 from 'web3' -import {init , traceHelper, TransactionDebugger as Debugger } from '@remix-project/remix-debug' +import { init , traceHelper, TransactionDebugger as Debugger } from '@remix-project/remix-debug' import { CompilerAbstract } from '@remix-project/remix-solidity' import { lineText } from '@remix-ui/editor' +import { util } from '@remix-project/remix-lib' +const { toHexPaddedString } = util export const DebuggerApiMixin = (Base) => class extends Base { @@ -139,7 +141,13 @@ export const DebuggerApiMixin = (Base) => class extends Base { }) const trace = await debug.debugger.traceManager.getTrace(hash) trace.structLogs = trace.structLogs.map((step) => { - step.stack = [] + const stack = [] + for (const prop in step.stack) { + if (prop !== 'length') { + stack.push(toHexPaddedString(step.stack[prop])) + } + } + step.stack = stack return step }) return trace From 8193e4d10b9c7bd5bef186cd62ba7ac287426fa8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 25 Jan 2023 11:13:23 +0100 Subject: [PATCH 04/12] linting --- libs/remix-debug/src/trace/traceManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-debug/src/trace/traceManager.ts b/libs/remix-debug/src/trace/traceManager.ts index 70be4ab225..ed75691530 100644 --- a/libs/remix-debug/src/trace/traceManager.ts +++ b/libs/remix-debug/src/trace/traceManager.ts @@ -69,7 +69,7 @@ export class TraceManager { fullStorage: false } this.web3.debug.traceTransaction(txHash, options, function (error, result) { - if (error) return reject(error) + if (error) return reject(error) resolve(result) }) }) From fd303d02d1d2f170847d14fc902386cabae3672e Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 25 Jan 2023 14:48:32 +0100 Subject: [PATCH 05/12] fix remix-simulator CLI --- libs/remix-simulator/bin/ethsim | 29 ++++++++++++++++------------- package.json | 1 + 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/libs/remix-simulator/bin/ethsim b/libs/remix-simulator/bin/ethsim index a6f56641ee..607cabbe9c 100755 --- a/libs/remix-simulator/bin/ethsim +++ b/libs/remix-simulator/bin/ethsim @@ -20,18 +20,21 @@ program }) program - .option('-p, --port [port]', 'specify port') - .option('-b, --ip [host]', 'specify host') - .option('-c, --coinbase [coinbase]', 'specify host') - .option('--rpc', 'run rpc server only') - .option('--details', 'display payloads for every requests and their responses') - .parse(process.argv) + .command('start') + .option('-p, --port [port]', 'specify port', 8545) + .option('-b, --ip [host]', 'specify host', '127.0.0.1') + .option('-c, --coinbase [coinbase]', 'specify coinbase', '0x0000000000000000000000000000000000000000') + .option('--rpc', 'run rpc server only', true) + .option('--details', 'display payloads for every requests and their responses', false) + .action(() => { + const Server = require('../src/server') + const server = new Server({ + coinbase: program.coinbase, + rpc: program.rpc, + logDetails: program.details + }) + server.start(program.host, program.port) + }) -const Server = require('../src/server') -const server = new Server({ - coinbase: program.coinbase || "0x0000000000000000000000000000000000000000", - rpc: program.rpc, - logDetails: program.details -}) -server.start(program.host || '127.0.0.1', program.port || 8545) +program.parse(process.argv) diff --git a/package.json b/package.json index b9bb6e82cd..304369daab 100644 --- a/package.json +++ b/package.json @@ -105,6 +105,7 @@ "nightwatch_local_providers": "yarn run build:e2e && nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/providers.test.js --env=chromeDesktop", "onchange": "onchange apps/remix-ide/build/app.js -- npm-run-all lint", "remixd": "nx build remixd && chmod +x dist/libs/remixd/src/bin/remixd.js && dist/libs/remixd/src/bin/remixd.js --remix-ide http://127.0.0.1:8080", + "simulator": "nx build remix-simulator && chmod +x dist/libs/remix-simulator/bin/ethsim && dist/libs/remix-simulator/bin/ethsim start --rpc", "selenium": "selenium-standalone start", "selenium-install": "selenium-standalone install", "sourcemap": "exorcist --root ../ apps/remix-ide/build/app.js.map > apps/remix-ide/build/app.js", From 10c446e8db01e8d9e9bd815be200f9fafc822c02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 16:45:34 +0000 Subject: [PATCH 06/12] Bump ua-parser-js from 0.7.31 to 0.7.33 Bumps [ua-parser-js](https://github.com/faisalman/ua-parser-js) from 0.7.31 to 0.7.33. - [Release notes](https://github.com/faisalman/ua-parser-js/releases) - [Changelog](https://github.com/faisalman/ua-parser-js/blob/master/changelog.md) - [Commits](https://github.com/faisalman/ua-parser-js/compare/0.7.31...0.7.33) --- updated-dependencies: - dependency-name: ua-parser-js dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 36e3bae935..20c19ef0ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -25404,9 +25404,9 @@ typescript@^4.8.4: integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== ua-parser-js@^0.7.30: - version "0.7.31" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.31.tgz#649a656b191dffab4f21d5e053e27ca17cbff5c6" - integrity sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ== + version "0.7.33" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.33.tgz#1d04acb4ccef9293df6f70f2c3d22f3030d8b532" + integrity sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw== uglify-js@^2.8.16: version "2.8.29" From 292b8a69be5499a5d8d99286a8a29064f1978a38 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 25 Jan 2023 16:21:37 +0100 Subject: [PATCH 07/12] fix tutorial type for learnEth section --- libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx index f91c78f979..67da2d885c 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx @@ -31,7 +31,7 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { window.open("https://remix-ide.readthedocs.io/en/latest/remix_tutorials_learneth.html?highlight=learneth#learneth-tutorial-repos", '_blank') } - const startLearnEthTutorial = async (tutorial: 'basics' | 'useofweb3js' | 'deploylibraries') => { + const startLearnEthTutorial = async (tutorial: 'basics' | 'soliditybeginner' | 'deploylibraries') => { await plugin.appManager.activatePlugin(['solidity', 'LearnEth', 'solidityUnitTesting']) plugin.verticalIcons.select('LearnEth') plugin.call('LearnEth', 'startTutorial', 'ethereum/remix-workshops', 'master', tutorial) @@ -74,7 +74,7 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { {(state.visibleTutorial === VisibleTutorial.Intermediate) &&
-
} From 2afc75e3aeeb9bd2d392bd53a648f287ee6e7464 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Thu, 26 Jan 2023 09:54:28 +0100 Subject: [PATCH 08/12] Fix action of LearnEth icon --- libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx index 67da2d885c..30f2332346 100644 --- a/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx +++ b/libs/remix-ui/home-tab/src/lib/components/homeTabLearn.tsx @@ -31,10 +31,11 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) { window.open("https://remix-ide.readthedocs.io/en/latest/remix_tutorials_learneth.html?highlight=learneth#learneth-tutorial-repos", '_blank') } - const startLearnEthTutorial = async (tutorial: 'basics' | 'soliditybeginner' | 'deploylibraries') => { + const startLearnEthTutorial = async (tutorial: 'home' | 'basics' | 'soliditybeginner' | 'deploylibraries') => { await plugin.appManager.activatePlugin(['solidity', 'LearnEth', 'solidityUnitTesting']) plugin.verticalIcons.select('LearnEth') - plugin.call('LearnEth', 'startTutorial', 'ethereum/remix-workshops', 'master', tutorial) + tutorial === 'home' ? plugin.call('LearnEth') : + plugin.call('LearnEth', 'startTutorial', 'ethereum/remix-workshops', 'master', tutorial) _paq.push(['trackEvent', 'hometab', 'startLearnEthTutorial', tutorial]) } @@ -46,7 +47,7 @@ function HomeTabLearn ({plugin}: HomeTabLearnProps) {