Skip to content

Commit 1121a6d

Browse files
author
filip mertens
committed
refactor dropdown
1 parent 9723b79 commit 1121a6d

File tree

7 files changed

+104
-41
lines changed

7 files changed

+104
-41
lines changed

libs/remix-ui/run-tab/src/lib/actions/events.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import { envChangeNotification } from "@remix-ui/helper"
22
import { RunTab } from "../types/run-tab"
33
import { setExecutionContext, setFinalContext, updateAccountBalances } from "./account"
44
import { addExternalProvider, addInstance, removeExternalProvider, setNetworkNameFromProvider } from "./actions"
5-
import { addDeployOption, clearAllInstances, clearRecorderCount, fetchContractListSuccess, resetUdapp, setCompilationSource, setCurrentContract, setCurrentFile, setLoadType, setProxyEnvAddress, setRecorderCount, setSendValue } from "./payload"
5+
import { addDeployOption, clearAllInstances, clearRecorderCount, fetchContractListSuccess, resetUdapp, setCompilationSource, setCurrentContract, setCurrentFile, setLoadType, setProxyEnvAddress, setRecorderCount, setRemixDActivated, setSendValue } from "./payload"
66
import { CompilerAbstract } from '@remix-project/remix-solidity'
77
import * as ethJSUtil from 'ethereumjs-util'
88
import Web3 from 'web3'
9+
import { Plugin } from "@remixproject/engine"
910

1011
export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
1112
plugin.blockchain.events.on('newTransaction', (tx, receipt) => {
@@ -73,6 +74,21 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
7374
plugin.on('filePanel', 'setWorkspace', () => {
7475
dispatch(resetUdapp())
7576
resetAndInit(plugin)
77+
plugin.call('manager', 'isActive', 'remixd').then((activated) => {
78+
dispatch(setRemixDActivated(activated))
79+
})
80+
})
81+
82+
plugin.on('manager', 'pluginActivated', (plugin: Plugin) => {
83+
if (plugin.name === 'remixd') {
84+
dispatch(setRemixDActivated(true))
85+
}
86+
})
87+
88+
plugin.on('manager', 'pluginDeactivated', (plugin: Plugin) => {
89+
if (plugin.name === 'remixd') {
90+
dispatch(setRemixDActivated(false))
91+
}
7692
})
7793

7894
plugin.fileManager.events.on('currentFileChanged', (currentFile: string) => {
@@ -100,12 +116,13 @@ export const setupEvents = (plugin: RunTab, dispatch: React.Dispatch<any>) => {
100116

101117
const broadcastCompilationResult = async (compilerName: string, plugin: RunTab, dispatch: React.Dispatch<any>, file, source, languageVersion, data, input?) => {
102118
// TODO check whether the tab is configured
119+
console.log('compilation finished', compilerName, file)
103120
const compiler = new CompilerAbstract(languageVersion, data, source, input)
104121
plugin.compilersArtefacts[languageVersion] = compiler
105122
plugin.compilersArtefacts.__last = compiler
106123

107124
const contracts = getCompiledContracts(compiler).map((contract) => {
108-
return { name: languageVersion, alias: contract.name, file: contract.file, compiler }
125+
return { name: languageVersion, alias: contract.name, file: contract.file, compiler, compilerName }
109126
})
110127
if ((contracts.length > 0)) {
111128
const contractsInCompiledFile = contracts.filter(obj => obj.file === file)
@@ -125,7 +142,7 @@ const broadcastCompilationResult = async (compilerName: string, plugin: RunTab,
125142
}
126143
dispatch(fetchContractListSuccess({ [file]: contracts }))
127144
dispatch(setCurrentFile(file))
128-
dispatch(setCompilationSource(compilerName))
145+
// dispatch(setCompilationSource(compilerName))
129146
// TODO: set current contract
130147
}
131148

libs/remix-ui/run-tab/src/lib/actions/payload.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ContractList } from '../reducers/runTab'
22
import { ContractData } from '@remix-project/core-plugin'
3-
import { ADD_DEPLOY_OPTION, ADD_INSTANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_DEPLOY_OPTION, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_COMPILATION_SOURCE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_PROXY_ENV_ADDRESS, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE } from '../constants'
3+
import { ADD_DEPLOY_OPTION, ADD_INSTANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_DEPLOY_OPTION, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_COMPILATION_SOURCE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_PROXY_ENV_ADDRESS, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE, SET_REMIXD_ACTIVATED } from '../constants'
44
import { DeployMode, DeployOptions } from '../types'
55

66
export const fetchAccountsListRequest = () => {
@@ -168,7 +168,7 @@ export const setCurrentFile = (file: string) => {
168168
}
169169
}
170170

171-
export const setCompilationSource = (source: string) => {
171+
export const setCompilationSource = (source: { [file:string]: string} ) => {
172172
return {
173173
type: SET_COMPILATION_SOURCE,
174174
payload: source
@@ -315,3 +315,10 @@ export const setProxyEnvAddress = (key: string) => {
315315
type: SET_PROXY_ENV_ADDRESS
316316
}
317317
}
318+
319+
export const setRemixDActivated = (activated: boolean) => {
320+
return {
321+
payload: activated,
322+
type: SET_REMIXD_ACTIVATED
323+
}
324+
}

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

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@ import { ContractData, FuncABI } from '@remix-project/core-plugin'
55
import * as ethJSUtil from 'ethereumjs-util'
66
import { ContractGUI } from './contractGUI'
77
import { deployWithProxyMsg, upgradeWithProxyMsg } from '@remix-ui/helper'
8-
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
8+
import { Dropdown, OverlayTrigger, Tooltip } from 'react-bootstrap'
99

10-
export function ContractDropdownUI (props: ContractDropdownProps) {
10+
export function ContractDropdownUI(props: ContractDropdownProps) {
1111
const [abiLabel, setAbiLabel] = useState<{
1212
display: string,
1313
content: string
1414
}>({
1515
display: '',
1616
content: ''
1717
})
18-
const [atAddressOptions, setAtAddressOptions] = useState<{title: string, disabled: boolean}>({
18+
const [atAddressOptions, setAtAddressOptions] = useState<{ title: string, disabled: boolean }>({
1919
title: 'address of contract',
2020
disabled: true
2121
})
2222
const [loadedAddress, setLoadedAddress] = useState<string>('')
23-
const [contractOptions, setContractOptions] = useState<{title: string, disabled: boolean}>({
23+
const [contractOptions, setContractOptions] = useState<{ title: string, disabled: boolean }>({
2424
title: 'Please compile *.sol file to deploy or access a contract',
2525
disabled: true
2626
})
2727
const [loadedContractData, setLoadedContractData] = useState<ContractData>(null)
2828
const [constructorInterface, setConstructorInterface] = useState<FuncABI>(null)
2929
const [constructorInputs, setConstructorInputs] = useState(null)
30+
const [compilerName, setCompilerName] = useState<string>('')
3031
const contractsRef = useRef<HTMLSelectElement>(null)
3132
const atAddressValue = useRef<HTMLInputElement>(null)
3233
const { contractList, loadType, currentFile, compilationSource, currentContract, compilationCount, deployOptions, proxyKey } = props.contracts
@@ -97,20 +98,23 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
9798

9899
useEffect(() => {
99100
initSelectedContract()
101+
updateCompilerName()
100102
}, [contractList])
101103

102104
useEffect(() => {
103105
// if the file change the ui is already feed with another bunch of contracts.
104106
// we also need to update the state
105-
const contracts = contractList[currentFile]
107+
const contracts = contractList[currentFile]
106108
if (contracts && contracts.length > 0) {
107109
props.setSelectedContract(contracts[0].alias)
108110
}
111+
updateCompilerName()
109112
}, [currentFile])
110113

111114
const initSelectedContract = () => {
112115
const contracts = contractList[currentFile]
113-
116+
117+
114118
if (contracts && contracts.length > 0) {
115119
const contract = contracts.find(contract => contract.alias === currentContract)
116120

@@ -122,9 +126,9 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
122126

123127
const isContractFile = (file) => {
124128
return /.(.sol)$/.exec(file) ||
125-
/.(.vy)$/.exec(file) || // vyper
126-
/.(.lex)$/.exec(file) || // lexon
127-
/.(.contract)$/.exec(file)
129+
/.(.vy)$/.exec(file) || // vyper
130+
/.(.lex)$/.exec(file) || // lexon
131+
/.(.contract)$/.exec(file)
128132
}
129133

130134
const enableAtAddress = (enable: boolean) => {
@@ -161,20 +165,20 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
161165

162166
const createInstance = (selectedContract, args, deployMode?: DeployMode[]) => {
163167
if (selectedContract.bytecodeObject.length === 0) {
164-
return props.modal('Alert', 'This contract may be abstract, it may not implement an abstract parent\'s methods completely or it may not invoke an inherited contract\'s constructor correctly.', 'OK', () => {})
168+
return props.modal('Alert', 'This contract may be abstract, it may not implement an abstract parent\'s methods completely or it may not invoke an inherited contract\'s constructor correctly.', 'OK', () => { })
165169
}
166170
if ((selectedContract.name !== currentContract) && (selectedContract.name === 'ERC1967Proxy')) selectedContract.name = currentContract
167171
const isProxyDeployment = (deployMode || []).find(mode => mode === 'Deploy with Proxy')
168172
const isContractUpgrade = (deployMode || []).find(mode => mode === 'Upgrade with Proxy')
169-
173+
170174
if (isProxyDeployment) {
171175
props.modal('Deploy Implementation & Proxy (ERC1967)', deployWithProxyMsg(), 'Proceed', () => {
172176
props.createInstance(loadedContractData, props.gasEstimationPrompt, props.passphrasePrompt, props.publishToStorage, props.mainnetPrompt, isOverSizePrompt, args, deployMode)
173-
}, 'Cancel', () => {})
177+
}, 'Cancel', () => { })
174178
} else if (isContractUpgrade) {
175179
props.modal('Deploy Implementation & Update Proxy', upgradeWithProxyMsg(), 'Proceed', () => {
176180
props.createInstance(loadedContractData, props.gasEstimationPrompt, props.passphrasePrompt, props.publishToStorage, props.mainnetPrompt, isOverSizePrompt, args, deployMode)
177-
}, 'Cancel', () => {})
181+
}, 'Cancel', () => { })
178182
} else {
179183
props.createInstance(loadedContractData, props.gasEstimationPrompt, props.passphrasePrompt, props.publishToStorage, props.mainnetPrompt, isOverSizePrompt, args, deployMode)
180184
}
@@ -211,9 +215,25 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
211215
window.localStorage.setItem(`ipfs/${props.exEnvironment}/${props.networkName}`, checkedState.toString())
212216
}
213217

218+
const updateCompilerName = () => {
219+
console.log('updateCompilerName', contractsRef.current.value)
220+
if (contractsRef.current.value) {
221+
console.log(contractsRef.current.value)
222+
const compilerNames = [...new Set([...contractList[currentFile].map(contract => contract.compilerName)])]
223+
console.log(compilerNames)
224+
contractList[currentFile].forEach(contract => {
225+
if (contract.alias === contractsRef.current.value) {
226+
setCompilerName(contract.compilerName)
227+
}
228+
})
229+
} else{
230+
setCompilerName('')
231+
}
232+
}
233+
214234
const handleContractChange = (e) => {
215235
const value = e.target.value
216-
236+
updateCompilerName()
217237
props.setSelectedContract(value)
218238
}
219239

@@ -230,7 +250,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
230250
const isOverSizePrompt = () => {
231251
return (
232252
<div>Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fails. <br />
233-
More info: <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-170.md" target="_blank" rel="noreferrer">eip-170</a>
253+
More info: <a href="https://github.com/ethereum/EIPs/blob/master/EIPS/eip-170.md" target="_blank" rel="noreferrer">eip-170</a>
234254
</div>
235255
)
236256
}
@@ -240,30 +260,34 @@ export function ContractDropdownUI (props: ContractDropdownProps) {
240260
<div className='d-flex justify-content-between'>
241261
<div className="d-flex justify-content-between align-items-end">
242262
<label className="udapp_settingsLabel pr-1">Contract</label>
243-
<div className="d-flex">{ Object.keys(props.contracts.contractList).length > 0 && compilationSource !== '' && <label className="text-capitalize" style={{maxHeight: '0.6rem', lineHeight: '1rem'}} data-id="udappCompiledBy">(Compiled by {compilationSource})</label>}</div>
263+
<div className="d-flex">{compilerName && compilerName !== '' && <label className="text-capitalize" style={{ maxHeight: '0.6rem', lineHeight: '1rem' }} data-id="udappCompiledBy">(Compiled by {compilerName})</label>}</div>
244264
</div>
245-
<OverlayTrigger placement={'right'} overlay={
246-
<Tooltip className="text-nowrap" id="info-sync-compiled-contract">
247-
<div>Click here to import contracts compiled from an external framework.</div>
248-
<div>This action is enabled when Remix is connected to an external framework (hardhat, truffle, foundry) through remixd.</div>
249-
</Tooltip>
250-
}>
251-
<button className="btn d-flex py-0" onClick={_ => props.syncContracts()}>
252-
<i style={{ cursor: 'pointer' }} className="fa fa-refresh mr-2 mt-2" aria-hidden="true"></i>
253-
</button>
254-
</OverlayTrigger>
265+
{props.remixdActivated ?
266+
<OverlayTrigger placement={'right'} overlay={
267+
<Tooltip className="text-nowrap" id="info-sync-compiled-contract">
268+
<div>Click here to import contracts compiled from an external framework.</div>
269+
<div>This action is enabled when Remix is connected to an external framework (hardhat, truffle, foundry) through remixd.</div>
270+
</Tooltip>
271+
}>
272+
<button className="btn d-flex py-0" onClick={_ => props.syncContracts()}>
273+
<i style={{ cursor: 'pointer' }} className="fa fa-refresh mr-2 mt-2" aria-hidden="true"></i>
274+
</button>
275+
</OverlayTrigger>
276+
: null}
255277
</div>
256278
<div className="udapp_subcontainer">
257-
<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' }}>
258-
{ (contractList[currentFile] || []).map((contract, index) => {
259-
return <option key={index} value={contract.alias}>{contract.alias} - {contract.file}</option>
260-
}) }
279+
<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' }}>
280+
{(contractList[currentFile] || []).map((contract, index) => {
281+
return <option key={index} value={contract.alias}>
282+
{contract.alias} - {contract.file}
283+
</option>
284+
})}
261285
</select>
262-
<span className="py-1" style={{ display: abiLabel.display }}>{ abiLabel.content }</span>
286+
<span className="py-1" style={{ display: abiLabel.display }}>{abiLabel.content}</span>
263287
</div>
264288
<div>
265289
<div className="udapp_deployDropdown">
266-
{ ((contractList[currentFile] && contractList[currentFile].filter(contract => contract)) || []).length <= 0 ? 'No compiled contracts'
290+
{((contractList[currentFile] && contractList[currentFile].filter(contract => contract)) || []).length <= 0 ? 'No compiled contracts'
267291
: loadedContractData ? <div>
268292
<ContractGUI
269293
title='Deploy'

libs/remix-ui/run-tab/src/lib/constants/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ export const REMOVE_DEPLOY_OPTION = 'REMOVE_DEPLOY_OPTION'
4646
export const SET_DEPLOY_OPTIONS = 'SET_DEPLOY_OPTIONS'
4747
export const SET_CURRENT_CONTRACT = 'SET_CURRENT_CONTRACT'
4848
export const SET_PROXY_ENV_ADDRESS = 'SET_PROXY_ENV_ADDRESS'
49+
export const SET_REMIXD_ACTIVATED = 'SET_REMIXD_ACTIVATED'

libs/remix-ui/run-tab/src/lib/reducers/runTab.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CompilerAbstract } from '@remix-project/remix-solidity-ts'
22
import { ContractData } from '@remix-project/core-plugin'
33
import { DeployOptions } from '../types'
4-
import { ADD_INSTANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, FETCH_PROVIDER_LIST_FAILED, FETCH_PROVIDER_LIST_REQUEST, FETCH_PROVIDER_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE, SET_PROXY_ENV_ADDRESS, ADD_DEPLOY_OPTION, REMOVE_DEPLOY_OPTION, SET_COMPILATION_SOURCE } from '../constants'
4+
import { ADD_INSTANCE, ADD_PROVIDER, CLEAR_INSTANCES, CLEAR_RECORDER_COUNT, DISPLAY_NOTIFICATION, DISPLAY_POPUP_MESSAGE, FETCH_ACCOUNTS_LIST_FAILED, FETCH_ACCOUNTS_LIST_REQUEST, FETCH_ACCOUNTS_LIST_SUCCESS, FETCH_CONTRACT_LIST_FAILED, FETCH_CONTRACT_LIST_REQUEST, FETCH_CONTRACT_LIST_SUCCESS, FETCH_PROVIDER_LIST_FAILED, FETCH_PROVIDER_LIST_REQUEST, FETCH_PROVIDER_LIST_SUCCESS, HIDE_NOTIFICATION, HIDE_POPUP_MESSAGE, REMOVE_INSTANCE, REMOVE_PROVIDER, RESET_STATE, SET_BASE_FEE_PER_GAS, SET_CONFIRM_SETTINGS, SET_CURRENT_CONTRACT, SET_CURRENT_FILE, SET_DECODED_RESPONSE, SET_DEPLOY_OPTIONS, SET_EXECUTION_ENVIRONMENT, SET_EXTERNAL_WEB3_ENDPOINT, SET_GAS_LIMIT, SET_GAS_PRICE, SET_GAS_PRICE_STATUS, SET_IPFS_CHECKED_STATE, SET_LOAD_TYPE, SET_MATCH_PASSPHRASE, SET_MAX_FEE, SET_MAX_PRIORITY_FEE, SET_NETWORK_NAME, SET_PASSPHRASE, SET_PATH_TO_SCENARIO, SET_PERSONAL_MODE, SET_RECORDER_COUNT, SET_SELECTED_ACCOUNT, SET_SEND_UNIT, SET_SEND_VALUE, SET_PROXY_ENV_ADDRESS, ADD_DEPLOY_OPTION, REMOVE_DEPLOY_OPTION, SET_COMPILATION_SOURCE, SET_REMIXD_ACTIVATED } from '../constants'
55

66
declare const window: any
77
interface Action {
@@ -12,7 +12,8 @@ export interface Contract {
1212
name: string,
1313
alias: string,
1414
file: string,
15-
compiler: CompilerAbstract
15+
compiler: CompilerAbstract,
16+
compilerName: string
1617
}
1718

1819
export interface ContractList {
@@ -64,6 +65,7 @@ export interface RunTabState {
6465
alias: string,
6566
file: string,
6667
compiler: CompilerAbstract
68+
compilerName: string
6769
}[]
6870
},
6971
deployOptions: { [file: string]: { [name: string]: DeployOptions } },
@@ -99,6 +101,7 @@ export interface RunTabState {
99101
pathToScenario: string,
100102
transactionCount: number
101103
}
104+
remixdActivated: boolean
102105
}
103106

104107
export const runTabInitialState: RunTabState = {
@@ -180,7 +183,8 @@ export const runTabInitialState: RunTabState = {
180183
recorder: {
181184
pathToScenario: 'scenario.json',
182185
transactionCount: 0
183-
}
186+
},
187+
remixdActivated: false
184188
}
185189

186190
type AddProvider = {
@@ -734,6 +738,14 @@ export const runTabReducer = (state: RunTabState = runTabInitialState, action: A
734738
}
735739
}
736740

741+
case SET_REMIXD_ACTIVATED: {
742+
const payload: boolean = action.payload
743+
return {
744+
...state,
745+
remixdActivated: payload
746+
}
747+
}
748+
737749
default:
738750
return state
739751
}

0 commit comments

Comments
 (0)