Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
44559ef0
Commit
44559ef0
authored
Aug 11, 2021
by
aniket-engg
Committed by
Aniket
Aug 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blockchain as a plugin
parent
63b70bf6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
app.js
apps/remix-ide/src/app.js
+2
-1
blockchain.js
apps/remix-ide/src/blockchain/blockchain.js
+13
-1
remixAppManager.js
apps/remix-ide/src/remixAppManager.js
+1
-1
No files found.
apps/remix-ide/src/app.js
View file @
44559ef0
...
@@ -306,6 +306,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -306,6 +306,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const
contextualListener
=
new
ContextualListener
({
editor
})
const
contextualListener
=
new
ContextualListener
({
editor
})
engine
.
register
([
engine
.
register
([
blockchain
,
contentImport
,
contentImport
,
themeModule
,
themeModule
,
editor
,
editor
,
...
@@ -481,7 +482,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -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
([
'sidePanel'
])
// activating host plugin separately
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'settings'
])
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
// Set workspace after initial activation
if
(
Array
.
isArray
(
workspace
))
{
if
(
Array
.
isArray
(
workspace
))
{
...
...
apps/remix-ide/src/blockchain/blockchain.js
View file @
44559ef0
import
Web3
from
'web3'
import
Web3
from
'web3'
import
{
Plugin
}
from
'@remixproject/engine'
import
{
toBuffer
,
addHexPrefix
}
from
'ethereumjs-util'
import
{
toBuffer
,
addHexPrefix
}
from
'ethereumjs-util'
import
{
waterfall
}
from
'async'
import
{
waterfall
}
from
'async'
import
{
EventEmitter
}
from
'events'
import
{
EventEmitter
}
from
'events'
...
@@ -9,10 +10,20 @@ import NodeProvider from './providers/node.js'
...
@@ -9,10 +10,20 @@ import NodeProvider from './providers/node.js'
import
{
execution
,
EventManager
,
helpers
}
from
'@remix-project/remix-lib'
import
{
execution
,
EventManager
,
helpers
}
from
'@remix-project/remix-lib'
const
{
txFormat
,
txExecution
,
typeConversion
,
txListener
:
Txlistener
,
TxRunner
,
TxRunnerWeb3
,
txHelper
}
=
execution
const
{
txFormat
,
txExecution
,
typeConversion
,
txListener
:
Txlistener
,
TxRunner
,
TxRunnerWeb3
,
txHelper
}
=
execution
const
{
txResultHelper
:
resultToRemixTx
}
=
helpers
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
// NOTE: the config object will need to be refactored out in remix-lib
constructor
(
config
)
{
constructor
(
config
)
{
super
(
profile
)
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
executionContext
=
new
ExecutionContext
()
this
.
executionContext
=
new
ExecutionContext
()
...
@@ -489,6 +500,7 @@ class Blockchain {
...
@@ -489,6 +500,7 @@ class Blockchain {
if
(
isVM
)
{
if
(
isVM
)
{
const
hhlogs
=
await
this
.
web3
().
eth
.
getHHLogsForTx
(
txResult
.
transactionHash
)
const
hhlogs
=
await
this
.
web3
().
eth
.
getHHLogsForTx
(
txResult
.
transactionHash
)
console
.
log
(
'hhLogs--2->'
,
hhlogs
)
console
.
log
(
'hhLogs--2->'
,
hhlogs
)
this
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
hhlogs
})
execResult
=
await
this
.
web3
().
eth
.
getExecutionResultFromSimulator
(
txResult
.
transactionHash
)
execResult
=
await
this
.
web3
().
eth
.
getExecutionResultFromSimulator
(
txResult
.
transactionHash
)
if
(
execResult
)
{
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.
// 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.
...
...
apps/remix-ide/src/remixAppManager.js
View file @
44559ef0
...
@@ -8,7 +8,7 @@ const _paq = window._paq = window._paq || []
...
@@ -8,7 +8,7 @@ const _paq = window._paq = window._paq || []
const
requiredModules
=
[
// services + layout views + system views
const
requiredModules
=
[
// services + layout views + system views
'manager'
,
'compilerArtefacts'
,
'compilerMetadata'
,
'contextualListener'
,
'editor'
,
'offsetToLineColumnConverter'
,
'network'
,
'theme'
,
'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'
]
'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)
const
dependentModules
=
[
'git'
,
'hardhat'
]
// module which shouldn't be manually activated (e.g git is activated by remixd)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment