Merge branch 'master' into yann300-patch-48

pull/5370/head
Liana Husikyan 2 years ago committed by GitHub
commit 5f841d8328
  1. 22
      .circleci/config.yml
  2. 1
      apps/debugger/tsconfig.app.json
  3. 1
      apps/etherscan/tsconfig.app.json
  4. 12
      apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts
  5. 1
      apps/remix-ide-e2e/src/local-plugin/.eslintrc
  6. 8
      apps/remix-ide-e2e/src/tests/recorder.test.ts
  7. 1
      apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts
  8. 8
      apps/remix-ide-e2e/src/tests/specialFunctions.test.ts
  9. 1
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  10. 2
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  11. 2
      apps/remix-ide/src/app/tabs/compile-and-run.ts
  12. 2
      apps/remix-ide/tsconfig.json
  13. 2
      apps/remix-ide/tsconfig.spec.json
  14. 1
      apps/solidity-compiler/tsconfig.app.json
  15. 4
      jest.preset.js
  16. 2
      libs/ghaction-helper/tsconfig.json
  17. 26
      libs/remix-solidity/jest.config.js
  18. 2
      libs/remix-solidity/tsconfig.json
  19. 2
      libs/remix-tests/tsconfig.spec.json
  20. 3
      libs/remix-ui/settings/src/lib/github-settings.tsx
  21. 2
      libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
  22. 2
      libs/remixd/tsconfig.spec.json
  23. 6
      package.json
  24. 1464
      yarn.lock

@ -226,7 +226,14 @@ jobs:
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- save_cache:
key: v1-deps-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn run downloadsolc_assets
- run: yarn run build:production
- run:
@ -250,7 +257,14 @@ jobs:
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- save_cache:
key: v1-deps-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn run downloadsolc_assets
- run: yarn run build:production
- run:
@ -274,8 +288,14 @@ jobs:
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- run: yarn run build:libs
- save_cache:
key: v1-deps-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn run downloadsolc_assets
- run: yarn run build:production
- run:

@ -9,7 +9,6 @@
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",

@ -9,7 +9,6 @@
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",

@ -7,12 +7,12 @@ import EventEmitter from 'events'
class JournalLastChildIncludes extends EventEmitter {
command(this: NightwatchBrowser, val: string): NightwatchBrowser {
this.api
.waitForElementVisible('*[data-id="terminalJournal"]', 10000)
.pause(1000)
.getText('*[data-id="terminalJournal"]', (result) => {
console.log('JournalLastChildIncludes', result.value)
if (typeof result.value === 'string' && result.value.indexOf(val) === -1) return this.api.assert.fail(`wait for ${val} in ${result.value}`)
else this.api.assert.ok(true, `<*[data-id="terminalJournal"]> contains ${val}.`)
.waitForElementPresent({
selector: `//*[@data-id='terminalJournal' and contains(.,'${val}')]`,
timeout: 10000,
locateStrategy: 'xpath'
}).perform((done) => {
done()
this.emit('complete')
})
return this

@ -238,7 +238,6 @@
"browser": true,
"commonjs": true,
"es6": true,
"jest": true,
"node": true
},
"settings": { "react": { "version": "detect" } },

@ -68,10 +68,9 @@ module.exports = {
})
},
'Record more than one contract #group1': function (browser: NightwatchBrowser) {
'Record more than one contract #group2': function (browser: NightwatchBrowser) {
// deploy 2 contracts (2 different ABIs), save the record, reexecute and test one of the function.
browser
.click('*[data-id="deployAndRunClearInstances"]')
.testContracts('multipleContracts.sol', sources[1]['multipleContracts.sol'], ['t1est', 't2est'])
.clickLaunchIcon('udapp')
.selectContract('t1est')
@ -81,6 +80,7 @@ module.exports = {
.selectContract('t2est')
.pause(1000)
.createContract('')
.click('[data-id="udappRecorderTitleExpander"]')
.click('.savetransaction')
.waitForElementVisible('[data-id="udappNotify-modal-footer-ok-react"]')
.execute(function () {
@ -92,7 +92,7 @@ module.exports = {
.click('*[data-id="deployAndRunClearInstances"]') // clear udapp
.click('*[data-id="terminalClearConsole"]') // clear terminal
.click('[data-id="runtransaction"]')
.clickInstance(2)
.clickInstance(1)
.pause(1000)
.clickFunction('set2 - transact (not payable)', { types: 'uint256 _po', values: '10' })
.testFunction('last',
@ -103,7 +103,7 @@ module.exports = {
},
'Run with live "mode" #group1': function (browser: NightwatchBrowser) {
'Run with live "mode" #group2': function (browser: NightwatchBrowser) {
let addressRef: string
browser.addFile('scenario_live_mode.json', { content: JSON.stringify(liveModeScenario, null, '\t') })
.addFile('scenario_live_mode_storage.sol', { content: testStorageForLiveMode })

@ -224,7 +224,6 @@ module.exports = {
'Call web3.eth.getAccounts() using Injected Provider (Metamask)': !function (browser: NightwatchBrowser) {
browser
.executeScriptInTerminal('web3.eth.getAccounts()')
.pause(2000)
.journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]')
.end()
}

@ -29,7 +29,6 @@ module.exports = {
.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '0xaa')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 0 wei')
.journalLastChildIncludes('data: 0xaa')
@ -67,7 +66,6 @@ module.exports = {
browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(receive)')
.journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x')
@ -80,7 +78,6 @@ module.exports = {
browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '10', '0xaa')
.pause(1000)
.journalLastChildIncludes('to CheckSpecials.(fallback) errored:')
.journalLastChildIncludes('The called function should be payable if you send value')
.perform(done())
@ -97,7 +94,6 @@ module.exports = {
.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(receive)')
.journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x')
@ -110,7 +106,6 @@ module.exports = {
browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '0xaa')
.pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined')
.perform(done())
@ -127,7 +122,6 @@ module.exports = {
.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x')
@ -140,7 +134,6 @@ module.exports = {
browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '0xaa')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0xaa')
@ -180,7 +173,6 @@ module.exports = {
.perform((done) => {
browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '999999998765257135', '0xaa')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 999999998765257135 wei')
.journalLastChildIncludes('data: 0xaa')

@ -202,7 +202,6 @@ module.exports = {
.addFile('scripts/deploy_storage.js', { content: scriptAutoExec.script })
.openFile('contracts/storage.sol')
.sendKeys('body', [browser.Keys.CONTROL, browser.Keys.SHIFT, 's'])
.pause(15000)
.journalLastChildIncludes('147')
},

@ -141,7 +141,6 @@ module.exports = {
.click('.udapp_contractActionsContainerSingle > button')
.clickInstance(0)
.clickFunction('g - transact (not payable)')
.pause(5000)
.journalLastChildIncludes('Error provided by the contract:')
.journalLastChildIncludes('CustomError : error description')
.journalLastChildIncludes('Parameters:')
@ -182,7 +181,6 @@ module.exports = {
.click('.udapp_contractActionsContainerSingle > button')
.clickInstance(1)
.clickFunction('h - transact (not payable)')
.pause(5000)
.journalLastChildIncludes('Error provided by the contract:')
.journalLastChildIncludes('CustomError : error description from library')
.journalLastChildIncludes('Parameters:')

@ -62,7 +62,7 @@ export class CompileAndRun extends Plugin {
if (clearAllInstances) {
await this.call('udapp', 'clearAllInstances')
}
await this.call('scriptRunner', 'execute', content)
await this.call('scriptRunner', 'execute', content, fileName)
} catch (e) {
this.call('notification', 'toast', e.message || e)
}

@ -5,7 +5,7 @@
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"types": ["node", "jest"],
"types": ["node"],
"resolveJsonModule": true
},
"files": [

@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": ["node"]
},
"include": [
"**/*.spec.ts",

@ -9,7 +9,6 @@
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",

@ -1,4 +0,0 @@
const nxPreset = require('@nrwl/jest/preset');
module.exports = { ...nxPreset }

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["jest", "node"]
"types": ["node"]
},
"include": ["**/*.ts"]
}

@ -1,26 +0,0 @@
module.exports = {
name: 'remix-solidity',
preset: '../../jest.config.js',
verbose: true,
silent: false, // Silent console messages, specially the 'remix-simulator' ones
transform: {
'^.+\\.[tj]sx?$': ['ts-jest',
{
useESM: true,
}]
},
transformIgnorePatterns: ["/node_modules/", "/dist/", "\\.pnp\\.[^\\/]+$"],
rootDir: "./",
testTimeout: 40000,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html', 'json'],
// Coverage
collectCoverage: true,
coverageReporters: ['text', 'text-summary'],
collectCoverageFrom: [
"**/*.ts",
"!**/sol/**",
"!src/types.ts",
"!src/logger.ts"
],
coverageDirectory: '../../coverage/libs/remix-solidity'
};

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["jest", "node"],
"types": ["node"],
},
"include": ["**/*.ts"]
}

@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": ["node"]
},
"include": [
"**/*.spec.ts",

@ -25,7 +25,8 @@ export function GithubSettings (props: GithubSettingsProps) {
}, [props.config])
const handleChangeTokenState = (event) => {
setGithubToken(event.target.value)
const token = event.target.value ? event.target.value.trim() : event.target.value
setGithubToken(token)
}
const handleChangeUserNameState = (event) => {

@ -153,7 +153,7 @@ export const TabsUI = (props: TabsUIProps) => {
const path = active().substr(active().indexOf('/') + 1, active().length)
const content = await props.plugin.call('fileManager', "readFile", path)
if (tabsState.currentExt === 'js' || tabsState.currentExt === 'ts') {
await props.plugin.call('scriptRunner', 'execute', content)
await props.plugin.call('scriptRunner', 'execute', content, path)
_paq.push(['trackEvent', 'editor', 'clickRunFromEditor', tabsState.currentExt])
} else if (tabsState.currentExt === 'sol' || tabsState.currentExt === 'yul') {
await props.plugin.call('solidity', 'compile', path)

@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": ["node"]
},
"include": [
"**/*.spec.ts",

@ -225,7 +225,6 @@
"@monaco-editor/react": "4.4.5",
"@nrwl/cli": "^15.7.1",
"@nrwl/eslint-plugin-nx": "^15.7.1",
"@nrwl/jest": "15.7.1",
"@nrwl/js": "15.7.1",
"@nrwl/linter": "15.7.1",
"@nrwl/node": "15.7.1",
@ -243,7 +242,6 @@
"@types/express-ws": "^3.0.1",
"@types/fs-extra": "^9.0.1",
"@types/isomorphic-git__lightning-fs": "^4.4.2",
"@types/jest": "28.1.1",
"@types/lodash": "^4.14.172",
"@types/mocha": "^9.1.1",
"@types/node": "18.7.18",
@ -264,7 +262,6 @@
"ace-mode-solidity": "^0.1.0",
"ace-mode-zokrates": "^1.0.4",
"babel-eslint": "^10.0.0",
"babel-jest": "25.1.0",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-fast-async": "^6.1.2",
"babel-plugin-module-resolver": "^4.0.0",
@ -315,8 +312,6 @@
"ipfs-mini": "^1.1.5",
"is-electron": "^2.2.0",
"javascript-serialize": "^1.6.1",
"jest": "^29.3.1",
"jest-environment-jsdom": "28.1.1",
"js-base64": "^2.1.9",
"js-beautify": "1.6.14",
"lerna": "^3.22.1",
@ -350,7 +345,6 @@
"tape": "^4.13.3",
"terser-webpack-plugin": "^5.3.6",
"timers-browserify": "^2.0.12",
"ts-jest": "^29.0.3",
"ts-node": "10.9.1",
"tslint": "~6.0.0",
"typescript": "^4.8.4",

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save