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
18008136
Commit
18008136
authored
Feb 05, 2020
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix missing ref
parent
ed22d29d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
universal-dapp-ui.js
src/app/ui/universal-dapp-ui.js
+7
-5
blockchain.js
src/blockchain/blockchain.js
+14
-0
pluginUDapp.js
src/blockchain/pluginUDapp.js
+4
-4
No files found.
src/app/ui/universal-dapp-ui.js
View file @
18008136
...
...
@@ -11,6 +11,7 @@ var css = require('../../universal-dapp-styles')
var
MultiParamManager
=
require
(
'./multiParamManager'
)
var
remixLib
=
require
(
'remix-lib'
)
var
txFormat
=
remixLib
.
execution
.
txFormat
const
txHelper
=
remixLib
.
execution
.
txHelper
var
TreeView
=
require
(
'./TreeView'
)
var
txCallBacks
=
require
(
'./sendTxCallbacks'
)
...
...
@@ -41,7 +42,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
)
}
...
...
@@ -50,6 +51,7 @@ 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
)
{
let
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>`
...
...
@@ -157,8 +159,8 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
}
setLLIError
(
''
)
const
fallback
=
this
.
udapp
.
getFallbackInterface
(
contractABI
)
const
receive
=
this
.
udapp
.
getReceiveInterface
(
contractABI
)
const
fallback
=
self
.
blockchain
.
getFallbackInterface
(
contractABI
)
const
receive
=
self
.
blockchain
.
getReceiveInterface
(
contractABI
)
const
args
=
{
funABI
:
fallback
||
receive
,
address
:
address
,
...
...
@@ -200,7 +202,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
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`
)
this
.
runTransaction
(
false
,
args
,
null
,
calldataInput
.
value
,
null
)
self
.
runTransaction
(
false
,
args
,
null
,
calldataInput
.
value
,
null
)
}
contractActionsWrapper
.
appendChild
(
lowLevelInteracions
)
...
...
@@ -218,7 +220,7 @@ UniversalDAppUI.prototype.getCallButton = function (args) {
lookupOnly
,
args
.
funABI
,
(
valArray
,
inputsValues
)
=>
self
.
runTransaction
(
lookupOnly
,
args
,
valArray
,
inputsValues
,
outputOverride
),
self
.
udapp
.
getInputs
(
args
.
funABI
)
self
.
blockchain
.
getInputs
(
args
.
funABI
)
)
const
contractActionsContainer
=
yo
`<div class="
${
css
.
contractActionsContainer
}
" >
${
multiParamManager
.
render
()}
</div>`
...
...
src/blockchain/blockchain.js
View file @
18008136
...
...
@@ -4,6 +4,7 @@ const txExecution = remixLib.execution.txExecution
const
typeConversion
=
remixLib
.
execution
.
typeConversion
const
TxRunner
=
remixLib
.
execution
.
txRunner
const
Txlistener
=
remixLib
.
execution
.
txListener
const
txHelper
=
remixLib
.
execution
.
txHelper
const
EventManager
=
remixLib
.
EventManager
const
executionContext
=
remixLib
.
execution
.
executionContext
const
ethJSUtil
=
require
(
'ethereumjs-util'
)
...
...
@@ -132,6 +133,19 @@ class Blockchain {
return
this
.
executionContext
.
web3
().
eth
.
getGasPrice
(
cb
)
}
getFallbackInterface
(
contractABI
)
{
return
txHelper
.
getFallbackInterface
(
contractABI
)
}
getReceiveInterface
(
contractABI
)
{
return
txHelper
.
getReceiveInterface
(
contractABI
)
}
getInputs
(
funABI
)
{
if
(
!
funABI
.
inputs
)
return
''
return
txHelper
.
inputParametersDeclarationToString
(
funABI
.
inputs
)
}
fromWei
(
value
,
doTypeConversion
,
unit
)
{
if
(
doTypeConversion
)
{
return
Web3
.
utils
.
fromWei
(
typeConversion
.
toInt
(
value
),
unit
||
'ether'
)
...
...
src/blockchain/pluginUDapp.js
View file @
18008136
...
...
@@ -15,19 +15,19 @@ class PluginUdapp {
}
createVMAccount
(
newAccount
)
{
return
this
.
blockchain
.
udapp
.
createVMAccount
(
newAccount
)
return
this
.
blockchain
.
createVMAccount
(
newAccount
)
}
sendTransaction
(
tx
)
{
return
this
.
blockchain
.
udapp
.
sendTransaction
(
tx
)
return
this
.
blockchain
.
sendTransaction
(
tx
)
}
getAccounts
(
cb
)
{
return
this
.
blockchain
.
udapp
.
getAccounts
(
cb
)
return
this
.
blockchain
.
getAccounts
(
cb
)
}
pendingTransactionsCount
()
{
return
this
.
blockchain
.
udapp
.
pendingTransactionsCount
()
return
this
.
blockchain
.
pendingTransactionsCount
()
}
}
...
...
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