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
7c7f624e
Unverified
Commit
7c7f624e
authored
Oct 10, 2018
by
yann300
Committed by
GitHub
Oct 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1536 from ethereum/supportSeveralCompiler
Support several compiler
parents
445e673c
a4ff239a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
116 additions
and
40 deletions
+116
-40
app.js
src/app.js
+4
-3
compiler-abstract.js
src/app/compiler/compiler-abstract.js
+26
-0
debugger.js
src/app/debugger/debugger.js
+3
-5
righthand-panel.js
src/app/panels/righthand-panel.js
+2
-0
pluginAPI.js
src/app/plugin/pluginAPI.js
+3
-0
pluginManager.js
src/app/plugin/pluginManager.js
+16
-0
run-tab.js
src/app/tabs/run-tab.js
+53
-24
multiParamManager.js
src/multiParamManager.js
+3
-0
recorder.js
src/recorder.js
+3
-6
universal-dapp.js
src/universal-dapp.js
+3
-2
No files found.
src/app.js
View file @
7c7f624e
...
@@ -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
0 → 100644
View file @
7c7f624e
'use strict'
var
remixLib
=
require
(
'remix-lib'
)
var
txHelper
=
remixLib
.
execution
.
txHelper
module
.
exports
=
class
CompilerAbstract
{
constructor
(
languageversion
,
data
)
{
this
.
languageversion
=
languageversion
this
.
data
=
data
}
getContracts
()
{
return
this
.
data
.
contracts
}
getContract
(
name
)
{
return
txHelper
.
getContract
(
name
,
this
.
data
.
contracts
)
}
visitContracts
(
calllback
)
{
return
txHelper
.
visitContracts
(
this
.
data
.
contracts
,
calllback
)
}
getData
()
{
return
this
.
data
}
}
src/app/debugger/debugger.js
View file @
7c7f624e
...
@@ -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/panels/righthand-panel.js
View file @
7c7f624e
...
@@ -54,6 +54,8 @@ module.exports = class RighthandPanel {
...
@@ -54,6 +54,8 @@ module.exports = class RighthandPanel {
self
.
_deps
.
udapp
self
.
_deps
.
udapp
)
)
self
.
_components
.
registry
.
put
({
api
:
pluginManager
,
name
:
'pluginmanager'
})
var
analysisTab
=
new
AnalysisTab
(
self
.
_components
.
registry
)
var
analysisTab
=
new
AnalysisTab
(
self
.
_components
.
registry
)
analysisTab
.
event
.
register
(
'newStaticAnaysisWarningMessage'
,
(
msg
,
settings
)
=>
{
self
.
_components
.
compile
.
addWarning
(
msg
,
settings
)
})
analysisTab
.
event
.
register
(
'newStaticAnaysisWarningMessage'
,
(
msg
,
settings
)
=>
{
self
.
_components
.
compile
.
addWarning
(
msg
,
settings
)
})
...
...
src/app/plugin/pluginAPI.js
View file @
7c7f624e
...
@@ -44,6 +44,9 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) =>
...
@@ -44,6 +44,9 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) =>
compiler
:
{
compiler
:
{
getCompilationResult
:
(
mod
,
cb
)
=>
{
getCompilationResult
:
(
mod
,
cb
)
=>
{
cb
(
null
,
compiler
.
lastCompilationResult
)
cb
(
null
,
compiler
.
lastCompilationResult
)
},
sendCompilationResult
:
(
mod
,
file
,
source
,
languageVersion
,
data
,
cb
)
=>
{
pluginManager
.
receivedDataFrom
(
'sendCompilationResult'
,
mod
,
[
file
,
source
,
languageVersion
,
data
])
}
}
},
},
udapp
:
{
udapp
:
{
...
...
src/app/plugin/pluginManager.js
View file @
7c7f624e
'use strict'
'use strict'
var
remixLib
=
require
(
'remix-lib'
)
var
EventManager
=
remixLib
.
EventManager
var
executionContext
=
require
(
'../../execution-context'
)
var
executionContext
=
require
(
'../../execution-context'
)
const
PluginAPI
=
require
(
'./pluginAPI'
)
const
PluginAPI
=
require
(
'./pluginAPI'
)
/**
/**
...
@@ -80,6 +82,7 @@ const PluginAPI = require('./pluginAPI')
...
@@ -80,6 +82,7 @@ const PluginAPI = require('./pluginAPI')
module
.
exports
=
class
PluginManager
{
module
.
exports
=
class
PluginManager
{
constructor
(
app
,
compiler
,
txlistener
,
fileProviders
,
fileManager
,
udapp
)
{
constructor
(
app
,
compiler
,
txlistener
,
fileProviders
,
fileManager
,
udapp
)
{
const
self
=
this
const
self
=
this
self
.
event
=
new
EventManager
()
var
pluginAPI
=
new
PluginAPI
(
var
pluginAPI
=
new
PluginAPI
(
this
,
this
,
fileProviders
,
fileProviders
,
...
@@ -90,6 +93,14 @@ module.exports = class PluginManager {
...
@@ -90,6 +93,14 @@ module.exports = class PluginManager {
self
.
plugins
=
{}
self
.
plugins
=
{}
self
.
origins
=
{}
self
.
origins
=
{}
self
.
inFocus
self
.
inFocus
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
file
,
provider
)
=>
{
self
.
broadcast
(
JSON
.
stringify
({
action
:
'notification'
,
key
:
'editor'
,
type
:
'currentFileChanged'
,
value
:
[
file
]
}))
})
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
self
.
broadcast
(
JSON
.
stringify
({
self
.
broadcast
(
JSON
.
stringify
({
action
:
'notification'
,
action
:
'notification'
,
...
@@ -184,6 +195,11 @@ module.exports = class PluginManager {
...
@@ -184,6 +195,11 @@ module.exports = class PluginManager {
this
.
post
(
this
.
origins
[
origin
],
value
)
this
.
post
(
this
.
origins
[
origin
],
value
)
}
}
}
}
receivedDataFrom
(
methodName
,
mod
,
argumentsArray
)
{
// TODO check whether 'mod' as right to do that
console
.
log
(
argumentsArray
)
this
.
event
.
trigger
(
methodName
,
argumentsArray
)
}
post
(
name
,
value
)
{
post
(
name
,
value
)
{
const
self
=
this
const
self
=
this
if
(
self
.
plugins
[
name
])
{
if
(
self
.
plugins
[
name
])
{
...
...
src/app/tabs/run-tab.js
View file @
7c7f624e
This diff is collapsed.
Click to expand it.
src/multiParamManager.js
View file @
7c7f624e
...
@@ -183,6 +183,9 @@ class MultiParamManager {
...
@@ -183,6 +183,9 @@ class MultiParamManager {
if (this.funABI.inputs && this.funABI.inputs.length > 0) {
if (this.funABI.inputs && this.funABI.inputs.length > 0) {
contractProperty.classList.add(css.hasArgs)
contractProperty.classList.add(css.hasArgs)
} else if (this.funABI.type === 'fallback') {
contractProperty.classList.add(css.hasArgs)
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden'
} else {
} else {
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden'
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden'
this.basicInputField.style.display = 'none'
this.basicInputField.style.display = 'none'
...
...
src/recorder.js
View file @
7c7f624e
...
@@ -13,7 +13,7 @@ var modal = require('./app/ui/modal-dialog-custom')
...
@@ -13,7 +13,7 @@ var modal = require('./app/ui/modal-dialog-custom')
*
*
*/
*/
class
Recorder
{
class
Recorder
{
constructor
(
compiler
,
udapp
,
logCallBack
)
{
constructor
(
udapp
,
logCallBack
)
{
var
self
=
this
var
self
=
this
self
.
logCallBack
=
logCallBack
self
.
logCallBack
=
logCallBack
self
.
event
=
new
EventManager
()
self
.
event
=
new
EventManager
()
...
@@ -27,14 +27,12 @@ class Recorder {
...
@@ -27,14 +27,12 @@ class Recorder {
if
(
this
.
data
.
_listen
)
{
if
(
this
.
data
.
_listen
)
{
var
record
=
{
value
,
parameters
:
payLoad
.
funArgs
}
var
record
=
{
value
,
parameters
:
payLoad
.
funArgs
}
if
(
!
to
)
{
if
(
!
to
)
{
var
selectedContract
=
compiler
.
getContract
(
payLoad
.
contractName
)
var
abi
=
payLoad
.
contractABI
if
(
selectedContract
)
{
var
abi
=
selectedContract
.
object
.
abi
var
sha3
=
ethutil
.
bufferToHex
(
ethutil
.
sha3
(
abi
))
var
sha3
=
ethutil
.
bufferToHex
(
ethutil
.
sha3
(
abi
))
record
.
abi
=
sha3
record
.
abi
=
sha3
record
.
contractName
=
payLoad
.
contractName
record
.
contractName
=
payLoad
.
contractName
record
.
bytecode
=
payLoad
.
contractBytecode
record
.
bytecode
=
payLoad
.
contractBytecode
record
.
linkReferences
=
selectedContract
.
object
.
evm
.
bytecode
.
linkReferences
record
.
linkReferences
=
payLoad
.
linkReferences
if
(
record
.
linkReferences
&&
Object
.
keys
(
record
.
linkReferences
).
length
)
{
if
(
record
.
linkReferences
&&
Object
.
keys
(
record
.
linkReferences
).
length
)
{
for
(
var
file
in
record
.
linkReferences
)
{
for
(
var
file
in
record
.
linkReferences
)
{
for
(
var
lib
in
record
.
linkReferences
[
file
])
{
for
(
var
lib
in
record
.
linkReferences
[
file
])
{
...
@@ -45,7 +43,6 @@ class Recorder {
...
@@ -45,7 +43,6 @@ class Recorder {
self
.
data
.
_abis
[
sha3
]
=
abi
self
.
data
.
_abis
[
sha3
]
=
abi
this
.
data
.
_contractABIReferences
[
timestamp
]
=
sha3
this
.
data
.
_contractABIReferences
[
timestamp
]
=
sha3
}
}
else
{
}
else
{
var
creationTimestamp
=
this
.
data
.
_createdContracts
[
to
]
var
creationTimestamp
=
this
.
data
.
_createdContracts
[
to
]
record
.
to
=
`created{
${
creationTimestamp
}
}`
record
.
to
=
`created{
${
creationTimestamp
}
}`
...
...
src/universal-dapp.js
View file @
7c7f624e
...
@@ -205,7 +205,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
...
@@ -205,7 +205,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
}
}
}
}
// contractsDetails is used to resolve libraries
// contractsDetails is used to resolve libraries
txFormat
.
buildData
(
args
.
contractName
,
args
.
contractAbi
,
self
.
data
.
contractsDetails
,
false
,
args
.
funABI
,
value
,
(
error
,
data
)
=>
{
txFormat
.
buildData
(
args
.
contractName
,
args
.
contractAbi
,
self
.
data
.
contractsDetails
,
false
,
args
.
funABI
,
args
.
funABI
.
type
!==
'fallback'
?
value
:
''
,
(
error
,
data
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
if
(
isUserAction
)
{
if
(
isUserAction
)
{
if
(
!
args
.
funABI
.
constant
)
{
if
(
!
args
.
funABI
.
constant
)
{
...
@@ -214,6 +214,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
...
@@ -214,6 +214,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
self
.
_deps
.
logCallback
(
`
${
logMsg
}
`
)
self
.
_deps
.
logCallback
(
`
${
logMsg
}
`
)
}
}
}
}
if
(
args
.
funABI
.
type
===
'fallback'
)
data
.
dataHex
=
value
self
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
(
error
,
txResult
)
=>
{
self
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
(
error
,
txResult
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
var
isVM
=
executionContext
.
isVM
()
var
isVM
=
executionContext
.
isVM
()
...
@@ -349,7 +350,7 @@ UniversalDApp.prototype.runTx = function (args, cb) {
...
@@ -349,7 +350,7 @@ UniversalDApp.prototype.runTx = function (args, cb) {
},
},
function
runTransaction
(
fromAddress
,
value
,
gasLimit
,
next
)
{
function
runTransaction
(
fromAddress
,
value
,
gasLimit
,
next
)
{
var
tx
=
{
to
:
args
.
to
,
data
:
args
.
data
.
dataHex
,
useCall
:
args
.
useCall
,
from
:
fromAddress
,
value
:
value
,
gasLimit
:
gasLimit
}
var
tx
=
{
to
:
args
.
to
,
data
:
args
.
data
.
dataHex
,
useCall
:
args
.
useCall
,
from
:
fromAddress
,
value
:
value
,
gasLimit
:
gasLimit
}
var
payLoad
=
{
funAbi
:
args
.
data
.
funAbi
,
funArgs
:
args
.
data
.
funArgs
,
contractBytecode
:
args
.
data
.
contractBytecode
,
contractName
:
args
.
data
.
contractName
}
var
payLoad
=
{
funAbi
:
args
.
data
.
funAbi
,
funArgs
:
args
.
data
.
funArgs
,
contractBytecode
:
args
.
data
.
contractBytecode
,
contractName
:
args
.
data
.
contractName
,
contractABI
:
args
.
data
.
contractABI
,
linkReferences
:
args
.
data
.
linkReferences
}
var
timestamp
=
Date
.
now
()
var
timestamp
=
Date
.
now
()
self
.
event
.
trigger
(
'initiatingTransaction'
,
[
timestamp
,
tx
,
payLoad
])
self
.
event
.
trigger
(
'initiatingTransaction'
,
[
timestamp
,
tx
,
payLoad
])
...
...
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