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
57b2963f
Commit
57b2963f
authored
Dec 31, 2019
by
Iuri Matias
Committed by
yann300
Feb 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove udapp and executionContext from universal dapp ui
parent
71a083e2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-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
+5
-8
No files found.
src/app/tabs/runTab/model/blockchain.js
View file @
57b2963f
...
@@ -304,6 +304,10 @@ class Blockchain {
...
@@ -304,6 +304,10 @@ class Blockchain {
})
})
}
}
context
()
{
return
(
this
.
executionContext
.
isVM
()
?
'memory'
:
'blockchain'
)
}
}
}
module
.
exports
=
Blockchain
module
.
exports
=
Blockchain
src/app/udapp/run-tab.js
View file @
57b2963f
...
@@ -49,7 +49,7 @@ export class RunTab extends LibraryPlugin {
...
@@ -49,7 +49,7 @@ export class RunTab extends LibraryPlugin {
}
}
onActivationInternal
()
{
onActivationInternal
()
{
this
.
udappUI
=
new
UniversalDAppUI
(
this
.
blockchain
,
this
.
udapp
,
this
.
logCallback
,
this
.
executionContext
)
this
.
udappUI
=
new
UniversalDAppUI
(
this
.
blockchain
,
this
.
logCallback
)
this
.
udapp
.
resetAPI
({
this
.
udapp
.
resetAPI
({
getAddress
:
(
cb
)
=>
{
getAddress
:
(
cb
)
=>
{
cb
(
null
,
$
(
'#txorigin'
).
val
())
cb
(
null
,
$
(
'#txorigin'
).
val
())
...
...
src/app/ui/universal-dapp-ui.js
View file @
57b2963f
...
@@ -14,12 +14,10 @@ var txFormat = remixLib.execution.txFormat
...
@@ -14,12 +14,10 @@ var txFormat = remixLib.execution.txFormat
var
TreeView
=
require
(
'./TreeView'
)
var
TreeView
=
require
(
'./TreeView'
)
var
txCallBacks
=
require
(
'./sendTxCallbacks'
)
var
txCallBacks
=
require
(
'./sendTxCallbacks'
)
function
UniversalDAppUI
(
blockchain
,
udapp
,
logCallback
,
executionContext
)
{
function
UniversalDAppUI
(
blockchain
,
logCallback
)
{
this
.
blockchain
=
blockchain
this
.
blockchain
=
blockchain
this
.
udapp
=
udapp
this
.
logCallback
=
logCallback
this
.
logCallback
=
logCallback
this
.
compilerData
=
{
contractsDetails
:
{}}
this
.
compilerData
=
{
contractsDetails
:
{}}
this
.
executionContext
=
executionContext
}
}
function
decodeResponseToTreeView
(
response
,
fnabi
)
{
function
decodeResponseToTreeView
(
response
,
fnabi
)
{
...
@@ -52,11 +50,10 @@ UniversalDAppUI.prototype.renderInstance = function (contract, address, contract
...
@@ -52,11 +50,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
// 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
UniversalDAppUI
.
prototype
.
renderInstanceFromABI
=
function
(
contractABI
,
address
,
contractName
)
{
UniversalDAppUI
.
prototype
.
renderInstanceFromABI
=
function
(
contractABI
,
address
,
contractName
)
{
var
self
=
this
address
=
(
address
.
slice
(
0
,
2
)
===
'0x'
?
''
:
'0x'
)
+
address
.
toString
(
'hex'
)
address
=
(
address
.
slice
(
0
,
2
)
===
'0x'
?
''
:
'0x'
)
+
address
.
toString
(
'hex'
)
address
=
ethJSUtil
.
toChecksumAddress
(
address
)
address
=
ethJSUtil
.
toChecksumAddress
(
address
)
var
instance
=
yo
`<div class="instance
${
css
.
instance
}
${
css
.
hidesub
}
" id="instance
${
address
}
"></div>`
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
shortAddress
=
helper
.
shortenAddress
(
address
)
var
title
=
yo
`
var
title
=
yo
`
...
@@ -160,8 +157,8 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
...
@@ -160,8 +157,8 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
}
}
setLLIError
(
''
)
setLLIError
(
''
)
const
fallback
=
self
.
udapp
.
getFallbackInterface
(
contractABI
)
const
fallback
=
this
.
udapp
.
getFallbackInterface
(
contractABI
)
const
receive
=
self
.
udapp
.
getReceiveInterface
(
contractABI
)
const
receive
=
this
.
udapp
.
getReceiveInterface
(
contractABI
)
const
args
=
{
const
args
=
{
funABI
:
fallback
||
receive
,
funABI
:
fallback
||
receive
,
address
:
address
,
address
:
address
,
...
@@ -203,7 +200,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
...
@@ -203,7 +200,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
else
if
(
fallback
)
args
.
funABI
=
fallback
else
if
(
fallback
)
args
.
funABI
=
fallback
if
(
!
args
.
funABI
)
return
setLLIError
(
`Please define a 'Fallback' function to send calldata and a either 'Receive' or payable 'Fallback' to send ethers`
)
if
(
!
args
.
funABI
)
return
setLLIError
(
`Please define a 'Fallback' function to send calldata and a either 'Receive' or payable 'Fallback' to send ethers`
)
self
.
runTransaction
(
false
,
args
,
null
,
calldataInput
.
value
,
null
)
this
.
runTransaction
(
false
,
args
,
null
,
calldataInput
.
value
,
null
)
}
}
contractActionsWrapper
.
appendChild
(
lowLevelInteracions
)
contractActionsWrapper
.
appendChild
(
lowLevelInteracions
)
...
...
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