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
e7bc017d
Commit
e7bc017d
authored
Dec 27, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move compiler-data into blockchain module; load blockchain module from run-tab
parent
a32ed437
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
18 deletions
+26
-18
app.js
src/app.js
+10
-3
compiler-metadata.js
src/app/files/compiler-metadata.js
+10
-12
blockchain.js
src/app/tabs/runTab/model/blockchain.js
+4
-0
run-tab.js
src/app/udapp/run-tab.js
+2
-3
No files found.
src/app.js
View file @
e7bc017d
...
...
@@ -24,6 +24,8 @@ var CompilerImport = require('./app/compiler/compiler-imports')
var
executionContext
=
remixLib
.
execution
.
executionContext
const
Blockchain
=
require
(
'./app/tabs/runTab/model/blockchain.js'
)
const
PluginManagerComponent
=
require
(
'./app/components/plugin-manager-component'
)
const
CompilersArtefacts
=
require
(
'./app/compiler/compiler-artefacts'
)
...
...
@@ -222,13 +224,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// ----------------- fileManager servive ----------------------------
const
fileManager
=
new
FileManager
(
editor
)
registry
.
put
({
api
:
fileManager
,
name
:
'filemanager'
})
// ----------------- universal dapp: run transaction, listen on transactions, decode events
const
udapp
=
new
UniversalDApp
(
registry
.
get
(
'config'
).
api
,
executionContext
)
const
blockchain
=
new
Blockchain
(
executionContext
,
udapp
)
// ----------------- compilation metadata generation servive ----------------------------
const
compilerMetadataGenerator
=
new
CompilerMetadata
(
executionContext
,
fileManager
,
registry
.
get
(
'config'
).
api
)
const
compilerMetadataGenerator
=
new
CompilerMetadata
(
blockchain
,
fileManager
,
registry
.
get
(
'config'
).
api
)
// ----------------- compilation result service (can keep track of compilation results) ----------------------------
const
compilersArtefacts
=
new
CompilersArtefacts
()
// store all the compilation results (key represent a compiler name)
registry
.
put
({
api
:
compilersArtefacts
,
name
:
'compilersartefacts'
})
// ----------------- universal dapp: run transaction, listen on transactions, decode events
const
udapp
=
new
UniversalDApp
(
registry
.
get
(
'config'
).
api
,
executionContext
)
const
{
eventsDecoder
,
txlistener
}
=
makeUdapp
(
udapp
,
executionContext
,
compilersArtefacts
,
(
domEl
)
=>
mainview
.
getTerminal
().
logHtml
(
domEl
))
// ----------------- network service (resolve network id / name) ----------------------------
const
networkModule
=
new
NetworkModule
(
executionContext
)
...
...
@@ -293,6 +299,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
registry
.
get
(
'filemanager'
).
api
)
const
run
=
new
RunTab
(
blockchain
,
udapp
,
executionContext
,
registry
.
get
(
'config'
).
api
,
...
...
src/app/files/compiler-metadata.js
View file @
e7bc017d
...
...
@@ -11,14 +11,13 @@ const profile = {
}
class
CompilerMetadata
extends
Plugin
{
constructor
(
executionContext
,
fileManager
,
config
)
{
constructor
(
blockchain
,
fileManager
,
config
)
{
super
(
profile
)
var
self
=
this
self
.
executionContext
=
executionContext
self
.
fileManager
=
fileManager
self
.
config
=
config
self
.
networks
=
[
'VM:-'
,
'main:1'
,
'ropsten:3'
,
'rinkeby:4'
,
'kovan:42'
,
'görli:5'
,
'Custom'
]
self
.
innerPath
=
'artifacts'
this
.
blockchain
=
blockchain
this
.
fileManager
=
fileManager
this
.
config
=
config
this
.
networks
=
[
'VM:-'
,
'main:1'
,
'ropsten:3'
,
'rinkeby:4'
,
'kovan:42'
,
'görli:5'
,
'Custom'
]
this
.
innerPath
=
'artifacts'
}
_JSONFileName
(
path
,
contractName
)
{
...
...
@@ -93,15 +92,14 @@ class CompilerMetadata extends Plugin {
// TODO: is only called by dropdownLogic and can be moved there
deployMetadataOf
(
contractName
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
var
self
=
this
var
provider
=
self
.
fileManager
.
currentFileProvider
()
var
path
=
self
.
fileManager
.
currentPath
()
var
provider
=
this
.
fileManager
.
currentFileProvider
()
var
path
=
this
.
fileManager
.
currentPath
()
if
(
provider
&&
path
)
{
self
.
executionContext
.
detectNetwork
((
err
,
{
id
,
name
}
=
{})
=>
{
this
.
blockchain
.
detectNetwork
((
err
,
{
id
,
name
}
=
{})
=>
{
if
(
err
)
{
console
.
log
(
err
)
}
else
{
var
fileName
=
self
.
_JSONFileName
(
path
,
contractName
)
var
fileName
=
this
.
_JSONFileName
(
path
,
contractName
)
provider
.
get
(
fileName
,
(
error
,
content
)
=>
{
if
(
error
)
return
reject
(
error
)
if
(
!
content
)
return
resolve
()
...
...
src/app/tabs/runTab/model/blockchain.js
View file @
e7bc017d
...
...
@@ -183,6 +183,10 @@ class Blockchain {
})(
this
.
networkcallid
)
}
detectNetwork
(
cb
)
{
return
this
.
executionContext
.
detectNetwork
(
cb
)
}
newAccount
(
passphraseCb
,
cb
)
{
return
this
.
udapp
.
newAccount
(
''
,
passphraseCb
,
cb
)
}
...
...
src/app/udapp/run-tab.js
View file @
e7bc017d
...
...
@@ -14,7 +14,6 @@ const Recorder = require('../tabs/runTab/model/recorder.js')
const
RecorderUI
=
require
(
'../tabs/runTab/recorder.js'
)
const
DropdownLogic
=
require
(
'../tabs/runTab/model/dropdownlogic.js'
)
const
ContractDropdownUI
=
require
(
'../tabs/runTab/contractDropdown.js'
)
const
Blockchain
=
require
(
'../tabs/runTab/model/blockchain.js'
)
const
UniversalDAppUI
=
require
(
'../ui/universal-dapp-ui'
)
...
...
@@ -34,13 +33,13 @@ const profile = {
export
class
RunTab
extends
LibraryPlugin
{
constructor
(
udapp
,
executionContext
,
config
,
fileManager
,
editor
,
filePanel
,
compilersArtefacts
,
networkModule
,
mainView
)
{
constructor
(
blockchain
,
udapp
,
executionContext
,
config
,
fileManager
,
editor
,
filePanel
,
compilersArtefacts
,
networkModule
,
mainView
)
{
super
(
udapp
,
profile
)
this
.
event
=
new
EventManager
()
this
.
config
=
config
this
.
udapp
=
udapp
this
.
executionContext
=
executionContext
this
.
blockchain
=
new
Blockchain
(
this
.
executionContext
,
udapp
)
this
.
blockchain
=
blockchain
this
.
fileManager
=
fileManager
this
.
editor
=
editor
this
.
logCallback
=
(
msg
)
=>
{
mainView
.
getTerminal
().
logHtml
(
msg
)
}
...
...
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