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
50e7bb9d
Commit
50e7bb9d
authored
Mar 29, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove udapp && udappUI
parent
207700fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
19 deletions
+15
-19
app.js
src/app.js
+1
-6
run-tab.js
src/app/tabs/run-tab.js
+11
-11
recorder.js
src/recorder.js
+3
-2
No files found.
src/app.js
View file @
50e7bb9d
...
...
@@ -716,12 +716,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
visitContracts
:
(
cb
)
=>
{
compiler
.
visitContracts
(
cb
)
},
udapp
:
()
=>
{
return
udapp
},
udappUI
:
()
=>
{
return
udappUI
},
switchFile
:
function
(
path
)
{
fileManager
.
switchFile
(
path
)
},
...
...
@@ -775,6 +769,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
var
rhpOpts
=
{
pluginAPI
:
new
PluginAPI
(
self
,
compiler
),
udapp
:
udapp
,
udappUI
:
udappUI
,
compiler
:
compiler
,
renderer
:
renderer
}
...
...
src/app/tabs/run-tab.js
View file @
50e7bb9d
...
...
@@ -55,7 +55,7 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) {
// PENDING transactions
function
updatePendingTxs
(
container
,
appAPI
)
{
var
pendingCount
=
Object
.
keys
(
appAPI
.
udapp
()
.
pendingTransactions
()).
length
var
pendingCount
=
Object
.
keys
(
opts
.
udapp
.
pendingTransactions
()).
length
pendingTxsText
.
innerText
=
pendingCount
+
' pending transactions'
}
...
...
@@ -90,7 +90,7 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) {
executionContext
.
event
.
register
(
'contextChanged'
,
(
context
,
silent
)
=>
{
setFinalContext
()
})
fillAccountsList
(
appAPI
,
el
)
fillAccountsList
(
appAPI
,
opts
,
el
)
setInterval
(()
=>
{
updateAccountBalances
(
container
,
appAPI
)
updatePendingTxs
(
container
,
appAPI
)
...
...
@@ -104,10 +104,10 @@ function runTab (appAPI = {}, appEvents = {}, opts = {}) {
return
{
render
()
{
return
container
}
}
}
function
fillAccountsList
(
appAPI
,
container
)
{
function
fillAccountsList
(
appAPI
,
opts
,
container
)
{
var
$txOrigin
=
$
(
container
.
querySelector
(
'#txorigin'
))
$txOrigin
.
empty
()
appAPI
.
udapp
()
.
getAccounts
((
err
,
accounts
)
=>
{
opts
.
udapp
.
getAccounts
((
err
,
accounts
)
=>
{
if
(
err
)
{
addTooltip
(
`Cannot get account list:
${
err
}
`
)
}
if
(
accounts
&&
accounts
[
0
])
{
for
(
var
a
in
accounts
)
{
$txOrigin
.
append
(
$
(
'<option />'
).
val
(
accounts
[
a
]).
text
(
accounts
[
a
]))
}
...
...
@@ -190,8 +190,8 @@ function makeRecorder (events, appAPI, appEvents, opts) {
}
if
(
txArray
.
length
)
{
noInstancesText
.
style
.
display
=
'none'
recorder
.
run
(
txArray
,
accounts
,
options
,
abis
,
linkReferences
,
(
abi
,
address
,
contractName
)
=>
{
instanceContainer
.
appendChild
(
appAPI
.
udappUI
()
.
renderInstanceFromABI
(
abi
,
address
,
contractName
))
recorder
.
run
(
txArray
,
accounts
,
options
,
abis
,
linkReferences
,
opts
.
udapp
,
(
abi
,
address
,
contractName
)
=>
{
instanceContainer
.
appendChild
(
opts
.
udappUI
.
renderInstanceFromABI
(
abi
,
address
,
contractName
))
})
}
}
else
{
...
...
@@ -284,7 +284,7 @@ function contractDropdown (events, appAPI, appEvents, opts, instanceContainer) {
txFormat
.
buildData
(
selectedContract
.
name
,
selectedContract
.
contract
.
object
,
opts
.
compiler
.
getContracts
(),
true
,
constructor
,
args
,
(
error
,
data
)
=>
{
if
(
!
error
)
{
appAPI
.
logMessage
(
`creation of
${
selectedContract
.
name
}
pending...`
)
appAPI
.
udapp
()
.
createContract
(
data
,
(
error
,
txResult
)
=>
{
opts
.
udapp
.
createContract
(
data
,
(
error
,
txResult
)
=>
{
if
(
!
error
)
{
var
isVM
=
executionContext
.
isVM
()
if
(
isVM
)
{
...
...
@@ -296,7 +296,7 @@ function contractDropdown (events, appAPI, appEvents, opts, instanceContainer) {
}
noInstancesText
.
style
.
display
=
'none'
var
address
=
isVM
?
txResult
.
result
.
createdAddress
:
txResult
.
result
.
contractAddress
instanceContainer
.
appendChild
(
appAPI
.
udappUI
()
.
renderInstance
(
selectedContract
.
contract
.
object
,
address
,
selectContractNames
.
value
))
instanceContainer
.
appendChild
(
opts
.
udappUI
.
renderInstance
(
selectedContract
.
contract
.
object
,
address
,
selectContractNames
.
value
))
}
else
{
appAPI
.
logMessage
(
`creation of
${
selectedContract
.
name
}
errored: `
+
error
)
}
...
...
@@ -308,7 +308,7 @@ function contractDropdown (events, appAPI, appEvents, opts, instanceContainer) {
appAPI
.
logMessage
(
msg
)
},
(
data
,
runTxCallback
)
=>
{
// called for libraries deployment
appAPI
.
udapp
()
.
runTx
(
data
,
runTxCallback
)
opts
.
udapp
.
runTx
(
data
,
runTxCallback
)
})
}
...
...
@@ -330,11 +330,11 @@ function contractDropdown (events, appAPI, appEvents, opts, instanceContainer) {
}
catch
(
e
)
{
return
modalDialogCustom
.
alert
(
'Failed to parse the current file as JSON ABI.'
)
}
instanceContainer
.
appendChild
(
appAPI
.
udappUI
()
.
renderInstanceFromABI
(
abi
,
address
,
address
))
instanceContainer
.
appendChild
(
opts
.
udappUI
.
renderInstanceFromABI
(
abi
,
address
,
address
))
})
}
else
{
var
contract
=
opts
.
compiler
.
getContract
(
contractNames
.
children
[
contractNames
.
selectedIndex
].
innerHTML
)
instanceContainer
.
appendChild
(
appAPI
.
udappUI
()
.
renderInstance
(
contract
.
object
,
address
,
selectContractNames
.
value
))
instanceContainer
.
appendChild
(
opts
.
udappUI
.
renderInstance
(
contract
.
object
,
address
,
selectContractNames
.
value
))
}
}
...
...
src/recorder.js
View file @
50e7bb9d
...
...
@@ -175,10 +175,11 @@ class Recorder {
* @param {Object} accounts
* @param {Object} options
* @param {Object} abis
* @param {Object} udapp
* @param {Function} newContractFn
*
*/
run
(
records
,
accounts
,
options
,
abis
,
linkReferences
,
newContractFn
)
{
run
(
records
,
accounts
,
options
,
abis
,
linkReferences
,
udapp
,
newContractFn
)
{
var
self
=
this
self
.
setListen
(
false
)
self
.
_api
.
logMessage
(
`Running
${
records
.
length
}
transaction(s) ...`
)
...
...
@@ -242,7 +243,7 @@ class Recorder {
self
.
_api
.
logMessage
(
`(
${
index
}
) data:
${
data
.
data
}
`
)
record
.
data
=
{
dataHex
:
data
.
data
,
funArgs
:
tx
.
record
.
parameters
,
funAbi
:
fnABI
,
contractBytecode
:
tx
.
record
.
bytecode
,
contractName
:
tx
.
record
.
contractName
}
}
self
.
_api
.
udapp
()
.
runTx
(
record
,
function
(
err
,
txResult
)
{
udapp
.
runTx
(
record
,
function
(
err
,
txResult
)
{
if
(
err
)
{
console
.
error
(
err
)
self
.
_api
.
logMessage
(
err
+
'. Execution failed at '
+
index
)
...
...
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