Merge branch 'remixd_terminal' of https://github.com/ethereum/remix-project into remixd_terminal

pull/1342/head
davidzagi93@gmail.com 3 years ago
commit f7ad2c0b8c
  1. 5
      libs/remix-lib/src/web3Provider/web3VmProvider.ts
  2. 4
      libs/remix-simulator/src/methods/transactions.ts
  3. 18
      libs/remix-ui/plugin-manager/src/lib/components/LocalPluginForm.tsx
  4. 2
      libs/remix-ui/solidity-compiler/src/lib/contract-selection.tsx

@ -144,8 +144,9 @@ export class Web3VmProvider {
if (lastOp) {
lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' && lastOp.op !== 'DESTRUCT'
}
this.vmTraces[this.processingHash].gas = '0x' + data.gasUsed.toString(16)
const gasUsed = '0x' + data.gasUsed.toString(16)
this.vmTraces[this.processingHash].gas = gasUsed
this.txsReceipt[this.processingHash].gasUsed = gasUsed
const logs = []
for (const l in data.execResult.logs) {
const log = data.execResult.logs[l]

@ -102,8 +102,8 @@ export class Transactions {
transactionIndex: '0x00',
blockHash: '0x' + txBlock.hash().toString('hex'),
blockNumber: '0x' + txBlock.header.number.toString('hex'),
gasUsed: Web3.utils.toHex(receipt.gas),
cumulativeGasUsed: Web3.utils.toHex(receipt.gas),
gasUsed: receipt.gasUsed,
cumulativeGasUsed: receipt.gasUsed, // only 1 tx per block
contractAddress: receipt.contractAddress,
logs: receipt.logs,
status: receipt.status,

@ -41,6 +41,7 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
const [type, setType] = useState<'iframe' | 'ws'>('iframe')
const [location, setLocation] = useState<'sidePanel' | 'mainPanel' | 'none'>('sidePanel')
const [methods, setMethods] = useState<string>('')
const [canactivate, setCanactivate] = useState<string>('')
useEffect(() => {
const storagePlugin:FormStateProps = localStorage.getItem('plugins/local') ? JSON.parse(localStorage.getItem('plugins/local')) : defaultProfile
@ -73,7 +74,8 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
url: url,
type: type,
location: location,
icon: 'assets/img/localPlugin.webp'
icon: 'assets/img/localPlugin.webp',
canActivate: typeof canactivate === 'string' ? canactivate.split(',').filter(val => val) : []
}
const localPlugin = type === 'iframe' ? new IframePlugin(initialState) : new WebsocketPlugin(initialState)
localPlugin.profile.hash = `local-${name}`
@ -122,14 +124,24 @@ function LocalPluginForm ({ closeModal, visible, pluginManager }: LocalPluginFor
placeholder="Name in the header" />
</div>
<div className="form-group">
<label htmlFor="plugin-methods">Api (comma separated list of methods name)</label>
<label htmlFor="plugin-methods">Api (comma separated list of method names)</label>
<input
className="form-control"
onChange={e => setMethods(e.target.value)}
value={ methods }
id="plugin-methods"
data-id="localPluginMethods"
placeholder="Name in the header" />
placeholder="Methods" />
</div>
<div className="form-group">
<label htmlFor="plugin-methods">Plugins it can activate (comma separated list of plugin names)</label>
<input
className="form-control"
onChange={e => setCanactivate(e.target.value)}
value={ canactivate }
id="plugin-canactivate"
data-id="localPluginCanActivate"
placeholder="Plugin names" />
</div>
<div className="form-group">

@ -115,7 +115,7 @@ export const ContractSelection = (props: ContractSelectionProps) => {
let node
if (propertyName === 'web3Deploy' || propertyName === 'name' || propertyName === 'Assembly') {
node = <pre>{ details[propertyName] }</pre>
} else if (propertyName === 'abi' || propertyName === 'metadata') {
} else if (details[propertyName] && (propertyName === 'abi' || propertyName === 'metadata')) {
if (details[propertyName] !== '') {
try {
node = <div>

Loading…
Cancel
Save