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
26f6c38f
Commit
26f6c38f
authored
Oct 09, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move compilersArtefacts to app.js
parent
351b79ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
14 deletions
+23
-14
app.js
src/app.js
+4
-3
compiler-abstract.js
src/app/compiler/compiler-abstract.js
+4
-0
debugger.js
src/app/debugger/debugger.js
+3
-5
run-tab.js
src/app/tabs/run-tab.js
+12
-6
No files found.
src/app.js
View file @
26f6c38f
...
@@ -396,6 +396,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -396,6 +396,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
var
offsetToLineColumnConverter
=
new
OffsetToLineColumnConverter
(
self
.
_components
.
compiler
.
event
)
var
offsetToLineColumnConverter
=
new
OffsetToLineColumnConverter
(
self
.
_components
.
compiler
.
event
)
registry
.
put
({
api
:
offsetToLineColumnConverter
,
name
:
'offsettolinecolumnconverter'
})
registry
.
put
({
api
:
offsetToLineColumnConverter
,
name
:
'offsettolinecolumnconverter'
})
self
.
_components
.
compilersArtefacts
=
{}
// store all the possible compilation data (key represent a compiler name)
registry
.
put
({
api
:
self
.
_components
.
compilersArtefacts
,
name
:
'compilersartefacts'
})
// ----------------- UniversalDApp -----------------
// ----------------- UniversalDApp -----------------
var
udapp
=
new
UniversalDApp
({
var
udapp
=
new
UniversalDApp
({
removable
:
false
,
removable
:
false
,
...
@@ -412,9 +415,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -412,9 +415,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
var
txlistener
=
new
Txlistener
({
var
txlistener
=
new
Txlistener
({
api
:
{
api
:
{
contracts
:
function
()
{
contracts
:
function
()
{
if
(
self
.
_components
.
compiler
.
lastCompilationResult
&&
self
.
_components
.
compiler
.
lastCompilationResult
.
data
)
{
if
(
self
.
_components
.
compilersArtefacts
[
'__last'
])
return
self
.
_components
.
compilersArtefacts
[
'__last'
].
getContracts
()
return
self
.
_components
.
compiler
.
lastCompilationResult
.
data
.
contracts
}
return
null
return
null
},
},
resolveReceipt
:
function
(
tx
,
cb
)
{
resolveReceipt
:
function
(
tx
,
cb
)
{
...
...
src/app/compiler/compiler-abstract.js
View file @
26f6c38f
...
@@ -19,4 +19,8 @@ module.exports = class CompilerAbstract {
...
@@ -19,4 +19,8 @@ module.exports = class CompilerAbstract {
visitContracts
(
calllback
)
{
visitContracts
(
calllback
)
{
return
txHelper
.
visitContracts
(
this
.
data
.
contracts
,
calllback
)
return
txHelper
.
visitContracts
(
this
.
data
.
contracts
,
calllback
)
}
}
getData
()
{
return
this
.
data
}
}
}
src/app/debugger/debugger.js
View file @
26f6c38f
...
@@ -17,16 +17,14 @@ function Debugger (container, sourceHighlighter, localRegistry) {
...
@@ -17,16 +17,14 @@ function Debugger (container, sourceHighlighter, localRegistry) {
this
.
_deps
=
{
this
.
_deps
=
{
offsetToLineColumnConverter
:
this
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
offsetToLineColumnConverter
:
this
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
editor
:
this
.
_components
.
registry
.
get
(
'editor'
).
api
,
editor
:
this
.
_components
.
registry
.
get
(
'editor'
).
api
,
compiler
:
this
.
_components
.
registry
.
get
(
'compiler'
).
api
compiler
:
this
.
_components
.
registry
.
get
(
'compiler'
).
api
,
compilersArtefacts
:
this
.
_components
.
registry
.
get
(
'compilersartefacts'
).
api
}
}
this
.
debugger
=
new
Ethdebugger
(
this
.
debugger
=
new
Ethdebugger
(
{
{
executionContext
:
executionContext
,
executionContext
:
executionContext
,
compilationResult
:
()
=>
{
compilationResult
:
()
=>
{
var
compilationResult
=
this
.
_deps
.
compiler
.
lastCompilationResult
if
(
this
.
_deps
.
compilersArtefacts
[
'__last'
])
return
this
.
_deps
.
compilersArtefacts
[
'__last'
].
getData
()
if
(
compilationResult
)
{
return
compilationResult
.
data
}
return
null
return
null
}
}
})
})
...
...
src/app/tabs/run-tab.js
View file @
26f6c38f
...
@@ -39,7 +39,6 @@ function runTab (opts, localRegistry) {
...
@@ -39,7 +39,6 @@ function runTab (opts, localRegistry) {
}
}
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globlalRegistry
self
.
_components
.
registry
=
localRegistry
||
globlalRegistry
self
.
_components
.
compilersArtefacts
=
{}
self
.
_components
.
transactionContextAPI
=
{
self
.
_components
.
transactionContextAPI
=
{
getAddress
:
(
cb
)
=>
{
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
cb
(
null
,
$
(
'#txorigin'
).
val
())
...
@@ -79,9 +78,9 @@ function runTab (opts, localRegistry) {
...
@@ -79,9 +78,9 @@ function runTab (opts, localRegistry) {
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
logCallback
:
self
.
_components
.
registry
.
get
(
'logCallback'
).
api
,
logCallback
:
self
.
_components
.
registry
.
get
(
'logCallback'
).
api
,
filePanel
:
self
.
_components
.
registry
.
get
(
'filepanel'
).
api
,
filePanel
:
self
.
_components
.
registry
.
get
(
'filepanel'
).
api
,
pluginManager
:
self
.
_components
.
registry
.
get
(
'pluginmanager'
).
api
pluginManager
:
self
.
_components
.
registry
.
get
(
'pluginmanager'
).
api
,
compilersArtefacts
:
self
.
_components
.
registry
.
get
(
'compilersartefacts'
).
api
}
}
self
.
_components
.
compilersArtefacts
[
'solidity'
]
=
self
.
_deps
.
compiler
self
.
_deps
.
udapp
.
resetAPI
(
self
.
_components
.
transactionContextAPI
)
self
.
_deps
.
udapp
.
resetAPI
(
self
.
_components
.
transactionContextAPI
)
self
.
_view
.
recorderCount
=
yo
`<span>0</span>`
self
.
_view
.
recorderCount
=
yo
`<span>0</span>`
self
.
_view
.
instanceContainer
=
yo
`<div class="
${
css
.
instanceContainer
}
"></div>`
self
.
_view
.
instanceContainer
=
yo
`<div class="
${
css
.
instanceContainer
}
"></div>`
...
@@ -312,11 +311,18 @@ function contractDropdown (events, self) {
...
@@ -312,11 +311,18 @@ function contractDropdown (events, self) {
self
.
_deps
.
pluginManager
.
event
.
register
(
'sendCompilationResult'
,
(
file
,
source
,
languageVersion
,
data
)
=>
{
self
.
_deps
.
pluginManager
.
event
.
register
(
'sendCompilationResult'
,
(
file
,
source
,
languageVersion
,
data
)
=>
{
// TODO check whether the tab is configured
// TODO check whether the tab is configured
let
compiler
=
new
CompilerAbstract
(
languageVersion
,
data
)
let
compiler
=
new
CompilerAbstract
(
languageVersion
,
data
)
self
.
_components
.
compilersArtefacts
[
languageVersion
]
=
compiler
self
.
_deps
.
compilersArtefacts
[
languageVersion
]
=
compiler
self
.
_deps
.
compilersArtefacts
[
'__last'
]
=
compiler
newlyCompiled
(
true
,
data
,
source
,
compiler
,
languageVersion
)
newlyCompiled
(
true
,
data
,
source
,
compiler
,
languageVersion
)
})
})
self
.
_deps
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
newlyCompiled
(
success
,
data
,
source
,
self
.
_deps
.
compiler
,
'solidity'
)
})
self
.
_deps
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
var
name
=
'solidity'
let
compiler
=
new
CompilerAbstract
(
name
,
data
)
self
.
_deps
.
compilersArtefacts
[
name
]
=
compiler
self
.
_deps
.
compilersArtefacts
[
'__last'
]
=
compiler
newlyCompiled
(
success
,
data
,
source
,
self
.
_deps
.
compiler
,
name
)
})
var
deployAction
=
(
value
)
=>
{
var
deployAction
=
(
value
)
=>
{
self
.
_view
.
createPanel
.
style
.
display
=
value
self
.
_view
.
createPanel
.
style
.
display
=
value
...
@@ -343,7 +349,7 @@ function contractDropdown (events, self) {
...
@@ -343,7 +349,7 @@ function contractDropdown (events, self) {
function
getSelectedContract
()
{
function
getSelectedContract
()
{
var
contract
=
selectContractNames
.
children
[
selectContractNames
.
selectedIndex
]
var
contract
=
selectContractNames
.
children
[
selectContractNames
.
selectedIndex
]
var
contractName
=
contract
.
innerHTML
var
contractName
=
contract
.
innerHTML
var
compiler
=
self
.
_
component
s
.
compilersArtefacts
[
contract
.
getAttribute
(
'compiler'
)]
var
compiler
=
self
.
_
dep
s
.
compilersArtefacts
[
contract
.
getAttribute
(
'compiler'
)]
if
(
!
compiler
)
return
null
if
(
!
compiler
)
return
null
if
(
contractName
)
{
if
(
contractName
)
{
...
...
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