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
c11bb34c
Commit
c11bb34c
authored
Dec 31, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove udapp and executionContext from universal dapp ui
parent
36e72f92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
blockchain.js
src/app/tabs/runTab/model/blockchain.js
+4
-0
run-tab.js
src/app/udapp/run-tab.js
+1
-1
universal-dapp-ui.js
src/app/ui/universal-dapp-ui.js
+12
-8
No files found.
src/app/tabs/runTab/model/blockchain.js
View file @
c11bb34c
...
...
@@ -306,6 +306,10 @@ class Blockchain {
})
}
context
()
{
return
(
this
.
executionContext
.
isVM
()
?
'memory'
:
'blockchain'
)
}
}
module
.
exports
=
Blockchain
src/app/udapp/run-tab.js
View file @
c11bb34c
...
...
@@ -49,7 +49,7 @@ export class RunTab extends LibraryPlugin {
}
onActivationInternal
()
{
this
.
udappUI
=
new
UniversalDAppUI
(
this
.
blockchain
,
this
.
udapp
,
this
.
logCallback
,
this
.
executionContext
)
this
.
udappUI
=
new
UniversalDAppUI
(
this
.
blockchain
,
this
.
logCallback
)
this
.
udapp
.
resetAPI
({
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
...
...
src/app/ui/universal-dapp-ui.js
View file @
c11bb34c
...
...
@@ -11,18 +11,17 @@ var css = require('../../universal-dapp-styles')
var
MultiParamManager
=
require
(
'./multiParamManager'
)
var
remixLib
=
require
(
'remix-lib'
)
var
txFormat
=
remixLib
.
execution
.
txFormat
var
txHelper
=
remixLib
.
execution
.
txHelper
var
confirmDialog
=
require
(
'./confirmDialog'
)
var
modalCustom
=
require
(
'./modal-dialog-custom'
)
var
modalDialog
=
require
(
'./modaldialog'
)
var
TreeView
=
require
(
'./TreeView'
)
function
UniversalDAppUI
(
blockchain
,
udapp
,
logCallback
,
executionContext
)
{
function
UniversalDAppUI
(
blockchain
,
logCallback
)
{
this
.
blockchain
=
blockchain
this
.
udapp
=
udapp
this
.
logCallback
=
logCallback
this
.
compilerData
=
{
contractsDetails
:
{}}
this
.
executionContext
=
executionContext
}
function
decodeResponseToTreeView
(
response
,
fnabi
)
{
...
...
@@ -46,7 +45,7 @@ UniversalDAppUI.prototype.renderInstance = function (contract, address, contract
if
(
noInstances
)
{
noInstances
.
parentNode
.
removeChild
(
noInstances
)
}
var
abi
=
this
.
udapp
.
getABI
(
contract
)
const
abi
=
txHelper
.
sortAbiFunction
(
contract
.
abi
)
return
this
.
renderInstanceFromABI
(
abi
,
address
,
contractName
)
}
...
...
@@ -55,11 +54,10 @@ UniversalDAppUI.prototype.renderInstance = function (contract, address, contract
// basically this has to be called for the "atAddress" (line 393) and when a contract creation succeed
// this returns a DOM element
UniversalDAppUI
.
prototype
.
renderInstanceFromABI
=
function
(
contractABI
,
address
,
contractName
)
{
var
self
=
this
address
=
(
address
.
slice
(
0
,
2
)
===
'0x'
?
''
:
'0x'
)
+
address
.
toString
(
'hex'
)
address
=
ethJSUtil
.
toChecksumAddress
(
address
)
var
instance
=
yo
`<div class="instance
${
css
.
instance
}
${
css
.
hidesub
}
" id="instance
${
address
}
"></div>`
var
context
=
self
.
udapp
.
context
()
const
context
=
this
.
blockchain
.
context
()
var
shortAddress
=
helper
.
shortenAddress
(
address
)
var
title
=
yo
`
...
...
@@ -111,7 +109,8 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
instance
.
appendChild
(
contractActionsWrapper
)
// Add the fallback function
var
fallback
=
self
.
udapp
.
getFallbackInterface
(
contractABI
)
const
fallback
=
txHelper
.
getFallbackInterface
(
contractABI
)
if
(
fallback
)
{
contractActionsWrapper
.
appendChild
(
this
.
getCallButton
({
funABI
:
fallback
,
...
...
@@ -226,9 +225,14 @@ UniversalDAppUI.prototype.getCallButton = function (args) {
self
.
blockchain
.
runOrCallContractMethod
(
args
.
contractName
,
args
.
contractAbi
,
args
.
funABI
,
inputsValues
,
args
.
address
,
callType
,
lookupOnly
,
logMsg
,
self
.
logCallback
,
outputCb
,
confirmationCb
,
continueCb
,
promptCb
)
}
let
inputs
=
''
if
(
args
.
funABI
.
inputs
)
{
inputs
=
txHelper
.
inputParametersDeclarationToString
(
args
.
funABI
.
inputs
)
}
const
multiParamManager
=
new
MultiParamManager
(
lookupOnly
,
args
.
funABI
,
(
valArray
,
inputsValues
,
domEl
)
=>
{
clickButton
(
valArray
,
inputsValues
,
domEl
)
},
self
.
udapp
.
getInputs
(
args
.
funABI
)
)
},
inputs
)
const
contractActionsContainer
=
yo
`<div class="
${
css
.
contractActionsContainer
}
" >
${
multiParamManager
.
render
()}
</div>`
contractActionsContainer
.
appendChild
(
outputOverride
)
...
...
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