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
77f304bf
Unverified
Commit
77f304bf
authored
Jul 04, 2018
by
yann300
Committed by
GitHub
Jul 04, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1397 from ethereum/refactor9
Clean app.js (9)
parents
5f087838
9b8e10b5
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
170 additions
and
199 deletions
+170
-199
app.js
src/app.js
+17
-69
contextView.js
src/app/editor/contextView.js
+9
-9
contextualListener.js
src/app/editor/contextualListener.js
+6
-6
fileManager.js
src/app/files/fileManager.js
+4
-2
editor-panel.js
src/app/panels/editor-panel.js
+29
-15
terminal.js
src/app/panels/terminal.js
+7
-11
compile-tab.js
src/app/tabs/compile-tab.js
+0
-8
run-tab.js
src/app/tabs/run-tab.js
+49
-19
settings-tab.js
src/app/tabs/settings-tab.js
+0
-3
cmdInterpreter.js
src/lib/cmdInterpreter.js
+1
-1
recorder.js
src/recorder.js
+8
-14
universal-dapp-ui.js
src/universal-dapp-ui.js
+0
-9
universal-dapp.js
src/universal-dapp.js
+29
-21
compiling.js
test-browser/tests/compiling.js
+11
-12
No files found.
src/app.js
View file @
77f304bf
...
@@ -24,7 +24,6 @@ var BrowserfilesTree = require('./app/files/browser-files-tree')
...
@@ -24,7 +24,6 @@ var BrowserfilesTree = require('./app/files/browser-files-tree')
var
chromeCloudStorageSync
=
require
(
'./app/files/chromeCloudStorageSync'
)
var
chromeCloudStorageSync
=
require
(
'./app/files/chromeCloudStorageSync'
)
var
SharedFolder
=
require
(
'./app/files/shared-folder'
)
var
SharedFolder
=
require
(
'./app/files/shared-folder'
)
var
Config
=
require
(
'./config'
)
var
Config
=
require
(
'./config'
)
var
Editor
=
require
(
'./app/editor/editor'
)
var
Renderer
=
require
(
'./app/ui/renderer'
)
var
Renderer
=
require
(
'./app/ui/renderer'
)
var
Compiler
=
require
(
'remix-solidity'
).
Compiler
var
Compiler
=
require
(
'remix-solidity'
).
Compiler
var
executionContext
=
require
(
'./execution-context'
)
var
executionContext
=
require
(
'./execution-context'
)
...
@@ -40,12 +39,9 @@ var Txlistener = remixLib.execution.txListener
...
@@ -40,12 +39,9 @@ var Txlistener = remixLib.execution.txListener
var
EventsDecoder
=
remixLib
.
execution
.
EventsDecoder
var
EventsDecoder
=
remixLib
.
execution
.
EventsDecoder
var
CompilerImport
=
require
(
'./app/compiler/compiler-imports'
)
var
CompilerImport
=
require
(
'./app/compiler/compiler-imports'
)
var
FileManager
=
require
(
'./app/files/fileManager'
)
var
FileManager
=
require
(
'./app/files/fileManager'
)
var
ContextualListener
=
require
(
'./app/editor/contextualListener'
)
var
ContextView
=
require
(
'./app/editor/contextView'
)
var
BasicReadOnlyExplorer
=
require
(
'./app/files/basicReadOnlyExplorer'
)
var
BasicReadOnlyExplorer
=
require
(
'./app/files/basicReadOnlyExplorer'
)
var
NotPersistedExplorer
=
require
(
'./app/files/NotPersistedExplorer'
)
var
NotPersistedExplorer
=
require
(
'./app/files/NotPersistedExplorer'
)
var
toolTip
=
require
(
'./app/ui/tooltip'
)
var
toolTip
=
require
(
'./app/ui/tooltip'
)
var
CommandInterpreter
=
require
(
'./lib/cmdInterpreter'
)
var
TransactionReceiptResolver
=
require
(
'./transactionReceiptResolver'
)
var
TransactionReceiptResolver
=
require
(
'./transactionReceiptResolver'
)
var
SourceHighlighter
=
require
(
'./app/editor/sourceHighlighter'
)
var
SourceHighlighter
=
require
(
'./app/editor/sourceHighlighter'
)
...
@@ -237,7 +233,7 @@ class App {
...
@@ -237,7 +233,7 @@ class App {
if
(
self
.
_view
.
transactionDebugger
.
isActive
)
return
if
(
self
.
_view
.
transactionDebugger
.
isActive
)
return
self
.
_components
.
fileManager
.
saveCurrentFile
()
self
.
_components
.
fileManager
.
saveCurrentFile
()
self
.
_components
.
editor
.
clearAnnotations
()
self
.
_components
.
editor
panel
.
getEditor
()
.
clearAnnotations
()
var
currentFile
=
self
.
_components
.
config
.
get
(
'currentFile'
)
var
currentFile
=
self
.
_components
.
config
.
get
(
'currentFile'
)
if
(
currentFile
)
{
if
(
currentFile
)
{
if
(
/.
(
.sol
)
$/
.
exec
(
currentFile
))
{
if
(
/.
(
.sol
)
$/
.
exec
(
currentFile
))
{
...
@@ -388,6 +384,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -388,6 +384,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
}
}
})
})
registry
.
put
({
api
:
msg
=>
self
.
_components
.
editorpanel
.
logHtmlMessage
(
msg
),
name
:
'logCallback'
})
// ----------------- Compiler -----------------
// ----------------- Compiler -----------------
self
.
_components
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
self
.
importFileCb
(
url
,
cb
))
self
.
_components
.
compiler
=
new
Compiler
((
url
,
cb
)
=>
self
.
importFileCb
(
url
,
cb
))
var
compiler
=
self
.
_components
.
compiler
var
compiler
=
self
.
_components
.
compiler
...
@@ -395,51 +393,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -395,51 +393,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
var
offsetToLineColumnConverter
=
new
OffsetToLineColumnConverter
(
compiler
.
event
)
var
offsetToLineColumnConverter
=
new
OffsetToLineColumnConverter
(
compiler
.
event
)
registry
.
put
({
api
:
offsetToLineColumnConverter
,
name
:
'offsettolinecolumnconverter'
})
registry
.
put
({
api
:
offsetToLineColumnConverter
,
name
:
'offsettolinecolumnconverter'
})
// ----------------- UniversalDApp -----------------
var
transactionContextAPI
=
{
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
},
getValue
:
(
cb
)
=>
{
try
{
var
number
=
document
.
querySelector
(
'#value'
).
value
var
select
=
document
.
getElementById
(
'unit'
)
var
index
=
select
.
selectedIndex
var
selectedUnit
=
select
.
querySelectorAll
(
'option'
)[
index
].
dataset
.
unit
var
unit
=
'ether'
// default
if
(
selectedUnit
===
'ether'
)
{
unit
=
'ether'
}
else
if
(
selectedUnit
===
'finney'
)
{
unit
=
'finney'
}
else
if
(
selectedUnit
===
'gwei'
)
{
unit
=
'gwei'
}
else
if
(
selectedUnit
===
'wei'
)
{
unit
=
'wei'
}
cb
(
null
,
executionContext
.
web3
().
toWei
(
number
,
unit
))
}
catch
(
e
)
{
cb
(
e
)
}
},
getGasLimit
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#gasLimit'
).
val
())
}
}
// @TODO should put this in runtab
registry
.
put
({
api
:
transactionContextAPI
,
name
:
'transactionContextAPI'
})
var
udapp
=
new
UniversalDApp
({
removable
:
false
,
removable_instances
:
true
})
// ----------------- UniversalDApp -----------------
var
udapp
=
new
UniversalDApp
({
removable
:
false
,
removable_instances
:
true
})
registry
.
put
({
api
:
udapp
,
name
:
'udapp'
})
registry
.
put
({
api
:
udapp
,
name
:
'udapp'
})
var
udappUI
=
new
UniversalDAppUI
(
udapp
)
var
udappUI
=
new
UniversalDAppUI
(
udapp
)
registry
.
put
({
api
:
udappUI
,
name
:
'udappUI'
})
registry
.
put
({
api
:
udappUI
,
name
:
'udappUI'
})
udapp
.
reset
({})
udappUI
.
reset
()
udapp
.
event
.
register
(
'debugRequested'
,
this
,
function
(
txResult
)
{
self
.
startdebugging
(
txResult
.
transactionHash
)
})
// ----------------- Tx listener -----------------
// ----------------- Tx listener -----------------
var
transactionReceiptResolver
=
new
TransactionReceiptResolver
()
var
transactionReceiptResolver
=
new
TransactionReceiptResolver
()
...
@@ -472,39 +436,23 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -472,39 +436,23 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
txlistener
.
startListening
()
txlistener
.
startListening
()
// ----------------- editor ----------------------------
// TODO: There are still a lot of dep between editorpanel and filemanager
this
.
_components
.
editor
=
new
Editor
({})
// @TODO: put into editorpanel
var
editor
=
self
.
_components
.
editor
// shortcut for the editor
registry
.
put
({
api
:
editor
,
name
:
'editor'
})
// ----------------- Command Interpreter -----------------
// ----------------- editor panel ----------------------
/*
self
.
_components
.
editorpanel
=
new
EditorPanel
()
this module basically listen on user input (from terminal && editor)
registry
.
put
({
api
:
self
.
_components
.
editorpanel
,
name
:
'editorpanel'
})
and interpret them as commands
*/
var
cmdInterpreter
=
new
CommandInterpreter
()
// @TODO: put into editorpanel
registry
.
put
({
api
:
cmdInterpreter
,
name
:
'cmdinterpreter'
})
// ----------------- file manager ----------------------------
// ----------------- file manager ----------------------------
self
.
_components
.
fileManager
=
new
FileManager
()
self
.
_components
.
fileManager
=
new
FileManager
()
var
fileManager
=
self
.
_components
.
fileManager
var
fileManager
=
self
.
_components
.
fileManager
registry
.
put
({
api
:
fileManager
,
name
:
'filemanager'
})
registry
.
put
({
api
:
fileManager
,
name
:
'filemanager'
})
// ---------------- ContextualListener -----------------------
self
.
_components
.
editorpanel
.
init
()
this
.
_components
.
contextualListener
=
new
ContextualListener
()
self
.
_components
.
fileManager
.
init
()
registry
.
put
({
api
:
this
.
_components
.
contextualListener
,
name
:
'contextualListener'
})
// ---------------- ContextView -----------------------
this
.
_components
.
contextView
=
new
ContextView
()
registry
.
put
({
api
:
this
.
_components
.
contextView
,
name
:
'contextview'
})
// ----------------- editor panel ----------------------
this
.
_components
.
editorpanel
=
new
EditorPanel
()
registry
.
put
({
api
:
this
.
_components
.
editorpanel
,
name
:
'editorpanel'
})
this
.
_components
.
editorpanel
.
event
.
register
(
'resize'
,
direction
=>
self
.
_adjustLayout
(
direction
))
this
.
_view
.
centerpanel
.
appendChild
(
this
.
_components
.
editorpanel
.
render
())
self
.
_components
.
editorpanel
.
event
.
register
(
'resize'
,
direction
=>
self
.
_adjustLayout
(
direction
))
self
.
_view
.
centerpanel
.
appendChild
(
self
.
_components
.
editorpanel
.
render
())
var
editor
=
self
.
_components
.
editorpanel
.
getEditor
()
// The event listener needs to be registered as early as possible, because the
// The event listener needs to be registered as early as possible, because the
// parent will send the message upon the "load" event.
// parent will send the message upon the "load" event.
...
...
src/app/editor/contextView.js
View file @
77f304bf
...
@@ -14,13 +14,13 @@ var css = require('./styles/contextView-styles')
...
@@ -14,13 +14,13 @@ var css = require('./styles/contextView-styles')
- rename declaration/references
- rename declaration/references
*/
*/
class
ContextView
{
class
ContextView
{
constructor
(
localRegistry
)
{
constructor
(
opts
,
localRegistry
)
{
const
self
=
this
const
self
=
this
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
contextualListener
=
opts
.
contextualListener
self
.
editor
=
opts
.
editor
self
.
_deps
=
{
self
.
_deps
=
{
contextualListener
:
self
.
_components
.
registry
.
get
(
'contextualListener'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
offsetToLineColumnConverter
:
self
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
offsetToLineColumnConverter
:
self
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
...
@@ -31,7 +31,7 @@ class ContextView {
...
@@ -31,7 +31,7 @@ class ContextView {
this
.
_current
this
.
_current
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
previousElement
=
null
this
.
previousElement
=
null
self
.
_deps
.
contextualListener
.
event
.
register
(
'contextChanged'
,
nodes
=>
{
self
.
contextualListener
.
event
.
register
(
'contextChanged'
,
nodes
=>
{
this
.
_nodes
=
nodes
this
.
_nodes
=
nodes
this
.
update
()
this
.
update
()
})
})
...
@@ -76,7 +76,7 @@ class ContextView {
...
@@ -76,7 +76,7 @@ class ContextView {
if
(
isDefinition
(
last
))
{
if
(
isDefinition
(
last
))
{
this
.
_current
=
last
this
.
_current
=
last
}
else
{
}
else
{
var
target
=
this
.
_deps
.
contextualListener
.
declarationOf
(
last
)
var
target
=
this
.
contextualListener
.
declarationOf
(
last
)
if
(
target
)
{
if
(
target
)
{
this
.
_current
=
target
this
.
_current
=
target
}
else
{
}
else
{
...
@@ -94,7 +94,7 @@ class ContextView {
...
@@ -94,7 +94,7 @@ class ContextView {
var
self
=
this
var
self
=
this
function
jumpToLine
(
lineColumn
)
{
function
jumpToLine
(
lineColumn
)
{
if
(
lineColumn
.
start
&&
lineColumn
.
start
.
line
&&
lineColumn
.
start
.
column
)
{
if
(
lineColumn
.
start
&&
lineColumn
.
start
.
line
&&
lineColumn
.
start
.
column
)
{
self
.
_deps
.
editor
.
gotoLine
(
lineColumn
.
start
.
line
,
lineColumn
.
end
.
column
+
1
)
self
.
editor
.
gotoLine
(
lineColumn
.
start
.
line
,
lineColumn
.
end
.
column
+
1
)
}
}
}
}
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
...
@@ -119,12 +119,12 @@ class ContextView {
...
@@ -119,12 +119,12 @@ class ContextView {
_render
(
node
,
nodeAtCursorPosition
)
{
_render
(
node
,
nodeAtCursorPosition
)
{
if
(
!
node
)
return
yo
`<div></div>`
if
(
!
node
)
return
yo
`<div></div>`
var
self
=
this
var
self
=
this
var
references
=
self
.
_deps
.
contextualListener
.
referencesOf
(
node
)
var
references
=
self
.
contextualListener
.
referencesOf
(
node
)
var
type
=
(
node
.
attributes
&&
node
.
attributes
.
type
)
?
node
.
attributes
.
type
:
node
.
name
var
type
=
(
node
.
attributes
&&
node
.
attributes
.
type
)
?
node
.
attributes
.
type
:
node
.
name
references
=
`
${
references
?
references
.
length
:
'0'
}
reference(s)`
references
=
`
${
references
?
references
.
length
:
'0'
}
reference(s)`
var
ref
=
0
var
ref
=
0
var
nodes
=
self
.
_deps
.
contextualListener
.
getActiveHighlights
()
var
nodes
=
self
.
contextualListener
.
getActiveHighlights
()
for
(
var
k
in
nodes
)
{
for
(
var
k
in
nodes
)
{
if
(
nodeAtCursorPosition
.
id
===
nodes
[
k
].
nodeId
)
{
if
(
nodeAtCursorPosition
.
id
===
nodes
[
k
].
nodeId
)
{
ref
=
k
ref
=
k
...
@@ -161,7 +161,7 @@ class ContextView {
...
@@ -161,7 +161,7 @@ class ContextView {
function
showGasEstimation
()
{
function
showGasEstimation
()
{
if
(
node
.
name
===
'FunctionDefinition'
)
{
if
(
node
.
name
===
'FunctionDefinition'
)
{
var
result
=
self
.
_deps
.
contextualListener
.
gasEstimation
(
node
)
var
result
=
self
.
contextualListener
.
gasEstimation
(
node
)
var
executionCost
=
'Execution cost: '
+
result
.
executionCost
+
' gas'
var
executionCost
=
'Execution cost: '
+
result
.
executionCost
+
' gas'
var
codeDepositCost
=
'Code deposit cost: '
+
result
.
codeDepositCost
+
' gas'
var
codeDepositCost
=
'Code deposit cost: '
+
result
.
codeDepositCost
+
' gas'
var
estimatedGas
=
result
.
codeDepositCost
?
`
${
codeDepositCost
}
,
${
executionCost
}
`
:
`
${
executionCost
}
`
var
estimatedGas
=
result
.
codeDepositCost
?
`
${
codeDepositCost
}
,
${
executionCost
}
`
:
`
${
executionCost
}
`
...
...
src/app/editor/contextualListener.js
View file @
77f304bf
...
@@ -9,14 +9,14 @@ var globalRegistry = require('../../global/registry')
...
@@ -9,14 +9,14 @@ var globalRegistry = require('../../global/registry')
trigger contextChanged(nodes)
trigger contextChanged(nodes)
*/
*/
class
ContextualListener
{
class
ContextualListener
{
constructor
(
localRegistry
)
{
constructor
(
opts
,
localRegistry
)
{
var
self
=
this
var
self
=
this
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
editor
=
opts
.
editor
self
.
_deps
=
{
self
.
_deps
=
{
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
offsetToLineColumnConverter
:
self
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
offsetToLineColumnConverter
:
self
.
_components
.
registry
.
get
(
'offsettolinecolumnconverter'
).
api
}
}
...
@@ -37,12 +37,12 @@ class ContextualListener {
...
@@ -37,12 +37,12 @@ class ContextualListener {
}
}
})
})
self
.
_deps
.
editor
.
event
.
register
(
'contentChanged'
,
()
=>
{
this
.
_stopHighlighting
()
})
self
.
editor
.
event
.
register
(
'contentChanged'
,
()
=>
{
this
.
_stopHighlighting
()
})
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
sourceMappingDecoder
=
new
SourceMappingDecoder
()
this
.
astWalker
=
new
AstWalker
()
this
.
astWalker
=
new
AstWalker
()
setInterval
(()
=>
{
setInterval
(()
=>
{
this
.
_highlightItems
(
self
.
_deps
.
editor
.
getCursorPosition
(),
self
.
_deps
.
compiler
.
lastCompilationResult
,
self
.
_deps
.
config
.
get
(
'currentFile'
))
this
.
_highlightItems
(
self
.
editor
.
getCursorPosition
(),
self
.
_deps
.
compiler
.
lastCompilationResult
,
self
.
_deps
.
config
.
get
(
'currentFile'
))
},
1000
)
},
1000
)
}
}
...
@@ -132,7 +132,7 @@ class ContextualListener {
...
@@ -132,7 +132,7 @@ class ContextualListener {
}
}
var
fileName
=
self
.
_deps
.
compiler
.
getSourceName
(
position
.
file
)
var
fileName
=
self
.
_deps
.
compiler
.
getSourceName
(
position
.
file
)
if
(
fileName
)
{
if
(
fileName
)
{
return
self
.
_deps
.
editor
.
addMarker
(
lineColumn
,
fileName
,
css
)
return
self
.
editor
.
addMarker
(
lineColumn
,
fileName
,
css
)
}
}
}
}
return
null
return
null
...
@@ -164,7 +164,7 @@ class ContextualListener {
...
@@ -164,7 +164,7 @@ class ContextualListener {
var
self
=
this
var
self
=
this
for
(
var
eventKey
in
this
.
_activeHighlights
)
{
for
(
var
eventKey
in
this
.
_activeHighlights
)
{
var
event
=
this
.
_activeHighlights
[
eventKey
]
var
event
=
this
.
_activeHighlights
[
eventKey
]
self
.
_deps
.
editor
.
removeMarker
(
event
.
eventId
,
event
.
fileTarget
)
self
.
editor
.
removeMarker
(
event
.
eventId
,
event
.
fileTarget
)
}
}
this
.
_activeHighlights
=
[]
this
.
_activeHighlights
=
[]
}
}
...
...
src/app/files/fileManager.js
View file @
77f304bf
...
@@ -15,10 +15,12 @@ class FileManager {
...
@@ -15,10 +15,12 @@ class FileManager {
constructor
(
localRegistry
)
{
constructor
(
localRegistry
)
{
this
.
tabbedFiles
=
{}
this
.
tabbedFiles
=
{}
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
_components
=
{}
this
.
_components
.
registry
=
localRegistry
||
globalRegistry
}
init
()
{
var
self
=
this
var
self
=
this
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_deps
=
{
self
.
_deps
=
{
compilerImport
:
self
.
_components
.
registry
.
get
(
'compilerimport'
).
api
,
compilerImport
:
self
.
_components
.
registry
.
get
(
'compilerimport'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
...
...
src/app/panels/editor-panel.js
View file @
77f304bf
...
@@ -4,8 +4,12 @@ var EventManager = remixLib.EventManager
...
@@ -4,8 +4,12 @@ var EventManager = remixLib.EventManager
var
$
=
require
(
'jquery'
)
var
$
=
require
(
'jquery'
)
var
Terminal
=
require
(
'./terminal'
)
var
Terminal
=
require
(
'./terminal'
)
var
Editor
=
require
(
'../editor/editor'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
CommandInterpreter
=
require
(
'../../lib/cmdInterpreter'
)
var
ContextualListener
=
require
(
'../editor/contextualListener'
)
var
ContextView
=
require
(
'../editor/contextView'
)
var
styles
=
require
(
'./styles/editor-panel-styles'
)
var
styles
=
require
(
'./styles/editor-panel-styles'
)
var
cssTabs
=
styles
.
cssTabs
var
cssTabs
=
styles
.
cssTabs
var
css
=
styles
.
css
var
css
=
styles
.
css
...
@@ -15,16 +19,16 @@ class EditorPanel {
...
@@ -15,16 +19,16 @@ class EditorPanel {
var
self
=
this
var
self
=
this
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
event
=
new
EventManager
()
}
init
()
{
var
self
=
this
self
.
_deps
=
{
self
.
_deps
=
{
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
txlistener
:
self
.
_components
.
registry
.
get
(
'txlistener'
).
api
,
txlistener
:
self
.
_components
.
registry
.
get
(
'txlistener'
).
api
,
contextView
:
self
.
_components
.
registry
.
get
(
'contextview'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
udapp
:
self
.
_components
.
registry
.
get
(
'udapp'
).
api
,
udapp
:
self
.
_components
.
registry
.
get
(
'udapp'
).
api
cmdInterpreter
:
self
.
_components
.
registry
.
get
(
'cmdinterpreter'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
}
}
self
.
event
=
new
EventManager
()
self
.
data
=
{
self
.
data
=
{
_FILE_SCROLL_DELTA
:
200
,
_FILE_SCROLL_DELTA
:
200
,
_layout
:
{
_layout
:
{
...
@@ -35,13 +39,19 @@ class EditorPanel {
...
@@ -35,13 +39,19 @@ class EditorPanel {
}
}
}
}
self
.
_view
=
{}
self
.
_view
=
{}
var
editor
=
new
Editor
({})
self
.
_components
.
registry
.
put
({
api
:
editor
,
name
:
'editor'
})
var
contextualListener
=
new
ContextualListener
({
editor
:
editor
})
self
.
_components
=
{
self
.
_components
=
{
editor
:
self
.
_deps
.
editor
,
// @TODO: instantiate in eventpanel instead of passing via `opts`
editor
:
editor
,
contextualListener
:
contextualListener
,
contextView
:
new
ContextView
({
contextualListener
:
contextualListener
,
editor
:
editor
}),
terminal
:
new
Terminal
({
terminal
:
new
Terminal
({
api
:
{
udapp
:
self
.
_deps
.
udapp
,
cmdInterpreter
:
self
.
_deps
.
cmdInterpreter
,
cmdInterpreter
:
new
CommandInterpreter
()
udapp
:
self
.
_deps
.
udapp
,
},
getPosition
(
event
)
{
{
getPosition
:
(
event
)
=>
{
var
limitUp
=
36
var
limitUp
=
36
var
limitDown
=
20
var
limitDown
=
20
var
height
=
window
.
innerHeight
var
height
=
window
.
innerHeight
...
@@ -49,9 +59,9 @@ class EditorPanel {
...
@@ -49,9 +59,9 @@ class EditorPanel {
newpos
=
(
newpos
<
height
-
limitDown
)
?
newpos
:
height
-
limitDown
newpos
=
(
newpos
<
height
-
limitDown
)
?
newpos
:
height
-
limitDown
return
newpos
return
newpos
}
}
}
})
})
}
}
self
.
_components
.
terminal
.
event
.
register
(
'filterChanged'
,
(
type
,
value
)
=>
{
self
.
_components
.
terminal
.
event
.
register
(
'filterChanged'
,
(
type
,
value
)
=>
{
this
.
event
.
trigger
(
'terminalFilterChanged'
,
[
type
,
value
])
this
.
event
.
trigger
(
'terminalFilterChanged'
,
[
type
,
value
])
})
})
...
@@ -93,6 +103,10 @@ class EditorPanel {
...
@@ -93,6 +103,10 @@ class EditorPanel {
self
.
_components
.
terminal
.
scroll2bottom
()
self
.
_components
.
terminal
.
scroll2bottom
()
}
}
}
}
getEditor
()
{
var
self
=
this
return
self
.
_components
.
editor
}
refresh
()
{
refresh
()
{
var
self
=
this
var
self
=
this
self
.
_view
.
tabs
.
onmouseenter
()
self
.
_view
.
tabs
.
onmouseenter
()
...
@@ -119,7 +133,7 @@ class EditorPanel {
...
@@ -119,7 +133,7 @@ class EditorPanel {
<div class=
${
css
.
content
}
>
<div class=
${
css
.
content
}
>
${
self
.
_renderTabsbar
()}
${
self
.
_renderTabsbar
()}
<div class=
${
css
.
contextviewcontainer
}
>
<div class=
${
css
.
contextviewcontainer
}
>
${
self
.
_
dep
s
.
contextView
.
render
()}
${
self
.
_
component
s
.
contextView
.
render
()}
</div>
</div>
${
self
.
_view
.
editor
}
${
self
.
_view
.
editor
}
${
self
.
_view
.
terminal
}
${
self
.
_view
.
terminal
}
...
@@ -191,7 +205,7 @@ class EditorPanel {
...
@@ -191,7 +205,7 @@ class EditorPanel {
delete
self
.
_deps
.
fileManager
.
tabbedFiles
[
name
]
delete
self
.
_deps
.
fileManager
.
tabbedFiles
[
name
]
self
.
_deps
.
fileManager
.
refreshTabs
()
self
.
_deps
.
fileManager
.
refreshTabs
()
if
(
Object
.
keys
(
self
.
_deps
.
fileManager
.
tabbedFiles
).
length
)
{
if
(
Object
.
keys
(
self
.
_deps
.
fileManager
.
tabbedFiles
).
length
)
{
self
.
switchFile
(
Object
.
keys
(
self
.
_deps
.
fileManager
.
tabbedFiles
)[
0
])
self
.
_deps
.
fileManager
.
switchFile
(
Object
.
keys
(
self
.
_deps
.
fileManager
.
tabbedFiles
)[
0
])
}
else
{
}
else
{
self
.
_deps
.
editor
.
displayEmptyReadOnlySession
()
self
.
_deps
.
editor
.
displayEmptyReadOnlySession
()
self
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
self
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
...
...
src/app/panels/terminal.js
View file @
77f304bf
...
@@ -24,10 +24,11 @@ function register (api) { KONSOLES.push(api) }
...
@@ -24,10 +24,11 @@ function register (api) { KONSOLES.push(api) }
var
ghostbar
=
yo
`<div class=
${
css
.
ghostbar
}
></div>`
var
ghostbar
=
yo
`<div class=
${
css
.
ghostbar
}
></div>`
class
Terminal
{
class
Terminal
{
constructor
(
opts
=
{
auto
:
true
}
)
{
constructor
(
opts
,
api
)
{
var
self
=
this
var
self
=
this
self
.
event
=
new
EventManager
()
self
.
event
=
new
EventManager
()
self
.
_api
=
opts
.
api
self
.
_api
=
api
self
.
_opts
=
opts
self
.
data
=
{
self
.
data
=
{
lineLength
:
opts
.
lineLength
||
80
,
lineLength
:
opts
.
lineLength
||
80
,
session
:
[],
session
:
[],
...
@@ -73,7 +74,7 @@ class Terminal {
...
@@ -73,7 +74,7 @@ class Terminal {
self
.
registerCommand
(
'script'
,
function
execute
(
args
,
scopedCommands
,
append
)
{
self
.
registerCommand
(
'script'
,
function
execute
(
args
,
scopedCommands
,
append
)
{
var
script
=
String
(
args
[
0
])
var
script
=
String
(
args
[
0
])
scopedCommands
.
log
(
`>
${
script
}
`
)
scopedCommands
.
log
(
`>
${
script
}
`
)
if
(
self
.
_
api
.
cmdInterpreter
&&
self
.
_api
.
cmdInterpreter
.
interpret
(
script
))
return
if
(
self
.
_
opts
.
cmdInterpreter
&&
self
.
opts
.
cmdInterpreter
.
interpret
(
script
))
return
self
.
_shell
(
script
,
scopedCommands
,
function
(
error
,
output
)
{
self
.
_shell
(
script
,
scopedCommands
,
function
(
error
,
output
)
{
if
(
error
)
scopedCommands
.
error
(
error
)
if
(
error
)
scopedCommands
.
error
(
error
)
else
scopedCommands
.
log
(
output
)
else
scopedCommands
.
log
(
output
)
...
@@ -111,7 +112,7 @@ class Terminal {
...
@@ -111,7 +112,7 @@ class Terminal {
self
.
_view
.
dragbar
=
yo
`
self
.
_view
.
dragbar
=
yo
`
<div onmousedown=
${
mousedown
}
class=
${
css
.
dragbarHorizontal
}
></div>`
<div onmousedown=
${
mousedown
}
class=
${
css
.
dragbarHorizontal
}
></div>`
self
.
_view
.
dropdown
=
self
.
_components
.
dropdown
.
render
()
self
.
_view
.
dropdown
=
self
.
_components
.
dropdown
.
render
()
self
.
_view
.
pendingTxCount
=
yo
`<div class=
${
css
.
pendingTx
}
title='Pending Transactions'>
${
self
.
_view
.
pendingTxCount
}
</div>`
self
.
_view
.
pendingTxCount
=
yo
`<div class=
${
css
.
pendingTx
}
title='Pending Transactions'>
0
</div>`
self
.
_view
.
bar
=
yo
`
self
.
_view
.
bar
=
yo
`
<div class=
${
css
.
bar
}
>
<div class=
${
css
.
bar
}
>
${
self
.
_view
.
dragbar
}
${
self
.
_view
.
dragbar
}
...
@@ -136,8 +137,8 @@ class Terminal {
...
@@ -136,8 +137,8 @@ class Terminal {
</div>
</div>
`
`
setInterval
(()
=>
{
setInterval
(()
=>
{
updatePendingTxs
(
self
.
_api
.
udapp
,
self
.
_view
.
pendingTxCount
)
self
.
_view
.
pendingTxCount
.
innerHTML
=
self
.
_opts
.
udapp
.
pendingTransactionsCount
(
)
},
5
000
)
},
1
000
)
function
listenOnNetwork
(
ev
)
{
function
listenOnNetwork
(
ev
)
{
self
.
event
.
trigger
(
'listenOnNetWork'
,
[
ev
.
currentTarget
.
checked
])
self
.
event
.
trigger
(
'listenOnNetWork'
,
[
ev
.
currentTarget
.
checked
])
...
@@ -578,10 +579,5 @@ function domTerminalFeatures (self, scopedCommands) {
...
@@ -578,10 +579,5 @@ function domTerminalFeatures (self, scopedCommands) {
}
}
function
blockify
(
el
)
{
return
yo
`<div class=
${
css
.
block
}
>
${
el
}
</div>`
}
function
blockify
(
el
)
{
return
yo
`<div class=
${
css
.
block
}
>
${
el
}
</div>`
}
// PENDING TX
function
updatePendingTxs
(
udapp
,
el
)
{
var
count
=
Object
.
keys
(
udapp
.
pendingTransactions
()).
length
el
.
innerText
=
count
}
module
.
exports
=
Terminal
module
.
exports
=
Terminal
src/app/tabs/compile-tab.js
View file @
77f304bf
...
@@ -33,15 +33,11 @@ module.exports = class CompileTab {
...
@@ -33,15 +33,11 @@ module.exports = class CompileTab {
// dependencies
// dependencies
self
.
_deps
=
{
self
.
_deps
=
{
app
:
self
.
_components
.
registry
.
get
(
'app'
).
api
,
app
:
self
.
_components
.
registry
.
get
(
'app'
).
api
,
udapp
:
self
.
_components
.
registry
.
get
(
'udapp'
).
api
,
udappUI
:
self
.
_components
.
registry
.
get
(
'udappUI'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
staticAnalysis
:
self
.
_components
.
registry
.
get
(
'staticanalysis'
).
api
,
staticAnalysis
:
self
.
_components
.
registry
.
get
(
'staticanalysis'
).
api
,
renderer
:
self
.
_components
.
registry
.
get
(
'renderer'
).
api
,
renderer
:
self
.
_components
.
registry
.
get
(
'renderer'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
transactionContextAPI
:
self
.
_components
.
registry
.
get
(
'transactionContextAPI'
).
api
,
rightHandPanel
:
self
.
_components
.
registry
.
get
(
'righthandpanel'
).
api
rightHandPanel
:
self
.
_components
.
registry
.
get
(
'righthandpanel'
).
api
}
}
self
.
data
=
{
self
.
data
=
{
...
@@ -113,12 +109,8 @@ module.exports = class CompileTab {
...
@@ -113,12 +109,8 @@ module.exports = class CompileTab {
var
contractName
=
yo
`<option>
${
contract
.
name
}
</option>`
var
contractName
=
yo
`<option>
${
contract
.
name
}
</option>`
self
.
_view
.
contractNames
.
appendChild
(
contractName
)
self
.
_view
.
contractNames
.
appendChild
(
contractName
)
})
})
self
.
_deps
.
udapp
.
reset
(
self
.
data
.
contractsDetails
,
self
.
_deps
.
transactionContextAPI
)
self
.
_deps
.
udappUI
.
reset
()
}
else
{
}
else
{
self
.
_view
.
contractNames
.
setAttribute
(
'disabled'
,
true
)
self
.
_view
.
contractNames
.
setAttribute
(
'disabled'
,
true
)
self
.
_deps
.
udapp
.
reset
({},
self
.
_deps
.
transactionContextAPI
)
self
.
_deps
.
udappUI
.
reset
()
}
}
// hightlight the tab if error
// hightlight the tab if error
if
(
success
)
document
.
querySelector
(
'.compileView'
).
style
.
color
=
''
// @TODO: compileView tab
if
(
success
)
document
.
querySelector
(
'.compileView'
).
style
.
color
=
''
// @TODO: compileView tab
...
...
src/app/tabs/run-tab.js
View file @
77f304bf
...
@@ -19,7 +19,7 @@ var addTooltip = require('../ui/tooltip')
...
@@ -19,7 +19,7 @@ var addTooltip = require('../ui/tooltip')
var
css
=
require
(
'./styles/run-tab-styles'
)
var
css
=
require
(
'./styles/run-tab-styles'
)
var
MultiParamManager
=
require
(
'../../multiParamManager'
)
var
MultiParamManager
=
require
(
'../../multiParamManager'
)
function
runTab
(
localRegistry
)
{
function
runTab
(
opts
,
localRegistry
)
{
/* -------------------------
/* -------------------------
VARIABLES
VARIABLES
--------------------------- */
--------------------------- */
...
@@ -35,6 +35,35 @@ function runTab (localRegistry) {
...
@@ -35,6 +35,35 @@ function runTab (localRegistry) {
}
}
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globlalRegistry
self
.
_components
.
registry
=
localRegistry
||
globlalRegistry
self
.
_components
.
transactionContextAPI
=
{
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
},
getValue
:
(
cb
)
=>
{
try
{
var
number
=
document
.
querySelector
(
'#value'
).
value
var
select
=
document
.
getElementById
(
'unit'
)
var
index
=
select
.
selectedIndex
var
selectedUnit
=
select
.
querySelectorAll
(
'option'
)[
index
].
dataset
.
unit
var
unit
=
'ether'
// default
if
(
selectedUnit
===
'ether'
)
{
unit
=
'ether'
}
else
if
(
selectedUnit
===
'finney'
)
{
unit
=
'finney'
}
else
if
(
selectedUnit
===
'gwei'
)
{
unit
=
'gwei'
}
else
if
(
selectedUnit
===
'wei'
)
{
unit
=
'wei'
}
cb
(
null
,
executionContext
.
web3
().
toWei
(
number
,
unit
))
}
catch
(
e
)
{
cb
(
e
)
}
},
getGasLimit
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#gasLimit'
).
val
())
}
}
// dependencies
// dependencies
self
.
_deps
=
{
self
.
_deps
=
{
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
...
@@ -42,9 +71,10 @@ function runTab (localRegistry) {
...
@@ -42,9 +71,10 @@ function runTab (localRegistry) {
udappUI
:
self
.
_components
.
registry
.
get
(
'udappUI'
).
api
,
udappUI
:
self
.
_components
.
registry
.
get
(
'udappUI'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
editor
Panel
:
self
.
_components
.
registry
.
get
(
'editorpanel
'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor
'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor
'
).
api
logCallback
:
self
.
_components
.
registry
.
get
(
'logCallback
'
).
api
}
}
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>`
self
.
_view
.
clearInstanceElement
=
yo
`
self
.
_view
.
clearInstanceElement
=
yo
`
...
@@ -198,16 +228,7 @@ function updateAccountBalances (container, self) {
...
@@ -198,16 +228,7 @@ function updateAccountBalances (container, self) {
RECORDER
RECORDER
------------------------------------------------ */
------------------------------------------------ */
function
makeRecorder
(
registry
,
runTabEvent
,
self
)
{
function
makeRecorder
(
registry
,
runTabEvent
,
self
)
{
var
recorder
=
new
Recorder
(
self
.
_deps
.
compiler
,
self
.
_deps
.
udapp
,
var
recorder
=
new
Recorder
(
self
.
_deps
.
compiler
,
self
.
_deps
.
udapp
,
self
.
_deps
.
logCallback
)
(
msg
)
=>
{
self
.
_deps
.
editorPanel
.
logMessage
(
msg
)
},
{
events
:
{
udapp
:
self
.
_deps
.
udapp
.
event
,
executioncontext
:
executionContext
.
event
,
runtab
:
runTabEvent
}
})
recorder
.
event
.
register
(
'newTxRecorded'
,
(
count
)
=>
{
recorder
.
event
.
register
(
'newTxRecorded'
,
(
count
)
=>
{
self
.
data
.
count
=
count
self
.
data
.
count
=
count
...
@@ -217,6 +238,15 @@ function makeRecorder (registry, runTabEvent, self) {
...
@@ -217,6 +238,15 @@ function makeRecorder (registry, runTabEvent, self) {
self
.
data
.
count
=
0
self
.
data
.
count
=
0
self
.
_view
.
recorderCount
.
innerText
=
0
self
.
_view
.
recorderCount
.
innerText
=
0
})
})
executionContext
.
event
.
register
(
'contextChanged'
,
()
=>
{
recorder
.
clearAll
()
})
runTabEvent
.
register
(
'clearInstance'
,
()
=>
{
recorder
.
clearAll
()
})
var
css2
=
csjs
`
var
css2
=
csjs
`
.container {}
.container {}
.runTxs {}
.runTxs {}
...
@@ -368,21 +398,21 @@ function contractDropdown (events, self) {
...
@@ -368,21 +398,21 @@ function contractDropdown (events, self) {
var
constructor
=
txHelper
.
getConstructorInterface
(
selectedContract
.
contract
.
object
.
abi
)
var
constructor
=
txHelper
.
getConstructorInterface
(
selectedContract
.
contract
.
object
.
abi
)
txFormat
.
buildData
(
selectedContract
.
name
,
selectedContract
.
contract
.
object
,
self
.
_deps
.
compiler
.
getContracts
(),
true
,
constructor
,
args
,
(
error
,
data
)
=>
{
txFormat
.
buildData
(
selectedContract
.
name
,
selectedContract
.
contract
.
object
,
self
.
_deps
.
compiler
.
getContracts
(),
true
,
constructor
,
args
,
(
error
,
data
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
self
.
_deps
.
editorPanel
.
logMessage
(
`creation of
${
selectedContract
.
name
}
pending...`
)
self
.
_deps
.
logCallback
(
`creation of
${
selectedContract
.
name
}
pending...`
)
self
.
_deps
.
udapp
.
createContract
(
data
,
(
error
,
txResult
)
=>
{
self
.
_deps
.
udapp
.
createContract
(
data
,
(
error
,
txResult
)
=>
{
if
(
error
)
{
if
(
error
)
{
self
.
_deps
.
editorPanel
.
logMessage
(
`creation of
${
selectedContract
.
name
}
errored: `
+
error
)
self
.
_deps
.
logCallback
(
`creation of
${
selectedContract
.
name
}
errored: `
+
error
)
}
else
{
}
else
{
var
isVM
=
executionContext
.
isVM
()
var
isVM
=
executionContext
.
isVM
()
if
(
isVM
)
{
if
(
isVM
)
{
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
if
(
vmError
.
error
)
{
if
(
vmError
.
error
)
{
self
.
_deps
.
editorPanel
.
logMessage
(
vmError
.
message
)
self
.
_deps
.
logCallback
(
vmError
.
message
)
return
return
}
}
}
}
if
(
txResult
.
result
.
status
&&
txResult
.
result
.
status
===
'0x0'
)
{
if
(
txResult
.
result
.
status
&&
txResult
.
result
.
status
===
'0x0'
)
{
self
.
_deps
.
editorPanel
.
logMessage
(
`creation of
${
selectedContract
.
name
}
errored: transaction execution failed`
)
self
.
_deps
.
logCallback
(
`creation of
${
selectedContract
.
name
}
errored: transaction execution failed`
)
return
return
}
}
var
noInstancesText
=
self
.
_view
.
noInstancesText
var
noInstancesText
=
self
.
_view
.
noInstancesText
...
@@ -392,10 +422,10 @@ function contractDropdown (events, self) {
...
@@ -392,10 +422,10 @@ function contractDropdown (events, self) {
}
}
})
})
}
else
{
}
else
{
self
.
_deps
.
editorPanel
.
logMessage
(
`creation of
${
selectedContract
.
name
}
errored: `
+
error
)
self
.
_deps
.
logCallback
(
`creation of
${
selectedContract
.
name
}
errored: `
+
error
)
}
}
},
(
msg
)
=>
{
},
(
msg
)
=>
{
self
.
_deps
.
editorPanel
.
logMessage
(
msg
)
self
.
_deps
.
logCallback
(
msg
)
},
(
data
,
runTxCallback
)
=>
{
},
(
data
,
runTxCallback
)
=>
{
// called for libraries deployment
// called for libraries deployment
self
.
_deps
.
udapp
.
runTx
(
data
,
runTxCallback
)
self
.
_deps
.
udapp
.
runTx
(
data
,
runTxCallback
)
...
...
src/app/tabs/settings-tab.js
View file @
77f304bf
...
@@ -24,10 +24,7 @@ module.exports = class SettingsTab {
...
@@ -24,10 +24,7 @@ module.exports = class SettingsTab {
// dependencies
// dependencies
self
.
_deps
=
{
self
.
_deps
=
{
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
udapp
:
self
.
_components
.
registry
.
get
(
'udapp'
).
api
,
udappUI
:
self
.
_components
.
registry
.
get
(
'udappUI'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
fileManager
:
self
.
_components
.
registry
.
get
(
'filemanager'
).
api
,
editorPanel
:
self
.
_components
.
registry
.
get
(
'editorpanel'
).
api
,
editorPanel
:
self
.
_components
.
registry
.
get
(
'editorpanel'
).
api
,
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
editor
:
self
.
_components
.
registry
.
get
(
'editor'
).
api
}
}
...
...
src/lib/cmdInterpreter.js
View file @
77f304bf
...
@@ -5,7 +5,7 @@ var EventManager = remixLib.EventManager
...
@@ -5,7 +5,7 @@ var EventManager = remixLib.EventManager
var
CommandInterpreterAPI
=
require
(
'./cmdInterpreterAPI'
)
var
CommandInterpreterAPI
=
require
(
'./cmdInterpreterAPI'
)
class
CmdInterpreter
{
class
CmdInterpreter
{
constructor
(
api
)
{
constructor
()
{
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
api
=
new
CommandInterpreterAPI
(
this
)
this
.
api
=
new
CommandInterpreterAPI
(
this
)
}
}
...
...
src/recorder.js
View file @
77f304bf
...
@@ -13,19 +13,13 @@ var modal = require('./app/ui/modal-dialog-custom')
...
@@ -13,19 +13,13 @@ var modal = require('./app/ui/modal-dialog-custom')
*
*
*/
*/
class
Recorder
{
class
Recorder
{
constructor
(
compiler
,
udapp
,
log
MessageCallback
,
opts
=
{}
)
{
constructor
(
compiler
,
udapp
,
log
CallBack
)
{
var
self
=
this
var
self
=
this
self
.
log
MessageCallback
=
logMessageCallb
ack
self
.
log
CallBack
=
logCallB
ack
self
.
event
=
new
EventManager
()
self
.
event
=
new
EventManager
()
self
.
data
=
{
_listen
:
true
,
_replay
:
false
,
journal
:
[],
_createdContracts
:
{},
_createdContractsReverse
:
{},
_usedAccounts
:
{},
_abis
:
{},
_contractABIReferences
:
{},
_linkReferences
:
{}
}
self
.
data
=
{
_listen
:
true
,
_replay
:
false
,
journal
:
[],
_createdContracts
:
{},
_createdContractsReverse
:
{},
_usedAccounts
:
{},
_abis
:
{},
_contractABIReferences
:
{},
_linkReferences
:
{}
}
opts
.
events
.
executioncontext
.
register
(
'contextChanged'
,
()
=>
{
self
.
clearAll
()
})
opts
.
events
.
runtab
.
register
(
'clearInstance'
,
()
=>
{
self
.
clearAll
()
})
opts
.
events
.
udapp
.
register
(
'initiatingTransaction'
,
(
timestamp
,
tx
,
payLoad
)
=>
{
udapp
.
event
.
register
(
'initiatingTransaction'
,
(
timestamp
,
tx
,
payLoad
)
=>
{
if
(
tx
.
useCall
)
return
if
(
tx
.
useCall
)
return
var
{
from
,
to
,
value
}
=
tx
var
{
from
,
to
,
value
}
=
tx
...
@@ -70,7 +64,7 @@ class Recorder {
...
@@ -70,7 +64,7 @@ class Recorder {
}
}
})
})
opts
.
events
.
udapp
.
register
(
'transactionExecuted'
,
(
error
,
from
,
to
,
data
,
call
,
txResult
,
timestamp
)
=>
{
udapp
.
event
.
register
(
'transactionExecuted'
,
(
error
,
from
,
to
,
data
,
call
,
txResult
,
timestamp
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
error
)
return
console
.
log
(
error
)
if
(
call
)
return
if
(
call
)
return
...
@@ -184,7 +178,7 @@ class Recorder {
...
@@ -184,7 +178,7 @@ class Recorder {
run
(
records
,
accounts
,
options
,
abis
,
linkReferences
,
udapp
,
newContractFn
)
{
run
(
records
,
accounts
,
options
,
abis
,
linkReferences
,
udapp
,
newContractFn
)
{
var
self
=
this
var
self
=
this
self
.
setListen
(
false
)
self
.
setListen
(
false
)
self
.
log
MessageCallb
ack
(
`Running
${
records
.
length
}
transaction(s) ...`
)
self
.
log
CallB
ack
(
`Running
${
records
.
length
}
transaction(s) ...`
)
async
.
eachOfSeries
(
records
,
function
(
tx
,
index
,
cb
)
{
async
.
eachOfSeries
(
records
,
function
(
tx
,
index
,
cb
)
{
var
record
=
self
.
resolveAddress
(
tx
.
record
,
accounts
,
options
)
var
record
=
self
.
resolveAddress
(
tx
.
record
,
accounts
,
options
)
var
abi
=
abis
[
tx
.
record
.
abi
]
var
abi
=
abis
[
tx
.
record
.
abi
]
...
@@ -241,14 +235,14 @@ class Recorder {
...
@@ -241,14 +235,14 @@ class Recorder {
cb
(
data
.
error
)
cb
(
data
.
error
)
return
return
}
else
{
}
else
{
self
.
log
MessageCallb
ack
(
`(
${
index
}
)
${
JSON
.
stringify
(
record
,
null
,
'
\
t'
)}
`
)
self
.
log
CallB
ack
(
`(
${
index
}
)
${
JSON
.
stringify
(
record
,
null
,
'
\
t'
)}
`
)
self
.
log
MessageCallb
ack
(
`(
${
index
}
) data:
${
data
.
data
}
`
)
self
.
log
CallB
ack
(
`(
${
index
}
) data:
${
data
.
data
}
`
)
record
.
data
=
{
dataHex
:
data
.
data
,
funArgs
:
tx
.
record
.
parameters
,
funAbi
:
fnABI
,
contractBytecode
:
tx
.
record
.
bytecode
,
contractName
:
tx
.
record
.
contractName
}
record
.
data
=
{
dataHex
:
data
.
data
,
funArgs
:
tx
.
record
.
parameters
,
funAbi
:
fnABI
,
contractBytecode
:
tx
.
record
.
bytecode
,
contractName
:
tx
.
record
.
contractName
}
}
}
udapp
.
runTx
(
record
,
function
(
err
,
txResult
)
{
udapp
.
runTx
(
record
,
function
(
err
,
txResult
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
)
console
.
error
(
err
)
self
.
log
MessageCallb
ack
(
err
+
'. Execution failed at '
+
index
)
self
.
log
CallB
ack
(
err
+
'. Execution failed at '
+
index
)
}
else
{
}
else
{
var
address
=
executionContext
.
isVM
()
?
txResult
.
result
.
createdAddress
:
txResult
.
result
.
contractAddress
var
address
=
executionContext
.
isVM
()
?
txResult
.
result
.
createdAddress
:
txResult
.
result
.
contractAddress
if
(
address
)
{
if
(
address
)
{
...
...
src/universal-dapp-ui.js
View file @
77f304bf
...
@@ -8,17 +8,8 @@ var copyToClipboard = require('./app/ui/copy-to-clipboard')
...
@@ -8,17 +8,8 @@ var copyToClipboard = require('./app/ui/copy-to-clipboard')
var
css
=
require
(
'./universal-dapp-styles'
)
var
css
=
require
(
'./universal-dapp-styles'
)
var
MultiParamManager
=
require
(
'./multiParamManager'
)
var
MultiParamManager
=
require
(
'./multiParamManager'
)
/*
trigger debugRequested
*/
function
UniversalDAppUI
(
udapp
,
opts
=
{})
{
function
UniversalDAppUI
(
udapp
,
opts
=
{})
{
var
self
=
this
this
.
udapp
=
udapp
this
.
udapp
=
udapp
self
.
el
=
yo
`<div class=
${
css
.
udapp
}
></div>`
}
UniversalDAppUI
.
prototype
.
reset
=
function
()
{
this
.
el
.
innerHTML
=
''
}
}
UniversalDAppUI
.
prototype
.
renderInstance
=
function
(
contract
,
address
,
contractName
)
{
UniversalDAppUI
.
prototype
.
renderInstance
=
function
(
contract
,
address
,
contractName
)
{
...
...
src/universal-dapp.js
View file @
77f304bf
...
@@ -21,21 +21,21 @@ var modalDialog = require('./app/ui/modaldialog')
...
@@ -21,21 +21,21 @@ var modalDialog = require('./app/ui/modaldialog')
var
typeConversion
=
remixLib
.
execution
.
typeConversion
var
typeConversion
=
remixLib
.
execution
.
typeConversion
var
confirmDialog
=
require
(
'./app/execution/confirmDialog'
)
var
confirmDialog
=
require
(
'./app/execution/confirmDialog'
)
/*
trigger debugRequested
*/
function
UniversalDApp
(
opts
,
localRegistry
)
{
function
UniversalDApp
(
opts
,
localRegistry
)
{
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
var
self
=
this
var
self
=
this
self
.
data
=
{}
self
.
_components
=
{}
self
.
_components
=
{}
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
_components
.
registry
=
localRegistry
||
globalRegistry
self
.
removable
=
opts
.
removable
self
.
removable
=
opts
.
removable
self
.
removable_instances
=
opts
.
removable_instances
self
.
removable_instances
=
opts
.
removable_instances
self
.
_deps
=
{
self
.
_deps
=
{
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
config
:
self
.
_components
.
registry
.
get
(
'config'
).
api
,
compiler
:
self
.
_components
.
registry
.
get
(
'compiler'
).
api
,
logCallback
:
self
.
_components
.
registry
.
get
(
'logCallback'
).
api
}
}
executionContext
.
event
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
executionContext
.
event
.
register
(
'contextChanged'
,
this
,
function
(
context
)
{
self
.
reset
(
self
.
contracts
)
self
.
reset
Environment
(
)
})
})
self
.
_txRunnerAPI
=
{
self
.
_txRunnerAPI
=
{
config
:
self
.
_deps
.
config
,
config
:
self
.
_deps
.
config
,
...
@@ -47,16 +47,15 @@ function UniversalDApp (opts, localRegistry) {
...
@@ -47,16 +47,15 @@ function UniversalDApp (opts, localRegistry) {
}
}
}
}
self
.
txRunner
=
new
TxRunner
({},
self
.
_txRunnerAPI
)
self
.
txRunner
=
new
TxRunner
({},
self
.
_txRunnerAPI
)
self
.
data
.
contractsDetails
=
{}
self
.
_deps
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
self
.
data
.
contractsDetails
=
success
&&
data
?
data
.
contracts
:
{}
})
self
.
accounts
=
{}
self
.
resetEnvironment
()
}
}
UniversalDApp
.
prototype
.
reset
=
function
(
contracts
,
transactionContextAPI
)
{
UniversalDApp
.
prototype
.
resetEnvironment
=
function
()
{
this
.
_deps
.
editorpanel
=
this
.
_components
.
registry
.
get
(
'editorpanel'
)
if
(
this
.
_deps
.
editorpanel
)
this
.
_deps
.
editorpanel
=
this
.
_deps
.
editorpanel
.
api
this
.
contracts
=
contracts
if
(
transactionContextAPI
)
{
this
.
transactionContextAPI
=
transactionContextAPI
}
this
.
accounts
=
{}
this
.
accounts
=
{}
if
(
executionContext
.
isVM
())
{
if
(
executionContext
.
isVM
())
{
this
.
_addAccount
(
'3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511'
,
'0x56BC75E2D63100000'
)
this
.
_addAccount
(
'3cd7232cd6f3fc66a57a6bedc1a8ed6c228fff0a327e169c2bcc5e869ed49511'
,
'0x56BC75E2D63100000'
)
...
@@ -71,12 +70,16 @@ UniversalDApp.prototype.reset = function (contracts, transactionContextAPI) {
...
@@ -71,12 +70,16 @@ UniversalDApp.prototype.reset = function (contracts, transactionContextAPI) {
executionContext
.
detectNetwork
((
error
,
network
)
=>
{
executionContext
.
detectNetwork
((
error
,
network
)
=>
{
if
(
!
error
&&
network
)
{
if
(
!
error
&&
network
)
{
var
txLink
=
executionContext
.
txDetailsLink
(
network
.
name
,
txhash
)
var
txLink
=
executionContext
.
txDetailsLink
(
network
.
name
,
txhash
)
if
(
txLink
)
this
.
_deps
.
editorpanel
.
logHtmlMessage
(
yo
`<a href="
${
txLink
}
" target="_blank">
${
txLink
}
</a>`
)
if
(
txLink
)
this
.
_deps
.
logCallback
(
yo
`<a href="
${
txLink
}
" target="_blank">
${
txLink
}
</a>`
)
}
}
})
})
})
})
}
}
UniversalDApp
.
prototype
.
resetAPI
=
function
(
transactionContextAPI
)
{
this
.
transactionContextAPI
=
transactionContextAPI
}
UniversalDApp
.
prototype
.
newAccount
=
function
(
password
,
cb
)
{
UniversalDApp
.
prototype
.
newAccount
=
function
(
password
,
cb
)
{
if
(
!
executionContext
.
isVM
())
{
if
(
!
executionContext
.
isVM
())
{
if
(
!
this
.
_deps
.
config
.
get
(
'settings/personal-mode'
))
{
if
(
!
this
.
_deps
.
config
.
get
(
'settings/personal-mode'
))
{
...
@@ -179,6 +182,10 @@ UniversalDApp.prototype.pendingTransactions = function () {
...
@@ -179,6 +182,10 @@ UniversalDApp.prototype.pendingTransactions = function () {
return
this
.
txRunner
.
pendingTxs
return
this
.
txRunner
.
pendingTxs
}
}
UniversalDApp
.
prototype
.
pendingTransactionsCount
=
function
()
{
return
Object
.
keys
(
this
.
txRunner
.
pendingTxs
).
length
}
UniversalDApp
.
prototype
.
call
=
function
(
isUserAction
,
args
,
value
,
lookupOnly
,
outputCb
)
{
UniversalDApp
.
prototype
.
call
=
function
(
isUserAction
,
args
,
value
,
lookupOnly
,
outputCb
)
{
const
self
=
this
const
self
=
this
var
logMsg
var
logMsg
...
@@ -189,13 +196,14 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
...
@@ -189,13 +196,14 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
logMsg
=
`call to
${
args
.
contractName
}
.
${(
args
.
funABI
.
name
)
?
args
.
funABI
.
name
:
'(fallback)'
}
`
logMsg
=
`call to
${
args
.
contractName
}
.
${(
args
.
funABI
.
name
)
?
args
.
funABI
.
name
:
'(fallback)'
}
`
}
}
}
}
txFormat
.
buildData
(
args
.
contractName
,
args
.
contractAbi
,
self
.
contracts
,
false
,
args
.
funABI
,
value
,
(
error
,
data
)
=>
{
// contractsDetails is used to resolve libraries
txFormat
.
buildData
(
args
.
contractName
,
args
.
contractAbi
,
self
.
data
.
contractsDetails
,
false
,
args
.
funABI
,
value
,
(
error
,
data
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
if
(
isUserAction
)
{
if
(
isUserAction
)
{
if
(
!
args
.
funABI
.
constant
)
{
if
(
!
args
.
funABI
.
constant
)
{
self
.
_deps
.
editorpanel
.
logMessage
(
`
${
logMsg
}
pending ... `
)
self
.
_deps
.
logCallback
(
`
${
logMsg
}
pending ... `
)
}
else
{
}
else
{
self
.
_deps
.
editorpanel
.
logMessage
(
`
${
logMsg
}
`
)
self
.
_deps
.
logCallback
(
`
${
logMsg
}
`
)
}
}
}
}
self
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
(
error
,
txResult
)
=>
{
self
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
(
error
,
txResult
)
=>
{
...
@@ -204,7 +212,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
...
@@ -204,7 +212,7 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
if
(
isVM
)
{
if
(
isVM
)
{
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
if
(
vmError
.
error
)
{
if
(
vmError
.
error
)
{
self
.
_deps
.
editorpanel
.
logMessage
(
`
${
logMsg
}
errored:
${
vmError
.
message
}
`
)
self
.
_deps
.
logCallback
(
`
${
logMsg
}
errored:
${
vmError
.
message
}
`
)
return
return
}
}
}
}
...
@@ -213,14 +221,14 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
...
@@ -213,14 +221,14 @@ UniversalDApp.prototype.call = function (isUserAction, args, value, lookupOnly,
outputCb
(
decoded
)
outputCb
(
decoded
)
}
}
}
else
{
}
else
{
self
.
_deps
.
editorpanel
.
logMessage
(
`
${
logMsg
}
errored:
${
error
}
`
)
self
.
_deps
.
logCallback
(
`
${
logMsg
}
errored:
${
error
}
`
)
}
}
})
})
}
else
{
}
else
{
self
.
_deps
.
editorpanel
.
logMessage
(
`
${
logMsg
}
errored:
${
error
}
`
)
self
.
_deps
.
logCallback
(
`
${
logMsg
}
errored:
${
error
}
`
)
}
}
},
(
msg
)
=>
{
},
(
msg
)
=>
{
self
.
_deps
.
editorpanel
.
logMessage
(
msg
)
self
.
_deps
.
logCallback
(
msg
)
},
(
data
,
runTxCallback
)
=>
{
},
(
data
,
runTxCallback
)
=>
{
// called for libraries deployment
// called for libraries deployment
self
.
runTx
(
data
,
runTxCallback
)
self
.
runTx
(
data
,
runTxCallback
)
...
...
test-browser/tests/compiling.js
View file @
77f304bf
...
@@ -73,8 +73,8 @@ function testReturnValues (browser, callback) {
...
@@ -73,8 +73,8 @@ function testReturnValues (browser, callback) {
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
.
testFunction
(
'retunValues1 - transact (not payable)'
,
.
testFunction
(
'retunValues1 - transact (not payable)'
,
'0x
79dc928d149d2ade02ab610a8ae290636222d034d4adce0bb08a68401e3d1f7f
'
,
'0x
c3660c7ab6899f196e77d3ab3749169e22c00ae7f1b8fe3af0ce54df49504019
'
,
`[vm]\nfrom:0xca3...a733c\nto:testReturnValues.retunValues1() 0x5e7...26e9f\nvalue:0 wei\ndata:0x9ed...59eb7\nlogs:0\nhash:0x
79d...d1f7f
`
,
`[vm]\nfrom:0xca3...a733c\nto:testReturnValues.retunValues1() 0x5e7...26e9f\nvalue:0 wei\ndata:0x9ed...59eb7\nlogs:0\nhash:0x
c36...04019
`
,
null
,
null
,
`{
`{
"0": "bool: _b true",
"0": "bool: _b true",
...
@@ -82,10 +82,9 @@ function testReturnValues (browser, callback) {
...
@@ -82,10 +82,9 @@ function testReturnValues (browser, callback) {
"2": "int256: _i -345",
"2": "int256: _i -345",
"3": "address: _a 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c"
"3": "address: _a 0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c"
}`
)
}`
)
.
pause
(
500
)
.
testFunction
(
'retunValues2 - transact (not payable)'
,
.
testFunction
(
'retunValues2 - transact (not payable)'
,
'0x
09175dcb30227b3af422d75786dbba3b0549985e5c7f59f86d12c7e1043ccb8c
'
,
'0x
c8cc8150fcb0b09cdf51e7357341272118888fe8c4efe32881b56e891377aad9
'
,
`[vm]\nfrom:0xca3...a733c\nto:testReturnValues.retunValues2() 0x5e7...26e9f\nvalue:0 wei\ndata:0xf57...4036c\nlogs:0\nhash:0x
091...ccb8c
`
,
null
,
`{
`[vm]\nfrom:0xca3...a733c\nto:testReturnValues.retunValues2() 0x5e7...26e9f\nvalue:0 wei\ndata:0xf57...4036c\nlogs:0\nhash:0x
c8c...7aad9
`
,
null
,
`{
"0": "bytes1: _b 0x12",
"0": "bytes1: _b 0x12",
"1": "bytes2: _b2 0x1223",
"1": "bytes2: _b2 0x1223",
"2": "bytes3: _b3 0x000000",
"2": "bytes3: _b3 0x000000",
...
@@ -97,8 +96,8 @@ function testReturnValues (browser, callback) {
...
@@ -97,8 +96,8 @@ function testReturnValues (browser, callback) {
"8": "bytes22: _b22 0x00000000000000000000325235235325325325235325",
"8": "bytes22: _b22 0x00000000000000000000325235235325325325235325",
"9": "bytes32: _b32 0x0000000000000000000000000000000000032523532532523532523532523532"
"9": "bytes32: _b32 0x0000000000000000000000000000000000032523532532523532523532523532"
}`
).
pause
(
500
).
testFunction
(
'retunValues3 - transact (not payable)'
,
}`
).
pause
(
500
).
testFunction
(
'retunValues3 - transact (not payable)'
,
'0x
7faab07aeaafc8afe6bf283bb83be70c000dff381dec04e779354e354da14aff
'
,
'0x
94c4b4324bad773dec29af3ffe26a698c32b5caf8a1eedf8889563158639d28a
'
,
'[vm]
\
nfrom:0xca3...a733c
\
nto:testReturnValues.retunValues3() 0x5e7...26e9f
\
nvalue:0 wei
\
ndata:0x033...e0a7d
\
nlogs:0
\
nhash:0x
7fa...14aff
'
,
null
,
`{
'[vm]
\
nfrom:0xca3...a733c
\
nto:testReturnValues.retunValues3() 0x5e7...26e9f
\
nvalue:0 wei
\
ndata:0x033...e0a7d
\
nlogs:0
\
nhash:0x
94c...9d28a
'
,
null
,
`{
"0": "uint8: _en 2",
"0": "uint8: _en 2",
"1": "int256[5][]: _a1 1,-45,-78,56,60,-1,42,334,-45455,-446,1,10,-5435,45,-7"
"1": "int256[5][]: _a1 1,-45,-78,56,60,-1,42,334,-45455,-446,1,10,-5435,45,-7"
}`
).
click
(
'i[class^="clearinstance"]'
).
perform
(()
=>
{
callback
(
null
,
browser
)
})
}`
).
click
(
'i[class^="clearinstance"]'
).
perform
(()
=>
{
callback
(
null
,
browser
)
})
...
@@ -111,17 +110,17 @@ function testInputValues (browser, callback) {
...
@@ -111,17 +110,17 @@ function testInputValues (browser, callback) {
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
click
(
'#runTabView button[class^="instanceButton"]'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
waitForElementPresent
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
.
click
(
'.instance:nth-of-type(2)'
)
.
testFunction
(
'inputValue1 - transact (not payable)'
,
.
testFunction
(
'inputValue1 - transact (not payable)'
,
'0x
917a873d27d105213eaf5461e14780387ccceb66fed574f8432d1963917832ae
'
,
'0x
f3265e3d9cd9299958bf81bed3cdfdd537942f85b9e0b95c5468c691d9396505
'
,
`[vm]\nfrom:0xca3...a733c\nto:test.inputValue1(uint256,int256,string) 0x8c1...401f5\nvalue:0 wei\ndata:0xd69...00000\nlogs:0\nhash:0x
917...832ae
`
,
`[vm]\nfrom:0xca3...a733c\nto:test.inputValue1(uint256,int256,string) 0x8c1...401f5\nvalue:0 wei\ndata:0xd69...00000\nlogs:0\nhash:0x
f32...96505
`
,
{
types
:
'uint256 _u, int256 _i, string _str'
,
values
:
'"2343242", "-4324324", "string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"'
},
{
types
:
'uint256 _u, int256 _i, string _str'
,
values
:
'"2343242", "-4324324", "string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"'
},
`{
`{
"0": "uint256: _uret 2343242",
"0": "uint256: _uret 2343242",
"1": "int256: _iret -4324324",
"1": "int256: _iret -4324324",
"2": "string: _strret string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"
"2": "string: _strret string _ string _ string _ string _ string _ string _ string _ string _ string _ string _"
}`
).
pause
(
500
).
testFunction
(
'inputValue2 - transact (not payable)'
,
}`
).
pause
(
500
).
testFunction
(
'inputValue2 - transact (not payable)'
,
'0x
487d09e244853bcb108b3a22cd6ee57b6431e50869619c9b918e9764fc16ef7f
'
,
'0x
d9ec6d8aa73d81755447190f52939ee3084e105b988d445a11e7ac718392ff5a
'
,
`[vm]\nfrom:0xca3...a733c\nto:test.inputValue2(uint256[3],bytes8[4]) 0x8c1...401f5\nvalue:0 wei\ndata:0x1b7...00000\nlogs:1\nhash:0x
487...6ef7f
`
,
`[vm]\nfrom:0xca3...a733c\nto:test.inputValue2(uint256[3],bytes8[4]) 0x8c1...401f5\nvalue:0 wei\ndata:0x1b7...00000\nlogs:1\nhash:0x
d9e...2ff5a
`
,
{
types
:
'uint256[3] _n, bytes8[4] _b8'
,
values
:
'[1,2,3], ["0x1234", "0x1234","0x1234","0x1234"]'
},
{
types
:
'uint256[3] _n, bytes8[4] _b8'
,
values
:
'[1,2,3], ["0x1234", "0x1234","0x1234","0x1234"]'
},
`{
`{
"0": "uint256[3]: _nret 1,2,3",
"0": "uint256[3]: _nret 1,2,3",
...
...
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