Skip to content

Commit

Permalink
Merge branch 'master' into udapp-disconnect-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
joeizang authored Jan 10, 2025
2 parents 1e87cae + 496e315 commit 41c1b70
Show file tree
Hide file tree
Showing 25 changed files with 53 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. Windows, Linux or MacOS]
- Browser [e.g. chrome, firefox]
- Version [e.g. 22]
- Browser: [e.g. chrome, firefox]
- Version: [e.g. 22]

**Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion apps/circuit-compiler/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = composePlugins(withNx(), (config) => {
})
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
Expand Down
2 changes: 1 addition & 1 deletion apps/contract-verification/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = composePlugins(withNx(), (config) => {
})
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
Expand Down
2 changes: 1 addition & 1 deletion apps/doc-gen/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = composePlugins(withNx(), withReact(), config => {
new webpack.DefinePlugin({}),
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
Expand Down
2 changes: 1 addition & 1 deletion apps/learneth/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = composePlugins(withNx(), (config) => {
})
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
Expand Down
2 changes: 1 addition & 1 deletion apps/noir-compiler/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = composePlugins(withNx(), (config) => {
})
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
Expand Down
2 changes: 1 addition & 1 deletion apps/quick-dapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = composePlugins(withNx(), (config) => {
})
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-dapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = composePlugins(withNx(), (config) => {
})
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide-e2e/src/local-plugin/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = composePlugins(withNx(), (config) => {
// add public path
config.output.publicPath = '/'

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ["source-map-loader"],
Expand Down
10 changes: 5 additions & 5 deletions apps/remix-ide-e2e/src/tests/quickDapp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const tests = {
.setValue('input[data-id="surgePassword"]', surgePassword)
.setValue('input[data-id="surgeSubdomain"]', surgeSubdomain)
.setValue('input[data-id="functionTitle0x6057361d"]', 'Function Store Title')
.setValue('input[data-id="functionTitle0x2e64cec1"]', 'Function Retrive Title')
.setValue('input[data-id="functionTitle0x2e64cec1"]', 'Function Retrieve Title')
.execute((function() {
document.querySelector('input[data-id="uploadLogo"]').classList.remove('d-none');
}))
Expand Down Expand Up @@ -176,7 +176,7 @@ const tests = {
})
})
.assert.containsText('*[data-id="functionTitle0x6057361d"]', 'Function Store Title')
.assert.containsText('*[data-id="functionTitle0x2e64cec1"]', 'Function Retrive Title')
.assert.containsText('*[data-id="functionTitle0x2e64cec1"]', 'Function Retrieve Title')
.assert.containsText('*[data-id="dappTitle"]', 'Storage')
.assert.containsText('*[data-id="dappInstructions"]', 'Store & retrieve value in a variable')
.assert.elementPresent('.fa-twitter.btn', 'Twitter icon should be present')
Expand All @@ -191,9 +191,9 @@ const tests = {
.getLocation('*[data-id="function0x6057361d"]', function (result: any) {
const funcStoreLocation = result.value
browser.getLocation('*[data-id="function0x2e64cec1"]', function (result: any) {
const funcRetriveLocation = result.value
browser.assert.strictEqual(funcStoreLocation.y, funcRetriveLocation.y, 'Both functions should be on the same horizontal line')
browser.assert.ok(funcStoreLocation.x > funcRetriveLocation.x, 'Function Store should be on the right of Function Retrive')
const funcRetrieveLocation = result.value
browser.assert.strictEqual(funcStoreLocation.y, funcRetrieveLocation.y, 'Both functions should be on the same horizontal line')
browser.assert.ok(funcStoreLocation.x > funcRetrieveLocation.x, 'Function Store should be on the right of Function Retrieve')
})
})
.getAttribute('a[data-id="viewSourceCode"]', 'href', function (result) {
Expand Down
16 changes: 8 additions & 8 deletions apps/remix-ide-e2e/src/tests/terminal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@ module.exports = {
.selectContract('OwnerTest')
.createContract('')
.pause(1000)
.journalChildIncludes('constructor', { shouldHaveOnlyOneOccurence: true })
.journalChildIncludes('constructor', { shouldHaveOnlyOneOccurrence: true })
.pause(5000)
.click('*[data-id="terminalClearConsole"]') // clear the terminal
.clickInstance(0)
.clickFunction('changeOwner - transact (not payable)', { types: 'address newOwner', values: '0xd9145CCE52D386f254917e481eB44e9943F39138' })
.pause(1000)
.journalChildIncludes('inside changeOwner', { shouldHaveOnlyOneOccurence: true })
.journalChildIncludes('inside changeOwner', { shouldHaveOnlyOneOccurrence: true })
.clickFunction('getOwner - call')
.pause(1000)
.journalChildIncludes('inside getOwner', { shouldHaveOnlyOneOccurence: true })
.journalChildIncludes('inside getOwner', { shouldHaveOnlyOneOccurrence: true })
},

'Emit 2 similar events and check the filtering is done properly #group4': function (browser: NightwatchBrowser) {
Expand Down Expand Up @@ -385,7 +385,7 @@ module.exports = {
}
function resolveENS() view {
// Same address for Mainet, Ropsten, Rinkerby, Gorli and other networks;
// Same address for Mainnet, Ropsten, Rinkerby, Gorli and other networks;
ENS ens = ENS(0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e);
(,bytes32 node) = NameEncoder.dnsEncodeName("vitalik.eth");
Resolver resolver = ens.resolver(node);
Expand Down Expand Up @@ -602,14 +602,14 @@ library Lib {
}
/**
* @title Storage
* @dev Store & retrieve value inr a variable
* @dev Store & retrieve value in a variable
*/
contract StorageWithLib {
uint256 number;
/**
* @dev Store valrue in variable
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
Expand Down Expand Up @@ -750,15 +750,15 @@ const scriptAutoExec = {
/**
* @title Storage
* @dev Store & retrieve value inr a variable
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_storage.js
*/
contract Storage {
uint256 number;
/**
* @dev Store valrue in variable
* @dev Store value in variable
* @param num value to store
*/
function store(uint256 num) public {
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide-e2e/src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ declare module 'nightwatch' {
journalLastChildIncludes(val: string): NightwatchBrowser
executeScriptInTerminal(script: string): NightwatchBrowser
clearEditableContent(cssSelector: string): NightwatchBrowser
journalChildIncludes(val: string, opts = {shouldHaveOnlyOneOccurence: boolean}): NightwatchBrowser
journalChildIncludes(val: string, opts = {shouldHaveOnlyOneOccurrence: boolean}): NightwatchBrowser
debugTransaction(index: number): NightwatchBrowser
checkElementStyle(cssSelector: string, styleProperty: string, expectedResult: string): NightwatchBrowser
openFile(name: string): NightwatchBrowser
Expand Down Expand Up @@ -57,7 +57,7 @@ declare module 'nightwatch' {
journalLastChild(val: string): NightwatchBrowser
checkTerminalFilter(filter: string, test: string, notContain: boolean): NightwatchBrowser
noWorkerErrorFor(version: string): NightwatchBrowser
validateValueInput(selector: string, valueTosSet: string[], expectedValue: string): NightwatchBrowser
validateValueInput(selector: string, valueToSet: string[], expectedValue: string): NightwatchBrowser
checkAnnotations(type: string): NightwatchBrowser
checkAnnotationsNotPresent(type: string): NightwatchBrowser
getLastTransactionHash(callback: (hash: string) => void)
Expand Down
2 changes: 2 additions & 0 deletions apps/remix-ide/src/app/plugins/remixAIPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React, { useCallback } from 'react';
import { ICompletions, IModel, RemoteInferencer, IRemoteModel, IParams, GenerationParams, CodeExplainAgent } from '@remix/remix-ai-core';
import { CustomRemixApi } from '@remix-api'
import { PluginViewWrapper } from '@remix-ui/helper'
const _paq = (window._paq = window._paq || [])

type chatRequestBufferT<T> = {
[key in keyof T]: T[key]
Expand Down Expand Up @@ -199,6 +200,7 @@ export class RemixAIPlugin extends ViewPlugin {
else {
console.log("chatRequestBuffer is not empty. First process the last request.")
}
_paq.push(['trackEvent', 'ai', 'remixAI_chat', 'askFromTerminal'])
}

async ProcessChatRequestBuffer(params:IParams=GenerationParams){
Expand Down
4 changes: 2 additions & 2 deletions apps/remix-ide/src/app/tabs/locales/en/pluginManager.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"pluginManager.displayName": "Plugin manager",
"pluginManager.activate": "Activate",
"pluginManager.deactivate": "Deactivate",
"pluginManager.activeModules": "Active Modules",
"pluginManager.inactiveModules": "Inactive Modules",
"pluginManager.activeModules": "Active Plugins",
"pluginManager.inactiveModules": "Inactive Plugins",
"pluginManager.connectLocal": "Connect to a Local Plugin",
"pluginManager.localForm.title": "Local Plugin",
"pluginManager.localForm.pluginName": "Plugin Name",
Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
})
)

// souce-map loader
// source-map loader
config.module.rules.push({
test: /\.js$/,
use: ['source-map-loader'],
Expand Down
14 changes: 7 additions & 7 deletions libs/remix-debug/src/code/codeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,25 @@ export class CodeManager {
return findNodeAtInstructionIndex('FunctionDefinition', instIndex, sourceMap, ast)
}

private retrieveCodeAndTrigger (codeMananger, address, stepIndex, tx) {
codeMananger.getCode(address).then((result) => {
this.retrieveIndexAndTrigger(codeMananger, address, stepIndex, result.instructions)
private retrieveCodeAndTrigger (codeManager, address, stepIndex, tx) {
codeManager.getCode(address).then((result) => {
this.retrieveIndexAndTrigger(codeManager, address, stepIndex, result.instructions)
}).catch((error) => {
return console.log(error)
})
}

private async retrieveIndexAndTrigger (codeMananger, address, step, code) {
private async retrieveIndexAndTrigger (codeManager, address, step, code) {
let result
const next = []
const returnInstructionIndexes = []
const outOfGasInstructionIndexes = []

try {
result = codeMananger.getInstructionIndex(address, step)
result = codeManager.getInstructionIndex(address, step)
for (let i = 1; i < 6; i++) {
if (this.traceManager.inRange(step + i)) {
next.push(codeMananger.getInstructionIndex(address, step + i))
next.push(codeManager.getInstructionIndex(address, step + i))
}
}

Expand All @@ -177,7 +177,7 @@ export class CodeManager {
return console.log(error)
}
try {
codeMananger.event.trigger('changed', [code, address, result, next, returnInstructionIndexes, outOfGasInstructionIndexes])
codeManager.event.trigger('changed', [code, address, result, next, returnInstructionIndexes, outOfGasInstructionIndexes])
} catch (e) {
console.log('dispatching event failed', e)
}
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-lib/src/execution/txHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function sortAbiFunction (contractabi) {
// Check if function is constant (introduced with Solidity 0.6.0)
const isConstant = ({ stateMutability }) => stateMutability === 'view' || stateMutability === 'pure'
// Sorts the list of ABI entries. Constant functions will appear first,
// followed by non-constant functions. Within those t wo groupings, functions
// followed by non-constant functions. Within those two groupings, functions
// will be sorted by their names.
return contractabi.sort(function (a, b) {
if (isConstant(a) && !isConstant(b)) {
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-simulator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/ethereum/remix-project/tree/master/libs/remix-simulator)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/ethereum/remix-project/issues)

`@remix-project/remix-simulator` is a web3 wrapper for different kind of providers. It is used in `remix-tests` library and in Remix IDE codebase.
`@remix-project/remix-simulator` is a web3 wrapper for different kinds of providers. It is used in `remix-tests` library and in Remix IDE codebase.

### Installation
`@remix-project/remix-simulator` is an NPM package and can be installed using NPM as:
Expand Down
6 changes: 3 additions & 3 deletions libs/remix-ui/editor/src/lib/web-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ export const loadTypes = async (monaco) => {
monaco.languages.typescript.typescriptDefaults.addExtraLib(ethersSha2Default, `file:///node_modules/@types/@ethersproject_sha2/index.d.ts`)

// @ts-ignore
const ethersSingningkey = await import('raw-loader!@ethersproject/signing-key/lib/index.d.ts')
const ethersSingningkeyDefault = ethersSingningkey.default.replace(/@ethersproject\//g, '@ethersproject_')
monaco.languages.typescript.typescriptDefaults.addExtraLib(ethersSingningkeyDefault, `file:///node_modules/@types/@ethersproject_signing-key/index.d.ts`)
const ethersSigningkey = await import('raw-loader!@ethersproject/signing-key/lib/index.d.ts')
const ethersSigningkeyDefault = ethersSigningkey.default.replace(/@ethersproject\//g, '@ethersproject_')
monaco.languages.typescript.typescriptDefaults.addExtraLib(ethersSigningkeyDefault, `file:///node_modules/@types/@ethersproject_signing-key/index.d.ts`)

// @ts-ignore
const ethersSolidity = await import('raw-loader!@ethersproject/solidity/lib/index.d.ts')
Expand Down
8 changes: 4 additions & 4 deletions libs/remix-ui/home-tab/src/lib/components/homeTabFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function HomeTabFile({ plugin }: HomeTabFileProps) {
plugin.verticalIcons.select('filePanel')
}

const handleSwichToRecentWorkspace = async (e, workspaceName) => {
const handleSwitchToRecentWorkspace = async (e, workspaceName) => {
e.preventDefault()
plugin.call('sidePanel', 'showContent', 'filePanel')
plugin.verticalIcons.select('filePanel')
Expand All @@ -146,17 +146,17 @@ function HomeTabFile({ plugin }: HomeTabFileProps) {
Recent Workspaces
</label>
{state.recentWorkspaces[0] && state.recentWorkspaces[0] !== '' && (
<a className="cursor-pointer mb-1 ml-2" href="#" onClick={(e) => handleSwichToRecentWorkspace(e, state.recentWorkspaces[0])}>
<a className="cursor-pointer mb-1 ml-2" href="#" onClick={(e) => handleSwitchToRecentWorkspace(e, state.recentWorkspaces[0])}>
{state.recentWorkspaces[0]}
</a>
)}
{state.recentWorkspaces[1] && state.recentWorkspaces[1] !== '' && (
<a className="cursor-pointer mb-1 ml-2" href="#" onClick={(e) => handleSwichToRecentWorkspace(e, state.recentWorkspaces[1])}>
<a className="cursor-pointer mb-1 ml-2" href="#" onClick={(e) => handleSwitchToRecentWorkspace(e, state.recentWorkspaces[1])}>
{state.recentWorkspaces[1]}
</a>
)}
{state.recentWorkspaces[2] && state.recentWorkspaces[2] !== '' && (
<a className="cursor-pointer ml-2" href="#" onClick={(e) => handleSwichToRecentWorkspace(e, state.recentWorkspaces[2])}>
<a className="cursor-pointer ml-2" href="#" onClick={(e) => handleSwitchToRecentWorkspace(e, state.recentWorkspaces[2])}>
{state.recentWorkspaces[2]}
</a>
)}
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-ui/plugin-manager/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export interface RemixUiPluginManagerProps {
pluginManagerSettings: PluginManagerSettings
}
/** @class Reference loaders.
* A loader is a get,set based object which load a workspace from a defined sources.
* A loader is a get, set based object which load a workspace from a defined sources.
* (localStorage, queryParams)
**/
declare class PluginLoader {
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-ui/run-tab/src/lib/actions/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const createNewBlockchainAccount = async (plugin: RunTab, dispatch: React
if (plugin.REACT_API.passphrase === plugin.REACT_API.matchPassphrase) {
cb(plugin.REACT_API.passphrase)
} else {
dispatch(displayNotification('Error', 'Passphase does not match', 'OK', null))
dispatch(displayNotification('Error', 'Passphrase does not match', 'OK', null))
}
setPassphrase('')
setMatchPassphrase('')
Expand Down
6 changes: 3 additions & 3 deletions libs/remix-ui/run-tab/src/lib/actions/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export const getSelectedContract = (contractName: string, compiler: CompilerAbst
return txHelper.getConstructorInterface(contract.object.abi)
},
getConstructorInputs: () => {
const constructorInteface = txHelper.getConstructorInterface(contract.object.abi)
const constructorInterface = txHelper.getConstructorInterface(contract.object.abi)

return txHelper.inputParametersDeclarationToString(constructorInteface.inputs)
return txHelper.inputParametersDeclarationToString(constructorInterface.inputs)
},
isOverSizeLimit: async (args: string) => {
const encodedParams = await txFormat.encodeParams(args, txHelper.getConstructorInterface(contract.object.abi))
Expand Down Expand Up @@ -309,7 +309,7 @@ export const runTransactions = (
funcIndex?: number) => {
let callinfo = ''
if (lookupOnly) callinfo = 'call'
else if (funcABI.type === 'fallback' || funcABI.type === 'receive') callinfo = 'lowLevelInteracions'
else if (funcABI.type === 'fallback' || funcABI.type === 'receive') callinfo = 'lowLevelinteractions'
else callinfo = 'transact'
_paq.push(['trackEvent', 'udapp', callinfo, plugin.blockchain.getCurrentNetworkStatus().network.name])

Expand Down
2 changes: 1 addition & 1 deletion libs/remix-ui/run-tab/src/lib/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ export const setNetworkName = (networkName: string) => setNetworkNameFromProvide
export const updateSelectedContract = (contractName) => setSelectedContract(dispatch, contractName)
export const syncContracts = () => syncContractsInternal(plugin)
export const isValidProxyAddress = (address: string) => isValidContractAddress(plugin, address)
export const isValidProxyUpgrade = (proxyAddress: string, contractName: string, solcInput: SolcInput, solcOuput: SolcOutput, solcVersion: string) => isValidContractUpgrade(plugin, proxyAddress, contractName, solcInput, solcOuput, solcVersion)
export const isValidProxyUpgrade = (proxyAddress: string, contractName: string, solcInput: SolcInput, solcOutput: SolcOutput, solcVersion: string) => isValidContractUpgrade(plugin, proxyAddress, contractName, solcInput, solcOutput, solcVersion)
2 changes: 1 addition & 1 deletion libs/remixd/src/bin/remixd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function errorHandler (error: any, service: string) {
console.log('\x1b[33m%s\x1b[0m', '[WARN] You may now only use IDE at ' + options.remixIde + ' to connect to that instance')
}

if (!options.sharedFolder) options.sharedFolder = process.cwd() // if no specified, use the current folder
if (!options.sharedFolder) options.sharedFolder = process.cwd() // if not specified, use the current folder

if (options.sharedFolder && existsSync(absolutePath('./', options.sharedFolder))) {
console.log('\x1b[33m%s\x1b[0m', '[WARN] Any application that runs on your computer can potentially read from and write to all files in the directory.')
Expand Down

0 comments on commit 41c1b70

Please sign in to comment.