Skip to content

Commit 01147f7

Browse files
authored
Merge branch 'master' into newaichat
2 parents 8723c01 + c01d28f commit 01147f7

File tree

29 files changed

+111
-89
lines changed

29 files changed

+111
-89
lines changed

apps/remix-ide-e2e/src/tests/generalSettings.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module.exports = {
2727
.click('*[data-id="compilerContainerCompileBtn"]')
2828
.pause(3000)
2929
.click('*[data-id="verticalIconsKindfilePanel"]')
30-
.openFile('contracts/artifacts/Ballot.json')
31-
.openFile('contracts/artifacts/Ballot_metadata.json')
30+
.openFile('artifacts/Ballot.json')
31+
.openFile('artifacts/Ballot_metadata.json')
3232
.getEditorValue((content) => {
3333
const metadata = JSON.parse(content)
3434
browser.assert.equal(metadata.language, 'Solidity')

apps/remix-ide-e2e/src/tests/migrateFileSystem.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ module.exports = {
103103
},
104104
'Should have an artifacts file with JSON test data #group1 #group3 #group5 #group7': function (browser: NightwatchBrowser) {
105105
browser.waitForElementVisible('*[data-id="remixIdeSidePanel"]', 5000)
106-
.click('*[data-id="treeViewLitreeViewItemtest_contracts/artifacts"]')
107-
.openFile('test_contracts/artifacts/Storage_metadata.json')
106+
.click('*[data-id="treeViewLitreeViewItemartifacts"]')
107+
.openFile('artifacts/Storage_metadata.json')
108108
.waitForElementVisible('*[id="editorView"]', 10000)
109109
.getEditorValue((content) => {
110110
const metadata = JSON.parse(content)

apps/remix-ide-e2e/src/tests/script-runner.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const deploy = async (contractName: string, args: Array<any>, accountIndex?: num
120120
console.log(\`deploying \${contractName}\`)
121121
// Note that the script needs the ABI which is generated from the compilation artifact.
122122
// Make sure contract is compiled and artifacts are generated
123-
const artifactsPath = \`contracts/artifacts/\${contractName}.json\` // Change this for different path
123+
const artifactsPath = \`artifacts/\${contractName}.json\` // Change this for different path
124124
125125
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
126126
// 'web3Provider' is a remix global variable object

apps/remix-ide-e2e/src/tests/search.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ module.exports = {
3434
.clearValue('*[id="search_include"]').pause(2000)
3535
.setValue('*[id="search_include"]', '**').sendKeys('*[id="search_include"]', browser.Keys.ENTER).pause(4000)
3636
.elements('css selector', '.search_plugin_search_line', (res) => {
37-
Array.isArray(res.value) && browser.assert.equal(res.value.length, 63)
37+
Array.isArray(res.value) && browser.assert.equal(res.value.length, 61)
3838
})
3939
.setValue('*[id="search_exclude"]', ',contracts/**').sendKeys('*[id="search_exclude"]', browser.Keys.ENTER).pause(4000)
4040
.elements('css selector', '.search_plugin_search_line', (res) => {
41-
Array.isArray(res.value) && browser.assert.equal(res.value.length, 56)
41+
Array.isArray(res.value) && browser.assert.equal(res.value.length, 54)
4242
})
4343
.clearValue('*[id="search_include"]').setValue('*[id="search_include"]', '*.sol, *.js, *.txt')
4444
.clearValue('*[id="search_exclude"]').setValue('*[id="search_exclude"]', '.*/**/*')

apps/remix-ide-e2e/src/tests/terminal.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ const deployWithEthersJs = `
522522
523523
// Note that the script needs the ABI which is generated from the compilation artifact.
524524
// Make sure contract is compiled and artifacts are generated
525-
const artifactsPath = 'contracts/artifacts/Owner.json' // Change this for different path
525+
const artifactsPath = 'artifacts/Owner.json' // Change this for different path
526526
527527
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', artifactsPath))
528528
// 'web3Provider' is a remix global variable object
@@ -555,7 +555,7 @@ const { expect } = require("chai");
555555
describe("Storage with lib", function () {
556556
it("test initial value", async function () {
557557
// Make sure contract is compiled and artifacts are generated
558-
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'contracts/artifacts/Storage.json'))
558+
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'artifacts/Storage.json'))
559559
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner()
560560
let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer)
561561
let storage = await Storage.deploy();
@@ -565,7 +565,7 @@ describe("Storage with lib", function () {
565565
});
566566
567567
it("test updating and retrieving updated value", async function () {
568-
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'contracts/artifacts/Storage.json'))
568+
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'artifacts/Storage.json'))
569569
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner()
570570
let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer)
571571
let storage = await Storage.deploy();
@@ -576,7 +576,7 @@ describe("Storage with lib", function () {
576576
});
577577
578578
it("fail test updating and retrieving updated value", async function () {
579-
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'contracts/artifacts/Storage.json'))
579+
const metadata = JSON.parse(await remix.call('fileManager', 'getFile', 'artifacts/Storage.json'))
580580
const signer = (new ethers.providers.Web3Provider(web3Provider)).getSigner()
581581
let Storage = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer)
582582
let storage = await Storage.deploy();
@@ -633,7 +633,7 @@ const { ethers } = require("hardhat");
633633
634634
describe("Storage", function () {
635635
it("test library integration by calling a lib method", async function () {
636-
const metadataLib = JSON.parse(await remix.call('fileManager', 'readFile', 'contracts/artifacts/Lib.json'))
636+
const metadataLib = JSON.parse(await remix.call('fileManager', 'readFile', 'artifacts/Lib.json'))
637637
console.log('deploying lib:')
638638
const artifactLib = {
639639
contractName: 'Lib',
@@ -650,7 +650,7 @@ describe("Storage", function () {
650650
const lib = await factoryLib.deploy();
651651
await lib.deployed()
652652
653-
const metadata = JSON.parse(await remix.call('fileManager', 'readFile', 'contracts/artifacts/StorageWithLib.json'))
653+
const metadata = JSON.parse(await remix.call('fileManager', 'readFile', 'artifacts/StorageWithLib.json'))
654654
const artifact = {
655655
contractName: 'StorageWithLib',
656656
sourceName: 'contracts/StorageWithLib.sol',
@@ -786,7 +786,7 @@ const scriptAutoExec = {
786786
787787
// function getContractFactoryFromArtifact(artifact: Artifact, factoryOptions: FactoryOptions): Promise<ethers.ContractFactory>;
788788
789-
const metadataLib = JSON.parse(await remix.call('fileManager', 'readFile', 'contracts/artifacts/lib.json'))
789+
const metadataLib = JSON.parse(await remix.call('fileManager', 'readFile', 'artifacts/lib.json'))
790790
console.log('deploying lib:')
791791
792792
const artifactLib = {
@@ -808,7 +808,7 @@ const scriptAutoExec = {
808808
809809
console.log('lib deployed', lib.address)
810810
811-
const metadata = JSON.parse(await remix.call('fileManager', 'readFile', 'contracts/artifacts/Storage.json'))
811+
const metadata = JSON.parse(await remix.call('fileManager', 'readFile', 'artifacts/Storage.json'))
812812
const artifact = {
813813
contractName: 'Storage',
814814
sourceName: 'contracts/1_Storage.sol',

apps/remix-ide-e2e/src/tests/transactionExecution.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { NightwatchBrowser } from 'nightwatch'
33
import init from '../helpers/init'
44
import { JsonRpcProvider } from 'ethers'
55

6+
const branch = process.env.CIRCLE_BRANCH;
7+
const isMasterBranch = branch === 'master';
8+
const runMasterTests: boolean = (branch ? (isMasterBranch ? true : false) : true)
9+
610
module.exports = {
711
'@disabled': true,
812
before: function (browser: NightwatchBrowser, done: VoidFunction) {
@@ -239,6 +243,9 @@ module.exports = {
239243
},
240244

241245
'Should switch to the mainnet VM fork and execute a tx to query ENS #group5': function (browser: NightwatchBrowser) {
246+
if (!runMasterTests) {
247+
return
248+
}
242249
let addressRef
243250
browser
244251
.addFile('mainnet_ens.sol', sources[7]['mainnet_ens.sol'])
@@ -267,6 +274,9 @@ module.exports = {
267274
},
268275

269276
'Should stay connected in the mainnet VM fork and execute state changing operations and non state changing operations #group5': function (browser: NightwatchBrowser) {
277+
if (!runMasterTests) {
278+
return
279+
}
270280
let addressRef
271281
browser
272282
.click('*[data-id="deployAndRunClearInstances"]') // clear udapp instances
@@ -312,6 +322,9 @@ module.exports = {
312322
},
313323

314324
'Should stay connected to mainnet VM fork and: check the block number is advancing and is not low #group5': function (browser: NightwatchBrowser) {
325+
if (!runMasterTests) {
326+
return
327+
}
315328
/*
316329
Should stay connected in the mainnet VM fork and:
317330
- check the block number has been set to the current mainnet block number.

apps/remix-ide-e2e/src/tests/url.test.ts

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,8 @@ module.exports = {
9797
.refreshPage()
9898
.pause(2000)
9999
.currentWorkspaceIs('code-sample')
100-
.waitForElementVisible('*[data-id=treeViewLitreeViewItemmainnet]')
101-
.waitForElementVisible('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7"]')
102-
.waitForElementVisible('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]')
103-
.click('*[data-id="treeViewLitreeViewItemmainnet/0xdac17f958d2ee523a2206206994597c13d831ec7/TetherToken.sol"]')
100+
.waitForElementVisible('*[data-id="treeViewLitreeViewItemTetherToken.sol"]')
101+
.click('*[data-id="treeViewLitreeViewItemTetherToken.sol"]')
104102
.getEditorValue((content) => {
105103
browser.assert.ok(content && content.indexOf(
106104
'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1)
@@ -114,8 +112,7 @@ module.exports = {
114112
.refreshPage()
115113
.pause(7000)
116114
.currentWorkspaceIs('code-sample')
117-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com"]')
118-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0xdAC17F958D2ee523a2206206994597C13D831ec7"]')
115+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemTetherToken.sol"]')
119116
.getEditorValue((content) => {
120117
browser.assert.ok(content && content.indexOf(
121118
'contract TetherToken is Pausable, StandardToken, BlackList {') !== -1)
@@ -129,18 +126,16 @@ module.exports = {
129126
.refreshPage()
130127
.pause(7000)
131128
.currentWorkspaceIs('code-sample')
132-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com"]')
133-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9"]')
134-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts"]')
135-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin"]')
136-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/Address.sol"]')
137-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/BaseAdminUpgradeabilityProxy.sol"]')
138-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/BaseUpgradeabilityProxy.sol"]')
139-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/InitializableAdminUpgradeabilityProxy.sol"]')
140-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/InitializableUpgradeabilityProxy.sol"]')
141-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/Proxy.sol"]')
142-
.assert.elementPresent('*[data-id="treeViewLitreeViewItemeth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/UpgradeabilityProxy.sol"]')
143-
.openFile('eth.blockscout.com/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/contracts/open-zeppelin/InitializableAdminUpgradeabilityProxy.sol')
129+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts"]')
130+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin"]')
131+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin/Address.sol"]')
132+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin/BaseAdminUpgradeabilityProxy.sol"]')
133+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin/BaseUpgradeabilityProxy.sol"]')
134+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin/InitializableAdminUpgradeabilityProxy.sol"]')
135+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin/InitializableUpgradeabilityProxy.sol"]')
136+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin/Proxy.sol"]')
137+
.assert.elementPresent('*[data-id="treeViewLitreeViewItemcontracts/open-zeppelin/UpgradeabilityProxy.sol"]')
138+
.openFile('open-zeppelin/InitializableAdminUpgradeabilityProxy.sol')
144139
.getEditorValue((content) => {
145140
browser.assert.ok(content && content.indexOf(
146141
'contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy {') !== -1)

apps/remix-ide/src/app/files/filesystems/fileSystemUtility.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ export const migrationTestData = {
173173
'.workspaces/workspace_test/test_contracts/1_Storage.sol': {
174174
content: 'testing'
175175
},
176-
'.workspaces/workspace_test/test_contracts/artifacts': {
176+
'.workspaces/workspace_test/artifacts': {
177177
children: {
178-
'.workspaces/workspace_test/test_contracts/artifacts/Storage_metadata.json': {
178+
'.workspaces/workspace_test/artifacts/Storage_metadata.json': {
179179
content: '{ "test": "data" }'
180180
}
181181
}

libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,21 @@ export class FetchAndCompile extends Plugin {
176176
}
177177
}
178178
const { config, compilationTargets, version } = data
179+
/*
180+
* If the remappings are defined in the config, we need to update them to point to the targetPath
181+
* it's beeing disabled for the moment.
182+
*/
183+
/*if (config && config.settings && config.settings.remappings) {
184+
console.log(config.settings.remappings)
185+
config.settings.remappings = config.settings.remappings.map((remapping) => {
186+
let [virtual, path] = remapping.split('=')
187+
if (virtual.includes(':')) {
188+
let [scope, path] = virtual.split(':')
189+
virtual = `${targetPath}/${scope}:${path}`
190+
}
191+
return `${virtual}=${targetPath}/${path}`
192+
})
193+
}*/
179194

180195
try {
181196
setTimeout(_ => this.emit('compiling', config.settings), 0)

libs/remix-core-plugin/src/lib/compiler-metadata.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ export class CompilerMetadata extends Plugin {
2222
}
2323

2424
_JSONFileName (path, contractName) {
25-
return this.joinPath(path, this.innerPath, contractName + '.json')
25+
return this.joinPath(this.innerPath, contractName + '.json')
2626
}
2727

2828
_MetadataFileName (path, contractName) {
29-
return this.joinPath(path, this.innerPath, contractName + '_metadata.json')
29+
return this.joinPath(this.innerPath, contractName + '_metadata.json')
3030
}
3131

3232
onActivation () {
@@ -53,7 +53,7 @@ export class CompilerMetadata extends Plugin {
5353
// Access each file in build-info, check the input sources
5454
// If they are all same as in current compiled file and sources includes the path of compiled file, remove old build file
5555
async removeStoredBuildInfo (currentInput, path, filePath) {
56-
const buildDir = this.joinPath(path, this.innerPath, 'build-info/')
56+
const buildDir = this.joinPath(this.innerPath, 'build-info/')
5757
if (await this.call('fileManager', 'exists', buildDir)) {
5858
const allBuildFiles = await this.call('fileManager', 'fileList', buildDir)
5959
const currentInputFileNames = Object.keys(currentInput.sources)
@@ -79,7 +79,7 @@ export class CompilerMetadata extends Plugin {
7979
input
8080
})
8181
const id = createHash('md5').update(Buffer.from(json)).digest().toString('hex')
82-
const buildFilename = this.joinPath(path, this.innerPath, 'build-info/' + id + '.json')
82+
const buildFilename = this.joinPath(this.innerPath, 'build-info/' + id + '.json')
8383
// If there are no file in buildInfoNames,it means compilation is running first time after loading Remix
8484
if (!this.buildInfoNames[filePath]) {
8585
// Check the existing build-info and delete all the previous build files for compiled file

0 commit comments

Comments
 (0)