Skip to content

Commit fd24241

Browse files
authored
Merge branch 'master' into fix_udapp_input_parameters
2 parents 39396a8 + adbb7a5 commit fd24241

File tree

14 files changed

+62
-36
lines changed

14 files changed

+62
-36
lines changed

apps/remix-ide/src/app/panels/layout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export class Layout extends Plugin {
8080
const params = queryParams.get()
8181
if (params.minimizeterminal || params.embed) {
8282
this.panels.terminal.minimized = true
83-
this.event.emit('change', null)
83+
this.event.emit('change', this.panels)
84+
this.emit('change', this.panels)
8485
}
8586
if (params.minimizesidepanel || params.embed) {
8687
this.event.emit('minimizesidepanel')

apps/remix-ide/src/blockchain/blockchain.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export class Blockchain extends Plugin {
353353
if (network.name === 'VM') return
354354
this.call('terminal', 'logHtml',
355355
(<a href={etherScanLink(network.name, txhash)} target="_blank">
356-
open in etherscan
356+
view on etherscan
357357
</a>))
358358
})
359359
})

libs/remix-lib/src/execution/txRunnerWeb3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ async function tryTillReceiptAvailable (txhash, web3) {
153153
async function tryTillTxAvailable (txhash, web3) {
154154
try {
155155
const tx = await web3.eth.getTransaction(txhash)
156-
if (tx) return tx
156+
if (tx && tx.blockHash) return tx
157157
} catch (e) {}
158158
return await tryTillTxAvailable(txhash, web3)
159159
}

libs/remix-tests/src/compiler.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ function isRemixTestFile (path: string) {
4747

4848
function processFile (filePath: string, sources: SrcIfc, isRoot = false) {
4949
const importRegEx = /import ['"](.+?)['"];/g
50-
let group: RegExpExecArray| null = null
5150
const isFileAlreadyInSources: boolean = Object.keys(sources).includes(filePath)
5251

5352
// Return if file is a remix test file or already processed
@@ -62,14 +61,6 @@ function processFile (filePath: string, sources: SrcIfc, isRoot = false) {
6261
content = includeTestLibs.concat(content)
6362
}
6463
sources[filePath] = { content }
65-
importRegEx.exec('') // Resetting state of RegEx
66-
67-
// Process each 'import' in file content
68-
while ((group = importRegEx.exec(content))) {
69-
const importedFile: string = group[1]
70-
const importedFilePath: string = path.join(path.dirname(filePath), importedFile)
71-
processFile(importedFilePath, sources)
72-
}
7364
}
7465

7566
const userAgent = (typeof (navigator) !== 'undefined') && navigator.userAgent ? navigator.userAgent.toLowerCase() : '-'
@@ -123,7 +114,13 @@ export function compileFileOrFiles (filename: string, isDirectory: boolean, opts
123114
} finally {
124115
async.waterfall([
125116
function loadCompiler (next) {
126-
compiler = new RemixCompiler()
117+
compiler = new RemixCompiler((url, cb) => {
118+
try {
119+
cb(null, fs.readFileSync(url, 'utf-8'))
120+
} catch (e) {
121+
cb(e.message)
122+
}
123+
})
127124
if (compilerConfig) {
128125
const { currentCompilerUrl, evmVersion, optimize, runs } = compilerConfig
129126
if (evmVersion) compiler.set('evmVersion', evmVersion)

libs/remix-ui/panel/src/lib/dragbar/dragbar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const DragBar = (props: IRemixDragBarUi) => {
2020
props.refObject.current.setAttribute('style', `height: ${h}px;`)
2121
setDragBarPosY(window.innerHeight - props.refObject.current.offsetHeight)
2222
setDragState(false)
23+
props.setHideStatus(false)
2324
}
2425
const handleResize = () => {
2526
setDragBarPosY(window.innerHeight - props.refObject.current.offsetHeight)

libs/remix-ui/panel/src/lib/main/main-panel.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,24 @@ const RemixUIMainPanel = () => {
3737
appContext.layout.event.on('change', () => {
3838
renderPanels()
3939
})
40+
41+
return () => {
42+
appContext.layout.event.off('change')
43+
}
4044
}, [])
4145

46+
const showTerminal = (hide: boolean) => {
47+
appContext.layout.panels.terminal.minimized = hide
48+
appContext.layout.event.emit('change', appContext.layout.panels)
49+
appContext.layout.emit('change', appContext.layout.panels)
50+
}
51+
4252
return (
4353
<div className="mainview">
4454
{Object.values(plugins).map((pluginRecord, i) => {
4555
return (
4656
<React.Fragment key={`mainView${i}`}>
47-
{(pluginRecord.profile.name === 'terminal') ? <DragBar key='dragbar-terminal' hidden={pluginRecord.minimized || false} setHideStatus={() => {}} refObject={terminalRef}></DragBar> : null}
57+
{(pluginRecord.profile.name === 'terminal') ? <DragBar key='dragbar-terminal' hidden={pluginRecord.minimized || false} setHideStatus={showTerminal} refObject={terminalRef}></DragBar> : null}
4858
<RemixUIPanelPlugin
4959
ref={refs[i]}
5060
key={pluginRecord.profile.name}

libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
237237
</div>
238238
<div className="udapp_orLabel mt-2" style={{ display: loadType === 'abi' ? 'none' : 'block' }}>or</div>
239239
<div className="udapp_button udapp_atAddressSect">
240-
<button className="udapp_atAddress btn btn-sm btn-info" id="runAndDeployAtAdressButton" disabled={atAddressOptions.disabled} onClick={loadFromAddress}>At Address</button>
240+
<button className="udapp_atAddress btn btn-sm btn-info" id="runAndDeployAtAdressButton" disabled={atAddressOptions.disabled} title={atAddressOptions.title} onClick={loadFromAddress}>At Address</button>
241241
<input
242242
className="udapp_input udapp_ataddressinput ataddressinput form-control"
243243
placeholder="Load contract from Address"

libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d
723723
<label className="text-warning h6" data-id="testTabTestsExecutionStopped" hidden={testsExecutionStoppedHidden}>The test execution has been stopped</label>
724724
<label className="text-danger h6" data-id="testTabTestsExecutionStoppedError" hidden={testsExecutionStoppedErrorHidden}>The test execution has been stopped because of error(s) in your test file</label>
725725
</div>
726-
<div id="solidityUnittestsOutput" data-id="testTabSolidityUnitTestsOutput">{testsOutput}</div>
726+
<div className="mx-3 mb-2 pb-4 border-primary" id="solidityUnittestsOutput" data-id="testTabSolidityUnitTestsOutput">{testsOutput}</div>
727727
</div>
728728
</div>
729729
)

libs/remix-ui/terminal/src/lib/actions/terminalAction.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ export const listenOnNetworkAction = async (plugins, isListening) => {
111111
}
112112

113113
export const initListeningOnNetwork = (plugins, dispatch: React.Dispatch<any>) => {
114+
const provider = plugins.blockchain.getProvider()
115+
114116
plugins.txListener.event.register(NEW_BLOCK, (block) => {
115117
if (!block.transactions || (block.transactions && !block.transactions.length)) {
116-
dispatch({ type: EMPTY_BLOCK, payload: { message: 0 } })
118+
dispatch({ type: EMPTY_BLOCK, payload: { message: 0, provider } })
117119
}
118120
})
119121
plugins.txListener.event.register(KNOWN_TRANSACTION, () => {
@@ -128,18 +130,20 @@ export const initListeningOnNetwork = (plugins, dispatch: React.Dispatch<any>) =
128130

129131
const log = async (plugins, tx, receipt, dispatch: React.Dispatch<any>) => {
130132
const resolvedTransaction = await plugins.txListener.resolvedTransaction(tx.hash)
133+
const provider = plugins.blockchain.getProvider()
134+
131135
if (resolvedTransaction) {
132136
let compiledContracts = null
133137
if (plugins._deps.compilersArtefacts.__last) {
134138
compiledContracts = await plugins._deps.compilersArtefacts.__last.getContracts()
135139
}
136140
await plugins.eventsDecoder.parseLogs(tx, resolvedTransaction.contractName, compiledContracts, async (error, logs) => {
137141
if (!error) {
138-
await dispatch({ type: KNOWN_TRANSACTION, payload: { message: [{ tx: tx, receipt: receipt, resolvedData: resolvedTransaction, logs: logs }] } })
142+
await dispatch({ type: KNOWN_TRANSACTION, payload: { message: [{ tx: tx, receipt: receipt, resolvedData: resolvedTransaction, logs: logs }], provider } })
139143
}
140144
})
141145
} else {
142-
await dispatch({ type: UNKNOWN_TRANSACTION, payload: { message: [{ tx: tx, receipt: receipt }] } })
146+
await dispatch({ type: UNKNOWN_TRANSACTION, payload: { message: [{ tx: tx, receipt: receipt }], provider } })
143147
}
144148
}
145149

libs/remix-ui/terminal/src/lib/components/Context.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import helper from 'apps/remix-ide/src/lib/helper'
44
const remixLib = require('@remix-project/remix-lib')
55
const typeConversion = remixLib.execution.typeConversion
66

7-
const Context = ({ opts, blockchain }) => {
7+
const Context = ({ opts, provider }: { opts, provider: string }) => {
88
const data = opts.tx || ''
99
const from = opts.from ? helper.shortenHexData(opts.from) : ''
1010
let to = opts.to
@@ -16,7 +16,8 @@ const Context = ({ opts, blockchain }) => {
1616
const block = data.receipt ? data.receipt.blockNumber : data.blockNumber || ''
1717
const i = data.receipt ? data.transactionIndex : data.transactionIndex
1818
const value = val ? typeConversion.toInt(val) : 0
19-
if (blockchain.getProvider() === 'vm') {
19+
20+
if (provider === 'vm') {
2021
return (
2122
<div>
2223
<span>
@@ -29,7 +30,7 @@ const Context = ({ opts, blockchain }) => {
2930
<div className='remix_ui_terminal_txItem'><span className='remix_ui_terminal_txItemTitle'>hash:</span> {hash}</div>
3031
</span>
3132
</div>)
32-
} else if (blockchain.getProvider() !== 'vm' && data.resolvedData) {
33+
} else if (provider !== 'vm' && data.resolvedData) {
3334
return (
3435
<div>
3536
<span>

0 commit comments

Comments
 (0)