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
50b41316
Commit
50b41316
authored
Sep 08, 2017
by
Rob Stupay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update to runtabs & udapp
parent
2cb7b975
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
app.js
src/app.js
+13
-1
run-tab.js
src/app/tabs/run-tab.js
+3
-2
universal-dapp.js
src/universal-dapp.js
+17
-8
No files found.
src/app.js
View file @
50b41316
...
@@ -410,7 +410,19 @@ function run () {
...
@@ -410,7 +410,19 @@ function run () {
return
offsetToLineColumnConverter
.
offsetToLineColumn
(
location
,
file
,
compiler
.
lastCompilationResult
)
return
offsetToLineColumnConverter
.
offsetToLineColumn
(
location
,
file
,
compiler
.
lastCompilationResult
)
}
}
}
}
var
staticanalysis
=
new
StaticAnalysis
(
staticAnalysisAPI
,
compiler
.
event
)
var
udapp
=
new
UniversalDApp
({
api
:
{
logMessage
:
(
msg
)
=>
{
self
.
_components
.
editorpanel
.
log
({
type
:
'log'
,
value
:
msg
})
}
},
opt
:
{
removable
:
false
,
removable_instances
:
true
}
})
udapp
.
reset
({},
transactionContextAPI
)
udapp
.
event
.
register
(
'debugRequested'
,
this
,
function
(
txResult
)
{
startdebugging
(
txResult
.
transactionHash
)
})
// ---------------- Righthand-panel --------------------
// ---------------- Righthand-panel --------------------
var
rhpAPI
=
{
var
rhpAPI
=
{
...
...
src/app/tabs/run-tab.js
View file @
50b41316
...
@@ -296,13 +296,14 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
...
@@ -296,13 +296,14 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
// appAPI.logMessage('transaction added ...')
// appAPI.logMessage('transaction added ...')
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
var
contracts
=
appAPI
.
getContracts
()
var
contracts
=
appAPI
.
getContracts
()
var
contractName
=
[
contractNames
.
children
[
contractNames
.
selectedIndex
].
innerHTML
]
var
contract
=
appAPI
.
getContracts
()[
contractNames
.
children
[
contractNames
.
selectedIndex
].
innerHTML
]
var
contract
=
appAPI
.
getContracts
()[
contractNames
.
children
[
contractNames
.
selectedIndex
].
innerHTML
]
var
constructor
=
txHelper
.
getConstructorInterface
(
contract
.
interface
)
var
constructor
=
txHelper
.
getConstructorInterface
(
contract
.
interface
)
var
args
=
createButtonInput
.
value
var
args
=
createButtonInput
.
value
txFormat
.
buildData
(
contract
,
contracts
,
true
,
constructor
,
args
,
appAPI
.
udapp
(),
(
error
,
data
)
=>
{
txFormat
.
buildData
(
contract
,
contracts
,
true
,
constructor
,
args
,
appAPI
.
udapp
(),
(
error
,
data
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
console
.
log
(
`
${
JSON
.
parse
(
JSON
.
stringify
(
contract
.
metadata
,
null
,
4
))}
`
)
appAPI
.
logMessage
(
`creation of
${
contractName
}
pending...`
)
appAPI
.
logMessage
(
`B creation of
${
contract
}
pending`
)
txExecution
.
createContract
(
data
,
appAPI
.
udapp
(),
(
error
,
txResult
)
=>
{
txExecution
.
createContract
(
data
,
appAPI
.
udapp
(),
(
error
,
txResult
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
var
isVM
=
executionContext
.
isVM
()
var
isVM
=
executionContext
.
isVM
()
...
...
src/universal-dapp.js
View file @
50b41316
...
@@ -117,7 +117,6 @@ function UniversalDApp (opts = {}) {
...
@@ -117,7 +117,6 @@ function UniversalDApp (opts = {}) {
personalMode
:
this
.
personalMode
personalMode
:
this
.
personalMode
})
})
}
}
UniversalDApp
.
prototype
.
reset
=
function
(
contracts
,
transactionContextAPI
)
{
UniversalDApp
.
prototype
.
reset
=
function
(
contracts
,
transactionContextAPI
)
{
this
.
el
.
innerHTML
=
''
this
.
el
.
innerHTML
=
''
this
.
contracts
=
contracts
this
.
contracts
=
contracts
...
@@ -223,6 +222,8 @@ UniversalDApp.prototype.getBalance = function (address, cb) {
...
@@ -223,6 +222,8 @@ UniversalDApp.prototype.getBalance = function (address, cb) {
// basically this has to be called for the "atAddress" (line 393) and when a contract creation succeed
// basically this has to be called for the "atAddress" (line 393) and when a contract creation succeed
// this returns a DOM element
// this returns a DOM element
UniversalDApp
.
prototype
.
renderInstance
=
function
(
contract
,
address
,
contractName
)
{
UniversalDApp
.
prototype
.
renderInstance
=
function
(
contract
,
address
,
contractName
)
{
var
self
=
this
function
remove
()
{
$instance
.
remove
()
}
function
remove
()
{
$instance
.
remove
()
}
var
$instance
=
$
(
`<div class="instance
${
css
.
instance
}
"/>`
)
var
$instance
=
$
(
`<div class="instance
${
css
.
instance
}
"/>`
)
var
context
=
executionContext
.
isVM
()
?
'memory'
:
'blockchain'
var
context
=
executionContext
.
isVM
()
?
'memory'
:
'blockchain'
...
@@ -233,7 +234,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
...
@@ -233,7 +234,7 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
<div class="
${
css
.
titleText
}
">
${
contractName
}
at
${
shortAddress
}
(
${
context
}
) </div>
<div class="
${
css
.
titleText
}
">
${
contractName
}
at
${
shortAddress
}
(
${
context
}
) </div>
<i class="fa fa-clipboard
${
css
.
copy
}
" aria-hidden="true" onclick=
${
copyToClipboard
}
title='Copy to clipboard'></i>
<i class="fa fa-clipboard
${
css
.
copy
}
" aria-hidden="true" onclick=
${
copyToClipboard
}
title='Copy to clipboard'></i>
</div>`
</div>`
if
(
this
.
removable_instance
)
{
if
(
self
.
removable_instances
)
{
var
close
=
yo
`<div class="
${
css
.
udappClose
}
" onclick=
${
remove
}
><i class="
${
css
.
closeIcon
}
fa fa-close" aria-hidden="true"></i></div>`
var
close
=
yo
`<div class="
${
css
.
udappClose
}
" onclick=
${
remove
}
><i class="
${
css
.
closeIcon
}
fa fa-close" aria-hidden="true"></i></div>`
title
.
appendChild
(
close
)
title
.
appendChild
(
close
)
}
}
...
@@ -257,7 +258,8 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
...
@@ -257,7 +258,8 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
$instance
.
append
(
this
.
getCallButton
({
$instance
.
append
(
this
.
getCallButton
({
funABI
:
fallback
,
funABI
:
fallback
,
address
:
address
,
address
:
address
,
contractAbi
:
abi
contractAbi
:
abi
,
contractName
:
contractName
}))
}))
}
}
...
@@ -269,7 +271,8 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
...
@@ -269,7 +271,8 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa
$instance
.
append
(
this
.
getCallButton
({
$instance
.
append
(
this
.
getCallButton
({
funABI
:
funABI
,
funABI
:
funABI
,
address
:
address
,
address
:
address
,
contractAbi
:
abi
contractAbi
:
abi
,
contractName
:
contractName
}))
}))
})
})
...
@@ -303,15 +306,21 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -303,15 +306,21 @@ UniversalDApp.prototype.getCallButton = function (args) {
.
attr
(
'title'
,
title
)
.
attr
(
'title'
,
title
)
.
text
(
title
)
.
text
(
title
)
.
click
(()
=>
{
.
click
(()
=>
{
call
()
call
(
true
)
})
})
function
call
()
{
function
call
(
isUserAction
)
{
txFormat
.
buildData
(
args
.
contractAbi
,
self
.
contracts
,
false
,
args
.
funABI
,
inputField
.
val
(),
self
,
(
error
,
data
)
=>
{
txFormat
.
buildData
(
args
.
contractAbi
,
self
.
contracts
,
false
,
args
.
funABI
,
inputField
.
val
(),
self
,
(
error
,
data
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
txExecution
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
self
,
(
error
,
txResult
)
=>
{
txExecution
.
callFunction
(
args
.
address
,
data
,
args
.
funABI
,
self
,
(
error
,
txResult
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
self
.
_api
.
logMessage
(
'UDApp transaction added ...'
)
if
(
isUserAction
)
{
if
(
args
.
funABI
.
constant
)
{
self
.
_api
.
logMessage
(
`transact to
${
args
.
contractName
}
.
${(
args
.
funABI
.
name
)
?
args
.
funABI
.
name
:
'(fallback)'
}
pending ... `
)
}
else
{
self
.
_api
.
logMessage
(
`call to
${
args
.
contractName
}
.
${(
args
.
funABI
.
name
)
?
args
.
funABI
.
name
:
'(fallback)'
}
pending ... `
)
}
}
var
isVM
=
executionContext
.
isVM
()
var
isVM
=
executionContext
.
isVM
()
if
(
isVM
)
{
if
(
isVM
)
{
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
var
vmError
=
txExecution
.
checkVMError
(
txResult
)
...
@@ -348,7 +357,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
...
@@ -348,7 +357,7 @@ UniversalDApp.prototype.getCallButton = function (args) {
if
(
lookupOnly
)
{
if
(
lookupOnly
)
{
$contractProperty
.
addClass
(
'constant'
)
$contractProperty
.
addClass
(
'constant'
)
button
.
attr
(
'title'
,
(
title
+
' - call'
))
button
.
attr
(
'title'
,
(
title
+
' - call'
))
call
()
call
(
false
)
}
}
if
(
args
.
funABI
.
inputs
&&
args
.
funABI
.
inputs
.
length
>
0
)
{
if
(
args
.
funABI
.
inputs
&&
args
.
funABI
.
inputs
.
length
>
0
)
{
...
...
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