From 2fbd5eca4a720b1d1c802722ac0b0b859d54cd28 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 10 Aug 2022 12:55:55 +0200 Subject: [PATCH 01/11] fix ipfs publish --- apps/etherscan/src/app/routes.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/etherscan/src/app/routes.tsx b/apps/etherscan/src/app/routes.tsx index 68fd76318f..1400a601df 100644 --- a/apps/etherscan/src/app/routes.tsx +++ b/apps/etherscan/src/app/routes.tsx @@ -1,6 +1,6 @@ import React from "react" import { - BrowserRouter as Router, + HashRouter as Router, Route, Routes, RouteProps, From b4419320d0264bb584619ad1f749e4aa0116dea8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 4 Aug 2022 11:55:32 +0200 Subject: [PATCH 02/11] add e2e for calls --- apps/remix-ide-e2e/src/tests/url.test.ts | 11 ++++++++++- apps/remix-ide/src/app.js | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index 832dca69d0..2bc6fe778f 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -246,6 +246,15 @@ module.exports = { .openFile('contracts') .openFile('contracts/governance') .openFile('contracts/governance/UnionGovernor.sol') - .end() + }, + + 'Should execute function call from URL parameters #group2': function (browser: NightwatchBrowser) { + browser + .switchWorkspace('default_workspace') + .url('http://127.0.0.1:8080?calls=fileManager//open//contracts/3_Ballot.sol///terminal//log//log') + .refresh() + .waitForElementVisible('*[data-shared="tooltipPopup"]') + .waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating fileManager and calling "open" ...') + .waitForElementContainsText('*[data-shared="tooltipPopup"]', 'initiating terminal and calling "log" ...') } } diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index de6d2ba470..a05934ea18 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -410,7 +410,7 @@ class AppComponent { if (params.call) { const callDetails = params.call.split('//') if (callDetails.length > 1) { - this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} ...`) + this.appManager.call('notification', 'toast', `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...`) // @todo(remove the timeout when activatePlugin is on 0.3.0) this.appManager.call(...callDetails).catch(console.error) } @@ -426,7 +426,7 @@ class AppComponent { this.appManager.call( "notification", "toast", - `initiating ${callDetails[0]} ...` + `initiating ${callDetails[0]} and calling "${callDetails[1]}" ...` ); // @todo(remove the timeout when activatePlugin is on 0.3.0) From 99791ce2a0608d87aaddef9682c27b62e19613b9 Mon Sep 17 00:00:00 2001 From: Lorenzo Paras Date: Tue, 2 Aug 2022 19:17:35 +1000 Subject: [PATCH 03/11] update README nx install command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8692c7c4ba..9e05e1860f 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Note: It contains the latest supported version of Solidity available at the time ``` * Install [Nx CLI](https://nx.dev/using-nx/nx-cli) globally to enable running **nx executable commands**. ```bash -yarn global add @nrwl/cli +yarn global add nx ``` * Clone the github repository (`wget` need to be installed first): From e23079d996c52ebe4b1c2c122f24c0e474efa379 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 15 Aug 2022 10:15:46 +0200 Subject: [PATCH 04/11] update url --- apps/remix-ide/src/app/files/dgitProvider.js | 8 ++++---- libs/remix-url-resolver/src/resolve.ts | 2 +- libs/remixd/src/origins.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/files/dgitProvider.js b/apps/remix-ide/src/app/files/dgitProvider.js index aa5b98dfa1..28f7fb2715 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.js +++ b/apps/remix-ide/src/app/files/dgitProvider.js @@ -28,10 +28,10 @@ class DGitProvider extends Plugin { constructor () { super(profile) this.ipfsconfig = { - host: 'ipfs.remixproject.org', + host: 'jqgt.remixproject.org', port: 443, protocol: 'https', - ipfsurl: 'https://ipfs.remixproject.org/ipfs/' + ipfsurl: 'https://jqgt.remixproject.org/ipfs/' } this.globalIPFSConfig = { host: 'ipfs.io', @@ -40,10 +40,10 @@ class DGitProvider extends Plugin { ipfsurl: 'https://ipfs.io/ipfs/' } this.remixIPFS = { - host: 'ipfs.remixproject.org', + host: 'jqgt.remixproject.org', port: 443, protocol: 'https', - ipfsurl: 'https://ipfs.remixproject.org/ipfs/' + ipfsurl: 'https://jqgt.remixproject.org/ipfs/' } this.ipfsSources = [this.remixIPFS, this.globalIPFSConfig, this.ipfsconfig] } diff --git a/libs/remix-url-resolver/src/resolve.ts b/libs/remix-url-resolver/src/resolve.ts index e2b77adddc..e3d9c4cf4b 100644 --- a/libs/remix-url-resolver/src/resolve.ts +++ b/libs/remix-url-resolver/src/resolve.ts @@ -113,7 +113,7 @@ export class RemixURLResolver { url = url.replace(/^ipfs:\/\/?/, 'ipfs/') // eslint-disable-next-line no-useless-catch try { - const req = 'https://ipfs.remixproject.org/' + url + const req = 'https://jqgt.remixproject.org/' + url // If you don't find greeter.sol on ipfs gateway use local // const req = 'http://localhost:8080/' + url const response: AxiosResponse = await axios.get(req, { transformResponse: [] }) diff --git a/libs/remixd/src/origins.json b/libs/remixd/src/origins.json index e0b8a5f283..3357227bca 100644 --- a/libs/remixd/src/origins.json +++ b/libs/remixd/src/origins.json @@ -9,6 +9,6 @@ "package://a7df6d3c223593f3550b35e90d7b0b1f.mod", "package://6fd22d6fe5549ad4c4d8fd3ca0b7816b.mod", "https://ipfsgw.komputing.org", - "https://ipfs.remixproject.org" + "https://jqgt.remixproject.org" ] } \ No newline at end of file From 4495313784d4af66478358353fc1aa9d5112aac0 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 16 Aug 2022 16:01:08 +0200 Subject: [PATCH 05/11] fix baseFee type --- libs/remix-ui/run-tab/src/lib/components/mainnet.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx b/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx index f62ad7eaeb..8af76dc27e 100644 --- a/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx @@ -12,7 +12,7 @@ export function MainnetPrompt (props: MainnetProps) { if (txFeeText) props.setTxFeeContent(txFeeText) if (gasPriceValue) onGasPriceChange(gasPriceValue) if (props.network && props.network.lastBlock && props.network.lastBlock.baseFeePerGas) { - const baseFee = Web3.utils.fromWei(Web3.utils.toBN(parseInt(props.network.lastBlock.baseFeePerGas, 16)), 'Gwei') + const baseFee = Web3.utils.fromWei(Web3.utils.toBN(props.network.lastBlock.baseFeePerGas), 'Gwei') setBaseFee(baseFee) onMaxFeeChange(baseFee) @@ -24,7 +24,7 @@ export function MainnetPrompt (props: MainnetProps) { const onMaxFeeChange = (value: string) => { const maxFee = value // @ts-ignore - if (parseInt(props.network.lastBlock.baseFeePerGas, 16) > Web3.utils.toWei(maxFee, 'Gwei')) { + if (Web3.utils.toBN(props.network.lastBlock.baseFeePerGas).gt(Web3.utils.toBN(Web3.utils.toWei(maxFee, 'Gwei')))) { props.setTxFeeContent('Transaction is invalid. Max fee should not be less than Base fee') props.updateGasPriceStatus(false) props.updateConfirmSettings(true) @@ -105,7 +105,7 @@ export function MainnetPrompt (props: MainnetProps) {
- Max fee (Not less than base fee {Web3.utils.fromWei(Web3.utils.toBN(parseInt(props.network.lastBlock.baseFeePerGas, 16)), 'Gwei')} Gwei): + Max fee (Not less than base fee {Web3.utils.fromWei(Web3.utils.toBN(props.network.lastBlock.baseFeePerGas), 'Gwei')} Gwei): onMaxFeeChange(e.target.value)} defaultValue={baseFee} /> Gwei From 37edba517e327a602480ed3ca1abd3a5d1af08ed Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 16 Aug 2022 16:07:32 +0200 Subject: [PATCH 06/11] remove txFeeContent and ise a state variable --- libs/remix-ui/run-tab/src/lib/actions/actions.ts | 6 +----- libs/remix-ui/run-tab/src/lib/actions/index.ts | 3 +-- libs/remix-ui/run-tab/src/lib/actions/payload.ts | 9 +-------- .../remix-ui/run-tab/src/lib/components/mainnet.tsx | 11 ++++++----- libs/remix-ui/run-tab/src/lib/constants/index.ts | 1 - libs/remix-ui/run-tab/src/lib/reducers/runTab.ts | 13 +------------ libs/remix-ui/run-tab/src/lib/run-tab.tsx | 4 +--- libs/remix-ui/run-tab/src/lib/types/index.ts | 2 -- 8 files changed, 11 insertions(+), 38 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/actions/actions.ts b/libs/remix-ui/run-tab/src/lib/actions/actions.ts index a99a8b3800..669851a869 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/actions.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/actions.ts @@ -1,5 +1,5 @@ import { ContractData } from "@remix-project/core-plugin" -import { addNewInstance, addProvider, clearAllInstances, clearRecorderCount, hidePopUp, removeExistingInstance, removeProvider, setBaseFeePerGas, setConfirmSettings, setCurrentContract, setExecutionEnvironment, setExternalEndpoint, setGasLimit, setGasPrice, setGasPriceStatus, setMatchPassphrase, setMaxFee, setMaxPriorityFee, setNetworkName, setPassphrase, setPathToScenario, setSelectedAccount, setSendUnit, setSendValue, setTxFeeContent } from "./payload" +import { addNewInstance, addProvider, clearAllInstances, clearRecorderCount, hidePopUp, removeExistingInstance, removeProvider, setBaseFeePerGas, setConfirmSettings, setCurrentContract, setExecutionEnvironment, setExternalEndpoint, setGasLimit, setGasPrice, setGasPriceStatus, setMatchPassphrase, setMaxFee, setMaxPriorityFee, setNetworkName, setPassphrase, setPathToScenario, setSelectedAccount, setSendUnit, setSendValue } from "./payload" export const setAccount = (dispatch: React.Dispatch, account: string) => { dispatch(setSelectedAccount(account)) @@ -65,10 +65,6 @@ export const updateGasPrice = (dispatch: React.Dispatch, price: string) => dispatch(setGasPrice(price)) } -export const updateTxFeeContent = (dispatch: React.Dispatch, content: string) => { - dispatch(setTxFeeContent(content)) -} - export const addInstance = (dispatch: React.Dispatch, instance: { contractData?: ContractData, address: string, name: string, abi?: any, decodedResponse?: Record }) => { instance.decodedResponse = {} dispatch(addNewInstance(instance)) diff --git a/libs/remix-ui/run-tab/src/lib/actions/index.ts b/libs/remix-ui/run-tab/src/lib/actions/index.ts index 6a20e9470d..f61de6ebd8 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/index.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/index.ts @@ -5,7 +5,7 @@ import { resetAndInit, setupEvents } from './events' import { createNewBlockchainAccount, fillAccountsList, setExecutionContext, signMessageWithAddress } from './account' import { clearInstances, clearPopUp, removeInstance, setAccount, setGasFee, setMatchPassphrasePrompt, setNetworkNameFromProvider, setPassphrasePrompt, setSelectedContract, setSendTransactionValue, setUnit, - updateBaseFeePerGas, updateConfirmSettings, updateGasPrice, updateGasPriceStatus, updateMaxFee, updateMaxPriorityFee, updateScenarioPath, updateTxFeeContent } from './actions' + updateBaseFeePerGas, updateConfirmSettings, updateGasPrice, updateGasPriceStatus, updateMaxFee, updateMaxPriorityFee, updateScenarioPath } from './actions' import { createInstance, getContext, getFuncABIInputs, getSelectedContract, loadAddress, runTransactions, updateInstanceBalance } from './deploy' import { CompilerAbstract as CompilerAbstractType } from '@remix-project/remix-solidity-ts' import { ContractData, FuncABI } from "@remix-project/core-plugin" @@ -50,7 +50,6 @@ export const setGasPrice = (price: string) => updateGasPrice(dispatch, price) export const setGasPriceStatus = (status: boolean) => updateGasPriceStatus(dispatch, status) export const setMaxFee = (fee: string) => updateMaxFee(dispatch, fee) export const setMaxPriorityFee = (fee: string) => updateMaxPriorityFee(dispatch, fee) -export const setTxFeeContent = (content: string) => updateTxFeeContent(dispatch, content) export const removeInstances = () => clearInstances(dispatch) export const removeSingleInstance = (index: number) => removeInstance(dispatch, index) export const getExecutionContext = () => getContext(plugin) diff --git a/libs/remix-ui/run-tab/src/lib/actions/payload.ts b/libs/remix-ui/run-tab/src/lib/actions/payload.ts index bb0fc91a41..fac454ca0b 100644 --- a/libs/remix-ui/run-tab/src/lib/actions/payload.ts +++ b/libs/remix-ui/run-tab/src/lib/actions/payload.ts @@ -1,6 +1,6 @@ import { ContractList } from '../reducers/runTab' import { ContractData } from '@remix-project/core-plugin' -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_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_TX_FEE_CONTENT } from '../constants' +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_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' import { DeployMode, DeployOptions } from '../types' export const fetchAccountsListRequest = () => { @@ -216,13 +216,6 @@ export const setGasPrice = (price: string) => { } } -export const setTxFeeContent = (content: string) => { - return { - type: SET_TX_FEE_CONTENT, - payload: content - } -} - export const addNewInstance = (instance: { contractData?: ContractData, address: string, name: string, abi?: any }) => { return { type: ADD_INSTANCE, diff --git a/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx b/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx index 8af76dc27e..a27e40b640 100644 --- a/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/mainnet.tsx @@ -6,10 +6,11 @@ import { MainnetProps } from '../types' export function MainnetPrompt (props: MainnetProps) { const [baseFee, setBaseFee] = useState('') + const [transactionFee, setTransactionFee] = useState('') useEffect(() => { props.init((txFeeText, gasPriceValue, gasPriceStatus) => { - if (txFeeText) props.setTxFeeContent(txFeeText) + if (txFeeText) setTransactionFee(txFeeText) if (gasPriceValue) onGasPriceChange(gasPriceValue) if (props.network && props.network.lastBlock && props.network.lastBlock.baseFeePerGas) { const baseFee = Web3.utils.fromWei(Web3.utils.toBN(props.network.lastBlock.baseFeePerGas), 'Gwei') @@ -25,7 +26,7 @@ export function MainnetPrompt (props: MainnetProps) { const maxFee = value // @ts-ignore if (Web3.utils.toBN(props.network.lastBlock.baseFeePerGas).gt(Web3.utils.toBN(Web3.utils.toWei(maxFee, 'Gwei')))) { - props.setTxFeeContent('Transaction is invalid. Max fee should not be less than Base fee') + setTransactionFee('Transaction is invalid. Max fee should not be less than Base fee') props.updateGasPriceStatus(false) props.updateConfirmSettings(true) return @@ -35,7 +36,7 @@ export function MainnetPrompt (props: MainnetProps) { } props.setNewGasPrice(maxFee, (txFeeText, priceStatus) => { - props.setTxFeeContent(txFeeText) + setTransactionFee(txFeeText) if (priceStatus) { props.updateConfirmSettings(false) } else { @@ -51,7 +52,7 @@ export function MainnetPrompt (props: MainnetProps) { const gasPrice = value props.setNewGasPrice(gasPrice, (txFeeText, priceStatus) => { - props.setTxFeeContent(txFeeText) + setTransactionFee(txFeeText) props.updateGasPriceStatus(priceStatus) props.updateGasPrice(gasPrice) }) @@ -120,7 +121,7 @@ export function MainnetPrompt (props: MainnetProps) { }
Max transaction fee: - { props.txFeeContent } + { transactionFee }
diff --git a/libs/remix-ui/run-tab/src/lib/constants/index.ts b/libs/remix-ui/run-tab/src/lib/constants/index.ts index 91dd777b3b..646cc4a14f 100644 --- a/libs/remix-ui/run-tab/src/lib/constants/index.ts +++ b/libs/remix-ui/run-tab/src/lib/constants/index.ts @@ -32,7 +32,6 @@ export const SET_MAX_FEE = 'SET_MAX_FEE' export const SET_MAX_PRIORITY_FEE = 'SET_MAX_PRIORITY_FEE' export const SET_BASE_FEE_PER_GAS = 'SET_BASE_FEE_PER_GAS' export const SET_GAS_PRICE = 'SET_GAS_PRICE' -export const SET_TX_FEE_CONTENT = 'SET_TX_FEE_CONTENT' export const ADD_INSTANCE = 'ADD_INSTANCE' export const REMOVE_INSTANCE = 'REMOVE_INSTANCE' export const CLEAR_INSTANCES = 'CLEAR_INSTANCES' diff --git a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts index 5bae13a09e..361a4bf100 100644 --- a/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts +++ b/libs/remix-ui/run-tab/src/lib/reducers/runTab.ts @@ -1,7 +1,7 @@ import { CompilerAbstract } from '@remix-project/remix-solidity-ts' import { ContractData } from '@remix-project/core-plugin' import { DeployOptions } from '../types' -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_TX_FEE_CONTENT, SET_PROXY_ENV_ADDRESS, ADD_DEPLOY_OPTION, REMOVE_DEPLOY_OPTION } from '../constants' +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 } from '../constants' declare const window: any interface Action { @@ -82,7 +82,6 @@ export interface RunTabState { maxFee: string, maxPriorityFee: string, baseFeePerGas: string, - txFeeContent: string, gasPrice: string, instances: { instanceList: { @@ -171,7 +170,6 @@ export const runTabInitialState: RunTabState = { maxFee: '', maxPriorityFee: '1', baseFeePerGas: '', - txFeeContent: '', gasPrice: '', instances: { instanceList: [], @@ -582,15 +580,6 @@ export const runTabReducer = (state: RunTabState = runTabInitialState, action: A } } - case SET_TX_FEE_CONTENT: { - const payload: string = action.payload - - return { - ...state, - txFeeContent: payload - } - } - case ADD_INSTANCE: { const payload: { contractData: ContractData, address: string, name: string, abi?: any, decodedResponse?: Record } = action.payload diff --git a/libs/remix-ui/run-tab/src/lib/run-tab.tsx b/libs/remix-ui/run-tab/src/lib/run-tab.tsx index 128d315201..1ad855434c 100644 --- a/libs/remix-ui/run-tab/src/lib/run-tab.tsx +++ b/libs/remix-ui/run-tab/src/lib/run-tab.tsx @@ -21,7 +21,7 @@ import { setBaseFeePerGas, setConfirmSettings, setGasPrice, setGasPriceStatus, setMaxFee, setMaxPriorityFee, - setTxFeeContent, removeInstances, + removeInstances, removeSingleInstance, getExecutionContext, executeTransactions, loadFromAddress, storeNewScenario, runScenario, @@ -189,8 +189,6 @@ export function RunTabUI (props: RunTabProps) { updateGasPriceStatus={setGasPriceStatus} updateMaxFee={setMaxFee} updateMaxPriorityFee={setMaxPriorityFee} - setTxFeeContent={setTxFeeContent} - txFeeContent={runTab.txFeeContent} maxFee={runTab.maxFee} maxPriorityFee={runTab.maxPriorityFee} /> diff --git a/libs/remix-ui/run-tab/src/lib/types/index.ts b/libs/remix-ui/run-tab/src/lib/types/index.ts index 8ef73156df..4d1e37524a 100644 --- a/libs/remix-ui/run-tab/src/lib/types/index.ts +++ b/libs/remix-ui/run-tab/src/lib/types/index.ts @@ -270,10 +270,8 @@ export interface MainnetProps { updateMaxFee: (fee: string) => void, updateBaseFeePerGas: (fee: string) => void, init: (cb: (txFeeText: string, gasPriceValue: string, gasPriceStatus: boolean) => void) => void, - setTxFeeContent: (content: string) => void, updateGasPrice: (price: string) => void, updateMaxPriorityFee: (fee: string) => void - txFeeContent: string, maxFee: string, maxPriorityFee: string } From 41fee2d69ec89fbe60e37b59924a6b54b8e46270 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 17 Aug 2022 09:46:12 +0200 Subject: [PATCH 07/11] fix e2e --- libs/remix-lib/src/helpers/hhconsoleSigs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/remix-lib/src/helpers/hhconsoleSigs.ts b/libs/remix-lib/src/helpers/hhconsoleSigs.ts index 1ae8955736..ee1c9dbcc0 100644 --- a/libs/remix-lib/src/helpers/hhconsoleSigs.ts +++ b/libs/remix-lib/src/helpers/hhconsoleSigs.ts @@ -375,5 +375,7 @@ export const ConsoleLogs = { 3982404743: '(address,address,address,uint)', 4161329696: '(address,address,address,string)', 238520724: '(address,address,address,bool)', - 1717301556: '(address,address,address,address)' + 1717301556: '(address,address,address,address)', + 4133908826: '(uint,uint)', + 3054400204: '(string,uint)' } From 319db240202d3e6411130750cf830e435a987895 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 17 Aug 2022 10:03:45 +0200 Subject: [PATCH 08/11] fixes --- libs/remix-ui/settings/src/lib/github-settings.tsx | 6 +++--- libs/remix-ui/settings/src/lib/remix-ui-settings.tsx | 2 +- libs/remix-ui/workspace/src/lib/actions/events.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/remix-ui/settings/src/lib/github-settings.tsx b/libs/remix-ui/settings/src/lib/github-settings.tsx index 243598d6ec..6136dd8f95 100644 --- a/libs/remix-ui/settings/src/lib/github-settings.tsx +++ b/libs/remix-ui/settings/src/lib/github-settings.tsx @@ -9,9 +9,9 @@ export function GithubSettings (props: GithubSettingsProps) { useEffect(() => { if (props.config) { - const githubToken = props.config.get('settings/gist-access-token') - const githubUserName = props.config.get('settings/github-user-name') - const githubEmail = props.config.get('settings/github-email') + const githubToken = props.config.get('settings/gist-access-token') || '' + const githubUserName = props.config.get('settings/github-user-name') || '' + const githubEmail = props.config.get('settings/github-email') || '' setGithubToken(githubToken) setGithubUsername(githubUserName) diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 912da468f3..1d767c7643 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -214,7 +214,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {

{ labels[type].link }

- handleSaveTokenState(e, type)} value={ tokenValue[type] } /> + handleSaveTokenState(e, type)} value={ tokenValue[type] || '' } />
saveToken(type)} value="Save" type="button" disabled={tokenValue === ''}> diff --git a/libs/remix-ui/workspace/src/lib/actions/events.ts b/libs/remix-ui/workspace/src/lib/actions/events.ts index 62092df30f..ce3c6982f3 100644 --- a/libs/remix-ui/workspace/src/lib/actions/events.ts +++ b/libs/remix-ui/workspace/src/lib/actions/events.ts @@ -209,6 +209,6 @@ const rootFolderChanged = async (path) => { } const setFileDecorators = async (items: fileDecoration[], cb?: (err: Error, result?: string | number | boolean | Record) => void) => { - await dispatch(setFileDecorationSuccess(items)) + dispatch && await dispatch(setFileDecorationSuccess(items)) cb && cb(null, true) } From 9916a1ecfd7c2ed66ffae08f004d0ffa8339f125 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 17 Aug 2022 10:40:37 +0200 Subject: [PATCH 09/11] undo settings --- libs/remix-ui/settings/src/lib/remix-ui-settings.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 1d767c7643..912da468f3 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -214,7 +214,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {

{ labels[type].link }

- handleSaveTokenState(e, type)} value={ tokenValue[type] || '' } /> + handleSaveTokenState(e, type)} value={ tokenValue[type] } />
saveToken(type)} value="Save" type="button" disabled={tokenValue === ''}> From 30604370365ed66437258eedb75f4eb32fc4c2d1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 17 Aug 2022 10:52:47 +0200 Subject: [PATCH 10/11] fix terminal --- .../settings/src/lib/remix-ui-settings.tsx | 2 +- .../terminal/src/lib/remix-ui-terminal.tsx | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx index 912da468f3..1d767c7643 100644 --- a/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx +++ b/libs/remix-ui/settings/src/lib/remix-ui-settings.tsx @@ -214,7 +214,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {

{ labels[type].link }

- handleSaveTokenState(e, type)} value={ tokenValue[type] } /> + handleSaveTokenState(e, type)} value={ tokenValue[type] || '' } />
saveToken(type)} value="Save" type="button" disabled={tokenValue === ''}> diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index 4c30fee8f9..4962101798 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -86,8 +86,8 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { scriptRunnerDispatch({ type: 'html', payload: { message: [html ? html.innerText ? html.innerText : html : null] } }) }, - log: (message, type) => { - scriptRunnerDispatch({ type: type ? type : 'log', payload: { message: [message] } }) + log: (message) => { + scriptRunnerDispatch({ type: 'log', payload: { message: [message] } }) } }) }, []) @@ -549,6 +549,11 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
{ msg }
) } else if (typeof msg === 'object') { + if (msg.value && isHtml(msg.value)) { + return ( +
{ parse(msg.value) }
+ ) + } let stringified try { stringified = JSON.stringify(msg) @@ -609,4 +614,13 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { ) } -export default RemixUiTerminal +function isHtml (value) { + if (!value.indexOf) return false + return value.indexOf(' Date: Wed, 10 Aug 2022 12:29:08 +0200 Subject: [PATCH 11/11] disable at address when value is empty --- .../run-tab/src/lib/components/contractDropdownUI.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx index a224c94242..c3b08c0858 100644 --- a/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx +++ b/libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx @@ -28,6 +28,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { const [constructorInterface, setConstructorInterface] = useState(null) const [constructorInputs, setConstructorInputs] = useState(null) const contractsRef = useRef(null) + const atAddressValue = useRef(null) const { contractList, loadType, currentFile, currentContract, compilationCount, deployOptions, proxyKey } = props.contracts useEffect(() => { @@ -52,7 +53,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) { }, [loadedAddress]) useEffect(() => { - if (/.(.abi)$/.exec(currentFile)) { + if (/.(.abi)$/.exec(currentFile) && "" !== atAddressValue.current.value) { setAbiLabel({ display: 'block', content: currentFile @@ -175,7 +176,6 @@ export function ContractDropdownUI (props: ContractDropdownProps) { const atAddressChanged = (event) => { const value = event.target.value - if (!value) { enableAtAddress(false) } else { @@ -282,6 +282,7 @@ export function ContractDropdownUI (props: ContractDropdownProps) {