pull/2894/head
yann300 2 years ago
parent ae00f8a0dc
commit b22352aeae
  1. 113561
      apps/remix-ide-e2e/src/helpers/hardhat_compilation.ts
  2. 113556
      apps/remix-ide-e2e/src/helpers/hardhat_compilation_8a7ab689ec618720f53ce867a3031c03.json
  3. 23
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  4. 3
      apps/remix-ide-e2e/tsconfig.e2e.json
  5. 3
      apps/remix-ide-e2e/tsconfig.json
  6. 0
      apps/remix-ide/contracts/artifacts/build-info/.gitgnore
  7. 1
      apps/remix-ide/contracts/hardhat.config.js
  8. 2
      libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx
  9. 2
      libs/remix-ui/run-tab/src/lib/reducers/runTab.ts

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,7 +1,8 @@
'use strict'
import { NightwatchBrowser } from 'nightwatch'
import { writeFileSync } from 'fs'
import init from '../helpers/init'
import { hardhat_compilation } from '../helpers/hardhat_compilation'
import * as hardhatCompilation from '../helpers/hardhat_compilation_8a7ab689ec618720f53ce867a3031c03.json'
const assetsTestContract = `import "./contract.sol";
contract Assets {
@ -115,13 +116,19 @@ module.exports = {
.scrollAndClick('#pluginManager *[data-id="pluginManagerComponentDeactivateButtonremixd"]')
},
'Should listen on compilation result from hardhat #group4': function (browser: NightwatchBrowser) {
browser
.addFile('artifacts/build-info/c7062fdd360381a85af23eeef31c98f8.json', { content: hardhat_compilation }) // emulate hardhat emitting a compilation result
.waitForElementContainsText('*[data-id="terminalJournal"]', 'received compilation result from hardhat', 60000)
.clickLaunchIcon('udapp')
.assert.containsText('*[data-id="udappCompiledBy"]', 'Compiled by hardhat')
.verifyContracts(['Lock'])
'Should listen on compilation result from hardhat #group5': function (browser: NightwatchBrowser) {
browser.perform((done) => {
console.log('working directory', process.cwd())
writeFileSync('./apps/remix-ide/contracts/artifacts/build-info/c7062fdd360381a85af23eeef31c98f8.json', JSON.stringify(hardhatCompilation))
done()
})
.expect.element('*[data-id="terminalJournal"]').text.to.contain('received compilation result from hardhat').before(60000)
browser.clickLaunchIcon('udapp')
.assert.textContains('*[data-id="udappCompiledBy"]', 'Compiled by hardhat')
.selectContract('Lock')
.createContract('1')
.expect.element('*[data-id="terminalJournal"]').text.to.contain('Unlock time should be in the future').before(60000)
}
}

@ -3,7 +3,8 @@
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist",
"allowJs": true
"allowJs": true,
"resolveJsonModule": true
},
"include": ["**/*.ts", "**/*.js"]
}

@ -2,7 +2,8 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["node", "nightwatch"],
"esModuleInterop": true
"esModuleInterop": true,
"resolveJsonModule": true
},
"include": ["**/*.ts", "**/*.js"]
}

@ -0,0 +1 @@
// simulate a hardhat project

@ -229,7 +229,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
<div className="udapp_container" data-id="contractDropdownContainer">
<div className='d-flex justify-content-between'>
<label className="udapp_settingsLabel">Contract</label>
{ Object.keys(props.contracts.contractList).length > 0 && compilationSource !== '' && <label data-id="udappCompiledBy" className='text-light'>Compiled by {compilationSource} </label> }
{ Object.keys(props.contracts.contractList).length > 0 && compilationSource !== '' && <label data-id="udappCompiledBy">Compiled by {compilationSource} </label> }
</div>
<div className="udapp_subcontainer">
<select ref={contractsRef} value={currentContract} onChange={handleContractChange} className="udapp_contractNames custom-select" disabled={contractOptions.disabled} title={contractOptions.title} style={{ display: loadType === 'abi' && !isContractFile(currentFile) ? 'none' : 'block' }}>

@ -525,8 +525,8 @@ export const runTabReducer = (state: RunTabState = runTabInitialState, action: A
return {
...state,
contracts: {
compilationSource: payload,
...state.contracts,
compilationSource: payload,
}
}
}

Loading…
Cancel
Save