blockchain as a plugin

pull/1460/head
aniket-engg 4 years ago committed by Aniket
parent 63b70bf6d3
commit 44559ef06a
  1. 3
      apps/remix-ide/src/app.js
  2. 14
      apps/remix-ide/src/blockchain/blockchain.js
  3. 2
      apps/remix-ide/src/remixAppManager.js

@ -306,6 +306,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const contextualListener = new ContextualListener({ editor })
engine.register([
blockchain,
contentImport,
themeModule,
editor,
@ -481,7 +482,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
await appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await appManager.activatePlugin(['home'])
await appManager.activatePlugin(['settings'])
await appManager.activatePlugin(['hiddenPanel', 'pluginManager', 'filePanel', 'contextualListener', 'terminal', 'fetchAndCompile', 'contentImport'])
await appManager.activatePlugin(['hiddenPanel', 'pluginManager', 'filePanel', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport'])
// Set workspace after initial activation
if (Array.isArray(workspace)) {

@ -1,4 +1,5 @@
import Web3 from 'web3'
import { Plugin } from '@remixproject/engine'
import { toBuffer, addHexPrefix } from 'ethereumjs-util'
import { waterfall } from 'async'
import { EventEmitter } from 'events'
@ -9,10 +10,20 @@ import NodeProvider from './providers/node.js'
import { execution, EventManager, helpers } from '@remix-project/remix-lib'
const { txFormat, txExecution, typeConversion, txListener: Txlistener, TxRunner, TxRunnerWeb3, txHelper } = execution
const { txResultHelper: resultToRemixTx } = helpers
const packageJson = require('../../../../package.json')
const profile = {
name: 'blockchain',
displayName: 'Blockchain',
description: 'Blockchain - Logic',
methods: [],
version: packageJson.version
}
class Blockchain {
class Blockchain extends Plugin {
// NOTE: the config object will need to be refactored out in remix-lib
constructor (config) {
super(profile)
this.event = new EventManager()
this.executionContext = new ExecutionContext()
@ -489,6 +500,7 @@ class Blockchain {
if (isVM) {
const hhlogs = await this.web3().eth.getHHLogsForTx(txResult.transactionHash)
console.log('hhLogs--2->', hhlogs)
this.call('terminal', 'log', { type: 'info', value: hhlogs })
execResult = await this.web3().eth.getExecutionResultFromSimulator(txResult.transactionHash)
if (execResult) {
// if it's not the VM, we don't have return value. We only have the transaction, and it does not contain the return value.

@ -8,7 +8,7 @@ const _paq = window._paq = window._paq || []
const requiredModules = [ // services + layout views + system views
'manager', 'compilerArtefacts', 'compilerMetadata', 'contextualListener', 'editor', 'offsetToLineColumnConverter', 'network', 'theme',
'fileManager', 'contentImport', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons',
'fileManager', 'contentImport', 'blockchain', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons',
'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider']
const dependentModules = ['git', 'hardhat'] // module which shouldn't be manually activated (e.g git is activated by remixd)

Loading…
Cancel
Save