implemented hardhat changes

pull/5370/head
davidzagi93@gmail.com 3 years ago
parent b803f394ca
commit b48af6810c
  1. 14
      apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts
  2. 8
      apps/remix-ide/src/app/panels/terminal.js
  3. 7
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
  4. 3
      libs/remix-ui/terminal/src/lib/types/terminalTypes.ts
  5. 102
      package-lock.json
  6. 1
      package.json

@ -198,13 +198,13 @@ module.exports = {
.waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000) .waitForElementVisible('*[data-id="testTabSolidityUnitTestsOutputheader"]', 120000)
.waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 60000) .waitForElementPresent('#solidityUnittestsOutput div[class^="testPass"]', 60000)
.waitForElementContainsText('#solidityUnittestsOutput', 'tests/hhLogs_test.sol', 60000) .waitForElementContainsText('#solidityUnittestsOutput', 'tests/hhLogs_test.sol', 60000)
.assert.containsText('#journal > div:nth-child(3) > span > div', 'Before all:') .assert.containsText('#journal > div:nth-child(2) > span ', 'Before all:')
.assert.containsText('#journal > div:nth-child(3) > span > div', 'Inside beforeAll') .assert.containsText('#journal > div:nth-child(2) > span', 'Inside beforeAll')
.assert.containsText('#journal > div:nth-child(4) > span > div', 'Check sender:') .assert.containsText('#journal > div:nth-child(3) > span', 'Check sender:')
.assert.containsText('#journal > div:nth-child(4) > span > div', 'msg.sender is 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4') .assert.containsText('#journal > div:nth-child(3) > span', 'msg.sender is 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4')
.assert.containsText('#journal > div:nth-child(5) > span > div', 'Check int logs:') .assert.containsText('#journal > div:nth-child(4) > span', 'Check int logs:')
.assert.containsText('#journal > div:nth-child(5) > span > div', '10 20') .assert.containsText('#journal > div:nth-child(4) > span', '10 20')
.assert.containsText('#journal > div:nth-child(5) > span > div', 'Number is 25') .assert.containsText('#journal > div:nth-child(4) > span', 'Number is 25')
.openFile('tests/hhLogs_test.sol') .openFile('tests/hhLogs_test.sol')
.removeFile('tests/hhLogs_test.sol', 'workspace_new') .removeFile('tests/hhLogs_test.sol', 'workspace_new')
}, },

@ -89,6 +89,7 @@ class Terminal extends Plugin {
this.call('debugger', 'debug', hash) this.call('debugger', 'debug', hash)
}) })
this.logHtmlResponse = [] this.logHtmlResponse = []
this.logResponse = []
} }
onActivation () { onActivation () {
@ -109,6 +110,12 @@ class Terminal extends Plugin {
this.logHtmlResponse = [] this.logHtmlResponse = []
} }
log (message) {
this.logResponse.push(message)
this.renderComponent()
this.logResponse = []
}
render () { render () {
return this.element return this.element
} }
@ -134,6 +141,7 @@ class Terminal extends Plugin {
txListener = {this.txListener} txListener = {this.txListener}
eventsDecoder = {this.eventsDecoder} eventsDecoder = {this.eventsDecoder}
logHtml = {this.logHtmlResponse} logHtml = {this.logHtmlResponse}
logResponse = {this.logResponse}
/>, />,
this.element this.element
) )

@ -17,6 +17,7 @@ import jsbeautify from 'js-beautify'
import renderUnKnownTransactions from './components/RenderUnknownTransactions' import renderUnKnownTransactions from './components/RenderUnknownTransactions'
import renderCall from './components/RenderCall' import renderCall from './components/RenderCall'
import renderKnownTransactions from './components/RenderKnownTransactions' import renderKnownTransactions from './components/RenderKnownTransactions'
import parse from 'html-react-parser'
import { RemixUiTerminalProps } from './types/terminalTypes' import { RemixUiTerminalProps } from './types/terminalTypes'
import { wrapScript } from './utils/wrapScript' import { wrapScript } from './utils/wrapScript'
@ -79,6 +80,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
scriptRunnerDispatch({ type: 'html', payload: { message: props.logHtml } }) scriptRunnerDispatch({ type: 'html', payload: { message: props.logHtml } })
}, [props.logHtml]) }, [props.logHtml])
useEffect(() => {
scriptRunnerDispatch({ type: 'log', payload: { message: props.logResponse } })
}, [props.logResponse])
// events // events
useEffect(() => { useEffect(() => {
initListeningOnNetwork(props, scriptRunnerDispatch) initListeningOnNetwork(props, scriptRunnerDispatch)
@ -526,7 +531,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
return x.message.map((msg, i) => { return x.message.map((msg, i) => {
if (typeof msg === 'object') { if (typeof msg === 'object') {
return ( return (
<div className="px-4 block" data-id="block_null" key={i}><span className={x.style}>{ JSON.stringify(msg) } </span></div> <div className="px-4 block" data-id="block_null" key={i}><span className={x.style}>{ msg.value ? parse(msg.value) : JSON.stringify(msg) } </span></div>
) )
} else { } else {
return ( return (

@ -24,5 +24,6 @@ export interface RemixUiTerminalProps {
commands: any, commands: any,
txListener: any, txListener: any,
eventsDecoder: any, eventsDecoder: any,
logHtml: any logHtml: any,
logResponse: any
} }

102
package-lock.json generated

@ -14890,6 +14890,21 @@
"webidl-conversions": "^4.0.2" "webidl-conversions": "^4.0.2"
} }
}, },
"domhandler": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.2.tgz",
"integrity": "sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w==",
"requires": {
"domelementtype": "^2.2.0"
},
"dependencies": {
"domelementtype": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A=="
}
}
},
"domutils": { "domutils": {
"version": "1.7.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
@ -15242,8 +15257,7 @@
"entities": { "entities": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz",
"integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==", "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ=="
"dev": true
}, },
"env-paths": { "env-paths": {
"version": "2.2.0", "version": "2.2.0",
@ -19581,6 +19595,15 @@
"integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==",
"dev": true "dev": true
}, },
"html-dom-parser": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-1.0.2.tgz",
"integrity": "sha512-Jq4oVkVSn+10ut3fyc2P/Fs1jqTo0l45cP6Q8d2ef/9jfkYwulO0QXmyLI0VUiZrXF4czpGgMEJRa52CQ6Fk8Q==",
"requires": {
"domhandler": "4.2.2",
"htmlparser2": "6.1.0"
}
},
"html-encoding-sniffer": { "html-encoding-sniffer": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz",
@ -19602,12 +19625,61 @@
"integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
"dev": true "dev": true
}, },
"html-react-parser": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/html-react-parser/-/html-react-parser-1.3.0.tgz",
"integrity": "sha512-lhpkOFH8pwqEjlNUYCWvjT43/JVCZO9MAZuCS6afT1/VP+bZcNxNUs4AUqiMzH0QPSDHwM/GFNXZNok1KTA4BQ==",
"requires": {
"domhandler": "4.2.2",
"html-dom-parser": "1.0.2",
"react-property": "2.0.0",
"style-to-js": "1.1.0"
}
},
"htmlescape": { "htmlescape": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz",
"integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=",
"dev": true "dev": true
}, },
"htmlparser2": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
"integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==",
"requires": {
"domelementtype": "^2.0.1",
"domhandler": "^4.0.0",
"domutils": "^2.5.2",
"entities": "^2.0.0"
},
"dependencies": {
"dom-serializer": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz",
"integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==",
"requires": {
"domelementtype": "^2.0.1",
"domhandler": "^4.2.0",
"entities": "^2.0.0"
}
},
"domelementtype": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz",
"integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A=="
},
"domutils": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz",
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
"requires": {
"dom-serializer": "^1.0.1",
"domelementtype": "^2.2.0",
"domhandler": "^4.2.0"
}
}
}
},
"http-cache-semantics": { "http-cache-semantics": {
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
@ -20001,6 +20073,11 @@
"source-map": "~0.5.3" "source-map": "~0.5.3"
} }
}, },
"inline-style-parser": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz",
"integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q=="
},
"inquirer": { "inquirer": {
"version": "6.5.2", "version": "6.5.2",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz",
@ -32937,6 +33014,11 @@
"warning": "^4.0.3" "warning": "^4.0.3"
} }
}, },
"react-property": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/react-property/-/react-property-2.0.0.tgz",
"integrity": "sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw=="
},
"react-redux": { "react-redux": {
"version": "7.2.2", "version": "7.2.2",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.2.tgz", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.2.tgz",
@ -36397,6 +36479,22 @@
"schema-utils": "^2.0.1" "schema-utils": "^2.0.1"
} }
}, },
"style-to-js": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.0.tgz",
"integrity": "sha512-1OqefPDxGrlMwcbfpsTVRyzwdhr4W0uxYQzeA2F1CBc8WG04udg2+ybRnvh3XYL4TdHQrCahLtax2jc8xaE6rA==",
"requires": {
"style-to-object": "0.3.0"
}
},
"style-to-object": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.3.0.tgz",
"integrity": "sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==",
"requires": {
"inline-style-parser": "0.1.1"
}
},
"stylehacks": { "stylehacks": {
"version": "4.0.3", "version": "4.0.3",
"resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-4.0.3.tgz",

@ -160,6 +160,7 @@
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"fs-extra": "^3.0.1", "fs-extra": "^3.0.1",
"html-react-parser": "^1.3.0",
"http-server": "^0.11.1", "http-server": "^0.11.1",
"intro.js": "^4.1.0", "intro.js": "^4.1.0",
"isbinaryfile": "^3.0.2", "isbinaryfile": "^3.0.2",

Loading…
Cancel
Save